| <script src="../../resources/js-test-pre.js"></script> |
| <input type="text" id="toBeRemoved" onfocus="focusHandler(this)"></input> |
| var jsTestIsAsync = true; |
| description("This tests that focusing and removing element won't cause crash."); |
| if (window.testRunner && window.accessibilityController) { |
| // Try to focus on the element. |
| accessibilityController.accessibleElementById("toBeRemoved").takeFocus(); |
| function focusHandler(node) |
| // Make sure we don't crash after removing the element. |
| node.parentNode.removeChild(node); |
| setTimeout("finishTest()", 0); |
| // Element should be removed while on focus |
| shouldBe("document.getElementById(\"toBeRemoved\")", "null"); |
| // Make sure accessing the element won't lead to crash |
| var detached = accessibilityController.accessibleElementById("toBeRemoved") |
| <script src="../../resources/js-test-post.js"></script> |