Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / undo / redo-split-text-with-removal.html
blob783717878bb86b93c404b74ccd0aca074fcf1db8
1 <script src="../../resources/dump-as-markup.js" type="text/javascript"></script>
2 <body>
3 <div id="test" contenteditable>hello</div>
4 <script>
6 var div = document.getElementById('test');
8 window.getSelection().setBaseAndExtent(div.firstChild, 2, div.firstChild, 2);
9 document.execCommand('InsertParagraph', true, null);
10 window.getSelection().setBaseAndExtent(div.firstChild, 0, div.firstChild, 2);
11 document.execCommand('bold', false, null);
13 Markup.description("This test splits a text node by inserting a new paragraph and bolds the the first half.\nAfter undoing these two steps, it removes the text node, and then redo. The test should not crash. (See bug 42941).")
14 Markup.dump(div, "before undo");
15 document.execCommand('undo', false, null);
16 document.execCommand('undo', false, null);
18 Markup.dump(div, "after undo");
19 div.removeChild(div.firstChild);
20 Markup.dump(div, "after node removal");
22 document.execCommand('redo', false, null);
23 document.execCommand('redo', false, null);
24 Markup.dump(div, "after redo");
26 </script>
27 </body>