| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 2 <html> | 4 <html> |
| 3 <body> | 5 <body> |
| 4 This test sets caret at the beginning of backward text and moving the character
to left and right. WebKit should not crash and you should see PASS below: | |
| 5 <textarea id="editor">‮LTR | 6 <textarea id="editor">‮LTR |
| 6 </textarea> | 7 </textarea> |
| 7 <script> | 8 <script> |
| 8 onload = function() { | 9 test(function() { |
| 9 var sel = window.getSelection(); | 10 var sel = window.getSelection(); |
| 10 sel.empty(); | 11 sel.empty(); |
| 11 var test = document.getElementById("editor"); | 12 var test = document.getElementById("editor"); |
| 12 test.focus(); | 13 test.focus(); |
| 13 test.selectionDirection = 'none'; | 14 test.selectionDirection = 'none'; |
| 14 test.selectionStart = 0; | 15 test.selectionStart = 0; |
| 15 test.selectionEnd = 0; | 16 test.selectionEnd = 0; |
| 16 getSelection().modify("move", "left", "character"); | 17 getSelection().modify("move", "left", "character"); |
| 17 getSelection().modify("move", "left", "character"); | 18 getSelection().modify("move", "left", "character"); |
| 18 test.selectionDirection = 'none'; | 19 test.selectionDirection = 'none'; |
| 19 test.selectionStart = 1; | 20 test.selectionStart = 1; |
| 20 test.selectionEnd = 1; | 21 test.selectionEnd = 1; |
| 21 getSelection().modify("move", "right", "character"); | 22 getSelection().modify("move", "right", "character"); |
| 22 getSelection().modify("move", "right", "character"); | 23 getSelection().modify("move", "right", "character"); |
| 23 document.body.innerHTML = "PASS"; | 24 }, "This test sets caret at the beginning of backward text and moving the charac
ter to left and right."); |
| 24 }; | |
| 25 | |
| 26 if (window.testRunner) | |
| 27 testRunner.dumpAsText(); | |
| 28 | |
| 29 </script> | 25 </script> |
| 30 </body> | 26 </body> |
| 31 </html> | 27 </html> |
| OLD | NEW |