Add an editing command for creating and inserting child lists
[WebKit-https.git] / LayoutTests / editing / execCommand / insert-nested-lists-with-pre.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     <pre id="pre">Hello<ul><li id="foo">foo</li></ul>world</pre>
10 </div>
11 </body>
12 <script>
13 Markup.description("Verifies that 'InsertNestedUnorderedList' and 'InsertNestedOrderedList' work as expected with pre elements. This test requires WebKitTestRunner or DumpRenderTree.");
14
15 editor.focus();
16 getSelection().setPosition(foo.childNodes[0], 0);
17 document.execCommand("InsertNestedOrderedList");
18 Markup.dump("editor", "After inserting a list inside the pre");
19
20 getSelection().setPosition(pre.childNodes[0], 0);
21 document.execCommand("InsertNestedUnorderedList");
22 Markup.dump("editor", "After inserting a list around the pre");
23 </script>
24 </html>