Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / node-removal-2.html
blobd32ba44b0d22f173ba732f0011c3fc20ab711191
1 <html>
2 <head>
3 <script>
4 if (window.testRunner)
5 testRunner.dumpEditingCallbacks();
6 </script>
9 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
11 <script>
13 function runTest() {
14 var selection = window.getSelection();
15 var e = document.getElementById("test");
16 var r = document.getElementById("removeme");
18 selection.setBaseAndExtent(e, 0, r.childNodes[0], 2);
20 r.parentNode.removeChild(r);
21 selectAllCommand();
24 </script>
26 <title>Removing the endpoints of a selection</title>
27 </head>
28 <body>
29 <p>This tests behavior when a node that serves as the start or end of a selection is removed from the document. Ideally, we would just adjust the selection when an endpoint is removed, for now, we just blow away the selection.</p>
30 <p>This test creates a selection that ends inside of a node that will be removed. Then the node is removed. Then a Select All is executed. The entire document should be selected.</p>
31 <div id="test">
32 hello <span style="color:red;" id="removeme">removeme</span> world!
33 </div>
35 <script>runTest()</script>
37 </body>
38 </html>