AX: elements with explicit tabindex should expose AXFocused as writable, since mouse...
[WebKit-https.git] / LayoutTests / platform / mac / accessibility / update-children-when-aria-role-changes.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../resources/js-test-pre.js"></script>
5 <script>
6 if (window.testRunner)
7    testRunner.dumpAsText();
8 </script>
9 </head>
10 <body>
11
12 <div id="parent" tabindex=0 role="group">
13    <span role="button" id="button1">button 1</span>
14    <span id="button2" title="button 2"></span>
15 </div>
16
17 <p id="description"></p>
18 <div id="console"></div>
19
20 <script>
21
22     description("This tests that when an ARIA role changes, the AX hierarchy is updated accordingly.");
23
24     if (window.accessibilityController) {
25         document.getElementById("parent").focus();
26         var parent = accessibilityController.focusedElement;
27         shouldBe("parent.childAtIndex(0).role", "'AXRole: AXButton'");
28         shouldBeTrue("parent.childAtIndex(1) == null || parent.childAtIndex(1).isValid == false");
29   
30         document.getElementById("button1").removeAttribute("role");
31         document.getElementById("button2").setAttribute("role", "button");
32        
33         shouldBe("parent.childAtIndex(0).role", "'AXRole: AXStaticText'");
34         shouldBe("parent.childAtIndex(1).role", "'AXRole: AXButton'");
35     }
36
37 </script>
38
39 <script src="../../../resources/js-test-post.js"></script>
40
41 </body>
42 </html>
43