blob: 783717878bb86b93c404b74ccd0aca074fcf1db8 [file] [log] [blame]
<script src="../../resources/dump-as-markup.js" type="text/javascript"></script>
<body>
<div id="test" contenteditable>hello</div>
<script>
var div = document.getElementById('test');
window.getSelection().setBaseAndExtent(div.firstChild, 2, div.firstChild, 2);
document.execCommand('InsertParagraph', true, null);
window.getSelection().setBaseAndExtent(div.firstChild, 0, div.firstChild, 2);
document.execCommand('bold', false, null);
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).")
Markup.dump(div, "before undo");
document.execCommand('undo', false, null);
document.execCommand('undo', false, null);
Markup.dump(div, "after undo");
div.removeChild(div.firstChild);
Markup.dump(div, "after node removal");
document.execCommand('redo', false, null);
document.execCommand('redo', false, null);
Markup.dump(div, "after redo");
</script>
</body>