OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../resources/js-test.js"></script> | |
5 </head> | |
6 <body> | |
7 | |
8 <input type="text" id="input" value="Line 1"> | |
9 | |
10 <p id="description"></p> | |
11 <div id="console"></div> | |
12 | |
13 <script> | |
14 description("This tests that text selection is reported correctly for te
xt input elements."); | |
15 | |
16 if (window.accessibilityController) { | |
17 | |
18 var input = document.getElementById('input'); | |
19 input.focus(); | |
20 var inputAccessible = | |
21 accessibilityController.accessibleElementById('input'); | |
22 | |
23 // Select the entire contents. | |
24 input.select(); | |
25 shouldBeZero("inputAccessible.selectionStart"); | |
26 shouldBeEqualToNumber("inputAccessible.selectionEnd", 6); | |
27 shouldBeEqualToNumber("inputAccessible.selectionStartLineNumber", 0)
; | |
28 shouldBeEqualToNumber("inputAccessible.selectionEndLineNumber", 0); | |
29 | |
30 // Select all possible text ranges. | |
31 for (var start = 0; start < 7; ++start) { | |
32 for (var end = start + 1; end < 7; ++end) { | |
33 input.setSelectionRange(start, end); | |
34 shouldBeEqualToNumber("inputAccessible.selectionStart", star
t); | |
35 shouldBeEqualToNumber("inputAccessible.selectionEnd", end); | |
36 shouldBeEqualToNumber("inputAccessible.selectionStartLineNum
ber", 0); | |
37 shouldBeEqualToNumber("inputAccessible.selectionEndLineNumbe
r", 0); | |
38 } | |
39 } | |
40 | |
41 } | |
42 </script> | |
43 | |
44 </body> | |
45 </html> | |
OLD | NEW |