blob: 98f4e4243b927ce96d4188c43f393da22d3b1249 [file] [log] [blame]
<p>This tests moveTo{Beginning, End}OfLineAndModifySelection. It should operate on line boundaries and not paragraph boundaries. To run it manually, click inside 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/end of the paragraph. Also, moveTo{Beginning, End}OfParagraphAndModifySelection should work.</p>
<div id="div" contenteditable="true" style="width: 200px;">The quick brown fox jumped over the lazy brown dog.</div>
<script>
if (window.layoutTestController) {
window.layoutTestController.dumpEditingCallbacks();
var div = document.getElementById("div");
var text = div.firstChild;
var sel = window.getSelection();
sel.setPosition(text, text.length);
layoutTestController.execCommand("MoveToBeginningOfLineAndModifySelection");
sel.setPosition(text, 0);
layoutTestController.execCommand("MoveToEndOfLineAndModifySelection");
sel.setPosition(text, text.length);
layoutTestController.execCommand("MoveToBeginningOfParagraphAndModifySelection");
sel.setPosition(text, 0);
layoutTestController.execCommand("MoveToEndOfParagraphAndModifySelection");
}
</script>