| <p> |
| Test that a backward delete in an editable root that contains only a single |
| visible position removes all children of the editable root. |
| </p> |
| <div id="editable-root" contenteditable> |
| <div id="square" style="background-color: red; height: 100px; width: 100px;">Lorem ipsum dolor sit amet</div> |
| </div> |
| <div id="result"></div> |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| var root = document.getElementById("editable-root"); |
| var square = document.getElementById("square"); |
| root.focus(); |
| document.execCommand("SelectAll"); |
| document.execCommand("delete", "backward"); |
| if (!square.parentNode) |
| document.getElementById("result").innerText = "FAIL: first delete removed the container"; |
| else { |
| document.execCommand("delete", "backward"); |
| document.getElementById("result").innerText = square.parentNode ? "FAIL: second delete did not remove the container" : "PASS"; |
| } |
| </script> |