blob: 803046570d51ee826b0552cb18449924e14b18e6 [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.testRunner) {
window.testRunner.dumpEditingCallbacks();
var text = document.getElementById("div").firstChild;
var selection = window.getSelection();
selection.setBaseAndExtent(text, 0, text, 0);
testRunner.execCommand("MoveForwardAndModifySelection");
testRunner.execCommand("MoveForwardAndModifySelection");
testRunner.execCommand("MoveForwardAndModifySelection");
testRunner.execCommand("MoveBackwardAndModifySelection");
} else {
log("Failure: This test cannot be run manually.")
}
</script>