| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <script src="../../resources/js-test-pre.js"></script> |
| <div id="parent" tabindex=0 role="group"> |
| <span role="button" id="button1">button 1</span> |
| <span id="button2" title="button 2"></span> |
| description("This tests that when an ARIA role changes, the AX hierarchy is updated accordingly."); |
| if (window.accessibilityController) { |
| document.getElementById("parent").focus(); |
| var parent = accessibilityController.focusedElement; |
| shouldBe("parent.childAtIndex(0).role", "'AXRole: AXButton'"); |
| shouldBeTrue("parent.childAtIndex(1) == null || parent.childAtIndex(1).isValid == false"); |
| document.getElementById("button1").removeAttribute("role"); |
| document.getElementById("button2").setAttribute("role", "button"); |
| shouldBe("parent.childAtIndex(0).role", "'AXRole: AXStaticText'"); |
| shouldBe("parent.childAtIndex(1).role", "'AXRole: AXButton'"); |
| <script src="../../resources/js-test-post.js"></script> |