| 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 caret position 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 for (var characterIndex = 0; characterIndex < 7; ++characterIndex) { | |
| 24 input.setSelectionRange(characterIndex, characterIndex); | |
| 25 shouldBeEqualToNumber("inputAccessible.selectionStart", | |
| 26 characterIndex); | |
| 27 shouldBeEqualToNumber("inputAccessible.selectionEnd", | |
| 28 characterIndex); | |
| 29 } | |
| 30 | |
| 31 } | |
| 32 </script> | |
| 33 | |
| 34 </body> | |
| 35 </html> | |
| OLD | NEW |