Title: [117499] branches/chromium/1132
Revision
117499
Author
rn...@webkit.org
Date
2012-05-17 14:41:37 -0700 (Thu, 17 May 2012)

Log Message

Merge 117361 - REGRESSION(r92823): WebKit strips font-weight: normal from b element when copying
https://bugs.webkit.org/show_bug.cgi?id=86663

Reviewed by Tony Chang.

The bug was caused by removeStyleFromRulesAndContext incorrectly stripping font-weight property
even when the context had no font-weight property because of a property name mismatch in getPropertiesNotIn.

Fixed the mismatch.

Test: editing/pasteboard/paste-text-with-style-5.html

* editing/EditingStyle.cpp:
(WebCore::getPropertiesNotIn):
Review URL: https://chromiumcodereview.appspot.com/10391190

Modified Paths

Added Paths

Diff

Copied: branches/chromium/1132/LayoutTests/editing/pasteboard/paste-text-with-style-5-expected.txt (from rev 117361, trunk/LayoutTests/editing/pasteboard/paste-text-with-style-5-expected.txt) (0 => 117499)


--- branches/chromium/1132/LayoutTests/editing/pasteboard/paste-text-with-style-5-expected.txt	                        (rev 0)
+++ branches/chromium/1132/LayoutTests/editing/pasteboard/paste-text-with-style-5-expected.txt	2012-05-17 21:41:37 UTC (rev 117499)
@@ -0,0 +1,13 @@
+This tests copying and pasting text does not strip inline styles that overrides UA style rules.
+To manually test, copy and paste "hello world" below. The pasted text should be bolded.
+
+Before copy-paste:
+| <b>
+|   style="font-weight: normal"
+|   "<#selection-caret>hello world"
+
+After copy-paste:
+| <b>
+|   style="font-weight: normal; "
+|   "hello world<#selection-caret>"
+| <br>

Copied: branches/chromium/1132/LayoutTests/editing/pasteboard/paste-text-with-style-5.html (from rev 117361, trunk/LayoutTests/editing/pasteboard/paste-text-with-style-5.html) (0 => 117499)


--- branches/chromium/1132/LayoutTests/editing/pasteboard/paste-text-with-style-5.html	                        (rev 0)
+++ branches/chromium/1132/LayoutTests/editing/pasteboard/paste-text-with-style-5.html	2012-05-17 21:41:37 UTC (rev 117499)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p id="description">This tests copying and pasting text does not strip inline styles that overrides UA style rules.
+To manually test, copy and paste "hello world" below. The pasted text should be bolded.</p>
+<div id="test" contenteditable><b style="font-weight: normal">hello world</b></div>
+<script src=""
+<script>
+if (window.layoutTestController)
+     layoutTestController.dumpAsText();
+
+Markup.description(document.getElementById('description').textContent);
+
+document.getElementById('test').focus();
+
+Markup.dump('test', 'Before copy-paste');
+document.execCommand('SelectAll', false, null);
+document.execCommand('Copy', false, null);
+document.execCommand('Paste', false, null);
+Markup.dump('test', 'After copy-paste');
+
+</script>
+</body>
+</html>

Modified: branches/chromium/1132/Source/WebCore/editing/EditingStyle.cpp (117498 => 117499)


--- branches/chromium/1132/Source/WebCore/editing/EditingStyle.cpp	2012-05-17 21:34:46 UTC (rev 117498)
+++ branches/chromium/1132/Source/WebCore/editing/EditingStyle.cpp	2012-05-17 21:41:37 UTC (rev 117499)
@@ -1493,7 +1493,7 @@
     diffTextDecorations(result.get(), CSSPropertyTextDecoration, baseTextDecorationsInEffect.get());
     diffTextDecorations(result.get(), CSSPropertyWebkitTextDecorationsInEffect, baseTextDecorationsInEffect.get());
 
-    if (baseStyle->getPropertyCSSValueInternal(CSSPropertyFontSize) && fontWeightIsBold(result.get()) == fontWeightIsBold(baseStyle))
+    if (baseStyle->getPropertyCSSValueInternal(CSSPropertyFontWeight) && fontWeightIsBold(result.get()) == fontWeightIsBold(baseStyle))
         result->removeProperty(CSSPropertyFontWeight);
 
     if (baseStyle->getPropertyCSSValueInternal(CSSPropertyColor) && getRGBAFontColor(result.get()) == getRGBAFontColor(baseStyle))
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to