WebCore:
authorjustin.garcia@apple.com <justin.garcia@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2007 01:33:52 +0000 (01:33 +0000)
committerjustin.garcia@apple.com <justin.garcia@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2007 01:33:52 +0000 (01:33 +0000)
commit2df7a33f2c0967a8f0f033b0df91c410bee8a9b3
tree4dbab9d5ead57c036b64426c0758319866b15159
parentdd64e22cbf2c290b99354feb027880cb2f0c87f2
WebCore:

        Reviewed by Darin Adler.

        <rdar://problem/5573879> GMail Beta: Crash in when undoing Remove Formating

        In the new beta, Google has added some custom code on top of our RemoveFormat
        to work around a bug where fully selected lists aren't removed.  This code corrupts
        the undo stack and causes crashes.  This change fixes two problems with RemoveFormat
        so that Google doesn't have to have any custom code. After checking this in I'll
        work on bulletproofing the undo stack

        * WebCore.xcodeproj/project.pbxproj:
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::insertLineBreak): Added this convenience method.
        (WebCore::CompositeEditCommand::inputText): Added code to select all inserted text, not
        just the last paragraph.  Added code to support an input string with '\n's.
        * editing/CompositeEditCommand.h:
        * editing/Editor.cpp:
        (WebCore::Editor::removeFormattingAndStyle): Moved code to its own EditCommand.
        * editing/RemoveFormatCommand.cpp: Added. Moved code from removeFormattingAndStyle here.
        (WebCore::RemoveFormatCommand::RemoveFormatCommand):
        (WebCore::RemoveFormatCommand::doApply): Added code to remove fully selected lists.
        * editing/RemoveFormatCommand.h: Added.
        (WebCore::RemoveFormatCommand::editingAction):

LayoutTests:

        Reviewed by Darin Adler.

        <rdar://problem/5573879> GMail Beta: Crash in when undoing Remove Formating

        Added to demonstrate fixes:
        * editing/execCommand/5573879.html: Added.
        * platform/mac/editing/execCommand/5573879-expected.checksum: Added.
        * platform/mac/editing/execCommand/5573879-expected.png: Added.
        * platform/mac/editing/execCommand/5573879-expected.txt: Added.

        Fixes (RemoveFormat now preserves the selection correctly):
        * platform/mac/editing/execCommand/4920742-1-expected.checksum:
        * platform/mac/editing/execCommand/4920742-1-expected.png:
        * platform/mac/editing/execCommand/4920742-1-expected.txt:
        * platform/mac/editing/execCommand/remove-formatting-2-expected.checksum:
        * platform/mac/editing/execCommand/remove-formatting-2-expected.png:
        * platform/mac/editing/execCommand/remove-formatting-2-expected.txt:
        * platform/mac/editing/execCommand/remove-formatting-expected.checksum:
        * platform/mac/editing/execCommand/remove-formatting-expected.png:
        * platform/mac/editing/execCommand/remove-formatting-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/execCommand/5573879.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/execCommand/4920742-1-expected.checksum
LayoutTests/platform/mac/editing/execCommand/4920742-1-expected.png
LayoutTests/platform/mac/editing/execCommand/4920742-1-expected.txt
LayoutTests/platform/mac/editing/execCommand/5573879-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/editing/execCommand/5573879-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/editing/execCommand/5573879-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/execCommand/remove-formatting-2-expected.checksum
LayoutTests/platform/mac/editing/execCommand/remove-formatting-2-expected.png
LayoutTests/platform/mac/editing/execCommand/remove-formatting-2-expected.txt
LayoutTests/platform/mac/editing/execCommand/remove-formatting-expected.checksum
LayoutTests/platform/mac/editing/execCommand/remove-formatting-expected.png
LayoutTests/platform/mac/editing/execCommand/remove-formatting-expected.txt
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/editing/CompositeEditCommand.cpp
WebCore/editing/CompositeEditCommand.h
WebCore/editing/Editor.cpp
WebCore/editing/RemoveFormatCommand.cpp [new file with mode: 0644]
WebCore/editing/RemoveFormatCommand.h [new file with mode: 0644]