WebCore:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Aug 2007 01:20:33 +0000 (01:20 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Aug 2007 01:20:33 +0000 (01:20 +0000)
commitb60c0efa9d0b30bc09b2d648ab6569d22ae23d9e
treeabf8a33f2f32f28877f837fff57e39a0cacc7f9f
parent638b8f79e7286198cc0abcee3380406c6c46d610
WebCore:

        Reviewed by Darin.

        <rdar://problem/5432254> GoogleDocs: A hang occurs when applying list style to selected table

        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::handleGeneralDelete): If the position
        that marked the start of the range to delete has been removed from the
        document, and it was inside the node that holds the position that marks
        the end of the range to delete, don't remove any children of that node,
        because we don't know how many to remove.  For example, if the end is
        [a, 5] and the start was in some descendant of a and was removed, don't
        remove any of the children of a.  We will now refuse to remove some content
        incorrectly, but that's less dangerous than removing content incorrectly.
        Long term we need to update these positions as we remove content from the
        document, but that seems like a more risky change.  Added a testcase.
        * editing/InsertListCommand.cpp:
        (WebCore::InsertListCommand::modifyRange): If the end of the selection to
        modify is just after a table, and if the start of the selection is inside
        that table, the last paragraph that we'll want modify is the last one inside
        the table, not the paragraph that contains the table itself. Adjust
        startOfLastParagraph here to avoid infinite recursion.

LayoutTests:

        Reviewed by Darin.

        <rdar://problem/5432254> GoogleDocs: A hang occurs when applying list style to selected table

        * editing/execCommand/5432254-1.html: Added.
        * editing/execCommand/5432254-2.html: Added.
        * platform/mac/editing/execCommand: Added.
        * platform/mac/editing/execCommand/5432254-1-expected.checksum: Added.
        * platform/mac/editing/execCommand/5432254-1-expected.png: Added.
        * platform/mac/editing/execCommand/5432254-1-expected.txt: Added.
        * platform/mac/editing/execCommand/5432254-2-expected.checksum: Added.
        * platform/mac/editing/execCommand/5432254-2-expected.png: Added.
        * platform/mac/editing/execCommand/5432254-2-expected.txt: Added.

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