blob: 99689171398f535ea2a63f7259cacf4a47ee6939 [file] [log] [blame]
<div id="description">This tests for a bug where moving the caret left towards a non-editable pocket of an editable region would make the caret disappear. The caret should be just before the 'B' in "Bob".</div>
<div id="edit" contenteditable="true"><span contenteditable="false">Bob</span> ; <span contenteditable="false">Sally</span></div>
<script>
if (window.testRunner)
window.testRunner.dumpAsText();
edit = document.getElementById("edit");
text = edit.childNodes[1];
s = window.getSelection();
s.setPosition(text, 0);
s.modify("move", "left", "character");
if (window.testRunner) {
var caretRect = textInputController.firstRectForCharacterRange(textInputController.selectedRange()[0], 0);
document.body.innerText = document.getElementById("description").innerText + "\n\nCaret: (" + caretRect[0] + ", " + caretRect[1] + ")";
}
</script>