WAI-ARIA: aria-activedescendant doesn't work as intended
[WebKit-https.git] / LayoutTests / platform / mac / accessibility / aria-tree-activedescendant.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
5 <script>
6 var successfullyParsed = false;
7 </script>
8 <script src="../../../fast/js/resources/js-test-pre.js"></script>
9 </head>
10 <body id="body">
11
12 <ul id="tree0" role="tree" aria-labelledby="treelabel" aria-activedescendant="tree0_item0" tabindex="0">
13 <li id="tree0_item0" role="treeitem" aria-level="1" aria-expanded="true">
14 <span><span class="expander"></span>Animals</span>
15 <ul role="group">
16 <li id="tree0_item0_0" role="treeitem" aria-level="2"><span>Birds</span></li>
17 <li id="tree0_item0_1" role="treeitem" aria-level="2" aria-expanded="false">
18 <span><span class="expander"></span>Cats</span>
19 <ul role="group">
20 <li id="tree0_item0_1_0" role="treeitem"aria-level="3"><span>Siamese</span></li>
21 <li id="tree0_item0_1_1" role="treeitem" aria-level="3"><span>Tabby</span></li>
22 </ul>
23 </li>
24 </ul>
25 </li>
26 </ul>
27
28 <p id="description"></p>
29 <div id="console"></div>
30
31 <script>
32
33     description("This tests that the ARIA drag and drop attributes work as intended.");
34
35     if (window.accessibilityController) {
36
37           var axtree = accessibilityController.rootElement.childAtIndex(0).childAtIndex(0);
38
39           var activeDescendant = axtree.childAtIndex(0);
40           shouldBe("axtree.selectedRowAtIndex(0).isEqual(activeDescendant)", "true");
41
42           var newActiveDescendant = axtree.childAtIndex(2);
43           document.getElementById("tree0").setAttribute("aria-activedescendant", "tree0_item0_1");
44
45           shouldBe("axtree.selectedRowAtIndex(0).isEqual(newActiveDescendant)", "true");
46     }
47
48     successfullyParsed = true;
49 </script>
50
51 <script src="../../../fast/js/resources/js-test-post.js"></script>
52 </body>
53 </html>