| OLD | NEW |
| (Empty) |
| 1 <p>This tests moveTo{Beginning, End}OfLineAndModifySelection. It should operate
on line boundaries and not paragraph boundaries. To run it manually, click ins
ide the first line of the editable region below and do Command+Shift+Left/Right
Arrow, the selection should extend to the start/end of the line, not the start/e
nd of the paragraph. Also, moveTo{Beginning, End}OfParagraphAndModifySelection
should work.</p> | |
| 2 <div id="div" contenteditable="true" style="width: 200px;">The quick brown fox j
umped over the lazy brown dog.</div> | |
| 3 | |
| 4 <script> | |
| 5 | |
| 6 if (window.testRunner) { | |
| 7 | |
| 8 window.testRunner.dumpEditingCallbacks(); | |
| 9 | |
| 10 var div = document.getElementById("div"); | |
| 11 var text = div.firstChild; | |
| 12 var sel = window.getSelection(); | |
| 13 | |
| 14 sel.collapse(text, text.length); | |
| 15 testRunner.execCommand("MoveToBeginningOfLineAndModifySelection"); | |
| 16 | |
| 17 sel.collapse(text, 0); | |
| 18 testRunner.execCommand("MoveToEndOfLineAndModifySelection"); | |
| 19 | |
| 20 sel.collapse(text, text.length); | |
| 21 testRunner.execCommand("MoveToBeginningOfParagraphAndModifySelection"); | |
| 22 | |
| 23 sel.collapse(text, 0); | |
| 24 testRunner.execCommand("MoveToEndOfParagraphAndModifySelection"); | |
| 25 } | |
| 26 </script> | |
| OLD | NEW |