REGRESSION(r184899): Crash when focusing an input element styled with a web font
[WebKit-https.git] / LayoutTests / accessibility / mac / html5-input-number.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 </head>
6 <body id="body">
7
8 <form>
9 <input id="number" type="number"><br>
10 </form>
11
12 <p id="description"></p>
13 <div id="console"></div>
14
15 <script>
16
17     description("This tests that input type='number' exposes the accessibility of it's stepper correctly");
18
19     if (window.accessibilityController) {
20
21         document.getElementById("number").focus();
22         var textfield = accessibilityController.focusedElement;
23
24         // Verify that the click point is the same as the child.
25         shouldBe("textfield.childrenCount", "1");
26
27         var incrementor = textfield.childAtIndex(0);
28
29         shouldBe("incrementor.role", "'AXRole: AXIncrementor'");
30         shouldBeTrue("incrementor.width > 0");
31         shouldBeTrue("incrementor.height > 0");
32         shouldBe("incrementor.childrenCount", "2");
33
34         shouldBe("incrementor.childAtIndex(0).role", "'AXRole: AXButton'");
35         shouldBe("incrementor.childAtIndex(0).subrole", "'AXSubrole: AXIncrementArrow'");
36         shouldBeTrue("incrementor.childAtIndex(0).width > 0");
37         shouldBeTrue("incrementor.childAtIndex(0).height > 0");
38         shouldBeTrue("incrementor.childAtIndex(0).isEnabled");
39
40         // Increment.
41         incrementor.childAtIndex(0).press();
42         shouldBe("textfield.stringValue", "'AXValue: 1'");
43
44         shouldBe("incrementor.childAtIndex(1).role", "'AXRole: AXButton'");
45         shouldBe("incrementor.childAtIndex(1).subrole", "'AXSubrole: AXDecrementArrow'");
46         shouldBeTrue("incrementor.childAtIndex(1).width > 0");
47         shouldBeTrue("incrementor.childAtIndex(1).height > 0");
48         shouldBeTrue("incrementor.childAtIndex(1).isEnabled");
49
50         // Decrement.
51         incrementor.childAtIndex(1).press();
52         shouldBe("textfield.stringValue", "'AXValue: 0'");
53     }
54
55 </script>
56
57 <script src="../../resources/js-test-post.js"></script>
58 </body>
59 </html>