Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / accessibility / spinbutton-crash.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 <script src="../resources/accessibility-helper.js"></script>
6 </head>
7
8 <body id="body">
9
10 <input type="number" id="number" value="10">
11
12 <p id="description"></p>
13 <div id="console"></div>
14 <script>
15
16     if (window.accessibilityController) {
17         description("This tests that a spin button won't access invalid attributes when its already detached.");
18
19         document.getElementById("number").focus();
20
21         var field = accessibilityController.accessibleElementById("number");
22         var spinner1 = spinnerForTextInput(field);
23         var spinnerChild = spinner1.uiElementAttributeValue("AXIncrementButton");
24         debug("spinner incrementer: " + spinnerChild.role);
25
26         shouldBe("document.getElementById('number').value", "'10'");
27         eventSender.keyDown('\u0008');
28         eventSender.keyDown('5');
29         shouldBe("document.getElementById('number').value", "'5'");
30         eventSender.keyDown('\u0008');
31         eventSender.keyDown('\u0008');
32         eventSender.keyDown('\u0008');
33
34         shouldBe("document.getElementById('number').value", "''");
35
36         // Don't crash!
37         var spinnerChild = spinner1.uiElementAttributeValue("AXIncrementButton");
38     }
39     successfullyParsed = true;
40 </script>
41
42 <script src="../resources/js-test-post.js"></script>
43 </body>
44 </html>