<div id="edit" contentEditable="true">foo<br>bar</div>

<script>
if (window.testRunner)
    window.testRunner.dumpAsText();
edit = document.getElementById("edit");
window.getSelection().setPosition(edit, 0);
document.execCommand("SelectAll");
document.execCommand("InsertUnorderedList");
document.execCommand("Undo");
text = document.createTextNode("This tests for a crash when undoing and then redoing after some arbitrary DOM operations are performed that effect the Undo stack.  The test should not crash.");
edit.innerHTML = "";
edit.appendChild(text);
document.execCommand("Undo");
document.execCommand("Redo");
</script>
