WebCore:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2007 18:11:04 +0000 (18:11 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2007 18:11:04 +0000 (18:11 +0000)
commit2349eeb11367198bb84cfe4d05f579a369d4426f
tree153d5a673f39f3c681af58d754a1ce79e4a93e09
parent90167b7c540bb7c854fb5accd57aa0e7db4623b6
WebCore:

        Reviewed by Adele.

        <rdar://problem/5156801> REGRESSION: Crash at DeleteSelectionCommand::doApply() when deleting table content

        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::handleGeneralDelete): Use a RefPtr
        for node.  If the node to be removed contains the selection, and if
        the next node to be removed (nextNode) is inside the deletion UI,
        removing node will remove nextNode from the document.  nextNode is
        a RefPtr, but node isn't and when nextNode falls out of scope the node
        that node points to will be destroyed and we'll end up using a stale pointer.
        Long term we should probably just disable the deletion UI before editing
        operations because the undo of the removal of node in the situation
        described above relies on the presence of the deletion UI, but it isn't
        present because its added and removed in a non-undoable way.

LayoutTests:

        Reviewed by Adele.

        <rdar://problem/5156801> REGRESSION: Crash at DeleteSelectionCommand::doApply() when deleting table content

        * editing/deleting/5156801-2.html: Added.
        * platform/mac/editing/deleting: Added.
        * platform/mac/editing/deleting/5156801-2-expected.checksum: Added.
        * platform/mac/editing/deleting/5156801-2-expected.png: Added.
        * platform/mac/editing/deleting/5156801-2-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/deleting/5156801-2.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/deleting/5156801-2-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/editing/deleting/5156801-2-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/editing/deleting/5156801-2-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/DeleteSelectionCommand.cpp