Skip to content
  • justin.garcia@apple.com's avatar
    WebCore: · e248230a
    justin.garcia@apple.com authored
    2008-11-21  Justin Garcia  <justin.garcia@apple.com>
    
            Reviewed by Darin Adler.
    
            <rdar://problem/5381788> Match NSTextView editing behavior at the end of hyperlink text
            
            Change link editing behavior to match TextEdit and MS Word when editing before and after 
            a link (Pages has two caret positions at link boundaries, Thunderbird and FF behave like we 
            used to, so it's difficult to get out of link editing mode):
            When inserting before or after a link, always insert content outside of the link.  This
            makes it impossible to get stuck in link editing mode, while making it slightly more 
            difficult to edit link labels.  WebKit editors that care about this can add UI for editing 
            link labels, like GMail and GoogleDocs have done.  We never actually had any bugs complaining
            about how it was difficult to edit link labels at the start/end, the code was just introduced 
            with another bug fix without much thought.
            
            Don't remember removed links anymore, no other editor does this and it made it 
            difficult/impossible to get out of link editing mode.  This code was added to fix
            <rdar://problem/4069359>, which is fixed instead by removing the styles from an 
            enclosing anchor element from those styles that we remember when we delete content.
    
            * editing/CompositeEditCommand.cpp:
            (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
            * editing/CompositeEditCommand.h:
            * editing/DeleteSelectionCommand.cpp:
            (WebCore::removeEnclosingAnchorStyle):
            (WebCore::DeleteSelectionCommand::saveTypingStyleState):
            (WebCore::DeleteSelectionCommand::doApply):
            * editing/DeleteSelectionCommand.h:
            * editing/EditCommand.cpp:
            (WebCore::EditCommand::apply):
            * editing/Editor.cpp:
            (WebCore::Editor::appliedEditing):
            * editing/InsertTextCommand.cpp:
            (WebCore::InsertTextCommand::prepareForTextInsertion):
            (WebCore::InsertTextCommand::input):
            * editing/RemoveFormatCommand.cpp:
            (WebCore::RemoveFormatCommand::doApply):
            * editing/SelectionController.cpp:
            (WebCore::SelectionController::setSelection):
            * editing/SelectionController.h:
    
    LayoutTests:
    
    2008-11-21  Justin Garcia  <justin.garcia@apple.com>
    
            Reviewed by Darin Adler.
            
            <rdar://problem/5381788> Match NSTextView editing behavior at the end of hyperlink text
            
            Removed tests for behaviors that we're no longer interested in:
            * editing/deleting/delete-link-1.html: Removed.
            * platform/mac/editing/deleting/delete-link-1-expected.checksum: Removed.
            * platform/mac/editing/deleting/delete-link-1-expected.png: Removed.
            * platform/mac/editing/deleting/delete-link-1-expected.txt: Removed.
            * editing/execCommand/19653-4-expected.txt: Removed.
            * editing/execCommand/19653-4.html: Removed.
            
            Reflects new behavior (don't remember removed anchors):
            * platform/mac/editing/deleting/5168598-expected.txt:
            
            Reflects new behavior.  Also made this test cross-platform:
            * editing/inserting/insert-before-link-1-expected.txt: Added.
            * editing/inserting/insert-before-link-1.html:
            * platform/mac/editing/inserting/insert-before-link-1-expected.checksum: Removed.
            * platform/mac/editing/inserting/insert-before-link-1-expected.png: Removed.
            * platform/mac/editing/inserting/insert-before-link-1-expected.txt: Removed.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    e248230a