blob: 27cac0b6d14e99d65ca02e7a543e911215c333ea [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.setPosition(div, 0);
sel.modify("move", "forward", "character");
sel.modify("move", "forward", "line");
sel.modify("move", "forward", "line");
sel.modify("move", "forward", "line");
</script>