| <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script> |
| var word = document.getElementById("word"); |
| eventSender.mouseMoveTo(x, y); |
| document.execCommand("Delete"); |
| document.execCommand("Undo"); |
| var selection = window.getSelection(); |
| if (selection.anchorNode != document.getElementById("root").firstChild || |
| selection.anchorOffset != 4 || |
| selection.focusNode != word.firstChild || |
| selection.focusOffset != 3) { |
| document.getElementById("result").innerHTML = "FAILED"; |
| console.log(selection.anchorNode); |
| console.log(selection.anchorOffset); |
| console.log(selection.focusNode); |
| console.log(selection.focusOffset); |
| document.getElementById("result").innerHTML = "PASSED"; |
| <div class="explanation"> |
| Select a word via double-click. Delete. Then undo the delete. The space that got smart deleted should now be selected. |
| <div contenteditable id="root"> |
| foo <span id="word">bar</span> baz |