Title: [186438] releases/WebKitGTK/webkit-2.8
- Revision
- 186438
- Author
- [email protected]
- Date
- 2015-07-07 04:00:07 -0700 (Tue, 07 Jul 2015)
Log Message
Merge r186191 - REGRESSION (r179168): Characters overlap after resizing the font on the copy-pasted Japanese text
https://bugs.webkit.org/show_bug.cgi?id=146492
Reviewed by Darin Adler.
Source/WebCore:
The bug was caused by WebKit serializing the used line-height size (e.g. 18px) in the copied content
instead of string "normal" and removeStyleFromRulesAndContext failing to strip it down when text with
a font that influences the line height got pasted. This is because the used value of line-height
property of the context and the pasted content doesn't match when the context doesn't use the same font.
Fixed the bug by not considering line-height as a list of editing properties we try to preserve. This is
fine because we don't provide editing operations to directly manipulate line-height.
Test: editing/pasteboard/cjk-line-height.html
* editing/EditingStyle.cpp:
(WebCore::editingProperties): Removed CSSPropertyLineHeight.
LayoutTests:
Added a regression test. Also reverted the bad rebaseline in r179168:
http://trac.webkit.org/changeset/179168/trunk/LayoutTests/editing/pasteboard/simplfiying-markup-should-not-strip-content-expected.txt
* editing/pasteboard/cjk-line-height-expected.txt: Added.
* editing/pasteboard/cjk-line-height.html: Added.
* editing/pasteboard/simplfiying-markup-should-not-strip-content-expected.txt:
Modified Paths
Added Paths
Diff
Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog (186437 => 186438)
--- releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog 2015-07-07 10:58:38 UTC (rev 186437)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog 2015-07-07 11:00:07 UTC (rev 186438)
@@ -1,3 +1,17 @@
+2015-06-30 Ryosuke Niwa <[email protected]>
+
+ REGRESSION (r179168): Characters overlap after resizing the font on the copy-pasted Japanese text
+ https://bugs.webkit.org/show_bug.cgi?id=146492
+
+ Reviewed by Darin Adler.
+
+ Added a regression test. Also reverted the bad rebaseline in r179168:
+ http://trac.webkit.org/changeset/179168/trunk/LayoutTests/editing/pasteboard/simplfiying-markup-should-not-strip-content-expected.txt
+
+ * editing/pasteboard/cjk-line-height-expected.txt: Added.
+ * editing/pasteboard/cjk-line-height.html: Added.
+ * editing/pasteboard/simplfiying-markup-should-not-strip-content-expected.txt:
+
2015-07-01 Antti Koivisto <[email protected]>
PNG mask images are loaded with Accept:image/svg+xml
Added: releases/WebKitGTK/webkit-2.8/LayoutTests/editing/pasteboard/cjk-line-height-expected.txt (0 => 186438)
--- releases/WebKitGTK/webkit-2.8/LayoutTests/editing/pasteboard/cjk-line-height-expected.txt (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/editing/pasteboard/cjk-line-height-expected.txt 2015-07-07 11:00:07 UTC (rev 186438)
@@ -0,0 +1,6 @@
+This tests copying and pasting text with a font that influences the used line-height value.
+To manually test, copy and paste the selected content below. WebKit should not generate line-height property in the pasted content.
+| <span>
+| style="font-family: 'Hiragino Kaku Gothic ProN';"
+| "hello<#selection-caret>"
+| <br>
Added: releases/WebKitGTK/webkit-2.8/LayoutTests/editing/pasteboard/cjk-line-height.html (0 => 186438)
--- releases/WebKitGTK/webkit-2.8/LayoutTests/editing/pasteboard/cjk-line-height.html (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/editing/pasteboard/cjk-line-height.html 2015-07-07 11:00:07 UTC (rev 186438)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div id=editor contenteditable><font face="Hiragino Kaku Gothic ProN">hello</font></div>
+<script src=""
+<script>
+
+Markup.description('This tests copying and pasting text with a font that influences the used line-height value.\n'
+ + 'To manually test, copy and paste the selected content below. WebKit should not generate line-height property in the pasted content.')
+
+var editor = document.getElementById('editor');
+editor.focus();
+document.execCommand('selectAll', false, null);
+
+Markup.noAutoDump();
+function dumpEditor() {
+ Markup.dump(editor);
+ Markup.notifyDone();
+}
+
+if (document.queryCommandEnabled('paste')) {
+ document.execCommand('copy', false, null);
+ document.execCommand('paste', false, null);
+ dumpEditor();
+} else
+ document._onpaste_ = function () { setTimeout(dumpEditor, 0); }
+
+</script>
+</body>
+</html>
Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/editing/pasteboard/simplfiying-markup-should-not-strip-content-expected.txt (186437 => 186438)
--- releases/WebKitGTK/webkit-2.8/LayoutTests/editing/pasteboard/simplfiying-markup-should-not-strip-content-expected.txt 2015-07-07 10:58:38 UTC (rev 186437)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/editing/pasteboard/simplfiying-markup-should-not-strip-content-expected.txt 2015-07-07 11:00:07 UTC (rev 186438)
@@ -33,7 +33,7 @@
| face="Verdana"
| "hello "
| <br>
-| style="font-family: Helvetica; line-height: 18px;"
+| style="font-family: Helvetica;"
| <font>
| face="Verdana"
| "worldWebKit<#selection-caret>"
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog (186437 => 186438)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog 2015-07-07 10:58:38 UTC (rev 186437)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog 2015-07-07 11:00:07 UTC (rev 186438)
@@ -1,3 +1,23 @@
+2015-06-30 Ryosuke Niwa <[email protected]>
+
+ REGRESSION (r179168): Characters overlap after resizing the font on the copy-pasted Japanese text
+ https://bugs.webkit.org/show_bug.cgi?id=146492
+
+ Reviewed by Darin Adler.
+
+ The bug was caused by WebKit serializing the used line-height size (e.g. 18px) in the copied content
+ instead of string "normal" and removeStyleFromRulesAndContext failing to strip it down when text with
+ a font that influences the line height got pasted. This is because the used value of line-height
+ property of the context and the pasted content doesn't match when the context doesn't use the same font.
+
+ Fixed the bug by not considering line-height as a list of editing properties we try to preserve. This is
+ fine because we don't provide editing operations to directly manipulate line-height.
+
+ Test: editing/pasteboard/cjk-line-height.html
+
+ * editing/EditingStyle.cpp:
+ (WebCore::editingProperties): Removed CSSPropertyLineHeight.
+
2015-07-01 Antti Koivisto <[email protected]>
PNG mask images are loaded with Accept:image/svg+xml
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/editing/EditingStyle.cpp (186437 => 186438)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/editing/EditingStyle.cpp 2015-07-07 10:58:38 UTC (rev 186437)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/editing/EditingStyle.cpp 2015-07-07 11:00:07 UTC (rev 186438)
@@ -63,7 +63,6 @@
CSSPropertyFontVariant,
CSSPropertyFontWeight,
CSSPropertyLetterSpacing,
- CSSPropertyLineHeight,
CSSPropertyOrphans,
CSSPropertyTextAlign,
CSSPropertyTextIndent,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes