blob: 2360ac0e83924be5501e309be0cfe0c82b4fb84b [file] [log] [blame]
<span>This test passes if the caret is at the start of the first line.</span>
<p id="result"></p>
<div id="edit" contentEditable="true" style="width: 350px; height: 100px; border: 1px solid blue;">a <span style=color:blue;">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span></div>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var edit = document.getElementById("edit");
window.getSelection().collapse(edit.childNodes.item(1).childNodes.item(0), 2);
window.getSelection().modify("move", "backward", "line");
window.getSelection().modify("move", "backward", "line");
document.getElementById("result").innerText = getSelection().baseOffset == 0 ? "PASS" : "FAIL";
</script>