<!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>[204956] 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/204956">204956</a></dd>
<dt>Author</dt> <dd>fred.wang@free.fr</dd>
<dt>Date</dt> <dd>2016-08-24 23:31:58 -0700 (Wed, 24 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Do not store layout parameters on the RenderMathMLRoot class
https://bugs.webkit.org/show_bug.cgi?id=161132

Patch by Frederic Wang &lt;fwang@igalia.com&gt; on 2016-08-24
Reviewed by Darin Adler.

Storing layout parameters on the RenderMathMLRoot class is not really needed since reading
the parameters from the MATH table is not too expensive and updateStyle() is currently always
called in layoutBlock() and computePreferredLogicalWidths(). Most of these parameters are
actually only used in layoutBlock(). We separate horizontal and vertical parameters since
the latter are not needed for preferred width calculations. This removes the need for calling
an updateStyle functions and may also fix update issues when zooming in or out.

No new tests, already covered by existing tests.

* rendering/mathml/MathMLStyle.cpp:
(WebCore::MathMLStyle::updateStyleIfNeeded): No need to update layout parameters for the
RenderMathMLRoot class.
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::styleDidChange): No need to update layout parameters.
(WebCore::RenderMathMLRoot::horizontalParameters): Move code from updateStyle to retrieve the
horizontal parameters.
(WebCore::RenderMathMLRoot::verticalParameters): Ditto for vertical parameters.
(WebCore::RenderMathMLRoot::computePreferredLogicalWidths): Call horizontalParameters() to
get the kernings of the index instead of calling updateStyle().
(WebCore::RenderMathMLRoot::layoutBlock): Call horizontalParameters() and
verticalParameters() to get the layout parameters instead of calling updateStyle().
(WebCore::RenderMathMLRoot::paint): Call horizontalParameters() and verticalParameters()
to get the layout parameters.
(WebCore::RenderMathMLRoot::updateFromElement): Deleted. No need to call updateStyle().
(WebCore::RenderMathMLRoot::updateStyle): Deleted.
* rendering/mathml/RenderMathMLRoot.h: Do not override updateFromElement(). Replace some
layout parameters stored on the class with struct and helper functions to manipulate them.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlMathMLStylecpp">trunk/Source/WebCore/rendering/mathml/MathMLStyle.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLRootcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLRooth">trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204955 => 204956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-25 06:25:04 UTC (rev 204955)
+++ trunk/Source/WebCore/ChangeLog        2016-08-25 06:31:58 UTC (rev 204956)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2016-08-24  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Do not store layout parameters on the RenderMathMLRoot class
+        https://bugs.webkit.org/show_bug.cgi?id=161132
+
+        Reviewed by Darin Adler.
+
+        Storing layout parameters on the RenderMathMLRoot class is not really needed since reading
+        the parameters from the MATH table is not too expensive and updateStyle() is currently always
+        called in layoutBlock() and computePreferredLogicalWidths(). Most of these parameters are
+        actually only used in layoutBlock(). We separate horizontal and vertical parameters since
+        the latter are not needed for preferred width calculations. This removes the need for calling
+        an updateStyle functions and may also fix update issues when zooming in or out.
+
+        No new tests, already covered by existing tests.
+
+        * rendering/mathml/MathMLStyle.cpp:
+        (WebCore::MathMLStyle::updateStyleIfNeeded): No need to update layout parameters for the
+        RenderMathMLRoot class.
+        * rendering/mathml/RenderMathMLRoot.cpp:
+        (WebCore::RenderMathMLRoot::styleDidChange): No need to update layout parameters.
+        (WebCore::RenderMathMLRoot::horizontalParameters): Move code from updateStyle to retrieve the
+        horizontal parameters.
+        (WebCore::RenderMathMLRoot::verticalParameters): Ditto for vertical parameters.
+        (WebCore::RenderMathMLRoot::computePreferredLogicalWidths): Call horizontalParameters() to
+        get the kernings of the index instead of calling updateStyle().
+        (WebCore::RenderMathMLRoot::layoutBlock): Call horizontalParameters() and
+        verticalParameters() to get the layout parameters instead of calling updateStyle().
+        (WebCore::RenderMathMLRoot::paint): Call horizontalParameters() and verticalParameters()
+        to get the layout parameters.
+        (WebCore::RenderMathMLRoot::updateFromElement): Deleted. No need to call updateStyle().
+        (WebCore::RenderMathMLRoot::updateStyle): Deleted.
+        * rendering/mathml/RenderMathMLRoot.h: Do not override updateFromElement(). Replace some
+        layout parameters stored on the class with struct and helper functions to manipulate them.
+
</ins><span class="cx"> 2016-08-24  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WorkerLocation.prototype.toString() should be enumerable
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlMathMLStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/MathMLStyle.cpp (204955 => 204956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/MathMLStyle.cpp        2016-08-25 06:25:04 UTC (rev 204955)
+++ trunk/Source/WebCore/rendering/mathml/MathMLStyle.cpp        2016-08-25 06:31:58 UTC (rev 204956)
</span><span class="lines">@@ -87,8 +87,6 @@
</span><span class="cx">         renderer-&gt;setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx">         if (is&lt;RenderMathMLToken&gt;(renderer))
</span><span class="cx">             downcast&lt;RenderMathMLToken&gt;(renderer)-&gt;updateTokenContent();
</span><del>-        else if (is&lt;RenderMathMLRoot&gt;(renderer))
-            downcast&lt;RenderMathMLRoot&gt;(renderer)-&gt;updateStyle();
</del><span class="cx">         else if (is&lt;RenderMathMLFraction&gt;(renderer))
</span><span class="cx">             downcast&lt;RenderMathMLFraction&gt;(renderer)-&gt;updateFromElement();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLRootcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp (204955 => 204956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp        2016-08-25 06:25:04 UTC (rev 204955)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp        2016-08-25 06:31:58 UTC (rev 204956)
</span><span class="lines">@@ -89,50 +89,59 @@
</span><span class="cx"> {
</span><span class="cx">     RenderMathMLRow::styleDidChange(diff, oldStyle);
</span><span class="cx">     m_radicalOperator.reset(style());
</span><del>-    updateStyle();
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLRoot::updateFromElement()
</del><ins>+RenderMathMLRoot::HorizontalParameters RenderMathMLRoot::horizontalParameters()
</ins><span class="cx"> {
</span><del>-    RenderMathMLRow::updateFromElement();
-    updateStyle();
</del><ins>+    HorizontalParameters parameters;
+
+    // Square roots do not require horizontal parameters.
+    if (m_kind == SquareRoot)
+        return parameters;
+
+    // We try and read constants to draw the radical from the OpenType MATH and use fallback values otherwise.
+    const auto&amp; primaryFont = style().fontCascade().primaryFont();
+    if (auto* mathData = style().fontCascade().primaryFont().mathData()) {
+        parameters.kernBeforeDegree = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::RadicalKernBeforeDegree);
+        parameters.kernAfterDegree = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::RadicalKernAfterDegree);
+    } else {
+        // RadicalKernBeforeDegree: No suggested value provided. OT Math Illuminated mentions 5/18 em, Gecko uses 0.
+        // RadicalKernAfterDegree: Suggested value is -10/18 of em.
+        parameters.kernBeforeDegree = 5 * style().fontCascade().size() / 18;
+        parameters.kernAfterDegree = -10 * style().fontCascade().size() / 18;
+    }
+    return parameters;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLRoot::updateStyle()
</del><ins>+RenderMathMLRoot::VerticalParameters RenderMathMLRoot::verticalParameters()
</ins><span class="cx"> {
</span><ins>+    VerticalParameters parameters;
</ins><span class="cx">     // We try and read constants to draw the radical from the OpenType MATH and use fallback values otherwise.
</span><span class="cx">     const auto&amp; primaryFont = style().fontCascade().primaryFont();
</span><span class="cx">     if (auto* mathData = style().fontCascade().primaryFont().mathData()) {
</span><del>-        m_ruleThickness = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::RadicalRuleThickness);
-        m_verticalGap = mathData-&gt;getMathConstant(primaryFont, mathMLStyle()-&gt;displayStyle() ? OpenTypeMathData::RadicalDisplayStyleVerticalGap : OpenTypeMathData::RadicalVerticalGap);
-        m_extraAscender = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::RadicalExtraAscender);
-
-        if (m_kind == RootWithIndex) {
-            m_kernBeforeDegree = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::RadicalKernBeforeDegree);
-            m_kernAfterDegree = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::RadicalKernAfterDegree);
-            m_degreeBottomRaisePercent = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::RadicalDegreeBottomRaisePercent);
-        }
</del><ins>+        parameters.ruleThickness = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::RadicalRuleThickness);
+        parameters.verticalGap = mathData-&gt;getMathConstant(primaryFont, mathMLStyle()-&gt;displayStyle() ? OpenTypeMathData::RadicalDisplayStyleVerticalGap : OpenTypeMathData::RadicalVerticalGap);
+        parameters.extraAscender = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::RadicalExtraAscender);
+        if (m_kind == RootWithIndex)
+            parameters.degreeBottomRaisePercent = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::RadicalDegreeBottomRaisePercent);
</ins><span class="cx">     } else {
</span><span class="cx">         // RadicalVerticalGap: Suggested value is 5/4 default rule thickness.
</span><span class="cx">         // RadicalDisplayStyleVerticalGap: Suggested value is default rule thickness + 1/4 x-height.
</span><span class="cx">         // RadicalRuleThickness: Suggested value is default rule thickness.
</span><span class="cx">         // RadicalExtraAscender: Suggested value is RadicalRuleThickness.
</span><del>-        // RadicalKernBeforeDegree: No suggested value provided. OT Math Illuminated mentions 5/18 em, Gecko uses 0.
-        // RadicalKernAfterDegree: Suggested value is -10/18 of em.
</del><span class="cx">         // RadicalDegreeBottomRaisePercent: Suggested value is 60%.
</span><del>-        m_ruleThickness = ruleThicknessFallback();
</del><ins>+        parameters.ruleThickness = ruleThicknessFallback();
</ins><span class="cx">         if (mathMLStyle()-&gt;displayStyle())
</span><del>-            m_verticalGap = m_ruleThickness + style().fontMetrics().xHeight() / 4;
</del><ins>+            parameters.verticalGap = parameters.ruleThickness + style().fontMetrics().xHeight() / 4;
</ins><span class="cx">         else
</span><del>-            m_verticalGap = 5 * m_ruleThickness / 4;
</del><ins>+            parameters.verticalGap = 5 * parameters.ruleThickness / 4;
</ins><span class="cx"> 
</span><span class="cx">         if (m_kind == RootWithIndex) {
</span><del>-            m_extraAscender = m_ruleThickness;
-            m_kernBeforeDegree = 5 * style().fontCascade().size() / 18;
-            m_kernAfterDegree = -10 * style().fontCascade().size() / 18;
-            m_degreeBottomRaisePercent = 0.6f;
</del><ins>+            parameters.extraAscender = parameters.ruleThickness;
+            parameters.degreeBottomRaisePercent = 0.6f;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><ins>+    return parameters;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderMathMLRoot::computePreferredLogicalWidths()
</span><span class="lines">@@ -139,8 +148,6 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(preferredLogicalWidthsDirty());
</span><span class="cx"> 
</span><del>-    updateStyle();
-
</del><span class="cx">     if (!isValid()) {
</span><span class="cx">         m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0;
</span><span class="cx">         setPreferredLogicalWidthsDirty(false);
</span><span class="lines">@@ -155,9 +162,10 @@
</span><span class="cx">         preferredWidth += m_maxPreferredLogicalWidth;
</span><span class="cx">     } else {
</span><span class="cx">         ASSERT(m_kind == RootWithIndex);
</span><del>-        preferredWidth += m_kernBeforeDegree;
</del><ins>+        auto horizontal = horizontalParameters();
+        preferredWidth += horizontal.kernBeforeDegree;
</ins><span class="cx">         preferredWidth += getIndex().maxPreferredLogicalWidth();
</span><del>-        preferredWidth += m_kernAfterDegree;
</del><ins>+        preferredWidth += horizontal.kernAfterDegree;
</ins><span class="cx">         preferredWidth += m_radicalOperator.maxPreferredWidth();
</span><span class="cx">         preferredWidth += getBase().maxPreferredLogicalWidth();
</span><span class="cx">     }
</span><span class="lines">@@ -173,7 +181,6 @@
</span><span class="cx">     if (!relayoutChildren &amp;&amp; simplifiedLayout())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    updateStyle();
</del><span class="cx">     m_radicalOperatorTop = 0;
</span><span class="cx">     m_baseWidth = 0;
</span><span class="cx"> 
</span><span class="lines">@@ -201,13 +208,16 @@
</span><span class="cx">         getIndex().layoutIfNeeded();
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    auto horizontal = horizontalParameters();
+    auto vertical = verticalParameters();
+
</ins><span class="cx">     // Stretch the radical operator to cover the base height.
</span><span class="cx">     // We can then determine the metrics of the radical operator + the base.
</span><span class="cx">     m_radicalOperator.stretchTo(style(), baseAscent + baseDescent);
</span><span class="cx">     LayoutUnit radicalOperatorHeight = m_radicalOperator.ascent() + m_radicalOperator.descent();
</span><del>-    LayoutUnit indexBottomRaise = m_degreeBottomRaisePercent * radicalOperatorHeight;
-    LayoutUnit radicalAscent = baseAscent + m_verticalGap + m_ruleThickness + m_extraAscender;
-    LayoutUnit radicalDescent = std::max&lt;LayoutUnit&gt;(baseDescent, radicalOperatorHeight + m_extraAscender - radicalAscent);
</del><ins>+    LayoutUnit indexBottomRaise = vertical.degreeBottomRaisePercent * radicalOperatorHeight;
+    LayoutUnit radicalAscent = baseAscent + vertical.verticalGap + vertical.ruleThickness + vertical.extraAscender;
+    LayoutUnit radicalDescent = std::max&lt;LayoutUnit&gt;(baseDescent, radicalOperatorHeight + vertical.extraAscender - radicalAscent);
</ins><span class="cx">     LayoutUnit descent = radicalDescent;
</span><span class="cx">     LayoutUnit ascent = radicalAscent;
</span><span class="cx"> 
</span><span class="lines">@@ -216,7 +226,7 @@
</span><span class="cx">         setLogicalWidth(m_radicalOperator.width() + m_baseWidth);
</span><span class="cx">     else {
</span><span class="cx">         ASSERT(m_kind == RootWithIndex);
</span><del>-        setLogicalWidth(m_kernBeforeDegree + getIndex().logicalWidth() + m_kernAfterDegree + m_radicalOperator.width() + m_baseWidth);
</del><ins>+        setLogicalWidth(horizontal.kernBeforeDegree + getIndex().logicalWidth() + horizontal.kernAfterDegree + m_radicalOperator.width() + m_baseWidth);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // For &lt;mroot&gt;, we update the metrics to take into account the index.
</span><span class="lines">@@ -228,10 +238,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // We set the final position of children.
</span><del>-    m_radicalOperatorTop = ascent - radicalAscent + m_extraAscender;
</del><ins>+    m_radicalOperatorTop = ascent - radicalAscent + vertical.extraAscender;
</ins><span class="cx">     LayoutUnit horizontalOffset = m_radicalOperator.width();
</span><span class="cx">     if (m_kind == RootWithIndex)
</span><del>-        horizontalOffset += m_kernBeforeDegree + getIndex().logicalWidth() + m_kernAfterDegree;
</del><ins>+        horizontalOffset += horizontal.kernBeforeDegree + getIndex().logicalWidth() + horizontal.kernAfterDegree;
</ins><span class="cx">     LayoutPoint baseLocation(mirrorIfNeeded(horizontalOffset, m_baseWidth), ascent - baseAscent);
</span><span class="cx">     if (m_kind == SquareRoot) {
</span><span class="cx">         for (auto* child = firstChildBox(); child; child = child-&gt;nextSiblingBox())
</span><span class="lines">@@ -239,7 +249,7 @@
</span><span class="cx">     } else {
</span><span class="cx">         ASSERT(m_kind == RootWithIndex);
</span><span class="cx">         getBase().setLocation(baseLocation);
</span><del>-        LayoutPoint indexLocation(mirrorIfNeeded(m_kernBeforeDegree, getIndex()), ascent + descent - indexBottomRaise - indexDescent - indexAscent);
</del><ins>+        LayoutPoint indexLocation(mirrorIfNeeded(horizontal.kernBeforeDegree, getIndex()), ascent + descent - indexBottomRaise - indexDescent - indexAscent);
</ins><span class="cx">         getIndex().setLocation(indexLocation);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -257,20 +267,23 @@
</span><span class="cx">     // We draw the radical operator.
</span><span class="cx">     LayoutPoint radicalOperatorTopLeft = paintOffset + location();
</span><span class="cx">     LayoutUnit horizontalOffset = 0;
</span><del>-    if (m_kind == RootWithIndex)
-        horizontalOffset = m_kernBeforeDegree + getIndex().logicalWidth() + m_kernAfterDegree;
</del><ins>+    if (m_kind == RootWithIndex) {
+        auto horizontal = horizontalParameters();
+        horizontalOffset = horizontal.kernBeforeDegree + getIndex().logicalWidth() + horizontal.kernAfterDegree;
+    }
</ins><span class="cx">     radicalOperatorTopLeft.move(mirrorIfNeeded(horizontalOffset, m_radicalOperator.width()), m_radicalOperatorTop);
</span><span class="cx">     m_radicalOperator.paint(style(), info, radicalOperatorTopLeft);
</span><span class="cx"> 
</span><span class="cx">     // We draw the radical line.
</span><del>-    if (!m_ruleThickness)
</del><ins>+    LayoutUnit ruleThickness = verticalParameters().ruleThickness;
+    if (!ruleThickness)
</ins><span class="cx">         return;
</span><span class="cx">     GraphicsContextStateSaver stateSaver(info.context());
</span><span class="cx"> 
</span><del>-    info.context().setStrokeThickness(m_ruleThickness);
</del><ins>+    info.context().setStrokeThickness(ruleThickness);
</ins><span class="cx">     info.context().setStrokeStyle(SolidStroke);
</span><span class="cx">     info.context().setStrokeColor(style().visitedDependentColor(CSSPropertyColor));
</span><del>-    LayoutPoint ruleOffsetFrom = paintOffset + location() + LayoutPoint(0, m_radicalOperatorTop + m_ruleThickness / 2);
</del><ins>+    LayoutPoint ruleOffsetFrom = paintOffset + location() + LayoutPoint(0, m_radicalOperatorTop + ruleThickness / 2);
</ins><span class="cx">     LayoutPoint ruleOffsetTo = ruleOffsetFrom;
</span><span class="cx">     horizontalOffset += m_radicalOperator.width();
</span><span class="cx">     ruleOffsetFrom.move(mirrorIfNeeded(horizontalOffset), 0);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLRooth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.h (204955 => 204956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.h        2016-08-25 06:25:04 UTC (rev 204955)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.h        2016-08-25 06:31:58 UTC (rev 204956)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> 
</span><span class="cx"> public:
</span><span class="cx">     RenderMathMLRoot(MathMLRowElement&amp;, RenderStyle&amp;&amp;);
</span><del>-    void updateFromElement() final;
</del><span class="cx">     void updateStyle();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -57,13 +56,20 @@
</span><span class="cx">     void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) final;
</span><span class="cx">     void paint(PaintInfo&amp;, const LayoutPoint&amp;) final;
</span><span class="cx"> 
</span><ins>+    struct HorizontalParameters {
+        LayoutUnit kernBeforeDegree;
+        LayoutUnit kernAfterDegree;
+    };
+    HorizontalParameters horizontalParameters();
+    struct VerticalParameters {
+        LayoutUnit verticalGap;
+        LayoutUnit ruleThickness;
+        LayoutUnit extraAscender;
+        float degreeBottomRaisePercent;
+    };
+    VerticalParameters verticalParameters();
+
</ins><span class="cx">     MathOperator m_radicalOperator;
</span><del>-    LayoutUnit m_verticalGap;
-    LayoutUnit m_ruleThickness;
-    LayoutUnit m_extraAscender;
-    LayoutUnit m_kernBeforeDegree;
-    LayoutUnit m_kernAfterDegree;
-    float m_degreeBottomRaisePercent;
</del><span class="cx">     LayoutUnit m_radicalOperatorTop;
</span><span class="cx">     LayoutUnit m_baseWidth;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>