| <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); |
| layoutTestController.execCommand("MoveForwardAndModifySelection"); |
| layoutTestController.execCommand("MoveForwardAndModifySelection"); |
| layoutTestController.execCommand("MoveForwardAndModifySelection"); |
| layoutTestController.execCommand("MoveBackwardAndModifySelection"); |
| } else { |
| log("Failure: This test cannot be run manually.") |
| } |
| |
| </script> |