LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Apr 2006 21:53:23 +0000 (21:53 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Apr 2006 21:53:23 +0000 (21:53 +0000)
commitd6c66cec75affc7d7d4e475a7f76132c1fd59fdb
tree5ab9c743fbf1103e38aba180961f4804de5d9aa2
parent4c78893f09669a4300aa6cd4adba1dfd2289ecbf
LayoutTests:

        Reviewed by darin

        <http://bugzilla.opendarwin.org/show_bug.cgi?id=8198>
        Hitting an assert on undo paste

        * editing/pasteboard/undoable-fragment-removes-expected.checksum: Added.
        * editing/pasteboard/undoable-fragment-removes-expected.png: Added.
        * editing/pasteboard/undoable-fragment-removes-expected.txt: Added.
        * editing/pasteboard/undoable-fragment-removes.html: Added.

WebCore:

        Reviewed by darin

        <http://bugzilla.opendarwin.org/show_bug.cgi?id=8198>
        Hitting an assert on undo paste

        ReplaceSelectionCommand was doing a combination of undoable and non-undoable
        removes from the ReplacementFragment.  On Undo Paste, the undoable removes
        couldn't be undone because the tree was in a different state than it was
        at the time of the remove.  This patch makes all the removes from the fragment
        non-undoable.  We could make them all undoable, but I can't think of any reason
        why we'd want the fragment to be reconstructed on an Undo Paste.

        * editing/AppendNodeCommand.cpp:
        (WebCore::AppendNodeCommand::doApply):
        Assert that the node to append isn't already in a tree, since if it is, it will
        be removed in a non-undoable way.
        * editing/InsertNodeBeforeCommand.cpp:
        (WebCore::InsertNodeBeforeCommand::doApply): Ditto.
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::doApply):
        Nodes were being moved from the fragment to the document with undoable inserts.
        Undoable inserts implicitly remove the node (in a non-undoable way) from its
        old location if it is already in a tree.  I now explicitly remove the nodes
        from the fragment before inserting them into the document to make it clear that
        they are being removed in a non-non-undoable way.  I also changed the one undoable
        remove from the fragment to a non-undoable remove.
        * editing/ReplaceSelectionCommand.h:
        Made ReplacementFragment's non-undoable removeNode public.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/undoable-fragment-removes-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/undoable-fragment-removes-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/undoable-fragment-removes-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/undoable-fragment-removes.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/AppendNodeCommand.cpp
WebCore/editing/InsertNodeBeforeCommand.cpp
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/editing/ReplaceSelectionCommand.h