blob: 50fc3d5cf8b665026220cc0512c9c7d7ba38bf50 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
</head>
<body id="body">
<div>
<h1 id="heading">Steps</h1>
<main id="main" tabindex=0>
test
<div class="step-one" aria-hidden="true"><span>Step 1: Do something</span></div>
<div class="step-two" aria-hidden="true"><span>Step 2: Do another thing</span></div>
<div 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>
function axElementById(id) {
return accessibilityController.accessibleElementById(id);
}
test((t) => {
var main = axElementById("main");
assert_equals(main.childrenCount, 1);
var group = document.getElementsByTagName('main')[0];
var items = group.getElementsByTagName('div');
items[0].removeAttribute('aria-hidden');
assert_equals(main.childrenCount, 2,
"After removing aria-hidden, the new count should be 2.");
// And most importantly...
assert_equals(main.childAtIndex(1).childrenCount, 1,
"The DIV that was made non-hidden should have one child now.");
}, "This tests that if aria-hidden changes on an element, all it's existing children will update their children caches");
</script>
</body>
</html>