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');
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");