Missing cursor/caret showing in search field on google.com
[WebKit-https.git] / LayoutTests / editing / selection / move-by-word-visually-textarea.html
1 <!DOCTYPE html>
2 <script src="../../resources/js-test-pre.js"></script>
3 <script>
4
5 onload = function() {
6     var sel = window.getSelection();
7     sel.empty();
8     
9     var test = document.getElementById("test_move_by_word");
10     test.focus();
11     test.value = "word word word\n\n\nword\n\n\n   ";
12     test.selectionDirection = 'none';
13     test.selectionStart = 0;
14     test.selectionEnd = 0;
15
16     var wordBreaks = test.title.split(" ");
17     var fail = false;
18     var i;
19     for (i = 0; i < 5; ++i) {
20         var start = test.selectionStart;
21         sel.modify("move", "right", "word");
22         var wordBreak;
23         if (i >= wordBreaks.length)
24             wordBreak = wordBreaks[wordBreaks.length - 1];
25         else
26             wordBreak = wordBreaks[i];
27         if (test.selectionStart != wordBreak) {
28             testFailed("Expected: " + start + " -> " + wordBreak + "; Actual : " + start + " -> " + test.selectionStart);
29             fail = true;
30         }
31     }
32
33     if (fail == false)
34         testPassed("Pass");
35 }
36
37 if (window.testRunner && window.internals) {
38     testRunner.dumpAsText();
39     internals.settings.setEditingBehavior('win');
40 }
41 </script>
42
43 <textarea title = "5 10 17 27" dir=ltr id="test_move_by_word"></textarea>