| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../resources/js-test-pre.js"></script> |
| <script src="../resources/accessibility-helper.js"></script> |
| </head> |
| |
| <body id="body"> |
| |
| <input type="number" id="number" value="10"> |
| |
| <p id="description"></p> |
| <div id="console"></div> |
| <script> |
| |
| if (window.accessibilityController) { |
| description("This tests that a spin button won't access invalid attributes when its already detached."); |
| |
| document.getElementById("number").focus(); |
| |
| var field = accessibilityController.accessibleElementById("number"); |
| var spinner1 = spinnerForTextInput(field); |
| var spinnerChild = spinner1.uiElementAttributeValue("AXIncrementButton"); |
| debug("spinner incrementer: " + spinnerChild.role); |
| |
| shouldBe("document.getElementById('number').value", "'10'"); |
| eventSender.keyDown('\u0008'); |
| eventSender.keyDown('5'); |
| shouldBe("document.getElementById('number').value", "'5'"); |
| eventSender.keyDown('\u0008'); |
| eventSender.keyDown('\u0008'); |
| eventSender.keyDown('\u0008'); |
| |
| shouldBe("document.getElementById('number').value", "''"); |
| |
| // Don't crash! |
| var spinnerChild = spinner1.uiElementAttributeValue("AXIncrementButton"); |
| } |
| successfullyParsed = true; |
| </script> |
| |
| <script src="../resources/js-test-post.js"></script> |
| </body> |
| </html> |