1 <script src=
"../../resources/dump-as-markup.js" type=
"text/javascript"></script>
3 <div id=
"test" contenteditable
>hello
</div>
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");