Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / deleting / 5206311-2.html
blob1e7a06a45518a2ba72d19dc96b7d487f16c230eb
1 <!DOCTYPE html>
2 <head>
3 <script src="../../resources/dump-as-markup.js"></script>
4 <script>
5 function runTest(elem)
7 sel = window.getSelection();
8 start = elem.getElementsByClassName("start")[0];
9 end = elem.getElementsByClassName("end")[0];
10 sel.setBaseAndExtent(start, 0, end, end.childNodes.length);
11 document.execCommand("Delete");
12 Markup.dump(elem.getElementsByClassName('root')[0], elem.getElementsByClassName("description")[0].textContent);
14 </script>
15 </head>
17 <body>
18 <div id="test1">
19 <p class="description">The test deletes cells 5 through 9.
20 Since all the cells in the third row were deleted, the third row is removed.
21 The cells in the second row are not removed because not all of them are deleted.
22 The second cell, which used to contain '5', is replaced with the 'world!' text, and the third cell is cleared</p>
23 <div class="root" contenteditable="true">
24 <table border="1">
25 <tr><td>1</td><td>2</td><td>3</td></tr>
26 <tr><td>4</td><td class="start">5</td><td>6</td></tr>
27 <tr><td>7</td><td>8</td><td>9</td></tr>
28 </table>
29 <div><span class="end">Hello </span>world!</div>
30 </div>
31 </div>
33 <script>runTest(test1);</script>
37 <div id="test2">
38 <p class="description">
39 This test deletes cells 5 through 9 of the first table and 1 through 5 of the second.
40 In the first table, cells 5-6 in the second row are cleared and the last row (cells 7-9) is removed.
41 In the second table, the first row (cells 1-3) is removed and cells 4-5 in the second row are cleared</p>
42 <div class="root" contenteditable="true">
43 <table border="1">
44 <tr><td>1</td><td>2</td><td>3</td></tr>
45 <tr><td>4</td><td class="start">5</td><td>6</td></tr>
46 <tr><td>7</td><td>8</td><td>9</td></tr>
47 </table>
48 <div>Hello world!</div>
49 <table border="1">
50 <tr><td>1</td><td>2</td><td>3</td></tr>
51 <tr><td>4</td><td class="end">5</td><td>6</td></tr>
52 <tr><td>7</td><td>8</td><td>9</td></tr>
53 </table>
54 </div>
55 </div>
57 <script>runTest(test2);</script>
58 </body>
59 </html>