Add an editing command for creating and inserting child lists
[WebKit-https.git] / LayoutTests / editing / execCommand / insert-nested-lists-in-table.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../editing.js"></script>
5 <script src="../../resources/dump-as-markup.js"></script>
6 </head>
7 <body>
8 <div contenteditable id="editor">
9     <table>
10         <tbody>
11             <tr><th>Left</th><th>Right</th></tr>
12             <tr><td id="foo">Foo</td><td>Bar</td></tr>
13             <tr><td>Baz</td><td id="garply">Garply</td> </tr>
14         </tbody>
15     </table>
16 </div>
17 </body>
18 <script>
19 Markup.description("Verifies that 'InsertNestedUnorderedList' and 'InsertNestedOrderedList' work as expected in table cells. This test requires WebKitTestRunner or DumpRenderTree.");
20
21 editor.focus();
22 getSelection().setPosition(garply.childNodes[0], 0);
23 document.execCommand("InsertNestedOrderedList");
24 Markup.dump("editor", "After inserting a list in a table cell");
25
26 selectAllCommand();
27 document.execCommand("InsertNestedUnorderedList");
28 Markup.dump("editor", "After wrapping the table in a list");
29
30 getSelection().setPosition(foo.childNodes[0], 0);
31 document.execCommand("InsertNestedUnorderedList");
32 Markup.dump("editor", "After inserting a nested list below the outer list");
33
34 getSelection().setPosition(garply.childNodes[0], 3);
35 document.execCommand("InsertNestedOrderedList");
36 Markup.dump("editor", "After inserting another list under a table cell");
37 </script>
38 </html>