blob: a8eb6ae22e3a0284f9da976313fca9e2e2b94743 [file] [log] [blame]
<p>This tests for a bug where selection change notifications would post the wrong proposed selected range.</p>
<div id="div" contenteditable="true">There should be five characters selected in this sentence.</div>
<ul id="console"></ul>
<script>
function log(str) {
console = document.getElementById("console");
li = document.createElement("li");
text = document.createTextNode(str);
console.appendChild(li);
li.appendChild(text);
}
if (window.layoutTestController) {
window.layoutTestController.dumpEditingCallbacks();
var text = document.getElementById("div").firstChild;
var selection = window.getSelection();
selection.setBaseAndExtent(text, 0, text, 0);
textInputController.doCommand("moveForwardAndModifySelection:");
textInputController.doCommand("moveForwardAndModifySelection:");
textInputController.doCommand("moveForwardAndModifySelection:");
textInputController.doCommand("moveBackwardAndModifySelection:");
} else {
log("Failure: This test cannot be run manually.")
}
</script>