blob: 064f3186734cee1f498eaf502fb7274a0b6c6d22 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test.js"></script>
</head>
<body id="body">
<div>
<h1 id="heading">Steps</h1>
<main id="main" tabindex=0>
test
<div tabindex="-1" class="step-one" aria-hidden="true"><span>Step 1: Do something</span></div>
<div tabindex="-1" class="step-two" aria-hidden="true"><span>Step 2: Do another thing</span></div>
<div tabindex="-1" class="step-three" aria-hidden="true"><span>Step 3: Do one last thing</span></div>
</main>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that if aria-hidden changes on an element, all it's existing children will update their children caches");
if (window.accessibilityController) {
document.getElementById("main").focus();
var main = accessibilityController.focusedElement;
// Access the element so the children cache is generated.
main.childAtIndex(0);
main.childAtIndex(1);
shouldBe("main.childrenCount", "1");
var group = document.getElementsByTagName('main')[0];
var items = group.getElementsByTagName('div');
items[0].removeAttribute('aria-hidden');
// After removing aria-hidden, the new count should be 2.
shouldBe("main.childrenCount", "2");
// And most importantly, the DIV that was made non-hidden should have one child now.
shouldBe("main.childAtIndex(1).childrenCount", "1");
}
</script>
</body>
</html>