Skip to content
  • justing's avatar
    LayoutTests: · 0982ef50
    justing authored
            Reviewed by darin
    
            <rdar://problem/4944770>
            editing/pasteboard/4641033 layout test is broken (12328)
    
            The fixes not only make this test pass, but also fix a bug that 
            was reflected in the results checked in for this test.  The caret
            was in the wrong position:
            * editing/pasteboard/4641033-expected.checksum:
            * editing/pasteboard/4641033-expected.png:
            * editing/pasteboard/4641033-expected.txt:
            Added:
            * editing/pasteboard/4944770-1-expected.checksum: Added.
            * editing/pasteboard/4944770-1-expected.png: Added.
            * editing/pasteboard/4944770-1-expected.txt: Added.
            * editing/pasteboard/4944770-1.html: Added.
            * editing/pasteboard/4944770-2-expected.checksum: Added.
            * editing/pasteboard/4944770-2-expected.png: Added.
            * editing/pasteboard/4944770-2-expected.txt: Added.
            * editing/pasteboard/4944770-2.html: Added.
            * editing/pasteboard/4944770-expected.checksum: Added.
            * editing/pasteboard/4944770-expected.png: Added.
            * editing/pasteboard/4944770-expected.txt: Added.
            Equivalent render trees:
            * editing/execCommand/format-block-from-range-selection-expected.txt:
            * editing/pasteboard/drag-drop-modifies-page-expected.txt:
            Fixed:
            * editing/pasteboard/nested-blocks-with-text-area-expected.checksum:
            * editing/pasteboard/nested-blocks-with-text-area-expected.png:
            * editing/pasteboard/nested-blocks-with-text-area-expected.txt:
            * editing/pasteboard/nested-blocks-with-text-field-expected.checksum:
            * editing/pasteboard/nested-blocks-with-text-field-expected.png:
            * editing/pasteboard/nested-blocks-with-text-field-expected.txt:
    
    WebCore:
    
            Reviewed by darin
            
            <rdar://problem/4944770>
            editing/pasteboard/4641033 layout test is broken (12328)
            
            This layout test failure demonstrates three bugs:
            Smart replace shouldn't be turned on, but is because a word
            selection granularity from the previous test isn't cleared.
            Smart replace shouldn't add any spaces because the paste is performed
            in an empty paragraph.
            Smart replace spaces are added to the text of options inside
            the select element instead of before/after the select element.
            
            This patch fixes the second two problems.  During a 
            ReplaceSelectionCommand, the VisiblePosition for the end of 
            the inserted content is the last position in the last leaf 
            inserted.  This is a problem when the last leaf is inside a 
            select element, since VP creation is inconsistent there.  
            Second, smart spaces were inserted inside the last leaf, not
            at the endOfInsertedContent.
    
            * editing/ReplaceSelectionCommand.cpp:
            (WebCore::ReplaceSelectionCommand::shouldMergeStart): Renamed 
            m_lastNodeInserted to m_lastLeafInserted.  Use the 
            start/endOfInsertedContent getters.
            (WebCore::ReplaceSelectionCommand::shouldMergeEnd): Ditto.
            (WebCore::ReplaceSelectionCommand::removeNodePreservingChildren): Ditto.
            (WebCore::ReplaceSelectionCommand::removeRedundantStyles): Ditto.
            (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent): Added.
            Special case for when the last leaf inserted is inside a select 
            element: return the VisiblePosition after the select element.
            (WebCore::ReplaceSelectionCommand::positionAtStartOfInsertedContent): Added.
            (WebCore::ReplaceSelectionCommand::doApply): Did renaming.  Used
            the start/endOfInsertedContent getters.  Insert smart replace spaces
            into the right nodes.
            (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): Renaming.
            (WebCore::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
            (WebCore::ReplaceSelectionCommand::updateNodesInserted): Ditto.
            * editing/ReplaceSelectionCommand.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    0982ef50