Skip to content
  • justin.garcia@apple.com's avatar
    WebCore: · 0ca5d705
    justin.garcia@apple.com authored
            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: http://svn.webkit.org/repository/webkit/trunk@28126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    0ca5d705