blob: ea3f02eee24940542d314138ec3b7544e57c40d6 [file] [log] [blame]
<p>This tests for a bug when moving the caret forward/backward by a line/paragraph. The horizontal position of the caret would be lost when moving the caret into an empty paragraph, when it should be preserved. The caret should be between the first and second 'x's in the third paragraph.</p>
<div id="div" contenteditable="true">
xxx<br>
xxx<br>
<br>
xxx<br>
</div>
<script>
var sel = window.getSelection();
sel.collapse(div, 0);
sel.modify("move", "forward", "character");
sel.modify("move", "forward", "line");
sel.modify("move", "forward", "line");
sel.modify("move", "forward", "line");
</script>