Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / accessibility / aria-hidden-updates-alldescendants.html
blob064f3186734cee1f498eaf502fb7274a0b6c6d22
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 </head>
6 <body id="body">
8 <div>
9 <h1 id="heading">Steps</h1>
11 <main id="main" tabindex=0>
12 test
13 <div tabindex="-1" class="step-one" aria-hidden="true"><span>Step 1: Do something</span></div>
14 <div tabindex="-1" class="step-two" aria-hidden="true"><span>Step 2: Do another thing</span></div>
15 <div tabindex="-1" class="step-three" aria-hidden="true"><span>Step 3: Do one last thing</span></div>
16 </main>
18 </div>
21 <p id="description"></p>
22 <div id="console"></div>
24 <script>
26 description("This tests that if aria-hidden changes on an element, all it's existing children will update their children caches");
28 if (window.accessibilityController) {
29 document.getElementById("main").focus();
31 var main = accessibilityController.focusedElement;
32 // Access the element so the children cache is generated.
33 main.childAtIndex(0);
34 main.childAtIndex(1);
35 shouldBe("main.childrenCount", "1");
37 var group = document.getElementsByTagName('main')[0];
38 var items = group.getElementsByTagName('div');
39 items[0].removeAttribute('aria-hidden');
41 // After removing aria-hidden, the new count should be 2.
42 shouldBe("main.childrenCount", "2");
44 // And most importantly, the DIV that was made non-hidden should have one child now.
45 shouldBe("main.childAtIndex(1).childrenCount", "1");
48 </script>
50 </body>
51 </html>