Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / deleting / 5206311-1.html
blobcf01648c5fe29a5102dea7aa9819f0ddd919e2aa
1 <script>
2 function runTest(num)
4 sel = window.getSelection();
5 start = document.getElementById("test" + num + "start");
6 end = document.getElementById("test" + num + "end");
7 sel.setBaseAndExtent(start, 0, end, end.childNodes.length);
8 document.execCommand("Delete");
10 </script>
12 <p>This empties a row (the second). It should be removed. <b>This demonstrates a bug: the two cells that contained the ends of the selection aren't given a placeholder and so appear differently than the other emptied cells.</b></p>
13 <div contenteditable="true">
14 <table border="1">
15 <tr><td>1</td><td id="test1start">2</td><td>3</td></tr>
16 <tr><td>4</td><td>5</td><td>6</td></tr>
17 <tr><td>7</td><td id="test1end">8</td><td>9</td></tr>
18 </table>
19 </div>
21 <script>runTest(1);</script>
24 <p>This empties a row (the second), but it still contains the selection and so shouldn't be removed.</p>
25 <div contenteditable="true">
26 <table border="1">
27 <tr><td>1</td><td>2</td><td>3</td></tr>
28 <tr><td id="test2start">4</td><td>5</td><td id="test2end">6</td></tr>
29 <tr><td>7</td><td>8</td><td>9</td></tr>
30 </table>
31 </div>
33 <script>runTest(2);</script>
35 <p>This empties the first row, it should be removed.</p>
36 <div contenteditable="true">
37 <div>Hello <span id="test3start">world!</span></div>
38 <table border="1">
39 <tr><td>1</td><td>2</td><td>3</td></tr>
40 <tr><td>4</td><td id="test3end">5</td><td>6</td></tr>
41 <tr><td>7</td><td>8</td><td>9</td></tr>
42 </table>
43 </div>
45 <script>runTest(3);</script>