3 <script src=
"../../resources/dump-as-markup.js"></script>
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
);
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">
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>
29 <div><span class=
"end">Hello
</span>world!
</div>
33 <script>runTest(test1
);</script>
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">
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>
48 <div>Hello world!
</div>
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>
57 <script>runTest(test2
);</script>