Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
2011-05-20 Ryosuke Niwa <rniwa@webkit.org>
Reviewed by Enrica Casucci. Wrap copied contents by one style span instead of two https://bugs.webkit.org/show_bug.cgi?id=60988 Rebaselined tests due to the change in how WebKit preserves style in copy and paste. * editing/pasteboard/4930986-2-expected.txt: Whitespace change. * editing/pasteboard/5065605-expected.txt: No longer adds redundant inline style declaration. * editing/pasteboard/paste-4039777-fix-expected.txt: Progression; Now we hit the list merging logic in ReplaceSelectionCommand: isStyleSpan(refNode.get()) && isListElement(refNode->firstChild()). * editing/pasteboard/paste-list-001-expected.txt: Ditto. * editing/pasteboard/paste-text-011-expected.txt: An extra style span was added. * editing/pasteboard/paste-text-012-expected.txt: Ditto. * editing/pasteboard/smart-paste-003-trailing-whitespace-expected.txt: No longer adds redundant style span. * platform/chromium-win/editing/pasteboard/paste-text-003-expected.txt: No longer adds empty anonymous nodes. * platform/chromium-win/editing/pasteboard/paste-text-011-expected.txt: Ditto. * platform/gtk/editing/pasteboard/paste-text-003-expected.txt: Ditto. * platform/mac/editing/pasteboard/paste-text-003-expected.txt: Ditto. * platform/qt/editing/pasteboard/paste-text-003-expected.txt: Ditto. 2011-05-20 Ryosuke Niwa <rniwa@webkit.org> Reviewed by Enrica Casucci. Wrap copied contents by one style span instead of two https://bugs.webkit.org/show_bug.cgi?id=60988 Replaced sourceDocumentStyleSpan and copiedRangeStyleSpan by one wrapping style span. Instead of wrapping the copied contents by user-applied style and document default style in serialization, take the difference with the document default's style in paste code. This will dramatically simplify our copy and paste code and pave a way to fix the bug 60914. No new tests because copy & paste is tested by existing layout tests. * editing/EditingStyle.cpp: (WebCore::EditingStyle::prepareToApplyAt): Remove the color property if RGBA values of color matches that of the computed style at the specified position. * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::handleStyleSpans): Replaced sourceDocumentStyleSpan and copiedRangeStyleSpan by wrappingStyleSpan. When pasting as a quotation, compare style against the document's default style to avoid keeping the document default style (tested by editing/pasteboard/4930986-3.html). * editing/ReplaceSelectionCommand.h: * editing/markup.cpp: (WebCore::createMarkup): Only use one style span to wrap the serialized contents. Canonical link: https://commits.webkit.org/76586@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@86983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
18 changed files
with
125 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,2 +1,2 @@ | ||
This tests to make sure that content that is colored by the user is pasted with that color during a Paste as Quotation. | ||
<blockquote><span class="Apple-style-span" style="color: red; ">This text should be red (it should be wrapped in a style span).</span></blockquote> | ||
<blockquote><span class="Apple-style-span" style="color: red;">This text should be red (it should be wrapped in a style span).</span></blockquote> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.