<!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>[201104] trunk/Source/WebCore</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/201104">201104</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-05-18 15:27:47 -0700 (Wed, 18 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Clean up / Modernize TextAutoSizingValue::adjustNodeSizes()
https://bugs.webkit.org/show_bug.cgi?id=157861

Reviewed by Alex Christensen.

Clean up / Modernize TextAutoSizingValue::adjustNodeSizes(), and
use tighter typing for autosizing nodes.

* dom/Document.cpp:
(WebCore::Document::addAutoSizingNode):
* dom/Document.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustComputedFontSizes):
* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::addNode):
(WebCore::TextAutoSizingValue::adjustNodeSizes):
(WebCore::TextAutoSizingValue::reset):
* rendering/TextAutoSizing.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowcpp">trunk/Source/WebCore/rendering/RenderBlockFlow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingTextAutoSizingcpp">trunk/Source/WebCore/rendering/TextAutoSizing.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingTextAutoSizingh">trunk/Source/WebCore/rendering/TextAutoSizing.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201103 => 201104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-18 22:25:01 UTC (rev 201103)
+++ trunk/Source/WebCore/ChangeLog        2016-05-18 22:27:47 UTC (rev 201104)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2016-05-18  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Clean up / Modernize TextAutoSizingValue::adjustNodeSizes()
+        https://bugs.webkit.org/show_bug.cgi?id=157861
+
+        Reviewed by Alex Christensen.
+
+        Clean up / Modernize TextAutoSizingValue::adjustNodeSizes(), and
+        use tighter typing for autosizing nodes.
+
+        * dom/Document.cpp:
+        (WebCore::Document::addAutoSizingNode):
+        * dom/Document.h:
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::adjustComputedFontSizes):
+        * rendering/TextAutoSizing.cpp:
+        (WebCore::TextAutoSizingValue::addNode):
+        (WebCore::TextAutoSizingValue::adjustNodeSizes):
+        (WebCore::TextAutoSizingValue::reset):
+        * rendering/TextAutoSizing.h:
+
</ins><span class="cx"> 2016-05-18  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove logging inadvertently committed in r201090.
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (201103 => 201104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-05-18 22:25:01 UTC (rev 201103)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-05-18 22:27:47 UTC (rev 201104)
</span><span class="lines">@@ -5279,11 +5279,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx"> 
</span><del>-void Document::addAutoSizingNode(Node* node, float candidateSize)
</del><ins>+void Document::addAutoSizingNode(Text&amp; node, float candidateSize)
</ins><span class="cx"> {
</span><del>-    LOG(TextAutosizing, &quot; addAutoSizingNode %p candidateSize=%f&quot;, node, candidateSize);
</del><ins>+    LOG(TextAutosizing, &quot; addAutoSizingNode %p candidateSize=%f&quot;, &amp;node, candidateSize);
</ins><span class="cx"> 
</span><del>-    TextAutoSizingKey key(&amp;node-&gt;renderer()-&gt;style());
</del><ins>+    TextAutoSizingKey key(&amp;node.renderer()-&gt;style());
</ins><span class="cx">     auto addResult = m_textAutoSizedNodes.ensure(WTFMove(key), [] {
</span><span class="cx">         return TextAutoSizingValue::create();
</span><span class="cx">     });
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (201103 => 201104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-05-18 22:25:01 UTC (rev 201103)
+++ trunk/Source/WebCore/dom/Document.h        2016-05-18 22:27:47 UTC (rev 201104)
</span><span class="lines">@@ -1692,7 +1692,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx"> public:
</span><del>-    void addAutoSizingNode(Node*, float size);
</del><ins>+    void addAutoSizingNode(Text&amp;, float size);
</ins><span class="cx">     void validateAutoSizingNodes();
</span><span class="cx">     void resetAutoSizingNodes();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (201103 => 201104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2016-05-18 22:25:01 UTC (rev 201103)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2016-05-18 22:27:47 UTC (rev 201104)
</span><span class="lines">@@ -3810,7 +3810,7 @@
</span><span class="cx">                 float lineTextMultiplier = lineCount == ONE_LINE ? oneLineTextMultiplier(specifiedSize) : textMultiplier(specifiedSize);
</span><span class="cx">                 candidateNewSize = roundf(std::min(minFontSize, specifiedSize * lineTextMultiplier));
</span><span class="cx">                 if (candidateNewSize &gt; specifiedSize &amp;&amp; candidateNewSize != fontDescription.computedSize() &amp;&amp; text.textNode() &amp;&amp; oldStyle.textSizeAdjust().isAuto())
</span><del>-                    document().addAutoSizingNode(text.textNode(), candidateNewSize);
</del><ins>+                    document().addAutoSizingNode(*text.textNode(), candidateNewSize);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextAutoSizingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextAutoSizing.cpp (201103 => 201104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextAutoSizing.cpp        2016-05-18 22:25:01 UTC (rev 201103)
+++ trunk/Source/WebCore/rendering/TextAutoSizing.cpp        2016-05-18 22:27:47 UTC (rev 201104)
</span><span class="lines">@@ -62,29 +62,27 @@
</span><span class="cx">     return m_autoSizedNodes.size();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextAutoSizingValue::addNode(Node* node, float size)
</del><ins>+void TextAutoSizingValue::addNode(Text&amp; node, float size)
</ins><span class="cx"> {
</span><del>-    ASSERT(node);
-    downcast&lt;RenderText&gt;(*node-&gt;renderer()).setCandidateComputedTextSize(size);
-    m_autoSizedNodes.add(node);
</del><ins>+    node.renderer()-&gt;setCandidateComputedTextSize(size);
+    m_autoSizedNodes.add(&amp;node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #define MAX_SCALE_INCREASE 1.7f
</span><span class="cx"> 
</span><span class="cx"> bool TextAutoSizingValue::adjustNodeSizes()
</span><span class="cx"> {
</span><del>-    bool objectsRemoved = false;
</del><ins>+    bool didRemoveObjects = false;
</ins><span class="cx"> 
</span><span class="cx">     // Remove stale nodes.  Nodes may have had their renderers detached.  We'll
</span><span class="cx">     // also need to remove the style from the documents m_textAutoSizedNodes
</span><span class="cx">     // collection.  Return true indicates we need to do that removal.
</span><del>-    Vector&lt;RefPtr&lt;Node&gt; &gt; nodesForRemoval;
-    for (auto&amp; autoSizingNode : m_autoSizedNodes) {
-        auto* text = downcast&lt;RenderText&gt;(autoSizingNode-&gt;renderer());
</del><ins>+    Vector&lt;Text*&gt; nodesForRemoval;
+    for (auto&amp; node : m_autoSizedNodes) {
+        auto* text = node-&gt;renderer();
</ins><span class="cx">         if (!text || !text-&gt;style().textSizeAdjust().isAuto() || !text-&gt;candidateComputedTextSize()) {
</span><del>-            // remove node.
-            nodesForRemoval.append(autoSizingNode);
-            objectsRemoved = true;
</del><ins>+            nodesForRemoval.append(node.get());
+            didRemoveObjects = true;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -94,83 +92,89 @@
</span><span class="cx">     // If we only have one piece of text with the style on the page don't
</span><span class="cx">     // adjust it's size.
</span><span class="cx">     if (m_autoSizedNodes.size() &lt;= 1)
</span><del>-        return objectsRemoved;
</del><ins>+        return didRemoveObjects;
</ins><span class="cx"> 
</span><span class="cx">     // Compute average size
</span><span class="cx">     float cumulativeSize = 0;
</span><del>-    for (auto&amp; autoSizingNode : m_autoSizedNodes) {
-        RenderText&amp; renderText = downcast&lt;RenderText&gt;(*autoSizingNode-&gt;renderer());
-        cumulativeSize += renderText.candidateComputedTextSize();
-    }
</del><ins>+    for (auto&amp; node : m_autoSizedNodes)
+        cumulativeSize += node-&gt;renderer()-&gt;candidateComputedTextSize();
</ins><span class="cx"> 
</span><span class="cx">     float averageSize = roundf(cumulativeSize / m_autoSizedNodes.size());
</span><span class="cx"> 
</span><span class="cx">     // Adjust sizes
</span><span class="cx">     bool firstPass = true;
</span><del>-    for (auto&amp; autoSizingNode : m_autoSizedNodes) {
-        auto* text = downcast&lt;RenderText&gt;(autoSizingNode-&gt;renderer());
-        if (text &amp;&amp; text-&gt;style().fontDescription().computedSize() != averageSize) {
-            float specifiedSize = text-&gt;style().fontDescription().specifiedSize();
-            float scaleChange = averageSize / specifiedSize;
-            if (scaleChange &gt; MAX_SCALE_INCREASE &amp;&amp; firstPass) {
-                firstPass = false;
-                averageSize = roundf(specifiedSize * MAX_SCALE_INCREASE);
-                scaleChange = averageSize / specifiedSize;
-            }
</del><ins>+    for (auto&amp; node : m_autoSizedNodes) {
+        auto* text = node-&gt;renderer();
+        if (!text || text-&gt;style().fontDescription().computedSize() == averageSize)
+            continue;
</ins><span class="cx"> 
</span><del>-            LOG(TextAutosizing, &quot;  adjust node size %p firstPass=%d averageSize=%f scaleChange=%f&quot;, autoSizingNode.get(), firstPass, averageSize, scaleChange);
</del><ins>+        float specifiedSize = text-&gt;style().fontDescription().specifiedSize();
+        float scaleChange = averageSize / specifiedSize;
+        if (scaleChange &gt; MAX_SCALE_INCREASE &amp;&amp; firstPass) {
+            firstPass = false;
+            averageSize = roundf(specifiedSize * MAX_SCALE_INCREASE);
+            scaleChange = averageSize / specifiedSize;
+        }
</ins><span class="cx"> 
</span><del>-            auto style = cloneRenderStyleWithState(text-&gt;style());
-            auto fontDescription = style.fontDescription();
-            fontDescription.setComputedSize(averageSize);
</del><ins>+        LOG(TextAutosizing, &quot;  adjust node size %p firstPass=%d averageSize=%f scaleChange=%f&quot;, node.get(), firstPass, averageSize, scaleChange);
+
+        auto* parentRenderer = text-&gt;parent();
+
+        auto style = cloneRenderStyleWithState(text-&gt;style());
+        auto fontDescription = style.fontDescription();
+        fontDescription.setComputedSize(averageSize);
+        style.setFontDescription(fontDescription);
+        style.fontCascade().update(&amp;node-&gt;document().fontSelector());
+        parentRenderer-&gt;setStyle(WTFMove(style));
+
+        if (parentRenderer-&gt;isAnonymousBlock())
+            parentRenderer = parentRenderer-&gt;parent();
+
+        // If we have a list we should resize ListMarkers separately.
+        if (is&lt;RenderListMarker&gt;(*parentRenderer-&gt;firstChild())) {
+            auto&amp; listMarkerRenderer = downcast&lt;RenderListMarker&gt;(*parentRenderer-&gt;firstChild());
+            auto style = cloneRenderStyleWithState(listMarkerRenderer.style());
</ins><span class="cx">             style.setFontDescription(fontDescription);
</span><del>-            style.fontCascade().update(&amp;autoSizingNode-&gt;document().fontSelector());
-            text-&gt;parent()-&gt;setStyle(WTFMove(style));
</del><ins>+            style.fontCascade().update(&amp;node-&gt;document().fontSelector());
+            listMarkerRenderer.setStyle(WTFMove(style));
+        }
</ins><span class="cx"> 
</span><del>-            RenderElement* parentRenderer = text-&gt;parent();
-            if (parentRenderer-&gt;isAnonymousBlock())
-                parentRenderer = parentRenderer-&gt;parent();
</del><ins>+        // Resize the line height of the parent.
+        auto&amp; parentStyle = parentRenderer-&gt;style();
+        Length lineHeightLength = parentStyle.specifiedLineHeight();
</ins><span class="cx"> 
</span><del>-            // If we have a list we should resize ListMarkers separately.
-            RenderObject* listMarkerRenderer = parentRenderer-&gt;firstChild();
-            if (listMarkerRenderer-&gt;isListMarker()) {
-                auto style = cloneRenderStyleWithState(listMarkerRenderer-&gt;style());
-                style.setFontDescription(fontDescription);
-                style.fontCascade().update(&amp;autoSizingNode-&gt;document().fontSelector());
-                downcast&lt;RenderListMarker&gt;(*listMarkerRenderer).setStyle(WTFMove(style));
-            }
</del><ins>+        int specifiedLineHeight;
+        if (lineHeightLength.isPercent())
+            specifiedLineHeight = minimumValueForLength(lineHeightLength, fontDescription.specifiedSize());
+        else
+            specifiedLineHeight = lineHeightLength.value();
</ins><span class="cx"> 
</span><del>-            // Resize the line height of the parent.
-            auto&amp; parentStyle = parentRenderer-&gt;style();
-            Length lineHeightLength = parentStyle.specifiedLineHeight();
</del><ins>+        int lineHeight = specifiedLineHeight * scaleChange;
+        if (lineHeightLength.isFixed() &amp;&amp; lineHeightLength.value() == lineHeight)
+            continue;
</ins><span class="cx"> 
</span><del>-            int specifiedLineHeight = 0;
-            if (lineHeightLength.isPercent())
-                specifiedLineHeight = minimumValueForLength(lineHeightLength, fontDescription.specifiedSize());
-            else
-                specifiedLineHeight = lineHeightLength.value();
-
-            int lineHeight = specifiedLineHeight * scaleChange;
-            if (!lineHeightLength.isFixed() || lineHeightLength.value() != lineHeight) {
-                auto newParentStyle = cloneRenderStyleWithState(parentStyle);
-                newParentStyle.setLineHeight(Length(lineHeight, Fixed));
-                newParentStyle.setSpecifiedLineHeight(lineHeightLength);
-                newParentStyle.setFontDescription(fontDescription);
-                newParentStyle.fontCascade().update(&amp;autoSizingNode-&gt;document().fontSelector());
-                parentRenderer-&gt;setStyle(WTFMove(newParentStyle));
-            }
-        }
</del><ins>+        auto newParentStyle = cloneRenderStyleWithState(parentStyle);
+        newParentStyle.setLineHeight(Length(lineHeight, Fixed));
+        newParentStyle.setSpecifiedLineHeight(lineHeightLength);
+        newParentStyle.setFontDescription(fontDescription);
+        newParentStyle.fontCascade().update(&amp;node-&gt;document().fontSelector());
+        parentRenderer-&gt;setStyle(WTFMove(newParentStyle));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return objectsRemoved;
</del><ins>+    return didRemoveObjects;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TextAutoSizingValue::reset()
</span><span class="cx"> {
</span><del>-    for (auto&amp; autoSizingNode : m_autoSizedNodes) {
-        auto* text = downcast&lt;RenderText&gt;(autoSizingNode-&gt;renderer());
</del><ins>+    for (auto&amp; node : m_autoSizedNodes) {
+        auto* text = node-&gt;renderer();
</ins><span class="cx">         if (!text)
</span><span class="cx">             continue;
</span><ins>+
+        auto* parentRenderer = text-&gt;parent();
+        if (!parentRenderer)
+            continue;
+
</ins><span class="cx">         // Reset the font size back to the original specified size
</span><span class="cx">         auto fontDescription = text-&gt;style().fontDescription();
</span><span class="cx">         float originalSize = fontDescription.specifiedSize();
</span><span class="lines">@@ -178,26 +182,24 @@
</span><span class="cx">             fontDescription.setComputedSize(originalSize);
</span><span class="cx">             auto style = cloneRenderStyleWithState(text-&gt;style());
</span><span class="cx">             style.setFontDescription(fontDescription);
</span><del>-            style.fontCascade().update(&amp;autoSizingNode-&gt;document().fontSelector());
-            text-&gt;parent()-&gt;setStyle(WTFMove(style));
</del><ins>+            style.fontCascade().update(&amp;node-&gt;document().fontSelector());
+            parentRenderer-&gt;setStyle(WTFMove(style));
</ins><span class="cx">         }
</span><ins>+
</ins><span class="cx">         // Reset the line height of the parent.
</span><del>-        RenderElement* parentRenderer = text-&gt;parent();
-        if (!parentRenderer)
-            continue;
-
</del><span class="cx">         if (parentRenderer-&gt;isAnonymousBlock())
</span><span class="cx">             parentRenderer = parentRenderer-&gt;parent();
</span><span class="cx"> 
</span><span class="cx">         auto&amp; parentStyle = parentRenderer-&gt;style();
</span><span class="cx">         Length originalLineHeight = parentStyle.specifiedLineHeight();
</span><del>-        if (originalLineHeight != parentStyle.lineHeight()) {
-            auto newParentStyle = cloneRenderStyleWithState(parentStyle);
-            newParentStyle.setLineHeight(originalLineHeight);
-            newParentStyle.setFontDescription(fontDescription);
-            newParentStyle.fontCascade().update(&amp;autoSizingNode-&gt;document().fontSelector());
-            parentRenderer-&gt;setStyle(WTFMove(newParentStyle));
-        }
</del><ins>+        if (originalLineHeight == parentStyle.lineHeight())
+            continue;
+
+        auto newParentStyle = cloneRenderStyleWithState(parentStyle);
+        newParentStyle.setLineHeight(originalLineHeight);
+        newParentStyle.setFontDescription(fontDescription);
+        newParentStyle.fontCascade().update(&amp;node-&gt;document().fontSelector());
+        parentRenderer-&gt;setStyle(WTFMove(newParentStyle));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextAutoSizingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextAutoSizing.h (201103 => 201104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextAutoSizing.h        2016-05-18 22:25:01 UTC (rev 201103)
+++ trunk/Source/WebCore/rendering/TextAutoSizing.h        2016-05-18 22:27:47 UTC (rev 201104)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Document;
</span><del>-class Node;
</del><ins>+class Text;
</ins><span class="cx"> 
</span><span class="cx"> class TextAutoSizingKey {
</span><span class="cx"> public:
</span><span class="lines">@@ -78,13 +78,13 @@
</span><span class="cx">         return adoptRef(*new TextAutoSizingValue);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void addNode(Node*, float size);
</del><ins>+    void addNode(Text&amp;, float size);
</ins><span class="cx">     bool adjustNodeSizes();
</span><span class="cx">     int numNodes() const;
</span><span class="cx">     void reset();
</span><span class="cx"> private:
</span><span class="cx">     TextAutoSizingValue() { }
</span><del>-    HashSet&lt;RefPtr&lt;Node&gt; &gt; m_autoSizedNodes;
</del><ins>+    HashSet&lt;RefPtr&lt;Text&gt;&gt; m_autoSizedNodes;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>

</body>
</html>