-
justing authored
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: http://svn.webkit.org/repository/webkit/trunk@17832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
e3143cdd