LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Nov 2006 01:04:48 +0000 (01:04 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Nov 2006 01:04:48 +0000 (01:04 +0000)
commit5a9a50a5b71535bc8ce27c2e8c7c5bea7cce4626
tree5d3ce14a770e936b5d467d989b1821f011beaf56
parentac3cf8831f4177c560c6add2a3c5e982d2fa3787
LayoutTests:

        Reviewed by harrison

        <rdar://problem/4237467> REGRESSION: Pasting word from quoted text quotes the destination
        <rdar://problem/4017358> quoted text is wrong color, when pasted as quotation

        Fixed:
        * editing/pasteboard/merge-end-blockquote-expected.checksum:
        * editing/pasteboard/merge-end-blockquote-expected.png:
        * editing/pasteboard/merge-end-blockquote-expected.txt:
        * editing/pasteboard/merge-end-blockquote.html:

        Added:
        * editing/pasteboard/paste-blockquote-1-expected.checksum: Added.
        * editing/pasteboard/paste-blockquote-1-expected.png: Added.
        * editing/pasteboard/paste-blockquote-1-expected.txt: Added.
        * editing/pasteboard/paste-blockquote-1.html: Added.
        * editing/pasteboard/paste-blockquote-2-expected.checksum: Added.
        * editing/pasteboard/paste-blockquote-2-expected.png: Added.
        * editing/pasteboard/paste-blockquote-2-expected.txt: Added.
        * editing/pasteboard/paste-blockquote-2.html: Added.
        * editing/pasteboard/paste-blockquote-3-expected.checksum: Added.
        * editing/pasteboard/paste-blockquote-3-expected.png: Added.
        * editing/pasteboard/paste-blockquote-3-expected.txt: Added.
        * editing/pasteboard/paste-blockquote-3.html: Added.

WebCore:

        Reviewed by harrison

        <rdar://problem/4237467> REGRESSION: Pasting word from quoted text quotes the destination
        <rdar://problem/4017358> quoted text is wrong color, when pasted as quotation

        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::isMailPasteAsQuotationNode): Added.  Checks for the node
        that Mail wraps around an incoming fragment when it wants it to be pasted
        with quoting (no merging should be done).
        (WebCore::ReplaceSelectionCommand::removeNodePreservingChildren): Added
        this virtual method in order to adjust the nodes that ReplaceSelectionCommand
        tracks.
        (WebCore::ReplaceSelectionCommand::shouldMerge): Don't merge from content
        inside a Mail Paste as Quotation node.  Allow merging from Mail blockquotes.
        (WebCore::ReplaceSelectionCommand::removeRedundantStyles): When pasting into
        a Mail blockquote, we ignore the parts of the source document's default style
        that are overriden by styles from the Mail blockquote.  This is necessary in order
        for text that's black (because black is the source document's default font color)
        to appear blue/green/whatever when it's pasted into a Mail blockquote.
        (WebCore::ReplaceSelectionCommand::handlePasteAsQuotationNode): Turn an inserted
        Mail Paste as Quotation node into a normal Mail blockquote.  This will prevent
        a copied blockquote that was inserted into the document using Paste as Quotation
        from triggering Paste as Quotation behavior when it's pasted.
        (WebCore::ReplaceSelectionCommand::doApply): Call the new/altered methods.
        * editing/ReplaceSelectionCommand.h:
        * editing/markup.cpp:
        (WebCore::styleFromMatchedRulesForElement): Put this code into a subroutine.
        (WebCore::removeEnclosingMailBlockquoteStyle): Added.
        (WebCore::startMarkup): When wrapping text nodes in style spans, leave out
        styles that Mail blockquotes contribute, so that Mail blockquote styles can
        be differentiated from styles that the user has applied.  When creating markup
        for elements, do the same thing.
        (WebCore::createMarkup): Call the new subroutine.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/merge-end-blockquote-expected.checksum
LayoutTests/editing/pasteboard/merge-end-blockquote-expected.png
LayoutTests/editing/pasteboard/merge-end-blockquote-expected.txt
LayoutTests/editing/pasteboard/merge-end-blockquote.html
LayoutTests/editing/pasteboard/paste-blockquote-1-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-blockquote-1-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-blockquote-1-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-blockquote-1.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-blockquote-2-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-blockquote-2-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-blockquote-2-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-blockquote-2.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-blockquote-3-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-blockquote-3-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-blockquote-3-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-blockquote-3.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/editing/ReplaceSelectionCommand.h
WebCore/editing/markup.cpp