2009-01-06 Justin Garcia <justin.garcia@apple.com>

        Reviewed by Oliver Hunt.
        
        Tests for:
        <rdar://problem/4059423> DOM operations performed on editable HTML can cause a crash later during Undo (19703)
        
        A few more may able to be written after <rdar://problem/6468156> is fixed.

        * editing/undo/4059423-1-expected.txt: Added.
        * editing/undo/4059423-1.html: Added.
        * editing/undo/4059423-2-expected.txt: Added.
        * editing/undo/4059423-2.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fd978503
2009-01-06 Justin Garcia <justin.garcia@apple.com>
Reviewed by Oliver Hunt.
Tests for:
<rdar://problem/4059423> DOM operations performed on editable HTML can cause a crash later during Undo (19703)
A few more may able to be written after <rdar://problem/6468156> is fixed.
* editing/undo/4059423-1-expected.txt: Added.
* editing/undo/4059423-1.html: Added.
* editing/undo/4059423-2-expected.txt: Added.
* editing/undo/4059423-2.html: Added.
2009-01-06 Oliver Hunt <oliver@apple.com>
Reviewed by Cameron Zwarich.
......
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.
<div id="edit" contentEditable="true">foo<br>bar</div>
<script>
if (window.layoutTestController)
window.layoutTestController.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>
This tests for a crash on Undo that was caused because of DOM operations that GMail performs while right aligning text. This text should be right aligned and this test should not crash.
<head>
<script>
function runTest() {
if (window.layoutTestController)
window.layoutTestController.dumpAsText();
window.getSelection().setPosition(document.body, 0);
document.execCommand("InsertText", false, "foo");
div = document.createElement("div");
div.appendChild(document.createTextNode("x"));
document.body.appendChild(div);
div.style.height = "0px";
div.style.overflow = "hidden";
document.execCommand("JustifyRight");
document.body.removeChild(div);
document.body.innerHTML = "<div align='right'>This tests for a crash on Undo that was caused because of DOM operations that GMail performs while right aligning text. This text should be right aligned and this test should not crash.</div>";
document.execCommand("Undo");
}
</script>
</head>
<body contentEditable="true" onLoad="runTest();"></body>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment