<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[186191] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/186191">186191</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2015-07-01 13:31:25 -0700 (Wed, 01 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/179168">r179168</a>): 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 &quot;normal&quot; 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 <a href="http://trac.webkit.org/projects/webkit/changeset/179168">r179168</a>:
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:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestseditingpasteboardsimplfiyingmarkupshouldnotstripcontentexpectedtxt">trunk/LayoutTests/editing/pasteboard/simplfiying-markup-should-not-strip-content-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreeditingEditingStylecpp">trunk/Source/WebCore/editing/EditingStyle.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestseditingpasteboardcjklineheightexpectedtxt">trunk/LayoutTests/editing/pasteboard/cjk-line-height-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingpasteboardcjklineheighthtml">trunk/LayoutTests/editing/pasteboard/cjk-line-height.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (186190 => 186191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-07-01 20:07:59 UTC (rev 186190)
+++ trunk/LayoutTests/ChangeLog        2015-07-01 20:31:25 UTC (rev 186191)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-06-30  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        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:
+
</ins><span class="cx"> 2015-07-01  Matthew Daiter  &lt;mdaiter@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Enable MEDIA_STREAM flag
</span></span></pre></div>
<a id="trunkLayoutTestseditingpasteboardcjklineheightexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/editing/pasteboard/cjk-line-height-expected.txt (0 => 186191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/pasteboard/cjk-line-height-expected.txt                                (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/cjk-line-height-expected.txt        2015-07-01 20:31:25 UTC (rev 186191)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+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.
+| &lt;span&gt;
+|   style=&quot;font-family: 'Hiragino Kaku Gothic ProN';&quot;
+|   &quot;hello&lt;#selection-caret&gt;&quot;
+| &lt;br&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestseditingpasteboardcjklineheighthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/editing/pasteboard/cjk-line-height.html (0 => 186191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/pasteboard/cjk-line-height.html                                (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/cjk-line-height.html        2015-07-01 20:31:25 UTC (rev 186191)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;div id=editor contenteditable&gt;&lt;font face=&quot;Hiragino Kaku Gothic ProN&quot;&gt;hello&lt;/font&gt;&lt;/div&gt;
+&lt;script src=&quot;../../resources/dump-as-markup.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+
+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); }
+
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestseditingpasteboardsimplfiyingmarkupshouldnotstripcontentexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/pasteboard/simplfiying-markup-should-not-strip-content-expected.txt (186190 => 186191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/pasteboard/simplfiying-markup-should-not-strip-content-expected.txt        2015-07-01 20:07:59 UTC (rev 186190)
+++ trunk/LayoutTests/editing/pasteboard/simplfiying-markup-should-not-strip-content-expected.txt        2015-07-01 20:31:25 UTC (rev 186191)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> |   face=&quot;Verdana&quot;
</span><span class="cx"> |   &quot;hello &quot;
</span><span class="cx"> | &lt;br&gt;
</span><del>-|   style=&quot;font-family: Helvetica; line-height: 18px;&quot;
</del><ins>+|   style=&quot;font-family: Helvetica;&quot;
</ins><span class="cx"> | &lt;font&gt;
</span><span class="cx"> |   face=&quot;Verdana&quot;
</span><span class="cx"> |   &quot;worldWebKit&lt;#selection-caret&gt;&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (186190 => 186191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-07-01 20:07:59 UTC (rev 186190)
+++ trunk/Source/WebCore/ChangeLog        2015-07-01 20:31:25 UTC (rev 186191)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2015-06-30  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        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 &quot;normal&quot; 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.
+
</ins><span class="cx"> 2015-06-30  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r184296): View keeps scrolling upward
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditingStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditingStyle.cpp (186190 => 186191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditingStyle.cpp        2015-07-01 20:07:59 UTC (rev 186190)
+++ trunk/Source/WebCore/editing/EditingStyle.cpp        2015-07-01 20:31:25 UTC (rev 186191)
</span><span class="lines">@@ -63,7 +63,6 @@
</span><span class="cx">     CSSPropertyFontVariant,
</span><span class="cx">     CSSPropertyFontWeight,
</span><span class="cx">     CSSPropertyLetterSpacing,
</span><del>-    CSSPropertyLineHeight,
</del><span class="cx">     CSSPropertyOrphans,
</span><span class="cx">     CSSPropertyTextAlign,
</span><span class="cx">     CSSPropertyTextIndent,
</span></span></pre>
</div>
</div>

</body>
</html>