Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / execCommand / delete-table-with-empty-contents.html
blob12130a719e8e31b6158f3229219f8bf4a04173e9
1 <!DOCTYPE html>
2 <div contenteditable test='empty'>
3 <table contenteditable=false>
4 <tr><td></td></tr>
5 </table>
6 </div>
8 <div contenteditable test='with empty span'>
9 <table contenteditable=false>
10 <tr><td><span></span></td></tr>
11 </table>
12 </div>
14 <div contenteditable test='with editable empty span'>
15 <table contenteditable=false>
16 <tr><td><span contenteditable></span></td></tr>
17 </table>
18 </div>
20 <div contenteditable test='with editable non-empty span'>
21 <table contenteditable=false>
22 <tr><td><span contenteditable>Test 4.</span></td></tr>
23 </table>
24 </div>
26 <div contenteditable test='with nested editable non-empty spans'>
27 <table contenteditable=false>
28 <tr><td><span contenteditable><span>Test 5.</span></span></td></tr>
29 </table>
30 </div>
32 <div contenteditable test='with multiple editable non-empty spans'>
33 <table contenteditable=false>
34 <tr><td><span contenteditable>Test 6.</span><span contenteditable>More test 6.</span></td></tr>
35 </table>
36 </div>
38 <div contenteditable test='with nested table'>
39 <table contenteditable=false>
40 <tr><td><span contenteditable>
41 <table contenteditable=false>
42 <tr><td>Test 7.</td></tr>
43 </table>
44 </span></td></tr>
45 </table>
46 </div>
48 <div contenteditable test='with nested table containing editable non-empty span'>
49 <table contenteditable=false>
50 <tr><td><span contenteditable>
51 <table contenteditable=false>
52 <tr><td><span contenteditable>Test 8.</span></td></tr>
53 </table>
54 </span></td></tr>
55 </table>
56 </div>
58 <pre>
59 Tests that tables that have empty-rendered cells during deletion are deleted
60 correctly. Empty-rendered cells can be caused by empty cells, cells with
61 content that has no height, or cells with editable content such that the
62 content is deleted prior to the table's deletion.
63 </pre>
65 <script>
66 var console = document.getElementsByTagName('pre')[0];
68 function runTestForContainer(container) {
69 container.focus();
70 document.execCommand('SelectAll');
71 document.execCommand('Delete');
73 var testDescription = container.getAttribute('test');
74 var result = container.innerText === '\n' ?
75 'PASS (' + testDescription + ')' :
76 'FAIL (' + testDescription + '), should contain exactly one LF but was ' + container.innerText;
77 console.appendChild(document.createTextNode('\n' + result));
79 if (window.testRunner)
80 document.body.removeChild(container);
83 Array.prototype.slice.call(document.getElementsByTagName('div')).forEach(runTestForContainer);
85 if (window.testRunner)
86 testRunner.dumpAsText();
87 </script>