JS Test Harness: Remove more link tags
[WebKit-https.git] / LayoutTests / accessibility / aria-hidden-updates-alldescendants.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script>
5 var successfullyParsed = false;
6 </script>
7 <script src="../fast/js/resources/js-test-pre.js"></script>
8 </head>
9 <body id="body">
10
11 <div>
12         <h1 id="heading">Steps</h1>
13
14         <main id="main" tabindex=0>
15          test
16                 <div tabindex="-1" class="step-one" aria-hidden="true"><span>Step 1: Do something</span></div>
17                 <div tabindex="-1" class="step-two" aria-hidden="true"><span>Step 2: Do another thing</span></div>
18                 <div tabindex="-1" class="step-three" aria-hidden="true"><span>Step 3: Do one last thing</span></div>
19         </main>
20
21 </div>
22
23
24 <p id="description"></p>
25 <div id="console"></div>
26
27 <script>
28
29     description("This tests that if aria-hidden changes on an element, all it's existing children will update their children caches");
30
31     if (window.accessibilityController) {
32           document.getElementById("main").focus();
33           
34           var main = accessibilityController.focusedElement;
35           // Access the element so the children cache is generated.
36           main.childAtIndex(0);
37           main.childAtIndex(1);
38           shouldBe("main.childrenCount", "1");
39
40           var group = document.getElementsByTagName('main')[0];
41           var items = group.getElementsByTagName('div');          
42           items[0].removeAttribute('aria-hidden');
43
44           // After removing aria-hidden, the new count should be 2.
45           shouldBe("main.childrenCount", "2");          
46           
47           // And most importantly, the DIV that was made non-hidden should have one child now.
48           shouldBe("main.childAtIndex(1).childrenCount", "1");
49     }
50
51     successfullyParsed = true;
52 </script>
53
54 <script src="../fast/js/resources/js-test-post.js"></script>
55 </body>
56 </html>