blob: e547adb32d85d66d9a9a9f492cb387562ce64cae [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<main id="main">
<div style="display:inline" tabindex="0">
<button id="button">test</button>
</div>
</main>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that when tabindex is updated on an element, the children are re-computed.")
if (window.accessibilityController) {
var main = accessibilityController.accessibleElementById("main");
var group = main.childAtIndex(0);
var button = accessibilityController.accessibleElementById("button");
shouldBeTrue("group.childAtIndex(0).parentElement().isEqual(group)");
shouldBeTrue("button.parentElement().isEqual(group)");
shouldBeTrue("group.parentElement().isEqual(main)");
shouldBeTrue("main.childAtIndex(0).isEqual(group)");
// Removing the tabindex updates children
document.getElementById("main").children[0].removeAttribute("tabindex");
shouldBeTrue("main.childAtIndex(0).isEqual(button)");
shouldBeTrue("button.parentElement().isEqual(main)");
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>