<!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>[199295] 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/199295">199295</a></dd>
<dt>Author</dt> <dd>fred.wang@free.fr</dd>
<dt>Date</dt> <dd>2016-04-11 08:38:46 -0700 (Mon, 11 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Refactor RenderMathMLFraction layout to avoid using flexbox
https://bugs.webkit.org/show_bug.cgi?id=153917

Patch by Frederic Wang &lt;fwang@igalia.com&gt; on 2016-04-11
Reviewed by Sergio Villar Senin.

Source/WebCore:

Based on a patch by Alejandro G. Castro &lt;alex@igalia.com&gt;

Implement the layoutBlock method to handle the layout calculations
directly in the class. This also fixes parsing of absolute values for
linethickness attribute (e.g. 10px) and adds support for the AxisHeight
and FractionRuleThickness MATH parameters.

Test: mathml/opentype/fraction-line.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::mathLineThickness): Use the thickness relative to the
default line thickness since that's really what is expected by mathml-line-fraction.html
* css/mathml.css: Remove flexbox properties for mfrac.
(mfrac): Deleted.
(mfrac &gt; *): Deleted.
(mfrac[numalign=&quot;left&quot;] &gt; :first-child): Deleted.
(mfrac[numalign=&quot;right&quot;] &gt; :first-child): Deleted.
(mfrac[denomalign=&quot;left&quot;] &gt; :last-child): Deleted.
(mfrac[denomalign=&quot;right&quot;] &gt; :last-child): Deleted.
(mfrac &gt; :first-child): Deleted.
(mfrac &gt; :last-child): Deleted.
(mfrac): Deleted.
* rendering/mathml/RenderMathMLBlock.cpp: Introduce a helper function to retrieve the math
axis height.
(WebCore::RenderMathMLBlock::mathAxisHeight):
* rendering/mathml/RenderMathMLBlock.h: Declare mathAxisHeight.
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::RenderMathMLFraction):
(WebCore::RenderMathMLFraction::parseAlignmentAttribute): Helper function to parse the align
attribute.
(WebCore::RenderMathMLFraction::isValid): Helper function to verify whether the child list
is valid with respect to the MathML specificitation.
(WebCore::RenderMathMLFraction::numerator): Helper function to retrieve the numerator.
(WebCore::RenderMathMLFraction::denominator): Helper function to retrieve the denominator.
(WebCore::RenderMathMLFraction::updateFromElement): Use the FractionRuleThickness parameter
when avaiable to calculate the default linethickness.
Fix computation of linethickness for absolute values (e.g. 10px), the default linethickness
must not be involved for such values.
We no longer need to manage style of anonymous wrappers.
(WebCore::RenderMathMLFraction::unembellishedOperator): Use the helper function and we no
longer care about anonymous wrappers.
(WebCore::RenderMathMLFraction::computePreferredLogicalWidths): Implement this function
without using flexbox.
(WebCore::RenderMathMLFraction::horizontalOffset): Helper function to get the horizontal
offsets of children depending of the alignment.
(WebCore::RenderMathMLFraction::layoutBlock): Implement this function without using flexbox.
(WebCore::RenderMathMLFraction::paint): Do not paint if the fraction is invalid. Use helper
function. Use the width of the renderer (instead of the one of the denominator) as the
length of the fraction bar.
(WebCore::RenderMathMLFraction::firstLineBaseline): Use the helper functions to get children
and axis height.
(WebCore::RenderMathMLFraction::paintChildren): Temporary function to remove in a
follow-up patch.
(WebCore::RenderMathMLFraction::fixChildStyle): Deleted. We no longer need to manage style
of anonymous wrappers.
(WebCore::RenderMathMLFraction::addChild): Deleted. We no longer need to manage
anonymous wrappers.
(WebCore::RenderMathMLFraction::styleDidChange): We no longer need to manage style of
anonymous wrappers.
(WebCore::RenderMathMLFraction::layout): Deleted.
* rendering/mathml/RenderMathMLFraction.h: Replace lineThickness with relativeLineThickness,
as needed by the accessibility code. Update function and members declarations.

LayoutTests:

* TestExpectations: No longer skip mathml/presentation/fractions-positions.html
* mathml/opentype/fraction-line-expected.html: Added. New test to verify AxisHeight and
FractionRuleThickness parameters.
* mathml/opentype/fraction-line.html: Added. New test to verify axis height and rule
thickness parameters.
* mathml/presentation/fractions-linethickness-expected.html: Adjust the test to be sure that
the default rule thickness is 1px.
* mathml/presentation/fractions-linethickness.html: Adjust the test to be sure that the
default rule thickness is 1px.
* platform/gtk/mathml/presentation/roots-expected.txt: Update reference to take into account
changes in the render tree.
* platform/ios-simulator/mathml/presentation/roots-expected.txt: Ditto
* platform/mac/TestExpectations: Mark fraction-line and fractions-linethickness as
possibly failing since these tests require Latin Modern Math to work reliably.
* platform/ios-simulator/TestExpectations: Ditto</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationfractionslinethicknessexpectedhtml">trunk/LayoutTests/mathml/presentation/fractions-linethickness-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationfractionslinethicknesshtml">trunk/LayoutTests/mathml/presentation/fractions-linethickness.html</a></li>
<li><a href="#trunkLayoutTestsplatformgtkmathmlpresentationrootsexpectedtxt">trunk/LayoutTests/platform/gtk/mathml/presentation/roots-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatormathmlpresentationrootsexpectedtxt">trunk/LayoutTests/platform/ios-simulator/mathml/presentation/roots-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCorecssmathmlcss">trunk/Source/WebCore/css/mathml.css</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLBlockcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLBlockh">trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.h</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLFractioncpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLFractionh">trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmathmlopentypefractionlineexpectedhtml">trunk/LayoutTests/mathml/opentype/fraction-line-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlopentypefractionlinehtml">trunk/LayoutTests/mathml/opentype/fraction-line.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/LayoutTests/ChangeLog        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-04-11  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Refactor RenderMathMLFraction layout to avoid using flexbox
+        https://bugs.webkit.org/show_bug.cgi?id=153917
+
+        Reviewed by Sergio Villar Senin.
+
+        * TestExpectations: No longer skip mathml/presentation/fractions-positions.html
+        * mathml/opentype/fraction-line-expected.html: Added. New test to verify AxisHeight and
+        FractionRuleThickness parameters.
+        * mathml/opentype/fraction-line.html: Added. New test to verify axis height and rule
+        thickness parameters.
+        * mathml/presentation/fractions-linethickness-expected.html: Adjust the test to be sure that
+        the default rule thickness is 1px.
+        * mathml/presentation/fractions-linethickness.html: Adjust the test to be sure that the
+        default rule thickness is 1px.
+        * platform/gtk/mathml/presentation/roots-expected.txt: Update reference to take into account
+        changes in the render tree.
+        * platform/ios-simulator/mathml/presentation/roots-expected.txt: Ditto
+        * platform/mac/TestExpectations: Mark fraction-line and fractions-linethickness as
+        possibly failing since these tests require Latin Modern Math to work reliably.
+        * platform/ios-simulator/TestExpectations: Ditto
+
</ins><span class="cx"> 2016-04-11  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r199290.
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/LayoutTests/TestExpectations        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -112,9 +112,6 @@
</span><span class="cx"> # This test verifies dynamic manipulation of the mroot and msqrt elements.
</span><span class="cx"> mathml/roots-removeChild.html [ ImageOnlyFailure ]
</span><span class="cx"> 
</span><del>-# There is a small 1px size difference but this will be fixed when we refactor completely RenderMathMLFraction.
-mathml/presentation/fractions-positions.html [ Skip ]
-
</del><span class="cx"> # For now we ignore margin/padding/border properties of MathML renderers.
</span><span class="cx"> mathml/presentation/bug97990.html [ Skip ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlopentypefractionlineexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/opentype/fraction-line-expected.html (0 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/opentype/fraction-line-expected.html                                (rev 0)
+++ trunk/LayoutTests/mathml/opentype/fraction-line-expected.html        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;Fraction line (axis height and rule thickness)&lt;/title&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;style type=&quot;text/css&quot;&gt;
+      math {
+        font-family: &quot;Latin Modern Math&quot;;
+        font-size: 100px;
+      }
+    &lt;/style&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+
+    &lt;div style=&quot;position: absolute; left: 0px; top: -25px;&quot;&gt;
+      &lt;math&gt;
+        &lt;mspace height=&quot;50px&quot; depth=&quot;50px&quot;/&gt;
+        &lt;mspace width=&quot;100px&quot; height=&quot;2px&quot; depth=&quot;2px&quot; mathbackground=&quot;green&quot;/&gt;
+      &lt;/math&gt;
+    &lt;/div&gt;
+
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/opentype/fraction-line-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsmathmlopentypefractionlinehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/opentype/fraction-line.html (0 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/opentype/fraction-line.html                                (rev 0)
+++ trunk/LayoutTests/mathml/opentype/fraction-line.html        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;Fraction line (axis height and rule thickness)&lt;/title&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;style type=&quot;text/css&quot;&gt;
+      /* For Latin Modern Math
+         AxisHeight = 250 * 100 / 1000 = 25px;
+         FractionRuleThickness = 40 * 100 / 1000 = 4px;
+       */
+      math {
+        font-family: &quot;Latin Modern Math&quot;;
+        font-size: 100px;
+      }
+    &lt;/style&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+
+    &lt;!-- This test passes if the (red) fraction bar is hidden by the green bar --&gt;
+    &lt;div style=&quot;position: absolute; left: 0px; top: 0px;&quot;&gt;
+      &lt;math&gt;
+        &lt;mspace height=&quot;50px&quot; depth=&quot;50px&quot;/&gt;
+        &lt;mfrac mathcolor=&quot;red&quot;&gt;
+          &lt;mspace width=&quot;50px&quot;/&gt;
+          &lt;mspace width=&quot;50px&quot;/&gt;
+        &lt;/mfrac&gt;
+      &lt;/math&gt;
+    &lt;/div&gt;
+
+    &lt;!-- This green bar is moved up by AxisHeight and has thickness height + depth = FractionRuleThickness. --&gt;
+    &lt;div style=&quot;position: absolute; left: 0px; top: -25px;&quot;&gt;
+      &lt;math&gt;
+        &lt;mspace height=&quot;50px&quot; depth=&quot;50px&quot;/&gt;
+        &lt;mspace width=&quot;100px&quot; height=&quot;2px&quot; depth=&quot;2px&quot; mathbackground=&quot;green&quot;/&gt;
+      &lt;/math&gt;
+    &lt;/div&gt;
+
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/opentype/fraction-line.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsmathmlpresentationfractionslinethicknessexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/fractions-linethickness-expected.html (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/fractions-linethickness-expected.html        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/LayoutTests/mathml/presentation/fractions-linethickness-expected.html        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -3,6 +3,15 @@
</span><span class="cx">   &lt;head&gt;
</span><span class="cx">     &lt;title&gt;fractions linethickness&lt;/title&gt;
</span><span class="cx">     &lt;meta charset=&quot;utf-8&quot;/&gt;
</span><ins>+    &lt;style type=&quot;text/css&quot;&gt;
+      /* For Latin Modern Math
+         FractionRuleThickness = 40 * 25 / 1000 = 1px;
+       */
+      math {
+        font-family: &quot;Latin Modern Math&quot;;
+        font-size: 25px;
+      }
+    &lt;/style&gt;
</ins><span class="cx">   &lt;/head&gt;
</span><span class="cx">   &lt;body&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -20,7 +29,7 @@
</span><span class="cx">          gLineThick = 3.f;
</span><span class="cx">       --&gt;
</span><span class="cx"> 
</span><del>-    &lt;math mathsize=&quot;32px&quot;&gt;
</del><ins>+    &lt;math&gt;
</ins><span class="cx">       &lt;mfrac linethickness=&quot;0.33px&quot;&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;
</span><span class="cx">       &lt;mfrac linethickness=&quot;1px&quot;&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;
</span><span class="cx">       &lt;mfrac linethickness=&quot;3px&quot;&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationfractionslinethicknesshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/fractions-linethickness.html (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/fractions-linethickness.html        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/LayoutTests/mathml/presentation/fractions-linethickness.html        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -3,11 +3,20 @@
</span><span class="cx">   &lt;head&gt;
</span><span class="cx">     &lt;title&gt;fractions linethickness&lt;/title&gt;
</span><span class="cx">     &lt;meta charset=&quot;utf-8&quot;/&gt;
</span><ins>+    &lt;style type=&quot;text/css&quot;&gt;
+      /* For Latin Modern Math
+         FractionRuleThickness = 40 * 25 / 1000 = 1px;
+       */
+      math {
+        font-family: &quot;Latin Modern Math&quot;;
+        font-size: 25px;
+      }
+    &lt;/style&gt;
</ins><span class="cx">   &lt;/head&gt;
</span><span class="cx">   &lt;body&gt;
</span><span class="cx"> 
</span><span class="cx">     &lt;!-- This should draw fraction bars of increasing thickness --&gt;
</span><del>-    &lt;math mathsize=&quot;32px&quot;&gt;
</del><ins>+    &lt;math&gt;
</ins><span class="cx">       &lt;mfrac linethickness=&quot;thin&quot;&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;
</span><span class="cx">       &lt;mfrac linethickness=&quot;medium&quot;&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;
</span><span class="cx">       &lt;mfrac linethickness=&quot;thick&quot;&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/mfrac&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkmathmlpresentationrootsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/mathml/presentation/roots-expected.txt (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/mathml/presentation/roots-expected.txt        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/LayoutTests/platform/gtk/mathml/presentation/roots-expected.txt        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx">   RenderView at (0,0) size 800x600
</span><del>-layer at (0,0) size 800x492
-  RenderBlock {html} at (0,0) size 800x492
-    RenderBody {body} at (8,16) size 784x460
</del><ins>+layer at (0,0) size 800x491
+  RenderBlock {html} at (0,0) size 800x491
+    RenderBody {body} at (8,16) size 784x459
</ins><span class="cx">       RenderBlock {p} at (0,0) size 784x18
</span><span class="cx">         RenderText {#text} at (0,0) size 177x17
</span><span class="cx">           text run at (0,0) width 177: &quot;square root (should be red): &quot;
</span><span class="lines">@@ -86,50 +86,48 @@
</span><span class="cx">       RenderBlock {p} at (0,103) size 784x40
</span><span class="cx">         RenderText {#text} at (0,8) size 113x17
</span><span class="cx">           text run at (0,8) width 113: &quot;root of a fraction: &quot;
</span><del>-        RenderMathMLMath {math} at (113,0) size 58x41 [padding: 0 1 0 1]
-          RenderMathMLSquareRoot {msqrt} at (1,0) size 56x41
</del><ins>+        RenderMathMLMath {math} at (113,0) size 56x41 [padding: 0 1 0 1]
+          RenderMathMLSquareRoot {msqrt} at (1,0) size 54x41
</ins><span class="cx">             RenderMathMLBlock (anonymous, flex) at (0,0) size 17x41
</span><span class="cx">               RenderMathMLRadicalOperator (anonymous) at (0,0) size 17x41
</span><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (0,0) size 13x40
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 13x40
</span><span class="cx">                     RenderText at (0,-56) size 13x106
</span><span class="cx">                       text run at (0,-56) width 13: &quot;\x{221A}&quot;
</span><del>-            RenderMathMLRootWrapper at (17,2) size 39x39
-              RenderMathMLFraction {mfrac} at (1,0) size 37x34
-                RenderMathMLBlock (anonymous, flex) at (0,0) size 37x17
-                  RenderMathMLRow {mrow} at (0,0) size 37x13
-                    RenderMathMLToken {mi} at (0,4) size 10x8 [padding: 0 2 0 0]
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x8
-                        RenderBlock (anonymous) at (0,0) size 8x8
-                          RenderText {#text} at (0,-50) size 8x106
-                            text run at (0,-50) width 8: &quot;x&quot;
-                    RenderMathMLOperator {mo} at (9,1) size 20x12
-                      RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
-                        RenderBlock (anonymous) at (0,0) size 12x12
-                          RenderText at (0,-47) size 12x106
-                            text run at (0,-47) width 12: &quot;+&quot;
-                    RenderMathMLToken {mn} at (28,0) size 9x12
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
-                        RenderBlock (anonymous) at (0,0) size 8x12
-                          RenderText {#text} at (0,-46) size 8x106
-                            text run at (0,-46) width 8: &quot;1&quot;
-                RenderMathMLBlock (anonymous, flex) at (0,16) size 37x18 [padding: 1 0 0 0]
-                  RenderMathMLRow {mrow} at (0,4) size 37x14
-                    RenderMathMLToken {mi} at (0,4) size 10x8 [padding: 0 2 0 0]
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x8
-                        RenderBlock (anonymous) at (0,0) size 8x8
-                          RenderText {#text} at (0,-50) size 8x106
-                            text run at (0,-50) width 8: &quot;x&quot;
-                    RenderMathMLOperator {mo} at (9,1) size 20x12
-                      RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
-                        RenderBlock (anonymous) at (0,0) size 12x12
-                          RenderText at (0,-47) size 12x106
-                            text run at (0,-47) width 12: &quot;+&quot;
-                    RenderMathMLToken {mn} at (28,0) size 9x12
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
-                        RenderBlock (anonymous) at (0,0) size 8x12
-                          RenderText {#text} at (0,-46) size 8x106
-                            text run at (0,-46) width 8: &quot;2&quot;
</del><ins>+            RenderMathMLRootWrapper at (17,2) size 37x39
+              RenderMathMLFraction {mfrac} at (0,0) size 37x34
+                RenderMathMLRow {mrow} at (0,0) size 37x13
+                  RenderMathMLToken {mi} at (0,4) size 10x8 [padding: 0 2 0 0]
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x8
+                      RenderBlock (anonymous) at (0,0) size 8x8
+                        RenderText {#text} at (0,-50) size 8x106
+                          text run at (0,-50) width 8: &quot;x&quot;
+                  RenderMathMLOperator {mo} at (9,1) size 20x12
+                    RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
+                      RenderBlock (anonymous) at (0,0) size 12x12
+                        RenderText at (0,-47) size 12x106
+                          text run at (0,-47) width 12: &quot;+&quot;
+                  RenderMathMLToken {mn} at (28,0) size 9x12
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
+                      RenderBlock (anonymous) at (0,0) size 8x12
+                        RenderText {#text} at (0,-46) size 8x106
+                          text run at (0,-46) width 8: &quot;1&quot;
+                RenderMathMLRow {mrow} at (0,20) size 37x14
+                  RenderMathMLToken {mi} at (0,4) size 10x8 [padding: 0 2 0 0]
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x8
+                      RenderBlock (anonymous) at (0,0) size 8x8
+                        RenderText {#text} at (0,-50) size 8x106
+                          text run at (0,-50) width 8: &quot;x&quot;
+                  RenderMathMLOperator {mo} at (9,1) size 20x12
+                    RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
+                      RenderBlock (anonymous) at (0,0) size 12x12
+                        RenderText at (0,-47) size 12x106
+                          text run at (0,-47) width 12: &quot;+&quot;
+                  RenderMathMLToken {mn} at (28,0) size 9x12
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
+                      RenderBlock (anonymous) at (0,0) size 8x12
+                        RenderText {#text} at (0,-46) size 8x106
+                          text run at (0,-46) width 8: &quot;2&quot;
</ins><span class="cx">       RenderBlock {p} at (0,159) size 784x18
</span><span class="cx">         RenderText {#text} at (0,0) size 173x17
</span><span class="cx">           text run at (0,0) width 173: &quot;cube root (should be blue): &quot;
</span><span class="lines">@@ -200,8 +198,8 @@
</span><span class="cx">       RenderBlock {p} at (0,227) size 784x40
</span><span class="cx">         RenderText {#text} at (0,8) size 185x17
</span><span class="cx">           text run at (0,8) width 185: &quot;long index w/ complex base: &quot;
</span><del>-        RenderMathMLMath {math} at (185,0) size 92x41 [padding: 0 1 0 1]
-          RenderMathMLRoot {mroot} at (1,0) size 90x41
</del><ins>+        RenderMathMLMath {math} at (185,0) size 90x41 [padding: 0 1 0 1]
+          RenderMathMLRoot {mroot} at (1,0) size 88x41
</ins><span class="cx">             RenderMathMLRootWrapper at (4,8) size 40x33
</span><span class="cx">               RenderMathMLRow {mrow} at (0,0) size 39x8
</span><span class="cx">                 RenderMathMLToken {mi} at (0,2) size 6x5 [padding: 0 1 0 0]
</span><span class="lines">@@ -235,82 +233,76 @@
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 13x40
</span><span class="cx">                     RenderText at (0,-56) size 13x106
</span><span class="cx">                       text run at (0,-56) width 13: &quot;\x{221A}&quot;
</span><del>-            RenderMathMLRootWrapper at (51,2) size 39x39
-              RenderMathMLFraction {mfrac} at (1,0) size 37x34
-                RenderMathMLBlock (anonymous, flex) at (0,0) size 37x17
-                  RenderMathMLRow {mrow} at (0,0) size 37x13
-                    RenderMathMLToken {mi} at (0,4) size 10x8 [padding: 0 2 0 0]
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x8
-                        RenderBlock (anonymous) at (0,0) size 8x8
-                          RenderText {#text} at (0,-50) size 8x106
-                            text run at (0,-50) width 8: &quot;x&quot;
-                    RenderMathMLOperator {mo} at (9,1) size 20x12
-                      RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
-                        RenderBlock (anonymous) at (0,0) size 12x12
-                          RenderText at (0,-47) size 12x106
-                            text run at (0,-47) width 12: &quot;+&quot;
-                    RenderMathMLToken {mn} at (28,0) size 9x12
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
-                        RenderBlock (anonymous) at (0,0) size 8x12
-                          RenderText {#text} at (0,-46) size 8x106
-                            text run at (0,-46) width 8: &quot;1&quot;
-                RenderMathMLBlock (anonymous, flex) at (0,16) size 37x18 [padding: 1 0 0 0]
-                  RenderMathMLRow {mrow} at (0,4) size 37x14
-                    RenderMathMLToken {mi} at (0,4) size 10x8 [padding: 0 2 0 0]
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x8
-                        RenderBlock (anonymous) at (0,0) size 8x8
-                          RenderText {#text} at (0,-50) size 8x106
-                            text run at (0,-50) width 8: &quot;x&quot;
-                    RenderMathMLOperator {mo} at (9,1) size 20x12
-                      RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
-                        RenderBlock (anonymous) at (0,0) size 12x12
-                          RenderText at (0,-47) size 12x106
-                            text run at (0,-47) width 12: &quot;+&quot;
-                    RenderMathMLToken {mn} at (28,0) size 9x12
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
-                        RenderBlock (anonymous) at (0,0) size 8x12
-                          RenderText {#text} at (0,-46) size 8x106
-                            text run at (0,-46) width 8: &quot;2&quot;
-      RenderBlock {p} at (0,283) size 784x35
-        RenderText {#text} at (0,17) size 75x17
-          text run at (0,17) width 75: &quot;high index: &quot;
-        RenderMathMLMath {math} at (75,0) size 33x36 [padding: 0 1 0 1]
-          RenderMathMLRoot {mroot} at (1,0) size 31x36
-            RenderMathMLRootWrapper at (4,0) size 11x36
-              RenderMathMLFraction {mfrac} at (1,0) size 8x26
-                RenderMathMLBlock (anonymous, flex) at (0,0) size 8x18
-                  RenderMathMLFraction {mfrac} at (1,0) size 6x16
-                    RenderMathMLBlock (anonymous, flex) at (0,0) size 6x7
-                      RenderMathMLToken {mi} at (0,0) size 6x5 [padding: 0 1 0 0]
-                        RenderMathMLBlock (anonymous, flex) at (0,0) size 5x5
-                          RenderBlock (anonymous) at (0,0) size 5x5
-                            RenderText {#text} at (0,-29) size 5x61
-                              text run at (0,-29) width 5: &quot;x&quot;
-                    RenderMathMLBlock (anonymous, flex) at (0,6) size 6x10 [padding: 1 0 0 0]
-                      RenderMathMLToken {mi} at (0,2) size 6x7 [padding: 0 1 0 0]
-                        RenderMathMLBlock (anonymous, flex) at (0,0) size 5x6
-                          RenderBlock (anonymous) at (0,0) size 5x6
-                            RenderText {#text} at (0,-29) size 5x61
-                              text run at (0,-29) width 5: &quot;y&quot;
-                RenderMathMLBlock (anonymous, flex) at (0,17) size 8x9 [padding: 1 0 0 0]
-                  RenderMathMLToken {mi} at (1,2) size 6x6 [padding: 0 1 0 0]
-                    RenderMathMLBlock (anonymous, flex) at (0,0) size 4x5
-                      RenderBlock (anonymous) at (0,0) size 4x5
-                        RenderText {#text} at (0,-29) size 4x61
-                          text run at (0,-29) width 4: &quot;z&quot;
-            RenderMathMLBlock (anonymous, flex) at (5,0) size 18x36
-              RenderMathMLRadicalOperator (anonymous) at (0,18) size 17x18
</del><ins>+            RenderMathMLRootWrapper at (51,2) size 37x39
+              RenderMathMLFraction {mfrac} at (0,0) size 37x34
+                RenderMathMLRow {mrow} at (0,0) size 37x13
+                  RenderMathMLToken {mi} at (0,4) size 10x8 [padding: 0 2 0 0]
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x8
+                      RenderBlock (anonymous) at (0,0) size 8x8
+                        RenderText {#text} at (0,-50) size 8x106
+                          text run at (0,-50) width 8: &quot;x&quot;
+                  RenderMathMLOperator {mo} at (9,1) size 20x12
+                    RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
+                      RenderBlock (anonymous) at (0,0) size 12x12
+                        RenderText at (0,-47) size 12x106
+                          text run at (0,-47) width 12: &quot;+&quot;
+                  RenderMathMLToken {mn} at (28,0) size 9x12
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
+                      RenderBlock (anonymous) at (0,0) size 8x12
+                        RenderText {#text} at (0,-46) size 8x106
+                          text run at (0,-46) width 8: &quot;1&quot;
+                RenderMathMLRow {mrow} at (0,20) size 37x14
+                  RenderMathMLToken {mi} at (0,4) size 10x8 [padding: 0 2 0 0]
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x8
+                      RenderBlock (anonymous) at (0,0) size 8x8
+                        RenderText {#text} at (0,-50) size 8x106
+                          text run at (0,-50) width 8: &quot;x&quot;
+                  RenderMathMLOperator {mo} at (9,1) size 20x12
+                    RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
+                      RenderBlock (anonymous) at (0,0) size 12x12
+                        RenderText at (0,-47) size 12x106
+                          text run at (0,-47) width 12: &quot;+&quot;
+                  RenderMathMLToken {mn} at (28,0) size 9x12
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
+                      RenderBlock (anonymous) at (0,0) size 8x12
+                        RenderText {#text} at (0,-46) size 8x106
+                          text run at (0,-46) width 8: &quot;2&quot;
+      RenderBlock {p} at (0,283) size 784x34
+        RenderText {#text} at (0,16) size 75x17
+          text run at (0,16) width 75: &quot;high index: &quot;
+        RenderMathMLMath {math} at (75,0) size 29x35 [padding: 0 1 0 1]
+          RenderMathMLRoot {mroot} at (1,0) size 27x35
+            RenderMathMLRootWrapper at (4,0) size 7x35
+              RenderMathMLFraction {mfrac} at (0,0) size 6x24
+                RenderMathMLFraction {mfrac} at (0,0) size 6x15
+                  RenderMathMLToken {mi} at (0,0) size 6x5 [padding: 0 1 0 0]
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 5x5
+                      RenderBlock (anonymous) at (0,0) size 5x5
+                        RenderText {#text} at (0,-29) size 5x61
+                          text run at (0,-29) width 5: &quot;x&quot;
+                  RenderMathMLToken {mi} at (0,8) size 6x7 [padding: 0 1 0 0]
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 5x6
+                      RenderBlock (anonymous) at (0,0) size 5x6
+                        RenderText {#text} at (0,-29) size 5x61
+                          text run at (0,-29) width 5: &quot;y&quot;
+                RenderMathMLToken {mi} at (0,18) size 6x6 [padding: 0 1 0 0]
+                  RenderMathMLBlock (anonymous, flex) at (0,0) size 4x5
+                    RenderBlock (anonymous) at (0,0) size 4x5
+                      RenderText {#text} at (0,-29) size 4x61
+                        text run at (0,-29) width 4: &quot;z&quot;
+            RenderMathMLBlock (anonymous, flex) at (1,0) size 18x35
+              RenderMathMLRadicalOperator (anonymous) at (0,17) size 17x18
</ins><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (0,0) size 13x17
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 13x17
</span><span class="cx">                     RenderText at (0,-56) size 13x106
</span><span class="cx">                       text run at (0,-56) width 13: &quot;\x{221A}&quot;
</span><del>-            RenderMathMLRootWrapper at (22,20) size 9x16
</del><ins>+            RenderMathMLRootWrapper at (18,18) size 9x17
</ins><span class="cx">               RenderMathMLToken {mn} at (0,0) size 8x12
</span><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                     RenderText {#text} at (0,-46) size 8x106
</span><span class="cx">                       text run at (0,-46) width 8: &quot;2&quot;
</span><del>-      RenderBlock {p} at (0,334) size 784x54
</del><ins>+      RenderBlock {p} at (0,333) size 784x54
</ins><span class="cx">         RenderText {#text} at (0,14) size 155x17
</span><span class="cx">           text run at (0,14) width 155: &quot;Imbricated square roots: &quot;
</span><span class="cx">         RenderMathMLMath {math} at (155,0) size 342x55 [padding: 0 1 0 1]
</span><span class="lines">@@ -460,11 +452,11 @@
</span><span class="cx">                                                             RenderText {#text} at (0,-45) size 12x106
</span><span class="cx">                                                               text run at (0,-45) width 12: &quot;A&quot;
</span><span class="cx">         RenderText {#text} at (0,0) size 0x0
</span><del>-      RenderBlock {p} at (0,404) size 784x56
-        RenderText {#text} at (0,25) size 110x17
-          text run at (0,25) width 110: &quot;Imbricated roots: &quot;
-        RenderMathMLMath {math} at (110,0) size 366x57 [padding: 0 1 0 1]
-          RenderMathMLRoot {mroot} at (1,0) size 364x57
</del><ins>+      RenderBlock {p} at (0,403) size 784x56
+        RenderText {#text} at (0,24) size 110x17
+          text run at (0,24) width 110: &quot;Imbricated roots: &quot;
+        RenderMathMLMath {math} at (110,0) size 364x57 [padding: 0 1 0 1]
+          RenderMathMLRoot {mroot} at (1,0) size 362x57
</ins><span class="cx">             RenderMathMLRootWrapper at (4,15) size 6x42
</span><span class="cx">               RenderMathMLToken {mn} at (0,0) size 5x7
</span><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (0,0) size 5x7
</span><span class="lines">@@ -477,19 +469,19 @@
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 13x57
</span><span class="cx">                     RenderText at (0,-56) size 13x106
</span><span class="cx">                       text run at (0,-56) width 13: &quot;\x{221A}&quot;
</span><del>-            RenderMathMLRootWrapper at (17,2) size 347x55
-              RenderMathMLRow {mrow} at (0,0) size 346x55
-                RenderMathMLToken {mn} at (0,26) size 8x12
</del><ins>+            RenderMathMLRootWrapper at (17,2) size 345x55
+              RenderMathMLRow {mrow} at (0,0) size 344x55
+                RenderMathMLToken {mn} at (0,25) size 8x12
</ins><span class="cx">                   RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                     RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                       RenderText {#text} at (0,-46) size 8x106
</span><span class="cx">                         text run at (0,-46) width 8: &quot;1&quot;
</span><del>-                RenderMathMLOperator {mo} at (8,27) size 20x12
</del><ins>+                RenderMathMLOperator {mo} at (8,26) size 20x12
</ins><span class="cx">                   RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
</span><span class="cx">                     RenderBlock (anonymous) at (0,0) size 12x12
</span><span class="cx">                       RenderText at (0,-47) size 12x106
</span><span class="cx">                         text run at (0,-47) width 12: &quot;+&quot;
</span><del>-                RenderMathMLRoot {mroot} at (27,0) size 319x55
</del><ins>+                RenderMathMLRoot {mroot} at (27,0) size 317x55
</ins><span class="cx">                   RenderMathMLRootWrapper at (4,14) size 6x41
</span><span class="cx">                     RenderMathMLToken {mn} at (0,0) size 5x8
</span><span class="cx">                       RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
</span><span class="lines">@@ -502,19 +494,19 @@
</span><span class="cx">                         RenderBlock (anonymous) at (0,0) size 13x55
</span><span class="cx">                           RenderText at (0,-56) size 13x106
</span><span class="cx">                             text run at (0,-56) width 13: &quot;\x{221A}&quot;
</span><del>-                  RenderMathMLRootWrapper at (17,2) size 302x53
-                    RenderMathMLRow {mrow} at (0,0) size 302x53
-                      RenderMathMLToken {mn} at (0,24) size 8x12
</del><ins>+                  RenderMathMLRootWrapper at (17,2) size 300x53
+                    RenderMathMLRow {mrow} at (0,0) size 300x53
+                      RenderMathMLToken {mn} at (0,23) size 8x12
</ins><span class="cx">                         RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                           RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                             RenderText {#text} at (0,-46) size 8x106
</span><span class="cx">                               text run at (0,-46) width 8: &quot;2&quot;
</span><del>-                      RenderMathMLOperator {mo} at (8,25) size 20x12
</del><ins>+                      RenderMathMLOperator {mo} at (8,24) size 20x12
</ins><span class="cx">                         RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
</span><span class="cx">                           RenderBlock (anonymous) at (0,0) size 12x12
</span><span class="cx">                             RenderText at (0,-47) size 12x106
</span><span class="cx">                               text run at (0,-47) width 12: &quot;+&quot;
</span><del>-                      RenderMathMLRoot {mroot} at (27,0) size 275x53
</del><ins>+                      RenderMathMLRoot {mroot} at (27,0) size 273x53
</ins><span class="cx">                         RenderMathMLRootWrapper at (4,14) size 6x39
</span><span class="cx">                           RenderMathMLToken {mn} at (0,0) size 5x7
</span><span class="cx">                             RenderMathMLBlock (anonymous, flex) at (0,0) size 5x7
</span><span class="lines">@@ -527,19 +519,19 @@
</span><span class="cx">                               RenderBlock (anonymous) at (0,0) size 13x53
</span><span class="cx">                                 RenderText at (0,-56) size 13x106
</span><span class="cx">                                   text run at (0,-56) width 13: &quot;\x{221A}&quot;
</span><del>-                        RenderMathMLRootWrapper at (17,2) size 258x51
-                          RenderMathMLRow {mrow} at (0,0) size 257x51
-                            RenderMathMLToken {mn} at (0,22) size 8x12
</del><ins>+                        RenderMathMLRootWrapper at (17,2) size 256x51
+                          RenderMathMLRow {mrow} at (0,0) size 255x51
+                            RenderMathMLToken {mn} at (0,21) size 8x12
</ins><span class="cx">                               RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                                 RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                                   RenderText {#text} at (0,-46) size 8x106
</span><span class="cx">                                     text run at (0,-46) width 8: &quot;3&quot;
</span><del>-                            RenderMathMLOperator {mo} at (8,23) size 20x12
</del><ins>+                            RenderMathMLOperator {mo} at (8,22) size 20x12
</ins><span class="cx">                               RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
</span><span class="cx">                                 RenderBlock (anonymous) at (0,0) size 12x12
</span><span class="cx">                                   RenderText at (0,-47) size 12x106
</span><span class="cx">                                     text run at (0,-47) width 12: &quot;+&quot;
</span><del>-                            RenderMathMLRoot {mroot} at (27,0) size 230x51
</del><ins>+                            RenderMathMLRoot {mroot} at (27,0) size 228x51
</ins><span class="cx">                               RenderMathMLRootWrapper at (4,13) size 6x38
</span><span class="cx">                                 RenderMathMLToken {mn} at (0,0) size 5x7
</span><span class="cx">                                   RenderMathMLBlock (anonymous, flex) at (0,0) size 5x7
</span><span class="lines">@@ -552,19 +544,19 @@
</span><span class="cx">                                     RenderBlock (anonymous) at (0,0) size 13x51
</span><span class="cx">                                       RenderText at (0,-56) size 13x106
</span><span class="cx">                                         text run at (0,-56) width 13: &quot;\x{221A}&quot;
</span><del>-                              RenderMathMLRootWrapper at (17,2) size 213x49
-                                RenderMathMLRow {mrow} at (0,0) size 212x49
-                                  RenderMathMLToken {mn} at (0,20) size 8x12
</del><ins>+                              RenderMathMLRootWrapper at (17,2) size 211x49
+                                RenderMathMLRow {mrow} at (0,0) size 210x49
+                                  RenderMathMLToken {mn} at (0,19) size 8x12
</ins><span class="cx">                                     RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                                       RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                                         RenderText {#text} at (0,-46) size 8x106
</span><span class="cx">                                           text run at (0,-46) width 8: &quot;4&quot;
</span><del>-                                  RenderMathMLOperator {mo} at (8,21) size 20x12
</del><ins>+                                  RenderMathMLOperator {mo} at (8,20) size 20x12
</ins><span class="cx">                                     RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
</span><span class="cx">                                       RenderBlock (anonymous) at (0,0) size 12x12
</span><span class="cx">                                         RenderText at (0,-47) size 12x106
</span><span class="cx">                                           text run at (0,-47) width 12: &quot;+&quot;
</span><del>-                                  RenderMathMLRoot {mroot} at (27,0) size 185x49
</del><ins>+                                  RenderMathMLRoot {mroot} at (27,0) size 183x49
</ins><span class="cx">                                     RenderMathMLRootWrapper at (4,11) size 6x38
</span><span class="cx">                                       RenderMathMLToken {mn} at (0,0) size 5x8
</span><span class="cx">                                         RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
</span><span class="lines">@@ -577,19 +569,19 @@
</span><span class="cx">                                           RenderBlock (anonymous) at (0,0) size 13x48
</span><span class="cx">                                             RenderText at (0,-56) size 13x106
</span><span class="cx">                                               text run at (0,-56) width 13: &quot;\x{221A}&quot;
</span><del>-                                    RenderMathMLRootWrapper at (17,2) size 168x47
-                                      RenderMathMLRow {mrow} at (0,0) size 168x41
-                                        RenderMathMLToken {mn} at (0,18) size 8x12
</del><ins>+                                    RenderMathMLRootWrapper at (17,2) size 166x47
+                                      RenderMathMLRow {mrow} at (0,0) size 166x41
+                                        RenderMathMLToken {mn} at (0,17) size 8x12
</ins><span class="cx">                                           RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                                             RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                                               RenderText {#text} at (0,-46) size 8x106
</span><span class="cx">                                                 text run at (0,-46) width 8: &quot;5&quot;
</span><del>-                                        RenderMathMLOperator {mo} at (8,19) size 20x12
</del><ins>+                                        RenderMathMLOperator {mo} at (8,18) size 20x12
</ins><span class="cx">                                           RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
</span><span class="cx">                                             RenderBlock (anonymous) at (0,0) size 12x12
</span><span class="cx">                                               RenderText at (0,-47) size 12x106
</span><span class="cx">                                                 text run at (0,-47) width 12: &quot;+&quot;
</span><del>-                                        RenderMathMLRoot {mroot} at (27,0) size 141x41
</del><ins>+                                        RenderMathMLRoot {mroot} at (27,0) size 139x41
</ins><span class="cx">                                           RenderMathMLRootWrapper at (4,9) size 6x32
</span><span class="cx">                                             RenderMathMLToken {mn} at (0,0) size 5x7
</span><span class="cx">                                               RenderMathMLBlock (anonymous, flex) at (0,0) size 5x7
</span><span class="lines">@@ -602,19 +594,19 @@
</span><span class="cx">                                                 RenderBlock (anonymous) at (0,0) size 13x40
</span><span class="cx">                                                   RenderText at (0,-56) size 13x106
</span><span class="cx">                                                     text run at (0,-56) width 13: &quot;\x{221A}&quot;
</span><del>-                                          RenderMathMLRootWrapper at (17,2) size 124x39
-                                            RenderMathMLRow {mrow} at (0,0) size 123x31
-                                              RenderMathMLToken {mn} at (0,16) size 8x12
</del><ins>+                                          RenderMathMLRootWrapper at (17,2) size 122x39
+                                            RenderMathMLRow {mrow} at (0,0) size 121x31
+                                              RenderMathMLToken {mn} at (0,15) size 8x12
</ins><span class="cx">                                                 RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                                                   RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                                                     RenderText {#text} at (0,-46) size 8x106
</span><span class="cx">                                                       text run at (0,-46) width 8: &quot;6&quot;
</span><del>-                                              RenderMathMLOperator {mo} at (8,17) size 20x12
</del><ins>+                                              RenderMathMLOperator {mo} at (8,16) size 20x12
</ins><span class="cx">                                                 RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
</span><span class="cx">                                                   RenderBlock (anonymous) at (0,0) size 12x12
</span><span class="cx">                                                     RenderText at (0,-47) size 12x106
</span><span class="cx">                                                       text run at (0,-47) width 12: &quot;+&quot;
</span><del>-                                              RenderMathMLRoot {mroot} at (27,0) size 96x31
</del><ins>+                                              RenderMathMLRoot {mroot} at (27,0) size 94x31
</ins><span class="cx">                                                 RenderMathMLRootWrapper at (4,5) size 6x26
</span><span class="cx">                                                   RenderMathMLToken {mn} at (0,0) size 5x7
</span><span class="cx">                                                     RenderMathMLBlock (anonymous, flex) at (0,0) size 5x7
</span><span class="lines">@@ -627,51 +619,49 @@
</span><span class="cx">                                                       RenderBlock (anonymous) at (0,0) size 13x30
</span><span class="cx">                                                         RenderText at (0,-56) size 13x106
</span><span class="cx">                                                           text run at (0,-56) width 13: &quot;\x{221A}&quot;
</span><del>-                                                RenderMathMLRootWrapper at (17,2) size 79x29
-                                                  RenderMathMLRow {mrow} at (0,0) size 79x29
-                                                    RenderMathMLToken {mn} at (0,14) size 8x12
</del><ins>+                                                RenderMathMLRootWrapper at (17,2) size 77x29
+                                                  RenderMathMLRow {mrow} at (0,0) size 77x28
+                                                    RenderMathMLToken {mn} at (0,13) size 8x12
</ins><span class="cx">                                                       RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                                                         RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                                                           RenderText {#text} at (0,-46) size 8x106
</span><span class="cx">                                                             text run at (0,-46) width 8: &quot;7&quot;
</span><del>-                                                    RenderMathMLOperator {mo} at (8,15) size 20x12
</del><ins>+                                                    RenderMathMLOperator {mo} at (8,14) size 20x12
</ins><span class="cx">                                                       RenderMathMLBlock (anonymous, flex) at (3,0) size 13x12
</span><span class="cx">                                                         RenderBlock (anonymous) at (0,0) size 12x12
</span><span class="cx">                                                           RenderText at (0,-47) size 12x106
</span><span class="cx">                                                             text run at (0,-47) width 12: &quot;+&quot;
</span><del>-                                                    RenderMathMLRoot {mroot} at (27,0) size 52x29
-                                                      RenderMathMLRootWrapper at (4,0) size 26x29
-                                                        RenderMathMLFraction {mfrac} at (1,0) size 23x18
-                                                          RenderMathMLBlock (anonymous, flex) at (0,0) size 23x10
-                                                            RenderMathMLRow {mrow} at (0,0) size 23x8
-                                                              RenderMathMLToken {mi} at (0,2) size 6x5 [padding: 0 1 0 0]
-                                                                RenderMathMLBlock (anonymous, flex) at (0,0) size 5x5
-                                                                  RenderBlock (anonymous) at (0,0) size 5x5
-                                                                    RenderText {#text} at (0,-29) size 5x61
-                                                                      text run at (0,-29) width 5: &quot;x&quot;
-                                                              RenderMathMLOperator {mo} at (5,0) size 12x7
-                                                                RenderMathMLBlock (anonymous, flex) at (2,0) size 7x7
-                                                                  RenderBlock (anonymous) at (0,0) size 7x7
-                                                                    RenderText at (0,-27) size 7x61
-                                                                      text run at (0,-27) width 7: &quot;+&quot;
-                                                              RenderMathMLToken {mi} at (16,2) size 7x6 [padding: 0 1 0 0]
-                                                                RenderMathMLBlock (anonymous, flex) at (0,0) size 5x6
-                                                                  RenderBlock (anonymous) at (0,0) size 5x6
-                                                                    RenderText {#text} at (0,-29) size 5x61
-                                                                      text run at (0,-29) width 5: &quot;y&quot;
-                                                          RenderMathMLBlock (anonymous, flex) at (0,9) size 23x9 [padding: 1 0 0 0]
-                                                            RenderMathMLToken {mi} at (8,2) size 6x6 [padding: 0 1 0 0]
-                                                              RenderMathMLBlock (anonymous, flex) at (0,0) size 4x5
-                                                                RenderBlock (anonymous) at (0,0) size 4x5
-                                                                  RenderText {#text} at (0,-29) size 4x61
-                                                                    text run at (0,-29) width 4: &quot;z&quot;
-                                                      RenderMathMLBlock (anonymous, flex) at (20,0) size 18x29
-                                                        RenderMathMLRadicalOperator (anonymous) at (0,11) size 17x18
</del><ins>+                                                    RenderMathMLRoot {mroot} at (27,0) size 50x28
+                                                      RenderMathMLRootWrapper at (4,0) size 24x28
+                                                        RenderMathMLFraction {mfrac} at (0,0) size 23x17
+                                                          RenderMathMLRow {mrow} at (0,0) size 23x8
+                                                            RenderMathMLToken {mi} at (0,2) size 6x5 [padding: 0 1 0 0]
+                                                              RenderMathMLBlock (anonymous, flex) at (0,0) size 5x5
+                                                                RenderBlock (anonymous) at (0,0) size 5x5
+                                                                  RenderText {#text} at (0,-29) size 5x61
+                                                                    text run at (0,-29) width 5: &quot;x&quot;
+                                                            RenderMathMLOperator {mo} at (5,0) size 12x7
+                                                              RenderMathMLBlock (anonymous, flex) at (2,0) size 7x7
+                                                                RenderBlock (anonymous) at (0,0) size 7x7
+                                                                  RenderText at (0,-27) size 7x61
+                                                                    text run at (0,-27) width 7: &quot;+&quot;
+                                                            RenderMathMLToken {mi} at (16,2) size 7x6 [padding: 0 1 0 0]
+                                                              RenderMathMLBlock (anonymous, flex) at (0,0) size 5x6
+                                                                RenderBlock (anonymous) at (0,0) size 5x6
+                                                                  RenderText {#text} at (0,-29) size 5x61
+                                                                    text run at (0,-29) width 5: &quot;y&quot;
+                                                          RenderMathMLToken {mi} at (8,11) size 6x6 [padding: 0 1 0 0]
+                                                            RenderMathMLBlock (anonymous, flex) at (0,0) size 4x5
+                                                              RenderBlock (anonymous) at (0,0) size 4x5
+                                                                RenderText {#text} at (0,-29) size 4x61
+                                                                  text run at (0,-29) width 4: &quot;z&quot;
+                                                      RenderMathMLBlock (anonymous, flex) at (18,0) size 18x28
+                                                        RenderMathMLRadicalOperator (anonymous) at (0,10) size 17x18
</ins><span class="cx">                                                           RenderMathMLBlock (anonymous, flex) at (0,0) size 13x17
</span><span class="cx">                                                             RenderBlock (anonymous) at (0,0) size 13x17
</span><span class="cx">                                                               RenderText at (0,-56) size 13x106
</span><span class="cx">                                                                 text run at (0,-56) width 13: &quot;\x{221A}&quot;
</span><del>-                                                      RenderMathMLRootWrapper at (37,12) size 14x17
</del><ins>+                                                      RenderMathMLRootWrapper at (35,11) size 14x17
</ins><span class="cx">                                                         RenderMathMLToken {mi} at (0,0) size 14x13 [padding: 0 2 0 0]
</span><span class="cx">                                                           RenderMathMLBlock (anonymous, flex) at (0,0) size 12x13
</span><span class="cx">                                                             RenderBlock (anonymous) at (0,0) size 12x13
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -652,6 +652,10 @@
</span><span class="cx"> pageoverlay/overlay-large-document.html [ Failure ]
</span><span class="cx"> webkit.org/b/153337 pageoverlay/overlay-installation.html [ Pass Failure ]
</span><span class="cx"> 
</span><ins>+# These tests require the Latin Modern Math font.
+mathml/opentype/fraction-line.html [ Pass ImageOnlyFailure ]
+mathml/presentation/fractions-linethickness.html [ Pass ImageOnlyFailure ]
+
</ins><span class="cx"> # MathML tests that fail:
</span><span class="cx"> mathml/opentype/horizontal.html [ Failure ]
</span><span class="cx"> mathml/opentype/opentype-stretchy-horizontal.html [ Failure ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatormathmlpresentationrootsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/mathml/presentation/roots-expected.txt (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/mathml/presentation/roots-expected.txt        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/LayoutTests/platform/ios-simulator/mathml/presentation/roots-expected.txt        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx">   RenderView at (0,0) size 800x600
</span><del>-layer at (0,0) size 800x518
-  RenderBlock {html} at (0,0) size 800x518
-    RenderBody {body} at (8,16) size 784x486
</del><ins>+layer at (0,0) size 800x517
+  RenderBlock {html} at (0,0) size 800x517
+    RenderBody {body} at (8,16) size 784x485
</ins><span class="cx">       RenderBlock {p} at (0,0) size 784x20
</span><span class="cx">         RenderText {#text} at (0,0) size 181x19
</span><span class="cx">           text run at (0,0) width 181: &quot;square root (should be red): &quot;
</span><span class="lines">@@ -86,50 +86,48 @@
</span><span class="cx">       RenderBlock {p} at (0,112) size 784x37
</span><span class="cx">         RenderText {#text} at (0,8) size 117x19
</span><span class="cx">           text run at (0,8) width 117: &quot;root of a fraction: &quot;
</span><del>-        RenderMathMLMath {math} at (116,0) size 49x38 [padding: 0 1 0 1]
-          RenderMathMLSquareRoot {msqrt} at (1,0) size 47x38
</del><ins>+        RenderMathMLMath {math} at (116,0) size 47x38 [padding: 0 1 0 1]
+          RenderMathMLSquareRoot {msqrt} at (1,0) size 45x38
</ins><span class="cx">             RenderMathMLBlock (anonymous, flex) at (0,0) size 12x38
</span><span class="cx">               RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x38
</span><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (0,0) size 9x37
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 9x37
</span><span class="cx">                     RenderText at (0,1) size 9x17
</span><span class="cx">                       text run at (0,1) width 9: &quot;\x{221A}&quot;
</span><del>-            RenderMathMLRootWrapper at (12,3) size 35x35
-              RenderMathMLFraction {mfrac} at (1,0) size 33x32
-                RenderMathMLBlock (anonymous, flex) at (0,0) size 33x16
-                  RenderMathMLRow {mrow} at (0,0) size 33x12
-                    RenderMathMLToken {mi} at (0,3) size 9x9 [padding: 0 2 0 0]
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x9
-                        RenderBlock (anonymous) at (0,0) size 8x9
-                          RenderText {#text} at (0,-4) size 8x17
-                            text run at (0,-4) width 8: &quot;x&quot;
-                    RenderMathMLOperator {mo} at (8,3) size 17x9
-                      RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
-                        RenderBlock (anonymous) at (0,0) size 9x9
-                          RenderText at (0,-4) size 9x17
-                            text run at (0,-4) width 9: &quot;+&quot;
-                    RenderMathMLToken {mn} at (24,0) size 9x12
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
-                        RenderBlock (anonymous) at (0,0) size 8x12
-                          RenderText {#text} at (0,-1) size 8x17
-                            text run at (0,-1) width 8: &quot;1&quot;
-                RenderMathMLBlock (anonymous, flex) at (0,15) size 33x17 [padding: 1 0 0 0]
-                  RenderMathMLRow {mrow} at (0,4) size 33x13
-                    RenderMathMLToken {mi} at (0,3) size 9x9 [padding: 0 2 0 0]
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x9
-                        RenderBlock (anonymous) at (0,0) size 8x9
-                          RenderText {#text} at (0,-4) size 8x17
-                            text run at (0,-4) width 8: &quot;x&quot;
-                    RenderMathMLOperator {mo} at (8,3) size 17x9
-                      RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
-                        RenderBlock (anonymous) at (0,0) size 9x9
-                          RenderText at (0,-4) size 9x17
-                            text run at (0,-4) width 9: &quot;+&quot;
-                    RenderMathMLToken {mn} at (24,0) size 9x12
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
-                        RenderBlock (anonymous) at (0,0) size 8x12
-                          RenderText {#text} at (0,-1) size 8x17
-                            text run at (0,-1) width 8: &quot;2&quot;
</del><ins>+            RenderMathMLRootWrapper at (12,3) size 33x35
+              RenderMathMLFraction {mfrac} at (0,0) size 33x32
+                RenderMathMLRow {mrow} at (0,0) size 33x12
+                  RenderMathMLToken {mi} at (0,3) size 9x9 [padding: 0 2 0 0]
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x9
+                      RenderBlock (anonymous) at (0,0) size 8x9
+                        RenderText {#text} at (0,-4) size 8x17
+                          text run at (0,-4) width 8: &quot;x&quot;
+                  RenderMathMLOperator {mo} at (8,3) size 17x9
+                    RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
+                      RenderBlock (anonymous) at (0,0) size 9x9
+                        RenderText at (0,-4) size 9x17
+                          text run at (0,-4) width 9: &quot;+&quot;
+                  RenderMathMLToken {mn} at (24,0) size 9x12
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
+                      RenderBlock (anonymous) at (0,0) size 8x12
+                        RenderText {#text} at (0,-1) size 8x17
+                          text run at (0,-1) width 8: &quot;1&quot;
+                RenderMathMLRow {mrow} at (0,19) size 33x13
+                  RenderMathMLToken {mi} at (0,3) size 9x9 [padding: 0 2 0 0]
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x9
+                      RenderBlock (anonymous) at (0,0) size 8x9
+                        RenderText {#text} at (0,-4) size 8x17
+                          text run at (0,-4) width 8: &quot;x&quot;
+                  RenderMathMLOperator {mo} at (8,3) size 17x9
+                    RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
+                      RenderBlock (anonymous) at (0,0) size 9x9
+                        RenderText at (0,-4) size 9x17
+                          text run at (0,-4) width 9: &quot;+&quot;
+                  RenderMathMLToken {mn} at (24,0) size 9x12
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
+                      RenderBlock (anonymous) at (0,0) size 8x12
+                        RenderText {#text} at (0,-1) size 8x17
+                          text run at (0,-1) width 8: &quot;2&quot;
</ins><span class="cx">       RenderBlock {p} at (0,165) size 784x20
</span><span class="cx">         RenderText {#text} at (0,0) size 177x19
</span><span class="cx">           text run at (0,0) width 177: &quot;cube root (should be blue): &quot;
</span><span class="lines">@@ -200,8 +198,8 @@
</span><span class="cx">       RenderBlock {p} at (0,237) size 784x37
</span><span class="cx">         RenderText {#text} at (0,8) size 188x19
</span><span class="cx">           text run at (0,8) width 188: &quot;long index w/ complex base: &quot;
</span><del>-        RenderMathMLMath {math} at (187,0) size 78x38 [padding: 0 1 0 1]
-          RenderMathMLRoot {mroot} at (1,0) size 75x38
</del><ins>+        RenderMathMLMath {math} at (187,0) size 76x38 [padding: 0 1 0 1]
+          RenderMathMLRoot {mroot} at (1,0) size 73x38
</ins><span class="cx">             RenderMathMLRootWrapper at (4,8) size 33x30
</span><span class="cx">               RenderMathMLRow {mrow} at (0,0) size 33x7
</span><span class="cx">                 RenderMathMLToken {mi} at (0,1) size 5x5 [padding: 0 1 0 0]
</span><span class="lines">@@ -235,82 +233,76 @@
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 9x37
</span><span class="cx">                     RenderText at (0,1) size 9x17
</span><span class="cx">                       text run at (0,1) width 9: &quot;\x{221A}&quot;
</span><del>-            RenderMathMLRootWrapper at (39,3) size 36x35
-              RenderMathMLFraction {mfrac} at (1,0) size 33x32
-                RenderMathMLBlock (anonymous, flex) at (0,0) size 33x16
-                  RenderMathMLRow {mrow} at (0,0) size 33x12
-                    RenderMathMLToken {mi} at (0,3) size 9x9 [padding: 0 2 0 0]
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x9
-                        RenderBlock (anonymous) at (0,0) size 8x9
-                          RenderText {#text} at (0,-4) size 8x17
-                            text run at (0,-4) width 8: &quot;x&quot;
-                    RenderMathMLOperator {mo} at (8,3) size 17x9
-                      RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
-                        RenderBlock (anonymous) at (0,0) size 9x9
-                          RenderText at (0,-4) size 9x17
-                            text run at (0,-4) width 9: &quot;+&quot;
-                    RenderMathMLToken {mn} at (24,0) size 9x12
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
-                        RenderBlock (anonymous) at (0,0) size 8x12
-                          RenderText {#text} at (0,-1) size 8x17
-                            text run at (0,-1) width 8: &quot;1&quot;
-                RenderMathMLBlock (anonymous, flex) at (0,15) size 33x17 [padding: 1 0 0 0]
-                  RenderMathMLRow {mrow} at (0,4) size 33x13
-                    RenderMathMLToken {mi} at (0,3) size 9x9 [padding: 0 2 0 0]
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x9
-                        RenderBlock (anonymous) at (0,0) size 8x9
-                          RenderText {#text} at (0,-4) size 8x17
-                            text run at (0,-4) width 8: &quot;x&quot;
-                    RenderMathMLOperator {mo} at (8,3) size 17x9
-                      RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
-                        RenderBlock (anonymous) at (0,0) size 9x9
-                          RenderText at (0,-4) size 9x17
-                            text run at (0,-4) width 9: &quot;+&quot;
-                    RenderMathMLToken {mn} at (24,0) size 9x12
-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
-                        RenderBlock (anonymous) at (0,0) size 8x12
-                          RenderText {#text} at (0,-1) size 8x17
-                            text run at (0,-1) width 8: &quot;2&quot;
-      RenderBlock {p} at (0,290) size 784x37
-        RenderText {#text} at (0,17) size 77x19
-          text run at (0,17) width 77: &quot;high index: &quot;
-        RenderMathMLMath {math} at (76,0) size 27x36 [padding: 0 1 0 1]
-          RenderMathMLRoot {mroot} at (1,0) size 25x36
-            RenderMathMLRootWrapper at (4,0) size 10x36
-              RenderMathMLFraction {mfrac} at (1,0) size 7x26
-                RenderMathMLBlock (anonymous, flex) at (0,0) size 7x18
-                  RenderMathMLFraction {mfrac} at (1,0) size 5x16
-                    RenderMathMLBlock (anonymous, flex) at (0,0) size 5x7
-                      RenderMathMLToken {mi} at (0,0) size 5x5 [padding: 0 1 0 0]
-                        RenderMathMLBlock (anonymous, flex) at (0,0) size 4x5
-                          RenderBlock (anonymous) at (0,0) size 4x5
-                            RenderText {#text} at (0,-3) size 4x10
-                              text run at (0,-3) width 4: &quot;x&quot;
-                    RenderMathMLBlock (anonymous, flex) at (0,6) size 5x10 [padding: 1 0 0 0]
-                      RenderMathMLToken {mi} at (0,2) size 5x7 [padding: 0 1 0 0]
-                        RenderMathMLBlock (anonymous, flex) at (0,0) size 4x6
-                          RenderBlock (anonymous) at (0,0) size 4x6
-                            RenderText {#text} at (0,-3) size 4x10
-                              text run at (0,-3) width 4: &quot;y&quot;
-                RenderMathMLBlock (anonymous, flex) at (0,17) size 7x9 [padding: 1 0 0 0]
-                  RenderMathMLToken {mi} at (1,2) size 5x6 [padding: 0 1 0 0]
</del><ins>+            RenderMathMLRootWrapper at (39,3) size 34x35
+              RenderMathMLFraction {mfrac} at (0,0) size 33x32
+                RenderMathMLRow {mrow} at (0,0) size 33x12
+                  RenderMathMLToken {mi} at (0,3) size 9x9 [padding: 0 2 0 0]
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x9
+                      RenderBlock (anonymous) at (0,0) size 8x9
+                        RenderText {#text} at (0,-4) size 8x17
+                          text run at (0,-4) width 8: &quot;x&quot;
+                  RenderMathMLOperator {mo} at (8,3) size 17x9
+                    RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
+                      RenderBlock (anonymous) at (0,0) size 9x9
+                        RenderText at (0,-4) size 9x17
+                          text run at (0,-4) width 9: &quot;+&quot;
+                  RenderMathMLToken {mn} at (24,0) size 9x12
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
+                      RenderBlock (anonymous) at (0,0) size 8x12
+                        RenderText {#text} at (0,-1) size 8x17
+                          text run at (0,-1) width 8: &quot;1&quot;
+                RenderMathMLRow {mrow} at (0,19) size 33x13
+                  RenderMathMLToken {mi} at (0,3) size 9x9 [padding: 0 2 0 0]
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x9
+                      RenderBlock (anonymous) at (0,0) size 8x9
+                        RenderText {#text} at (0,-4) size 8x17
+                          text run at (0,-4) width 8: &quot;x&quot;
+                  RenderMathMLOperator {mo} at (8,3) size 17x9
+                    RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
+                      RenderBlock (anonymous) at (0,0) size 9x9
+                        RenderText at (0,-4) size 9x17
+                          text run at (0,-4) width 9: &quot;+&quot;
+                  RenderMathMLToken {mn} at (24,0) size 9x12
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
+                      RenderBlock (anonymous) at (0,0) size 8x12
+                        RenderText {#text} at (0,-1) size 8x17
+                          text run at (0,-1) width 8: &quot;2&quot;
+      RenderBlock {p} at (0,290) size 784x36
+        RenderText {#text} at (0,16) size 77x19
+          text run at (0,16) width 77: &quot;high index: &quot;
+        RenderMathMLMath {math} at (76,0) size 23x35 [padding: 0 1 0 1]
+          RenderMathMLRoot {mroot} at (1,0) size 21x35
+            RenderMathMLRootWrapper at (4,0) size 6x35
+              RenderMathMLFraction {mfrac} at (0,0) size 5x25
+                RenderMathMLFraction {mfrac} at (0,0) size 5x16
+                  RenderMathMLToken {mi} at (0,0) size 5x5 [padding: 0 1 0 0]
</ins><span class="cx">                     RenderMathMLBlock (anonymous, flex) at (0,0) size 4x5
</span><span class="cx">                       RenderBlock (anonymous) at (0,0) size 4x5
</span><span class="cx">                         RenderText {#text} at (0,-3) size 4x10
</span><del>-                          text run at (0,-3) width 4: &quot;z&quot;
-            RenderMathMLBlock (anonymous, flex) at (4,0) size 13x36
-              RenderMathMLRadicalOperator (anonymous) at (0,18) size 12x18
</del><ins>+                          text run at (0,-3) width 4: &quot;x&quot;
+                  RenderMathMLToken {mi} at (0,9) size 5x7 [padding: 0 1 0 0]
+                    RenderMathMLBlock (anonymous, flex) at (0,0) size 4x6
+                      RenderBlock (anonymous) at (0,0) size 4x6
+                        RenderText {#text} at (0,-3) size 4x10
+                          text run at (0,-3) width 4: &quot;y&quot;
+                RenderMathMLToken {mi} at (0,19) size 5x6 [padding: 0 1 0 0]
+                  RenderMathMLBlock (anonymous, flex) at (0,0) size 4x5
+                    RenderBlock (anonymous) at (0,0) size 4x5
+                      RenderText {#text} at (0,-3) size 4x10
+                        text run at (0,-3) width 4: &quot;z&quot;
+            RenderMathMLBlock (anonymous, flex) at (0,0) size 13x35
+              RenderMathMLRadicalOperator (anonymous) at (0,17) size 12x18
</ins><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (0,0) size 9x18
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 9x18
</span><span class="cx">                     RenderText at (0,1) size 9x17
</span><span class="cx">                       text run at (0,1) width 9: &quot;\x{221A}&quot;
</span><del>-            RenderMathMLRootWrapper at (16,21) size 9x15
</del><ins>+            RenderMathMLRootWrapper at (12,20) size 9x15
</ins><span class="cx">               RenderMathMLToken {mn} at (0,0) size 8x12
</span><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                     RenderText {#text} at (0,-1) size 8x17
</span><span class="cx">                       text run at (0,-1) width 8: &quot;2&quot;
</span><del>-      RenderBlock {p} at (0,343) size 784x59
</del><ins>+      RenderBlock {p} at (0,342) size 784x59
</ins><span class="cx">         RenderText {#text} at (0,28) size 160x19
</span><span class="cx">           text run at (0,28) width 160: &quot;Imbricated square roots: &quot;
</span><span class="cx">         RenderMathMLMath {math} at (159,0) size 277x60 [padding: 0 1 0 1]
</span><span class="lines">@@ -460,11 +452,11 @@
</span><span class="cx">                                                             RenderText {#text} at (0,-1) size 10x17
</span><span class="cx">                                                               text run at (0,-1) width 10: &quot;A&quot;
</span><span class="cx">         RenderText {#text} at (0,0) size 0x0
</span><del>-      RenderBlock {p} at (0,418) size 784x68
-        RenderText {#text} at (0,37) size 114x19
-          text run at (0,37) width 114: &quot;Imbricated roots: &quot;
-        RenderMathMLMath {math} at (113,0) size 294x69 [padding: 0 1 0 1]
-          RenderMathMLRoot {mroot} at (1,0) size 292x69
</del><ins>+      RenderBlock {p} at (0,417) size 784x68
+        RenderText {#text} at (0,36) size 114x19
+          text run at (0,36) width 114: &quot;Imbricated roots: &quot;
+        RenderMathMLMath {math} at (113,0) size 292x69 [padding: 0 1 0 1]
+          RenderMathMLRoot {mroot} at (1,0) size 290x69
</ins><span class="cx">             RenderMathMLRootWrapper at (4,19) size 5x50
</span><span class="cx">               RenderMathMLToken {mn} at (0,0) size 5x8
</span><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
</span><span class="lines">@@ -477,19 +469,19 @@
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 9x68
</span><span class="cx">                     RenderText at (0,1) size 9x17
</span><span class="cx">                       text run at (0,1) width 9: &quot;\x{221A}&quot;
</span><del>-            RenderMathMLRootWrapper at (12,3) size 280x66
-              RenderMathMLRow {mrow} at (0,0) size 280x63
-                RenderMathMLToken {mn} at (0,37) size 8x12
</del><ins>+            RenderMathMLRootWrapper at (12,3) size 278x66
+              RenderMathMLRow {mrow} at (0,0) size 278x63
+                RenderMathMLToken {mn} at (0,36) size 8x12
</ins><span class="cx">                   RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                     RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                       RenderText {#text} at (0,-1) size 8x17
</span><span class="cx">                         text run at (0,-1) width 8: &quot;1&quot;
</span><del>-                RenderMathMLOperator {mo} at (8,40) size 16x9
</del><ins>+                RenderMathMLOperator {mo} at (8,39) size 16x9
</ins><span class="cx">                   RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
</span><span class="cx">                     RenderBlock (anonymous) at (0,0) size 9x9
</span><span class="cx">                       RenderText at (0,-4) size 9x17
</span><span class="cx">                         text run at (0,-4) width 9: &quot;+&quot;
</span><del>-                RenderMathMLRoot {mroot} at (23,0) size 257x63
</del><ins>+                RenderMathMLRoot {mroot} at (23,0) size 255x63
</ins><span class="cx">                   RenderMathMLRootWrapper at (4,17) size 5x46
</span><span class="cx">                     RenderMathMLToken {mn} at (0,0) size 5x8
</span><span class="cx">                       RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
</span><span class="lines">@@ -498,24 +490,24 @@
</span><span class="cx">                             text run at (0,0) width 5: &quot;4&quot;
</span><span class="cx">                   RenderMathMLBlock (anonymous, flex) at (0,0) size 13x63
</span><span class="cx">                     RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x63
</span><del>-                      RenderMathMLBlock (anonymous, flex) at (0,0) size 9x63
-                        RenderBlock (anonymous) at (0,0) size 9x63
</del><ins>+                      RenderMathMLBlock (anonymous, flex) at (0,0) size 9x62
+                        RenderBlock (anonymous) at (0,0) size 9x62
</ins><span class="cx">                           RenderText at (0,1) size 9x17
</span><span class="cx">                             text run at (0,1) width 9: &quot;\x{221A}&quot;
</span><del>-                  RenderMathMLRootWrapper at (12,3) size 244x60
-                    RenderMathMLRow {mrow} at (0,0) size 244x57
-                      RenderMathMLToken {mn} at (0,33) size 8x12
</del><ins>+                  RenderMathMLRootWrapper at (12,3) size 242x60
+                    RenderMathMLRow {mrow} at (0,0) size 242x57
+                      RenderMathMLToken {mn} at (0,32) size 8x12
</ins><span class="cx">                         RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                           RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                             RenderText {#text} at (0,-1) size 8x17
</span><span class="cx">                               text run at (0,-1) width 8: &quot;2&quot;
</span><del>-                      RenderMathMLOperator {mo} at (8,36) size 16x9
</del><ins>+                      RenderMathMLOperator {mo} at (8,35) size 16x9
</ins><span class="cx">                         RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
</span><span class="cx">                           RenderBlock (anonymous) at (0,0) size 9x9
</span><span class="cx">                             RenderText at (0,-4) size 9x17
</span><span class="cx">                               text run at (0,-4) width 9: &quot;+&quot;
</span><del>-                      RenderMathMLRoot {mroot} at (23,0) size 221x57
-                        RenderMathMLRootWrapper at (4,15) size 5x42
</del><ins>+                      RenderMathMLRoot {mroot} at (23,0) size 219x57
+                        RenderMathMLRootWrapper at (4,14) size 5x43
</ins><span class="cx">                           RenderMathMLToken {mn} at (0,0) size 5x8
</span><span class="cx">                             RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
</span><span class="cx">                               RenderBlock (anonymous) at (0,0) size 5x8
</span><span class="lines">@@ -523,23 +515,23 @@
</span><span class="cx">                                   text run at (0,0) width 5: &quot;5&quot;
</span><span class="cx">                         RenderMathMLBlock (anonymous, flex) at (0,0) size 13x57
</span><span class="cx">                           RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x57
</span><del>-                            RenderMathMLBlock (anonymous, flex) at (0,0) size 9x57
-                              RenderBlock (anonymous) at (0,0) size 9x57
</del><ins>+                            RenderMathMLBlock (anonymous, flex) at (0,0) size 9x56
+                              RenderBlock (anonymous) at (0,0) size 9x56
</ins><span class="cx">                                 RenderText at (0,1) size 9x17
</span><span class="cx">                                   text run at (0,1) width 9: &quot;\x{221A}&quot;
</span><del>-                        RenderMathMLRootWrapper at (12,3) size 208x54
-                          RenderMathMLRow {mrow} at (0,0) size 208x51
-                            RenderMathMLToken {mn} at (0,29) size 8x12
</del><ins>+                        RenderMathMLRootWrapper at (12,3) size 206x54
+                          RenderMathMLRow {mrow} at (0,0) size 206x51
+                            RenderMathMLToken {mn} at (0,28) size 8x12
</ins><span class="cx">                               RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                                 RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                                   RenderText {#text} at (0,-1) size 8x17
</span><span class="cx">                                     text run at (0,-1) width 8: &quot;3&quot;
</span><del>-                            RenderMathMLOperator {mo} at (8,32) size 16x9
</del><ins>+                            RenderMathMLOperator {mo} at (8,31) size 16x9
</ins><span class="cx">                               RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
</span><span class="cx">                                 RenderBlock (anonymous) at (0,0) size 9x9
</span><span class="cx">                                   RenderText at (0,-4) size 9x17
</span><span class="cx">                                     text run at (0,-4) width 9: &quot;+&quot;
</span><del>-                            RenderMathMLRoot {mroot} at (23,0) size 185x51
</del><ins>+                            RenderMathMLRoot {mroot} at (23,0) size 183x51
</ins><span class="cx">                               RenderMathMLRootWrapper at (4,12) size 5x39
</span><span class="cx">                                 RenderMathMLToken {mn} at (0,0) size 5x8
</span><span class="cx">                                   RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
</span><span class="lines">@@ -548,23 +540,23 @@
</span><span class="cx">                                         text run at (0,0) width 5: &quot;6&quot;
</span><span class="cx">                               RenderMathMLBlock (anonymous, flex) at (0,0) size 13x51
</span><span class="cx">                                 RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x51
</span><del>-                                  RenderMathMLBlock (anonymous, flex) at (0,0) size 9x51
-                                    RenderBlock (anonymous) at (0,0) size 9x51
</del><ins>+                                  RenderMathMLBlock (anonymous, flex) at (0,0) size 9x50
+                                    RenderBlock (anonymous) at (0,0) size 9x50
</ins><span class="cx">                                       RenderText at (0,1) size 9x17
</span><span class="cx">                                         text run at (0,1) width 9: &quot;\x{221A}&quot;
</span><del>-                              RenderMathMLRootWrapper at (12,3) size 172x48
-                                RenderMathMLRow {mrow} at (0,0) size 172x45
-                                  RenderMathMLToken {mn} at (0,25) size 8x12
</del><ins>+                              RenderMathMLRootWrapper at (12,3) size 170x48
+                                RenderMathMLRow {mrow} at (0,0) size 170x45
+                                  RenderMathMLToken {mn} at (0,24) size 8x12
</ins><span class="cx">                                     RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                                       RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                                         RenderText {#text} at (0,-1) size 8x17
</span><span class="cx">                                           text run at (0,-1) width 8: &quot;4&quot;
</span><del>-                                  RenderMathMLOperator {mo} at (8,28) size 16x9
</del><ins>+                                  RenderMathMLOperator {mo} at (8,27) size 16x9
</ins><span class="cx">                                     RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
</span><span class="cx">                                       RenderBlock (anonymous) at (0,0) size 9x9
</span><span class="cx">                                         RenderText at (0,-4) size 9x17
</span><span class="cx">                                           text run at (0,-4) width 9: &quot;+&quot;
</span><del>-                                  RenderMathMLRoot {mroot} at (23,0) size 149x45
</del><ins>+                                  RenderMathMLRoot {mroot} at (23,0) size 147x45
</ins><span class="cx">                                     RenderMathMLRootWrapper at (4,11) size 5x34
</span><span class="cx">                                       RenderMathMLToken {mn} at (0,0) size 5x7
</span><span class="cx">                                         RenderMathMLBlock (anonymous, flex) at (0,0) size 5x7
</span><span class="lines">@@ -573,24 +565,24 @@
</span><span class="cx">                                               text run at (0,-1) width 5: &quot;7&quot;
</span><span class="cx">                                     RenderMathMLBlock (anonymous, flex) at (0,0) size 13x45
</span><span class="cx">                                       RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x45
</span><del>-                                        RenderMathMLBlock (anonymous, flex) at (0,0) size 9x45
-                                          RenderBlock (anonymous) at (0,0) size 9x45
</del><ins>+                                        RenderMathMLBlock (anonymous, flex) at (0,0) size 9x44
+                                          RenderBlock (anonymous) at (0,0) size 9x44
</ins><span class="cx">                                             RenderText at (0,1) size 9x17
</span><span class="cx">                                               text run at (0,1) width 9: &quot;\x{221A}&quot;
</span><del>-                                    RenderMathMLRootWrapper at (12,3) size 136x42
-                                      RenderMathMLRow {mrow} at (0,0) size 136x39
-                                        RenderMathMLToken {mn} at (0,21) size 8x12
</del><ins>+                                    RenderMathMLRootWrapper at (12,3) size 134x42
+                                      RenderMathMLRow {mrow} at (0,0) size 134x39
+                                        RenderMathMLToken {mn} at (0,20) size 8x12
</ins><span class="cx">                                           RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                                             RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                                               RenderText {#text} at (0,-1) size 8x17
</span><span class="cx">                                                 text run at (0,-1) width 8: &quot;5&quot;
</span><del>-                                        RenderMathMLOperator {mo} at (8,24) size 16x9
</del><ins>+                                        RenderMathMLOperator {mo} at (8,23) size 16x9
</ins><span class="cx">                                           RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
</span><span class="cx">                                             RenderBlock (anonymous) at (0,0) size 9x9
</span><span class="cx">                                               RenderText at (0,-4) size 9x17
</span><span class="cx">                                                 text run at (0,-4) width 9: &quot;+&quot;
</span><del>-                                        RenderMathMLRoot {mroot} at (23,0) size 113x39
-                                          RenderMathMLRootWrapper at (4,8) size 5x31
</del><ins>+                                        RenderMathMLRoot {mroot} at (23,0) size 111x39
+                                          RenderMathMLRootWrapper at (4,7) size 5x32
</ins><span class="cx">                                             RenderMathMLToken {mn} at (0,0) size 5x8
</span><span class="cx">                                               RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
</span><span class="cx">                                                 RenderBlock (anonymous) at (0,0) size 5x8
</span><span class="lines">@@ -598,23 +590,23 @@
</span><span class="cx">                                                     text run at (0,0) width 5: &quot;8&quot;
</span><span class="cx">                                           RenderMathMLBlock (anonymous, flex) at (0,0) size 13x39
</span><span class="cx">                                             RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x39
</span><del>-                                              RenderMathMLBlock (anonymous, flex) at (0,0) size 9x39
-                                                RenderBlock (anonymous) at (0,0) size 9x39
</del><ins>+                                              RenderMathMLBlock (anonymous, flex) at (0,0) size 9x38
+                                                RenderBlock (anonymous) at (0,0) size 9x38
</ins><span class="cx">                                                   RenderText at (0,1) size 9x17
</span><span class="cx">                                                     text run at (0,1) width 9: &quot;\x{221A}&quot;
</span><del>-                                          RenderMathMLRootWrapper at (12,3) size 100x36
-                                            RenderMathMLRow {mrow} at (0,0) size 100x33
-                                              RenderMathMLToken {mn} at (0,17) size 8x12
</del><ins>+                                          RenderMathMLRootWrapper at (12,3) size 98x36
+                                            RenderMathMLRow {mrow} at (0,0) size 98x33
+                                              RenderMathMLToken {mn} at (0,16) size 8x12
</ins><span class="cx">                                                 RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                                                   RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                                                     RenderText {#text} at (0,-1) size 8x17
</span><span class="cx">                                                       text run at (0,-1) width 8: &quot;6&quot;
</span><del>-                                              RenderMathMLOperator {mo} at (8,20) size 16x9
</del><ins>+                                              RenderMathMLOperator {mo} at (8,19) size 16x9
</ins><span class="cx">                                                 RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
</span><span class="cx">                                                   RenderBlock (anonymous) at (0,0) size 9x9
</span><span class="cx">                                                     RenderText at (0,-4) size 9x17
</span><span class="cx">                                                       text run at (0,-4) width 9: &quot;+&quot;
</span><del>-                                              RenderMathMLRoot {mroot} at (23,0) size 77x33
</del><ins>+                                              RenderMathMLRoot {mroot} at (23,0) size 75x33
</ins><span class="cx">                                                 RenderMathMLRootWrapper at (4,5) size 5x28
</span><span class="cx">                                                   RenderMathMLToken {mn} at (0,0) size 5x8
</span><span class="cx">                                                     RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
</span><span class="lines">@@ -623,55 +615,53 @@
</span><span class="cx">                                                           text run at (0,0) width 5: &quot;9&quot;
</span><span class="cx">                                                 RenderMathMLBlock (anonymous, flex) at (0,0) size 13x33
</span><span class="cx">                                                   RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x33
</span><del>-                                                    RenderMathMLBlock (anonymous, flex) at (0,0) size 9x33
-                                                      RenderBlock (anonymous) at (0,0) size 9x33
</del><ins>+                                                    RenderMathMLBlock (anonymous, flex) at (0,0) size 9x32
+                                                      RenderBlock (anonymous) at (0,0) size 9x32
</ins><span class="cx">                                                         RenderText at (0,1) size 9x17
</span><span class="cx">                                                           text run at (0,1) width 9: &quot;\x{221A}&quot;
</span><del>-                                                RenderMathMLRootWrapper at (12,3) size 64x30
-                                                  RenderMathMLRow {mrow} at (0,0) size 64x27
-                                                    RenderMathMLToken {mn} at (0,13) size 8x12
</del><ins>+                                                RenderMathMLRootWrapper at (12,3) size 62x30
+                                                  RenderMathMLRow {mrow} at (0,0) size 62x27
+                                                    RenderMathMLToken {mn} at (0,12) size 8x12
</ins><span class="cx">                                                       RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
</span><span class="cx">                                                         RenderBlock (anonymous) at (0,0) size 8x12
</span><span class="cx">                                                           RenderText {#text} at (0,-1) size 8x17
</span><span class="cx">                                                             text run at (0,-1) width 8: &quot;7&quot;
</span><del>-                                                    RenderMathMLOperator {mo} at (8,16) size 16x9
</del><ins>+                                                    RenderMathMLOperator {mo} at (8,15) size 16x9
</ins><span class="cx">                                                       RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
</span><span class="cx">                                                         RenderBlock (anonymous) at (0,0) size 9x9
</span><span class="cx">                                                           RenderText at (0,-4) size 9x17
</span><span class="cx">                                                             text run at (0,-4) width 9: &quot;+&quot;
</span><del>-                                                    RenderMathMLRoot {mroot} at (23,0) size 41x27
-                                                      RenderMathMLRootWrapper at (4,0) size 22x27
-                                                        RenderMathMLFraction {mfrac} at (1,0) size 19x17
-                                                          RenderMathMLBlock (anonymous, flex) at (0,0) size 19x9
-                                                            RenderMathMLRow {mrow} at (0,0) size 19x7
-                                                              RenderMathMLToken {mi} at (0,1) size 5x5 [padding: 0 1 0 0]
-                                                                RenderMathMLBlock (anonymous, flex) at (0,0) size 4x5
-                                                                  RenderBlock (anonymous) at (0,0) size 4x5
-                                                                    RenderText {#text} at (0,-3) size 4x10
-                                                                      text run at (0,-3) width 4: &quot;x&quot;
-                                                              RenderMathMLOperator {mo} at (4,0) size 10x6
-                                                                RenderMathMLBlock (anonymous, flex) at (2,0) size 5x6
-                                                                  RenderBlock (anonymous) at (0,0) size 5x6
-                                                                    RenderText at (0,-2) size 5x10
-                                                                      text run at (0,-2) width 5: &quot;+&quot;
-                                                              RenderMathMLToken {mi} at (13,1) size 6x6 [padding: 0 1 0 0]
-                                                                RenderMathMLBlock (anonymous, flex) at (0,0) size 4x6
-                                                                  RenderBlock (anonymous) at (0,0) size 4x6
-                                                                    RenderText {#text} at (0,-3) size 4x10
-                                                                      text run at (0,-3) width 4: &quot;y&quot;
-                                                          RenderMathMLBlock (anonymous, flex) at (0,8) size 19x9 [padding: 1 0 0 0]
-                                                            RenderMathMLToken {mi} at (7,2) size 5x6 [padding: 0 1 0 0]
</del><ins>+                                                    RenderMathMLRoot {mroot} at (23,0) size 39x27
+                                                      RenderMathMLRootWrapper at (4,0) size 20x27
+                                                        RenderMathMLFraction {mfrac} at (0,0) size 19x17
+                                                          RenderMathMLRow {mrow} at (0,0) size 19x7
+                                                            RenderMathMLToken {mi} at (0,1) size 5x5 [padding: 0 1 0 0]
</ins><span class="cx">                                                               RenderMathMLBlock (anonymous, flex) at (0,0) size 4x5
</span><span class="cx">                                                                 RenderBlock (anonymous) at (0,0) size 4x5
</span><span class="cx">                                                                   RenderText {#text} at (0,-3) size 4x10
</span><del>-                                                                    text run at (0,-3) width 4: &quot;z&quot;
-                                                      RenderMathMLBlock (anonymous, flex) at (16,0) size 13x27
</del><ins>+                                                                    text run at (0,-3) width 4: &quot;x&quot;
+                                                            RenderMathMLOperator {mo} at (4,0) size 10x6
+                                                              RenderMathMLBlock (anonymous, flex) at (2,0) size 5x6
+                                                                RenderBlock (anonymous) at (0,0) size 5x6
+                                                                  RenderText at (0,-2) size 5x10
+                                                                    text run at (0,-2) width 5: &quot;+&quot;
+                                                            RenderMathMLToken {mi} at (13,1) size 6x6 [padding: 0 1 0 0]
+                                                              RenderMathMLBlock (anonymous, flex) at (0,0) size 4x6
+                                                                RenderBlock (anonymous) at (0,0) size 4x6
+                                                                  RenderText {#text} at (0,-3) size 4x10
+                                                                    text run at (0,-3) width 4: &quot;y&quot;
+                                                          RenderMathMLToken {mi} at (7,11) size 5x6 [padding: 0 1 0 0]
+                                                            RenderMathMLBlock (anonymous, flex) at (0,0) size 4x5
+                                                              RenderBlock (anonymous) at (0,0) size 4x5
+                                                                RenderText {#text} at (0,-3) size 4x10
+                                                                  text run at (0,-3) width 4: &quot;z&quot;
+                                                      RenderMathMLBlock (anonymous, flex) at (14,0) size 13x27
</ins><span class="cx">                                                         RenderMathMLRadicalOperator (anonymous) at (0,9) size 12x18
</span><span class="cx">                                                           RenderMathMLBlock (anonymous, flex) at (0,0) size 9x18
</span><span class="cx">                                                             RenderBlock (anonymous) at (0,0) size 9x18
</span><span class="cx">                                                               RenderText at (0,1) size 9x17
</span><span class="cx">                                                                 text run at (0,1) width 9: &quot;\x{221A}&quot;
</span><del>-                                                      RenderMathMLRootWrapper at (28,12) size 12x15
</del><ins>+                                                      RenderMathMLRootWrapper at (26,12) size 12x15
</ins><span class="cx">                                                         RenderMathMLToken {mi} at (0,0) size 12x12 [padding: 0 2 0 0]
</span><span class="cx">                                                           RenderMathMLBlock (anonymous, flex) at (0,0) size 10x12
</span><span class="cx">                                                             RenderBlock (anonymous) at (0,0) size 10x12
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -787,6 +787,10 @@
</span><span class="cx"> webkit.org/b/72828 mathml/opentype/horizontal.html [ Failure ]
</span><span class="cx"> webkit.org/b/72828 mathml/opentype/horizontal-munderover.html [ Failure ]
</span><span class="cx"> 
</span><ins>+# These tests require the Latin Modern Math font.
+mathml/opentype/fraction-line.html [ Pass ImageOnlyFailure ]
+mathml/presentation/fractions-linethickness.html [ Pass ImageOnlyFailure ]
+
</ins><span class="cx"> # Missing references
</span><span class="cx"> webkit.org/b/119038 mathml/presentation/mo-stretch.html [ Failure ]
</span><span class="cx"> webkit.org/b/119038 mathml/presentation/roots.xhtml [ Failure ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/Source/WebCore/ChangeLog        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -1,3 +1,73 @@
</span><ins>+2016-04-11  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Refactor RenderMathMLFraction layout to avoid using flexbox
+        https://bugs.webkit.org/show_bug.cgi?id=153917
+
+        Reviewed by Sergio Villar Senin.
+
+        Based on a patch by Alejandro G. Castro &lt;alex@igalia.com&gt;
+
+        Implement the layoutBlock method to handle the layout calculations
+        directly in the class. This also fixes parsing of absolute values for
+        linethickness attribute (e.g. 10px) and adds support for the AxisHeight
+        and FractionRuleThickness MATH parameters.
+
+        Test: mathml/opentype/fraction-line.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::mathLineThickness): Use the thickness relative to the
+        default line thickness since that's really what is expected by mathml-line-fraction.html
+        * css/mathml.css: Remove flexbox properties for mfrac.
+        (mfrac): Deleted.
+        (mfrac &gt; *): Deleted.
+        (mfrac[numalign=&quot;left&quot;] &gt; :first-child): Deleted.
+        (mfrac[numalign=&quot;right&quot;] &gt; :first-child): Deleted.
+        (mfrac[denomalign=&quot;left&quot;] &gt; :last-child): Deleted.
+        (mfrac[denomalign=&quot;right&quot;] &gt; :last-child): Deleted.
+        (mfrac &gt; :first-child): Deleted.
+        (mfrac &gt; :last-child): Deleted.
+        (mfrac): Deleted.
+        * rendering/mathml/RenderMathMLBlock.cpp: Introduce a helper function to retrieve the math
+        axis height.
+        (WebCore::RenderMathMLBlock::mathAxisHeight):
+        * rendering/mathml/RenderMathMLBlock.h: Declare mathAxisHeight.
+        * rendering/mathml/RenderMathMLFraction.cpp:
+        (WebCore::RenderMathMLFraction::RenderMathMLFraction):
+        (WebCore::RenderMathMLFraction::parseAlignmentAttribute): Helper function to parse the align
+        attribute.
+        (WebCore::RenderMathMLFraction::isValid): Helper function to verify whether the child list
+        is valid with respect to the MathML specificitation.
+        (WebCore::RenderMathMLFraction::numerator): Helper function to retrieve the numerator.
+        (WebCore::RenderMathMLFraction::denominator): Helper function to retrieve the denominator.
+        (WebCore::RenderMathMLFraction::updateFromElement): Use the FractionRuleThickness parameter
+        when avaiable to calculate the default linethickness.
+        Fix computation of linethickness for absolute values (e.g. 10px), the default linethickness
+        must not be involved for such values.
+        We no longer need to manage style of anonymous wrappers.
+        (WebCore::RenderMathMLFraction::unembellishedOperator): Use the helper function and we no
+        longer care about anonymous wrappers.
+        (WebCore::RenderMathMLFraction::computePreferredLogicalWidths): Implement this function
+        without using flexbox.
+        (WebCore::RenderMathMLFraction::horizontalOffset): Helper function to get the horizontal
+        offsets of children depending of the alignment.
+        (WebCore::RenderMathMLFraction::layoutBlock): Implement this function without using flexbox.
+        (WebCore::RenderMathMLFraction::paint): Do not paint if the fraction is invalid. Use helper
+        function. Use the width of the renderer (instead of the one of the denominator) as the
+        length of the fraction bar.
+        (WebCore::RenderMathMLFraction::firstLineBaseline): Use the helper functions to get children
+        and axis height.
+        (WebCore::RenderMathMLFraction::paintChildren): Temporary function to remove in a
+        follow-up patch.
+        (WebCore::RenderMathMLFraction::fixChildStyle): Deleted. We no longer need to manage style
+        of anonymous wrappers.
+        (WebCore::RenderMathMLFraction::addChild): Deleted. We no longer need to manage
+        anonymous wrappers.
+        (WebCore::RenderMathMLFraction::styleDidChange): We no longer need to manage style of
+        anonymous wrappers.
+        (WebCore::RenderMathMLFraction::layout): Deleted.
+        * rendering/mathml/RenderMathMLFraction.h: Replace lineThickness with relativeLineThickness,
+        as needed by the accessibility code. Update function and members declarations.
+
</ins><span class="cx"> 2016-04-11  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r199290.
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -3997,7 +3997,7 @@
</span><span class="cx">     if (!is&lt;RenderMathMLFraction&gt;(m_renderer))
</span><span class="cx">         return -1;
</span><span class="cx">     
</span><del>-    return downcast&lt;RenderMathMLFraction&gt;(*m_renderer).lineThickness();
</del><ins>+    return downcast&lt;RenderMathMLFraction&gt;(*m_renderer).relativeLineThickness();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorecssmathmlcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/mathml.css (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/mathml.css        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/Source/WebCore/css/mathml.css        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -44,36 +44,10 @@
</span><span class="cx">     white-space: nowrap !important;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-mo, mfrac {
</del><ins>+mo {
</ins><span class="cx">     flex-direction: column;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-mfrac &gt; * {
-    align-self: center;
-}
-mfrac[numalign=&quot;left&quot;] &gt; :first-child {
-    align-self: flex-start;
-}
-mfrac[numalign=&quot;right&quot;] &gt; :first-child {
-    align-self: flex-end;
-}
-mfrac[denomalign=&quot;left&quot;] &gt; :last-child {
-    align-self: flex-start;
-}
-mfrac[denomalign=&quot;right&quot;] &gt; :last-child {
-    align-self: flex-end;
-}
-mfrac &gt; :first-child {
-    -webkit-margin-after: 0.2em;
-}
-mfrac &gt; :last-child {
-    -webkit-margin-before: 0.2em;
-}
-mfrac {
-    -webkit-margin-start: 1px;
-    -webkit-margin-end: 1px;
-}
-
</del><span class="cx"> msub &gt; * + *, msup &gt; * + *, msubsup &gt; * + *, mmultiscripts &gt; * + *, munder &gt; * + *, mover &gt; * + *, munderover &gt; * + * {
</span><span class="cx">     font-size: 0.75em; /* FIXME: MathML standard is 0.71em */
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -65,6 +65,15 @@
</span><span class="cx">     return newBlock;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LayoutUnit RenderMathMLBlock::mathAxisHeight() const
+{
+    const auto&amp; primaryFont = style().fontCascade().primaryFont();
+    if (auto* mathData = primaryFont.mathData())
+        return mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::AxisHeight);
+
+    return style().fontMetrics().xHeight() / 2;
+}
+
</ins><span class="cx"> int RenderMathMLBlock::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
</span><span class="cx"> {
</span><span class="cx">     // mathml.css sets math { -webkit-line-box-contain: glyphs replaced; line-height: 0; }, so when linePositionMode == PositionOfInteriorLineBoxes we want to
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.h (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.h        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.h        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -63,6 +63,8 @@
</span><span class="cx">     
</span><span class="cx">     // Create a new RenderMathMLBlock, with a new style inheriting from this-&gt;style().
</span><span class="cx">     RenderPtr&lt;RenderMathMLBlock&gt; createAnonymousMathMLBlock();
</span><ins>+
+    LayoutUnit mathAxisHeight() const;
</ins><span class="cx">     
</span><span class="cx"> protected:
</span><span class="cx">     static LayoutUnit ascentForChild(const RenderBox&amp; child)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLFractioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
</span><span class="cx">  * Copyright (C) 2010 François Sausset (sausset@gmail.com). All rights reserved.
</span><ins>+ * Copyright (C) 2016 Igalia S.L.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -38,133 +39,202 @@
</span><span class="cx">     
</span><span class="cx"> using namespace MathMLNames;
</span><span class="cx"> 
</span><ins>+// FIXME: The &quot;MathML in HTML5&quot; implementation note suggests the values 50% for &quot;thin&quot; and 200% for &quot;thick&quot; (http://webkit.org/b/155639).
</ins><span class="cx"> static const float gLineThin = 0.33f;
</span><span class="cx"> static const float gLineMedium = 1.f;
</span><span class="cx"> static const float gLineThick = 3.f;
</span><span class="cx"> static const float gFractionBarWidth = 0.05f;
</span><span class="cx"> 
</span><ins>+// FIXME: We should read the gaps and shifts from the MATH table (http://webkit.org/b/155639).
+static const float gNumeratorGap = 0.2f;
+static const float gDenominatorGap = 0.2f;
+
</ins><span class="cx"> RenderMathMLFraction::RenderMathMLFraction(MathMLInlineContainerElement&amp; element, Ref&lt;RenderStyle&gt;&amp;&amp; style)
</span><span class="cx">     : RenderMathMLBlock(element, WTFMove(style))
</span><del>-    , m_lineThickness(gLineMedium)
</del><ins>+    , m_defaultLineThickness(1)
+    , m_lineThickness(0)
+    , m_numeratorAlign(FractionAlignmentCenter)
+    , m_denominatorAlign(FractionAlignmentCenter)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLFraction::fixChildStyle(RenderObject* child)
</del><ins>+RenderMathMLFraction::FractionAlignment RenderMathMLFraction::parseAlignmentAttribute(const String&amp; value)
</ins><span class="cx"> {
</span><del>-    ASSERT(child-&gt;isAnonymous() &amp;&amp; child-&gt;style().refCount() == 1);
-    child-&gt;style().setFlexDirection(FlowColumn);
</del><ins>+    if (equalLettersIgnoringASCIICase(value, &quot;left&quot;))
+        return FractionAlignmentLeft;
+    if (equalLettersIgnoringASCIICase(value, &quot;right&quot;))
+        return FractionAlignmentRight;
+    return FractionAlignmentCenter;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-// FIXME: It's cleaner to only call updateFromElement when an attribute has changed. Move parts
-// of this to fixChildStyle or other methods, and call them when needed.
</del><ins>+bool RenderMathMLFraction::isValid() const
+{
+    // Verify whether the list of children is valid:
+    // &lt;mfrac&gt; numerator denominator &lt;/mfrac&gt;
+    RenderBox* child = firstChildBox();
+    if (!child)
+        return false;
+    child = child-&gt;nextSiblingBox();
+    return child &amp;&amp; !child-&gt;nextSiblingBox();
+}
+
+RenderBox&amp; RenderMathMLFraction::numerator() const
+{
+    ASSERT(isValid());
+    return *firstChildBox();
+}
+
+RenderBox&amp; RenderMathMLFraction::denominator() const
+{
+    ASSERT(isValid());
+    return *firstChildBox()-&gt;nextSiblingBox();
+}
+
</ins><span class="cx"> void RenderMathMLFraction::updateFromElement()
</span><span class="cx"> {
</span><del>-    // FIXME: mfrac where bevelled=true will need to reorganize the descendants
-    if (isEmpty()) 
</del><ins>+    if (isEmpty())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RenderObject* numeratorWrapper = firstChild();
-    RenderObject* denominatorWrapper = numeratorWrapper-&gt;nextSibling();
-    if (!denominatorWrapper)
-        return;
</del><ins>+    // We first determine the default line thickness.
+    const auto&amp; primaryFont = style().fontCascade().primaryFont();
+    if (auto* mathData = style().fontCascade().primaryFont().mathData())
+        m_defaultLineThickness = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::FractionRuleThickness);
+    else
+        m_defaultLineThickness = gFractionBarWidth * style().fontSize();
</ins><span class="cx"> 
</span><ins>+    // Next, we parse the linethickness attribute.
</ins><span class="cx">     String thickness = element().getAttribute(MathMLNames::linethicknessAttr);
</span><del>-    m_lineThickness = gLineMedium;
</del><span class="cx">     if (equalLettersIgnoringASCIICase(thickness, &quot;thin&quot;))
</span><del>-        m_lineThickness = gLineThin;
</del><ins>+        m_lineThickness = m_defaultLineThickness * gLineThin;
</ins><span class="cx">     else if (equalLettersIgnoringASCIICase(thickness, &quot;medium&quot;))
</span><del>-        m_lineThickness = gLineMedium;
</del><ins>+        m_lineThickness = m_defaultLineThickness * gLineMedium;
</ins><span class="cx">     else if (equalLettersIgnoringASCIICase(thickness, &quot;thick&quot;))
</span><del>-        m_lineThickness = gLineThick;
</del><ins>+        m_lineThickness = m_defaultLineThickness * gLineThick;
</ins><span class="cx">     else {
</span><del>-        // This function parses the thickness attribute using gLineMedium as
-        // the default value. If the parsing fails, m_lineThickness will not be
-        // modified i.e. the default value will be used.
</del><ins>+        // Parse the thickness using m_defaultLineThickness as the default value.
+        m_lineThickness = m_defaultLineThickness;
</ins><span class="cx">         parseMathMLLength(thickness, m_lineThickness, &amp;style(), false);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // Update the style for the padding of the denominator for the line thickness
-    lastChild()-&gt;style().setPaddingTop(Length(static_cast&lt;int&gt;(m_lineThickness), Fixed));
</del><ins>+    m_numeratorAlign = parseAlignmentAttribute(element().getAttribute(MathMLNames::numalignAttr));
+    m_denominatorAlign = parseAlignmentAttribute(element().getAttribute(MathMLNames::denomalignAttr));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLFraction::addChild(RenderObject* child, RenderObject* /* beforeChild */)
-{
-    if (isEmpty()) {
-        RenderPtr&lt;RenderMathMLBlock&gt; numeratorWrapper = createAnonymousMathMLBlock();
-        fixChildStyle(numeratorWrapper.get());
-        RenderMathMLBlock::addChild(numeratorWrapper.leakPtr());
-        
-        RenderPtr&lt;RenderMathMLBlock&gt; denominatorWrapper = createAnonymousMathMLBlock();
-        fixChildStyle(denominatorWrapper.get());
-        RenderMathMLBlock::addChild(denominatorWrapper.leakPtr());
-    }
-    
-    if (firstChild()-&gt;isEmpty())
-        downcast&lt;RenderElement&gt;(*firstChild()).addChild(child);
-    else
-        downcast&lt;RenderElement&gt;(*lastChild()).addChild(child);
-    
-    updateFromElement();
-}
-
</del><span class="cx"> void RenderMathMLFraction::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
</span><span class="cx"> {
</span><span class="cx">     RenderMathMLBlock::styleDidChange(diff, oldStyle);
</span><span class="cx">     
</span><del>-    for (RenderObject* child = firstChild(); child; child = child-&gt;nextSibling())
-        fixChildStyle(child);
</del><span class="cx">     updateFromElement();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderMathMLOperator* RenderMathMLFraction::unembellishedOperator()
</span><span class="cx"> {
</span><del>-    RenderObject* numeratorWrapper = firstChild();
-    if (!numeratorWrapper)
</del><ins>+    if (!isValid() || !is&lt;RenderMathMLBlock&gt;(numerator()))
</ins><span class="cx">         return nullptr;
</span><del>-    RenderObject* numerator = numeratorWrapper-&gt;firstChildSlow();
-    if (!is&lt;RenderMathMLBlock&gt;(numerator))
-        return nullptr;
-    return downcast&lt;RenderMathMLBlock&gt;(*numerator).unembellishedOperator();
</del><ins>+
+    return downcast&lt;RenderMathMLBlock&gt;(numerator()).unembellishedOperator();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLFraction::layout()
</del><ins>+void RenderMathMLFraction::computePreferredLogicalWidths()
</ins><span class="cx"> {
</span><ins>+    ASSERT(preferredLogicalWidthsDirty());
+
+    m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0;
+
+    if (isValid()) {
+        LayoutUnit numeratorWidth = numerator().maxPreferredLogicalWidth();
+        LayoutUnit denominatorWidth = denominator().maxPreferredLogicalWidth();
+        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = std::max(numeratorWidth, denominatorWidth);
+    }
+
+    setPreferredLogicalWidthsDirty(false);
+}
+
+LayoutUnit RenderMathMLFraction::horizontalOffset(RenderBox&amp; child, FractionAlignment align)
+{
+    switch (align) {
+    case FractionAlignmentRight:
+        return LayoutUnit(logicalWidth() - child.logicalWidth());
+    case FractionAlignmentCenter:
+        return LayoutUnit((logicalWidth() - child.logicalWidth()) / 2);
+    case FractionAlignmentLeft:
+        return LayoutUnit(0);
+    }
+
+    ASSERT_NOT_REACHED();
+    return LayoutUnit(0);
+}
+
+void RenderMathMLFraction::layoutBlock(bool relayoutChildren, LayoutUnit)
+{
+    ASSERT(needsLayout());
+
+    // FIXME: We should be able to remove this.
</ins><span class="cx">     updateFromElement();
</span><span class="cx"> 
</span><del>-    // Adjust the fraction line thickness for the zoom
-    if (lastChild() &amp;&amp; lastChild()-&gt;isRenderBlock())
-        m_lineThickness *= ceilf(gFractionBarWidth * style().fontSize());
</del><ins>+    if (!relayoutChildren &amp;&amp; simplifiedLayout())
+        return;
</ins><span class="cx"> 
</span><del>-    RenderMathMLBlock::layout();
</del><ins>+    if (!isValid()) {
+        setLogicalWidth(0);
+        setLogicalHeight(0);
+        clearNeedsLayout();
+        return;
+    }
+
+    LayoutUnit verticalOffset = 0;
+
+    numerator().layoutIfNeeded();
+    denominator().layoutIfNeeded();
+
+    setLogicalWidth(std::max&lt;LayoutUnit&gt;(numerator().logicalWidth(), denominator().logicalWidth()));
+
+    LayoutPoint numeratorLocation(horizontalOffset(numerator(), m_numeratorAlign), verticalOffset);
+    numerator().setLocation(numeratorLocation);
+
+    verticalOffset += numerator().logicalHeight() + gNumeratorGap * style().fontSize() + m_lineThickness + gDenominatorGap * style().fontSize();
+
+    LayoutPoint denominatorLocation(horizontalOffset(denominator(), m_denominatorAlign), verticalOffset);
+    denominator().setLocation(denominatorLocation);
+
+    setLogicalHeight(verticalOffset + denominator().logicalHeight());
+
+    clearNeedsLayout();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderMathMLFraction::paint(PaintInfo&amp; info, const LayoutPoint&amp; paintOffset)
</span><span class="cx"> {
</span><span class="cx">     RenderMathMLBlock::paint(info, paintOffset);
</span><del>-    if (info.context().paintingDisabled() || info.phase != PaintPhaseForeground || style().visibility() != VISIBLE)
</del><ins>+    if (info.context().paintingDisabled() || info.phase != PaintPhaseForeground || style().visibility() != VISIBLE || !isValid())
</ins><span class="cx">         return;
</span><del>-    
-    RenderBox* denominatorWrapper = lastChildBox();
-    if (!denominatorWrapper || !m_lineThickness)
-        return;
</del><span class="cx"> 
</span><del>-    IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location() + denominatorWrapper-&gt;location() + LayoutPoint(0, m_lineThickness / 2));
</del><ins>+    IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location() + LayoutPoint(0, numerator().logicalHeight() + gNumeratorGap * style().fontSize() + m_lineThickness / 2));
</ins><span class="cx">     
</span><span class="cx">     GraphicsContextStateSaver stateSaver(info.context());
</span><span class="cx">     
</span><span class="cx">     info.context().setStrokeThickness(m_lineThickness);
</span><span class="cx">     info.context().setStrokeStyle(SolidStroke);
</span><span class="cx">     info.context().setStrokeColor(style().visitedDependentColor(CSSPropertyColor));
</span><del>-    info.context().drawLine(adjustedPaintOffset, roundedIntPoint(LayoutPoint(adjustedPaintOffset.x() + denominatorWrapper-&gt;offsetWidth(), adjustedPaintOffset.y())));
</del><ins>+    info.context().drawLine(adjustedPaintOffset, roundedIntPoint(LayoutPoint(adjustedPaintOffset.x() + logicalWidth(), adjustedPaintOffset.y())));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Optional&lt;int&gt; RenderMathMLFraction::firstLineBaseline() const
</span><span class="cx"> {
</span><del>-    if (RenderBox* denominatorWrapper = lastChildBox())
-        return Optional&lt;int&gt;(denominatorWrapper-&gt;logicalTop() + static_cast&lt;int&gt;(lroundf((m_lineThickness + style().fontMetrics().xHeight()) / 2)));
</del><ins>+    if (isValid()) {
+        LayoutUnit axisHeight = mathAxisHeight();
+        return Optional&lt;int&gt;(numerator().logicalHeight() + gNumeratorGap * style().fontSize() + static_cast&lt;int&gt;(lroundf(m_lineThickness / 2 + axisHeight)));
+    }
</ins><span class="cx">     return RenderMathMLBlock::firstLineBaseline();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RenderMathMLFraction::paintChildren(PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset, PaintInfo&amp; paintInfoForChild, bool usePrintRect)
+{
+    for (RenderBox* child = firstChildBox(); child; child = child-&gt;nextSiblingBox()) {
+        if (!paintChild(*child, paintInfo, paintOffset, paintInfoForChild, usePrintRect, PaintAsInlineBlock))
+            return;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> #endif // ENABLE(MATHML)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLFractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.h (199294 => 199295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.h        2016-04-11 12:46:30 UTC (rev 199294)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.h        2016-04-11 15:38:46 UTC (rev 199295)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
</span><span class="cx">  * Copyright (C) 2010 François Sausset (sausset@gmail.com). All rights reserved.
</span><ins>+ * Copyright (C) 2016 Igalia S.L.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -39,23 +40,39 @@
</span><span class="cx">     RenderMathMLFraction(MathMLInlineContainerElement&amp;, Ref&lt;RenderStyle&gt;&amp;&amp;);
</span><span class="cx"> 
</span><span class="cx">     MathMLInlineContainerElement&amp; element() { return static_cast&lt;MathMLInlineContainerElement&amp;&gt;(nodeForNonAnonymous()); }
</span><del>-    float lineThickness() const { return m_lineThickness; }
</del><ins>+    float relativeLineThickness() const { return m_defaultLineThickness ? m_lineThickness / m_defaultLineThickness : LayoutUnit(0); }
</ins><span class="cx"> 
</span><ins>+    void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) final;
+    void paintChildren(PaintInfo&amp; forSelf, const LayoutPoint&amp;, PaintInfo&amp; forChild, bool usePrintRect) final;
+
+protected:
+    void computePreferredLogicalWidths() final;
+
</ins><span class="cx"> private:
</span><del>-    bool isRenderMathMLFraction() const override { return true; }
-    const char* renderName() const override { return &quot;RenderMathMLFraction&quot;; }
</del><ins>+    bool isRenderMathMLFraction() const final { return true; }
+    const char* renderName() const final { return &quot;RenderMathMLFraction&quot;; }
</ins><span class="cx"> 
</span><del>-    void addChild(RenderObject* child, RenderObject* beforeChild) override;
-    void updateFromElement() override;
-    Optional&lt;int&gt; firstLineBaseline() const override;
-    void paint(PaintInfo&amp;, const LayoutPoint&amp;) override;
-    RenderMathMLOperator* unembellishedOperator() override;
-    void layout() override;
-    void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
</del><ins>+    void updateFromElement() final;
+    Optional&lt;int&gt; firstLineBaseline() const final;
+    void paint(PaintInfo&amp;, const LayoutPoint&amp;) final;
+    RenderMathMLOperator* unembellishedOperator() final;
+    void styleDidChange(StyleDifference, const RenderStyle* oldStyle) final;
+    
+    bool isValid() const;
+    RenderBox&amp; numerator() const;
+    RenderBox&amp; denominator() const;
+    enum FractionAlignment {
+        FractionAlignmentCenter,
+        FractionAlignmentLeft,
+        FractionAlignmentRight
+    };
+    FractionAlignment parseAlignmentAttribute(const String&amp; value);
+    LayoutUnit horizontalOffset(RenderBox&amp;, FractionAlignment);
</ins><span class="cx"> 
</span><del>-    void fixChildStyle(RenderObject*);
-    
</del><ins>+    LayoutUnit m_defaultLineThickness;
</ins><span class="cx">     LayoutUnit m_lineThickness;
</span><ins>+    FractionAlignment m_numeratorAlign;
+    FractionAlignment m_denominatorAlign;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>

</body>
</html>