blob: 9faa5f2b41f351c44b55b3d3d6ccae38bd7a639f [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) {
testRunner.dumpEditingCallbacks();
testRunner.dumpAsLayoutWithPixelResults();
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>