Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / accessibility / aria-hidden-updates-alldescendants.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 </head>
6 <body id="body">
7
8 <div>
9         <h1 id="heading">Steps</h1>
10
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>
17
18 </div>
19
20
21 <p id="description"></p>
22 <div id="console"></div>
23
24 <script>
25
26     description("This tests that if aria-hidden changes on an element, all it's existing children will update their children caches");
27
28     if (window.accessibilityController) {
29           jsTestIsAsync = true;
30           document.getElementById("main").focus();
31           
32           var main = accessibilityController.focusedElement;
33           // Access the element so the children cache is generated.
34           main.childAtIndex(0);
35           main.childAtIndex(1);
36           shouldBe("main.childrenCount", "1");
37
38           var group = document.getElementsByTagName('main')[0];
39           var items = group.getElementsByTagName('div');          
40           items[0].removeAttribute('aria-hidden');
41           setTimeout(function() {
42               // After removing aria-hidden, the new count should be 2.
43               shouldBe("main.childrenCount", "2");          
44           
45               // And most importantly, the DIV that was made non-hidden should have one child now.
46               shouldBe("main.childAtIndex(1).childrenCount", "1");
47               finishJSTest();
48           }, 0);
49     }
50
51 </script>
52
53 <script src="../resources/js-test-post.js"></script>
54 </body>
55 </html>