<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[19951] trunk</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/19951">19951</a></dd>
<dt>Author</dt> <dd>justing</dd>
<dt>Date</dt> <dd>2007-03-02 17:46:44 -0800 (Fri, 02 Mar 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>LayoutTests:

        Reviewed by kevin
        
        &lt;rdar://problem/5028447&gt;
        REGRESSION: Gmail Editor: Copied message text pastes at the wrong font size

        * editing/pasteboard/5028447-expected.checksum: Added.
        * editing/pasteboard/5028447-expected.png: Added.
        * editing/pasteboard/5028447-expected.txt: Added.
        * editing/pasteboard/5028447.html: Added.

WebCore:

        Reviewed by kevin
        
        &lt;rdar://problem/5028447&gt;
        REGRESSION: Gmail Editor: Copied message text pastes at the wrong font size

        * editing/markup.cpp:
        (WebCore::createMarkup): The style of the div that holds
        a fully selected body's styles didn't include styles inherited
        from the body's ancestors.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreeditingmarkupcpp">trunk/WebCore/editing/markup.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestseditingpasteboard5028447expectedchecksum">trunk/LayoutTests/editing/pasteboard/5028447-expected.checksum</a></li>
<li><a href="#trunkLayoutTestseditingpasteboard5028447expectedpng">trunk/LayoutTests/editing/pasteboard/5028447-expected.png</a></li>
<li><a href="#trunkLayoutTestseditingpasteboard5028447expectedtxt">trunk/LayoutTests/editing/pasteboard/5028447-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingpasteboard5028447html">trunk/LayoutTests/editing/pasteboard/5028447.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (19950 => 19951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2007-03-03 00:48:34 UTC (rev 19950)
+++ trunk/LayoutTests/ChangeLog        2007-03-03 01:46:44 UTC (rev 19951)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2007-03-02  Justin Garcia  &lt;justin.garcia@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Reviewed by kevin
+        
+        &lt;rdar://problem/5028447&gt;
+        REGRESSION: Gmail Editor: Copied message text pastes at the wrong font size
+
+        * editing/pasteboard/5028447-expected.checksum: Added.
+        * editing/pasteboard/5028447-expected.png: Added.
+        * editing/pasteboard/5028447-expected.txt: Added.
+        * editing/pasteboard/5028447.html: Added.
+
+2007-03-02  Justin Garcia  &lt;justin.garcia@apple.com&gt;
+
</ins><span class="cx">         Reviewed by harrison
</span><span class="cx">         
</span><span class="cx">         &lt;rdar://problem/4545040&gt;
</span></span></pre></div>
<a id="trunkLayoutTestseditingpasteboard5028447expectedchecksum"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/editing/pasteboard/5028447-expected.checksum (0 => 19951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/pasteboard/5028447-expected.checksum                                (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/5028447-expected.checksum        2007-03-03 01:46:44 UTC (rev 19951)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+ac8893aaeb08db770a76596fa8fa8972
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestseditingpasteboard5028447expectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/editing/pasteboard/5028447-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/editing/pasteboard/5028447-expected.png
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:mime-type
</span><span class="cx">   + application/octet-stream
</span><a id="trunkLayoutTestseditingpasteboard5028447expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/editing/pasteboard/5028447-expected.txt (0 => 19951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/pasteboard/5028447-expected.txt                                (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/5028447-expected.txt        2007-03-03 01:46:44 UTC (rev 19951)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderText {#text} at (0,0) size 418x29
+        text run at (0,0) width 418: &quot;All the text here should be the same size. &quot;
+      RenderText {#text} at (418,0) size 784x58
+        text run at (418,0) width 361: &quot;All the text here should be the same&quot;
+        text run at (779,0) width 5: &quot; &quot;
+        text run at (0,29) width 51: &quot;size. &quot;
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+caret: position 43 of child 1 {#text} of child 1 {BODY} of child 0 {HTML} of document
</ins></span></pre></div>
<a id="trunkLayoutTestseditingpasteboard5028447html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/editing/pasteboard/5028447.html (0 => 19951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/pasteboard/5028447.html                                (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/5028447.html        2007-03-03 01:46:44 UTC (rev 19951)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;html style=&quot;font-size: 50px;&quot;&gt;
+&lt;style&gt;
+body {
+    font-size: 50%;
+}
+&lt;/style&gt;
+&lt;body contenteditable=&quot;true&quot;&gt;
+All the text here should be the same size.&amp;nbsp;
+&lt;script&gt;
+document.execCommand(&quot;SelectAll&quot;);
+document.execCommand(&quot;Copy&quot;);
+window.getSelection().modify(&quot;move&quot;, &quot;forward&quot;, &quot;character&quot;);
+document.execCommand(&quot;Paste&quot;);
+&lt;/script&gt;
+&lt;/body&gt;
</ins></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (19950 => 19951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2007-03-03 00:48:34 UTC (rev 19950)
+++ trunk/WebCore/ChangeLog        2007-03-03 01:46:44 UTC (rev 19951)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2007-03-02  Justin Garcia  &lt;justin.garcia@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Reviewed by kevin
+        
+        &lt;rdar://problem/5028447&gt;
+        REGRESSION: Gmail Editor: Copied message text pastes at the wrong font size
+
+        * editing/markup.cpp:
+        (WebCore::createMarkup): The style of the div that holds
+        a fully selected body's styles didn't include styles inherited
+        from the body's ancestors.
+        
+2007-03-02  Justin Garcia  &lt;justin.garcia@apple.com&gt;
+
</ins><span class="cx">         Reviewed by harrison
</span><span class="cx"> 
</span><span class="cx">         &lt;rdar://problem/4545040&gt;
</span></span></pre></div>
<a id="trunkWebCoreeditingmarkupcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/editing/markup.cpp (19950 => 19951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/editing/markup.cpp        2007-03-03 00:48:34 UTC (rev 19950)
+++ trunk/WebCore/editing/markup.cpp        2007-03-03 01:46:44 UTC (rev 19951)
</span><span class="lines">@@ -534,15 +534,27 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    // FIXME: Do this for all fully selected blocks, not just a body.
</del><span class="cx">     root = range-&gt;startPosition().node();
</span><span class="cx">     while (root &amp;&amp; !root-&gt;hasTagName(bodyTag))
</span><span class="cx">         root = root-&gt;parentNode();
</span><ins>+    // Include markup for fully selected blocks (turn the body into a div so that we
+    // don't end up with multiple bodies after a paste).
+    // FIXME: Do this for all fully selected blocks, not just the body.
</ins><span class="cx">     if (root &amp;&amp; *Selection::selectionFromContentsOfNode(root).toRange() == *range) {
</span><del>-        CSSMutableStyleDeclaration* inlineStyleDecl = static_cast&lt;HTMLElement*&gt;(root)-&gt;inlineStyleDecl();
-        RefPtr&lt;CSSMutableStyleDeclaration&gt; style = inlineStyleDecl ? inlineStyleDecl-&gt;copy() : new CSSMutableStyleDeclaration();
-        style-&gt;merge(styleFromMatchedRulesForElement(static_cast&lt;Element*&gt;(root)).get());
</del><ins>+        // From this fully selected root editable element we want:
+        // The non-inheritble styles from its matched rules (author only).
+        RefPtr&lt;CSSMutableStyleDeclaration&gt; style = styleFromMatchedRulesForElement(static_cast&lt;Element*&gt;(root));
</ins><span class="cx">         
</span><ins>+        // The non-inheritble styles from its inline style declaration.
+        RefPtr&lt;CSSMutableStyleDeclaration&gt; inlineStyleDecl = static_cast&lt;HTMLElement*&gt;(root)-&gt;getInlineStyleDecl();
+        style-&gt;merge(inlineStyleDecl.get());
+
+        // All the inheritble styles from its computed style.
+        RefPtr&lt;CSSComputedStyleDeclaration&gt; computedStyle = new CSSComputedStyleDeclaration(static_cast&lt;Element*&gt;(root));
+        RefPtr&lt;CSSMutableStyleDeclaration&gt; inheritedComputedProperties = computedStyle-&gt;copyInheritableProperties();
+        style-&gt;merge(inheritedComputedProperties.get());
+        
+        // Pull off default styles because those will be added via the top level style span.
</ins><span class="cx">         defaultStyle-&gt;diff(style.get());
</span><span class="cx">         
</span><span class="cx">         // Bring the background attribute over, but not as an attribute because a background attribute on a div
</span></span></pre>
</div>
</div>

</body>
</html>