Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Issue 7031026: Revert 84311 - REGRESSION(r55762): Highlight color can't be copied in gmail. (Closed)

Created:
9 years, 7 months ago by kerz_chromium
Modified:
9 years, 7 months ago
Reviewers:
enrica
CC:
chromium-reviews
Base URL:
http://svn.webkit.org/repository/webkit/branches/chromium/742/
Visibility:
Public.

Description

Revert 84311 - REGRESSION(r55762): Highlight color can't be copied in gmail. https://bugs.webkit.org/show_bug.cgi?id=58925 <rdar://problem/9253057> Reviewed by Ryosuke Niwa. Source/WebCore: Test: editing/pasteboard/copy-text-with-backgroundcolor.html The changes of r55762 uncovered the underlying issue here. The markup fragment placed in the pasteboard does not contain the background color style. This occurs only if the selection is limited to a single text node, whereas if the selection spans across multiple nodes, the style is preserved correctly. The fix consists in changing the logic that decides whether we should include the wrapping node in the markup. That logic is based on the code in highestAncestorToWrapMarkup which relies on isElementPresentational to choose candidates to be the wrapping node. I've extended it to accept nodes that have non fully transparent background colors. * editing/Editor.cpp: (WebCore::Editor::hasTransparentBackgroundColor): Now is a static method of the class. * editing/Editor.h: * editing/markup.cpp: (WebCore::isElementPresentational): Modified to use hasTransparentBackgroundColor. LayoutTests: The following test checks that when we copy a text node surrounded by an element that has non transparent background color we preserve the background color as well. * editing/pasteboard/copy-text-with-backgroundcolor-expected.txt: Added. * editing/pasteboard/copy-text-with-backgroundcolor.html: Added. TBR=enrica@apple.com Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=86685

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -8269 lines) Patch
M LayoutTests/ChangeLog View 1 chunk +0 lines, -8 lines 0 comments Download
D LayoutTests/editing/pasteboard/copy-text-with-backgroundcolor.html View 1 chunk +0 lines, -74 lines 0 comments Download
D LayoutTests/editing/pasteboard/copy-text-with-backgroundcolor-expected.txt View 1 chunk +0 lines, -79 lines 0 comments Download
M Source/WebCore/ChangeLog View 1 chunk +0 lines, -8105 lines 0 comments Download
M Source/WebCore/editing/Editor.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/WebCore/editing/Editor.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/WebCore/editing/markup.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 1 (0 generated)
kerz_chromium
9 years, 7 months ago (2011-05-17 17:38:11 UTC) #1

          

Powered by Google App Engine
This is Rietveld 408576698