| <!DOCTYPE html> |
| <html> |
| <body id="body"> |
| <script src="../../resources/js-test-pre.js"></script> |
| <div id="content"> |
| |
| <div id="event" role="group" tabindex=0 onaccessibledismiss="eventCallback(true)"> |
| test1 |
| </div> |
| |
| <div id="no_event" role="group" tabindex=0> |
| test2 |
| </div> |
| |
| </div> |
| |
| <p id="description"></p> |
| <div id="console"></div> |
| |
| <script> |
| |
| description("This tests the accessibledismiss event on iOS."); |
| |
| function eventCallback(domLevel1) { |
| debug("received " + (domLevel1 ? "DOM Level 1 " : "") + "accessibledismiss event"); |
| if (domLevel1) |
| document.getElementById("event").removeAttribute("onaccessibledismiss"); |
| } |
| |
| if (window.accessibilityController) { |
| |
| var node = document.getElementById("event"); |
| var axNode = accessibilityController.accessibleElementById("event"); |
| // DOM Level 1 event |
| axNode.dismiss(); |
| // DOM Level 2 event |
| node.onaccessibledismiss = function(event) { |
| eventCallback(); |
| }; |
| |
| var dispatched = axNode.dismiss(); |
| shouldBeTrue("dispatched"); |
| |
| node = document.getElementById("no_event"); |
| axNode = accessibilityController.accessibleElementById("no_event"); |
| dispatched = axNode.dismiss(); |
| shouldBeFalse("dispatched"); |
| } |
| </script> |
| |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |