Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / undo / redo-split-text-node.html
blob8aa9aa64be90f2dc2ccaaede55a4ee1520ede98d
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');
7 window.getSelection().setBaseAndExtent(div.firstChild, 2, div.firstChild, 2);
8 document.execCommand('InsertParagraph', true, null);
9 window.getSelection().setBaseAndExtent(div.firstChild, 0, div.firstChild, 2);
10 document.execCommand('bold', false, null);
12 Markup.description("This test splits a text node by inserting a new paragraph and bolds the the first half.\nIf splitTextNode correctly reapplied the split, undo and redo should preserve the style. (See bug 42941).")
13 Markup.dump(div, "before undo");
14 document.execCommand('undo', false, null);
15 document.execCommand('undo', false, null);
16 Markup.dump(div, "after undo");
17 document.execCommand('redo', false, null);
18 document.execCommand('redo', false, null);
19 Markup.dump(div, "after redo");
21 </script>
22 </body>