Changeset 84311 in webkit
- Timestamp:
- Apr 19, 2011 4:37:32 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r84308 r84311 1 2011-04-19 Enrica Casucci <enrica@apple.com> 2 3 Reviewed by Ryosuke Niwa. 4 5 REGRESSION(r55762): Highlight color can't be copied in gmail. 6 https://bugs.webkit.org/show_bug.cgi?id=58925 7 <rdar://problem/9253057> 8 9 The following test checks that when we copy a text node surrounded by an element that 10 has non transparent background color we preserve the background color as well. 11 12 * editing/pasteboard/copy-text-with-backgroundcolor-expected.txt: Added. 13 * editing/pasteboard/copy-text-with-backgroundcolor.html: Added. 14 1 15 2011-04-19 Chris Rogers <crogers@google.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r84309 r84311 1 2011-04-19 Enrica Casucci <enrica@apple.com> 2 3 Reviewed by Ryosuke Niwa. 4 5 REGRESSION(r55762): Highlight color can't be copied in gmail. 6 https://bugs.webkit.org/show_bug.cgi?id=58925 7 <rdar://problem/9253057> 8 9 Test: editing/pasteboard/copy-text-with-backgroundcolor.html 10 11 The changes of r55762 uncovered the underlying issue here. The markup fragment 12 placed in the pasteboard does not contain the background color style. 13 This occurs only if the selection is limited to a single text node, whereas if the 14 selection spans across multiple nodes, the style is preserved correctly. 15 The fix consists in changing the logic that decides whether we should include the wrapping 16 node in the markup. That logic is based on the code in highestAncestorToWrapMarkup which relies 17 on isElementPresentational to choose candidates to be the wrapping node. 18 I've extended it to accept nodes that have non fully transparent background colors. 19 20 * editing/Editor.cpp: 21 (WebCore::Editor::hasTransparentBackgroundColor): Now is a static method of the class. 22 * editing/Editor.h: 23 * editing/markup.cpp: 24 (WebCore::isElementPresentational): Modified to use hasTransparentBackgroundColor. 25 1 26 2011-04-19 Geoffrey Garen <ggaren@apple.com> 2 27 -
trunk/Source/WebCore/editing/Editor.cpp
r83501 r84311 917 917 } 918 918 919 static boolhasTransparentBackgroundColor(CSSStyleDeclaration* style)919 bool Editor::hasTransparentBackgroundColor(CSSStyleDeclaration* style) 920 920 { 921 921 RefPtr<CSSValue> cssValue = style->getPropertyCSSValue(CSSPropertyBackgroundColor); -
trunk/Source/WebCore/editing/Editor.h
r83492 r84311 199 199 Command command(const String& commandName, EditorCommandSource); 200 200 static bool commandIsSupportedFromMenuOrKeyBinding(const String& commandName); // Works without a frame. 201 static bool hasTransparentBackgroundColor(CSSStyleDeclaration*); 201 202 202 203 bool insertText(const String&, Event* triggeringEvent); -
trunk/Source/WebCore/editing/markup.cpp
r84265 r84311 466 466 if (!style) 467 467 return false; 468 return !propertyMissingOrEqualToNone(style.get(), CSSPropertyTextDecoration) ;468 return !propertyMissingOrEqualToNone(style.get(), CSSPropertyTextDecoration) || !Editor::hasTransparentBackgroundColor(style.get()); 469 469 } 470 470
Note: See TracChangeset
for help on using the changeset viewer.