Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / deleting / in-visibly-empty-root.html
blob5950637acdcc7392b3b8bcbc0dc080cd5e0ee434
1 <p>
2 Test that a backward delete in an editable root that contains only a single
3 visible position removes all children of the editable root.
4 </p>
5 <div id="editable-root" contenteditable>
6 <div id="square" style="background-color: red; height: 100px; width: 100px;">Lorem ipsum dolor sit amet</div>
7 </div>
8 <div id="result"></div>
9 <script>
10 if (window.testRunner)
11 testRunner.dumpAsText();
13 var root = document.getElementById("editable-root");
14 var square = document.getElementById("square");
15 root.focus();
16 document.execCommand("SelectAll");
17 document.execCommand("delete", "backward");
18 if (!square.parentNode)
19 document.getElementById("result").innerText = "FAIL: first delete removed the container";
20 else {
21 document.execCommand("delete", "backward");
22 document.getElementById("result").innerText = square.parentNode ? "FAIL: second delete did not remove the container" : "PASS";
24 </script>