Skip to content
  • tony@chromium.org's avatar
    2010-02-17 Tony Chang <tony@chromium.org> · 2509fab1
    tony@chromium.org authored
            Reviewed by Eric Seidel.
    
            https://bugs.webkit.org/show_bug.cgi?id=26937
            No longer allow span styles to surround block elements like
            divs when pasting (see paste-text-012 and 5065605 which had divs in
            spans).  This also causes a few cases of empty spans to be removed
            (see 19089 and 5245519).
    
            * editing/execCommand/19089-expected.txt:
            * editing/pasteboard/5245519-expected.txt:
            * editing/pasteboard/5245519.html:
            * platform/mac/editing/pasteboard/5065605-expected.txt:
            * platform/mac/editing/pasteboard/paste-text-011-expected.txt:
            * platform/mac/editing/pasteboard/paste-text-012-expected.txt:
    2010-02-17  Tony Chang  <tony@chromium.org>
    
            Reviewed by Eric Seidel.
    
            Copying and pasting into a contenteditable area can create <div>s surrounded by <span>s
            https://bugs.webkit.org/show_bug.cgi?id=26937
    
            This happens because of a span added when we copy that is used to
            preserve styles.  To avoid this, when we paste, make sure to apply
            the styles to the span's children and then remove the style span.
    
            This change is covered by existing layout tests.
    
            * editing/ReplaceSelectionCommand.cpp:
            (WebCore::ReplaceSelectionCommand::handleStyleSpans):
            (WebCore::ReplaceSelectionCommand::copyStyleToChildren):
            * editing/ReplaceSelectionCommand.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    2509fab1