REGRESSION(r184899): Crash when focusing an input element styled with a web font
[WebKit-https.git] / LayoutTests / platform / mac / accessibility / textbox-role-reports-line-number.html
1 <!DOCTYPE HTML>
2 <html>
3 <body>
4 <script src="../../../resources/js-test-pre.js"></script>
5 <div role="textbox" id="ariaTextBox" aria-multiline="false" tabindex="0">Some text in a textbox</div>
6 <div role="textbox" id="multilineAriaTextBox" aria-multiline="true" tabindex="0"><div>Some text in a</div><div>multiline textbox.</div></div>
7 <div id="console"></div>
8 <script>
9 description("This tests that the AXSelection property is correctly reported for non-native text boxes.");
10
11 if (window.testRunner && window.accessibilityController) {
12
13     window.testRunner.dumpAsText();
14     var ariaTextBox = document.getElementById("ariaTextBox");
15     ariaTextBox.focus();
16     var axElement = accessibilityController.focusedElement;
17
18     shouldBe("window.getSelection().setBaseAndExtent(ariaTextBox.childNodes[0], 0, ariaTextBox.childNodes[0], 0);"
19         + " axElement.insertionPointLineNumber", "0");
20
21
22     var multilineAriaTextBox = document.getElementById("multilineAriaTextBox");
23     multilineAriaTextBox.focus();
24     axElement = accessibilityController.focusedElement;
25
26     shouldBe("window.getSelection().setBaseAndExtent(multilineAriaTextBox.childNodes[0], 1, multilineAriaTextBox.childNodes[0], 1);"
27         + " axElement.insertionPointLineNumber", "0");
28     shouldBe("window.getSelection().setBaseAndExtent(multilineAriaTextBox.childNodes[1], 1, multilineAriaTextBox.childNodes[1], 1);"
29         + " axElement.insertionPointLineNumber", "1");
30 }
31 </script>
32
33 <script src="../../../resources/js-test-post.js"></script>
34 </body>
35 </html>