<!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>[199665] 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/199665">199665</a></dd>
<dt>Author</dt> <dd>fred.wang@free.fr</dd>
<dt>Date</dt> <dd>2016-04-18 07:45:00 -0700 (Mon, 18 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Refactor RenderMathMLScripts 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-18
Reviewed by Martin Robinson.

Source/WebCore:

Tests: mathml/mathml-in-html5/subsup-parameters-1.html
       mathml/opentype/large-operators-italic-correction.html

Reimplement RenderMathMLScripts without any flexbox or anonymous.
We also rely on parameters from the MATH table to improve rendering.

* css/mathml.css:
(msub &gt; * + * + *, msup &gt; * + * + *, msubsup &gt; * + * + * + *, msub &gt; mprescripts, msup &gt; mprescripts, msubsup &gt; mprescripts, msub &gt; none, msup &gt; none, msubsup &gt; none, mmultiscripts &gt; mprescripts ~ mprescripts, mmultiscripts &gt; mprescripts ~ mprescripts ~ *): Deleted.
Invalid markup for scripts is now just hidden.
* rendering/mathml/RenderMathMLOperator.h: ditto.
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::unembellishedOperator): Reimplemented.
(WebCore::RenderMathMLScripts::getBaseAndScripts): Helper function to verify whether the
child list is valid and retrieve pointers on important children.
(WebCore::RenderMathMLScripts::spaceAfterScript): Helper function to get the
space after a script.
(WebCore::RenderMathMLScripts::italicCorrection): Helper function to read the
italic correction of a largeop base.
(WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Implement this function.
(WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): Helper function to get
the maximum ascent/descent of all the scripts and determine the minimal
sub/sup shifts to apply.
(WebCore::RenderMathMLScripts::mirrorIfNeeded): Helper function to calculate the horizontal
offset depending on the directionality.
(WebCore::RenderMathMLScripts::layoutBlock): Implement this function.
(WebCore::RenderMathMLScripts::firstLineBaseline): Implement this function.
(WebCore::RenderMathMLScripts::paintChildren): Implement this function.
(WebCore::RenderMathMLScripts::RenderMathMLScripts): Deleted.
(WebCore::RenderMathMLScripts::base): Deleted.
(WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair): Deleted.
(WebCore::RenderMathMLScripts::fixAnonymousStyles): Deleted.
(WebCore::RenderMathMLScripts::addChildInternal): Deleted.
(WebCore::RenderMathMLScripts::removeChildInternal): Deleted.
(WebCore::RenderMathMLScripts::addChild): Deleted.
(WebCore::RenderMathMLScripts::removeChild): Deleted.
(WebCore::RenderMathMLScripts::styleDidChange): Deleted.
(WebCore::RenderMathMLScripts::layout): Deleted.
(WebCore::RenderMathMLScriptsWrapper::createAnonymousWrapper): Deleted.
(WebCore::RenderMathMLScriptsWrapper::addChildInternal): Deleted.
(WebCore::RenderMathMLScriptsWrapper::addChild): Deleted.
(WebCore::RenderMathMLScriptsWrapper::removeChildInternal): Deleted.
(WebCore::RenderMathMLScriptsWrapper::removeChild): Deleted.
* rendering/mathml/RenderMathMLScripts.h: Update definitions and remove classes
for anonymous wrappers.

LayoutTests:

We import tests from the MathML in HTML5 test suite to verify various OpenType MATH parameters.
We also add a test for the italic correction of large operators (bug 130325).
Finally, we adjust some tests and expectations to take into account the new rendering.

* imported/mathml-in-html5/LICENSE: Added.
* imported/mathml-in-html5/README.md: Added.
* imported/mathml-in-html5/fonts/math/scripts-spaceafterscript3000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-spaceafterscript3000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subscriptbaselinedropmin9000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subscriptbaselinedropmin9000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subscriptshiftdown6000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subscriptshiftdown6000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subscripttopmax4000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subscripttopmax4000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000-superscriptbottommaxwithsubscript3000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subsuperscriptgapmin11000-superscriptbottommaxwithsubscript3000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subsuperscriptgapmin11000.woff.
* imported/mathml-in-html5/fonts/math/scripts-superscriptbaselinedropmax10000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptbaselinedropmax10000.woff.
* imported/mathml-in-html5/fonts/math/scripts-superscriptbottommin8000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptbottommin8000.woff.
* imported/mathml-in-html5/fonts/math/scripts-superscriptshiftup7000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptshiftup7000.woff.
* imported/mathml-in-html5/fonts/math/scripts-superscriptshiftupcramped5000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptshiftupcramped5000.woff.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1-expected.txt: Renamed from LayoutTests/mathml/mathml-in-html5/subsup-parameters-1-expected.txt.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1.html: Renamed from LayoutTests/mathml/mathml-in-html5/subsup-parameters-1.html.
* mathml/msubsup-fuzz-expected.txt: Test adjustment: Update the reference now that nothing
is displayed for invalid markup.
* accessibility/mac/mathml-multiscript-expected.txt: ditto.
* mathml/opentype/large-operators-italic-correction.html: Added. This test verifies that the
italic correction from the MATH table is used for positioning subscripts of large operators.
* mathml/opentype/large-operators-italic-correction-expected.txt: Added.
* mathml/presentation/bug95015.html: Test adjustment: move down a bit the covering red
rectangle, since the script is slightly lower.
* mathml/presentation/bug95015-expected.html: ditto
* mathml/presentation/multiscripts-positions.html: Test adjustment: Modify the expected
vertical positions of scripts now that we follow Gecko's behavior.
* mathml/presentation/multiscripts-positions-expected.html: ditto.
* mathml/presentation/multiscripts-noscripts-expected.html: There seem to be small errors in
the ascent of mmultiscripts, probably due to the conversions between firstLineBaseline (int)
and LayoutUnit (fractional pixel). For now, let's tweak the tests.
* mathml/presentation/multiscripts-noscripts.html: ditto.
* mathml/presentation/scripts-height-expected.html: ditto
* mathml/presentation/scripts-height.html: ditto
* mathml/presentation/scripts-horizontal-alignment.html: Modify the test to make it work
with the new layout rules.
* mathml/presentation/scripts-horizontal-alignment-expected.html: ditto.
* platform/gtk/accessibility/math-multiscript-attributes-expected.txt: Test adjustment:
Update reference to take into account a small shift.
* platform/mac/accessibility/math-multiscript-attributes-expected.txt: ditto.
* platform/gtk/mathml/presentation/roots-expected.png: Test adjustment: Update reference to
take into account small rendering changes.
* platform/gtk/mathml/presentation/roots-expected.txt: ditto.
* platform/ios-simulator/mathml/presentation/roots-expected.txt: ditto.
* platform/mac/TestExpectations: Mark some tests for scripts as failing on mac. MATH fonts
are really needed to make them reliable.
* platform/ios-simulator/TestExpectations: Ditto</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacmathmlmultiscriptexpectedtxt">trunk/LayoutTests/accessibility/mac/mathml-multiscript-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymathmultiscriptattributesexpectedtxt">trunk/LayoutTests/accessibility/math-multiscript-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmathmlmsubsupfuzzexpectedtxt">trunk/LayoutTests/mathml/msubsup-fuzz-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationbug95015expectedhtml">trunk/LayoutTests/mathml/presentation/bug95015-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationbug95015html">trunk/LayoutTests/mathml/presentation/bug95015.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationmultiscriptsnoscriptsexpectedhtml">trunk/LayoutTests/mathml/presentation/multiscripts-noscripts-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationmultiscriptsnoscriptshtml">trunk/LayoutTests/mathml/presentation/multiscripts-noscripts.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationmultiscriptspositionsexpectedhtml">trunk/LayoutTests/mathml/presentation/multiscripts-positions-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationmultiscriptspositionshtml">trunk/LayoutTests/mathml/presentation/multiscripts-positions.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationscriptsheightexpectedhtml">trunk/LayoutTests/mathml/presentation/scripts-height-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationscriptsheighthtml">trunk/LayoutTests/mathml/presentation/scripts-height.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationscriptshorizontalalignmentexpectedhtml">trunk/LayoutTests/mathml/presentation/scripts-horizontal-alignment-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationscriptshorizontalalignmenthtml">trunk/LayoutTests/mathml/presentation/scripts-horizontal-alignment.html</a></li>
<li><a href="#trunkLayoutTestsplatformgtkaccessibilitymathmultiscriptattributesexpectedtxt">trunk/LayoutTests/platform/gtk/accessibility/math-multiscript-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformgtkmathmlpresentationrootsexpectedpng">trunk/LayoutTests/platform/gtk/mathml/presentation/roots-expected.png</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="#trunkSourceWebCorecssmathmlcss">trunk/Source/WebCore/css/mathml.css</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLScriptscpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLScriptsh">trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/imported/mathml-in-html5/</li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5LICENSE">trunk/LayoutTests/imported/mathml-in-html5/LICENSE</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5READMEmd">trunk/LayoutTests/imported/mathml-in-html5/README.md</a></li>
<li>trunk/LayoutTests/imported/mathml-in-html5/fonts/</li>
<li>trunk/LayoutTests/imported/mathml-in-html5/fonts/math/</li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptsspaceafterscript3000woff">trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-spaceafterscript3000.woff</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssubscriptbaselinedropmin9000woff">trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subscriptbaselinedropmin9000.woff</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssubscriptshiftdown6000woff">trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subscriptshiftdown6000.woff</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssubscripttopmax4000woff">trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subscripttopmax4000.woff</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssubsuperscriptgapmin11000superscriptbottommaxwithsubscript3000woff">trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000-superscriptbottommaxwithsubscript3000.woff</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssubsuperscriptgapmin11000woff">trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000.woff</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssuperscriptbaselinedropmax10000woff">trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptbaselinedropmax10000.woff</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssuperscriptbottommin8000woff">trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptbottommin8000.woff</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssuperscriptshiftup7000woff">trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptshiftup7000.woff</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssuperscriptshiftupcramped5000woff">trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptshiftupcramped5000.woff</a></li>
<li>trunk/LayoutTests/imported/mathml-in-html5/mathml/</li>
<li>trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/</li>
<li>trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/</li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5mathmlpresentationmarkupscriptssubsupparameters1expectedtxt">trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5mathmlpresentationmarkupscriptssubsupparameters1html">trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1.html</a></li>
<li><a href="#trunkLayoutTestsmathmlopentypelargeoperatorsitaliccorrectionexpectedtxt">trunk/LayoutTests/mathml/opentype/large-operators-italic-correction-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmathmlopentypelargeoperatorsitaliccorrectionhtml">trunk/LayoutTests/mathml/opentype/large-operators-italic-correction.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/ChangeLog        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -1,3 +1,60 @@
</span><ins>+2016-04-18  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Refactor RenderMathMLScripts layout to avoid using flexbox
+        https://bugs.webkit.org/show_bug.cgi?id=153917
+
+        Reviewed by Martin Robinson.
+
+        We import tests from the MathML in HTML5 test suite to verify various OpenType MATH parameters.
+        We also add a test for the italic correction of large operators (bug 130325).
+        Finally, we adjust some tests and expectations to take into account the new rendering.
+
+        * imported/mathml-in-html5/LICENSE: Added.
+        * imported/mathml-in-html5/README.md: Added.
+        * imported/mathml-in-html5/fonts/math/scripts-spaceafterscript3000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-spaceafterscript3000.woff.
+        * imported/mathml-in-html5/fonts/math/scripts-subscriptbaselinedropmin9000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subscriptbaselinedropmin9000.woff.
+        * imported/mathml-in-html5/fonts/math/scripts-subscriptshiftdown6000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subscriptshiftdown6000.woff.
+        * imported/mathml-in-html5/fonts/math/scripts-subscripttopmax4000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subscripttopmax4000.woff.
+        * imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000-superscriptbottommaxwithsubscript3000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subsuperscriptgapmin11000-superscriptbottommaxwithsubscript3000.woff.
+        * imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subsuperscriptgapmin11000.woff.
+        * imported/mathml-in-html5/fonts/math/scripts-superscriptbaselinedropmax10000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptbaselinedropmax10000.woff.
+        * imported/mathml-in-html5/fonts/math/scripts-superscriptbottommin8000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptbottommin8000.woff.
+        * imported/mathml-in-html5/fonts/math/scripts-superscriptshiftup7000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptshiftup7000.woff.
+        * imported/mathml-in-html5/fonts/math/scripts-superscriptshiftupcramped5000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptshiftupcramped5000.woff.
+        * imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1-expected.txt: Renamed from LayoutTests/mathml/mathml-in-html5/subsup-parameters-1-expected.txt.
+        * imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1.html: Renamed from LayoutTests/mathml/mathml-in-html5/subsup-parameters-1.html.
+        * mathml/msubsup-fuzz-expected.txt: Test adjustment: Update the reference now that nothing
+        is displayed for invalid markup.
+        * accessibility/mac/mathml-multiscript-expected.txt: ditto.
+        * mathml/opentype/large-operators-italic-correction.html: Added. This test verifies that the
+        italic correction from the MATH table is used for positioning subscripts of large operators.
+        * mathml/opentype/large-operators-italic-correction-expected.txt: Added.
+        * mathml/presentation/bug95015.html: Test adjustment: move down a bit the covering red
+        rectangle, since the script is slightly lower.
+        * mathml/presentation/bug95015-expected.html: ditto
+        * mathml/presentation/multiscripts-positions.html: Test adjustment: Modify the expected
+        vertical positions of scripts now that we follow Gecko's behavior.
+        * mathml/presentation/multiscripts-positions-expected.html: ditto.
+        * mathml/presentation/multiscripts-noscripts-expected.html: There seem to be small errors in
+        the ascent of mmultiscripts, probably due to the conversions between firstLineBaseline (int)
+        and LayoutUnit (fractional pixel). For now, let's tweak the tests.
+        * mathml/presentation/multiscripts-noscripts.html: ditto.
+        * mathml/presentation/scripts-height-expected.html: ditto
+        * mathml/presentation/scripts-height.html: ditto
+        * mathml/presentation/scripts-horizontal-alignment.html: Modify the test to make it work
+        with the new layout rules.
+        * mathml/presentation/scripts-horizontal-alignment-expected.html: ditto.
+        * platform/gtk/accessibility/math-multiscript-attributes-expected.txt: Test adjustment:
+        Update reference to take into account a small shift.
+        * platform/mac/accessibility/math-multiscript-attributes-expected.txt: ditto.
+        * platform/gtk/mathml/presentation/roots-expected.png: Test adjustment: Update reference to
+        take into account small rendering changes.
+        * platform/gtk/mathml/presentation/roots-expected.txt: ditto.
+        * platform/ios-simulator/mathml/presentation/roots-expected.txt: ditto.
+        * platform/mac/TestExpectations: Mark some tests for scripts as failing on mac. MATH fonts
+        are really needed to make them reliable.
+        * platform/ios-simulator/TestExpectations: Ditto
+
</ins><span class="cx"> 2016-04-18  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [css-grid] Use grid-template-areas to determine the explicit grid
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacmathmlmultiscriptexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/mac/mathml-multiscript-expected.txt (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/mathml-multiscript-expected.txt        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/accessibility/mac/mathml-multiscript-expected.txt        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -2,35 +2,15 @@
</span><span class="cx"> 1
</span><span class="cx"> 2
</span><span class="cx">  
</span><del>-A
-1
-2
-3
</del><span class="cx">  
</span><span class="cx"> A
</span><span class="cx"> 4
</span><span class="cx"> 5
</span><span class="cx">  
</span><del>-A
-4
-5
-6
</del><span class="cx">  
</span><del>-A
-1
-2
-3
-4
-5
-6
</del><span class="cx">  
</span><span class="cx"> A
</span><span class="cx">  
</span><del>-A
-1
-3
-5
-6
</del><span class="cx"> This tests checks that mmultiscript tags will create the correct accessibility math hierarchy.
</span><span class="cx"> 
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymathmultiscriptattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/math-multiscript-attributes-expected.txt (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/math-multiscript-attributes-expected.txt        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/accessibility/math-multiscript-attributes-expected.txt        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx"> AXChildren: 
</span><span class="cx"> AXHelp: 
</span><span class="cx"> AXParent: 
</span><del>-AXSize: NSSize: {12, 24}
</del><ins>+AXSize: NSSize: {12, 25}
</ins><span class="cx"> AXTitle: 
</span><span class="cx"> AXDescription: 
</span><span class="cx"> AXValue: 
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx"> AXChildren: 
</span><span class="cx"> AXHelp: 
</span><span class="cx"> AXParent: 
</span><del>-AXSize: NSSize: {9, 19}
</del><ins>+AXSize: NSSize: {10, 19}
</ins><span class="cx"> AXTitle: 
</span><span class="cx"> AXDescription: 
</span><span class="cx"> AXValue: 
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> AXChildren: 
</span><span class="cx"> AXHelp: 
</span><span class="cx"> AXParent: 
</span><del>-AXSize: NSSize: {9, 18}
</del><ins>+AXSize: NSSize: {10, 18}
</ins><span class="cx"> AXTitle: 
</span><span class="cx"> AXDescription: 
</span><span class="cx"> AXValue: 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5LICENSE"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/LICENSE (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/LICENSE                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/LICENSE        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+This repository is covered by the dual-licensing approach described in:
+
+    http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5READMEmd"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/README.md (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/README.md                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/README.md        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+# Tests for the MathML in HTML5 implementation note
+
+This repository contains tests for the
+[MathML in HTML5 implementation note](http://www.mathml-association.org/MathMLinHTML5/).
+We follow the formats and conventions of
+[W3C's Test the Web Forward Project](http://testthewebforward.org/),
+please read their documentation for details. The main goals are:
+- helping implementers to verify conformance with the technical description
+  given in the MathML in HTML5 note.
+- provide a set of automatable tests to integrate into the testing framework of
+  web browser developers.
+
+## Installation
+
+You must at least install [git](http://git-scm.com/) and
+[python](http://python.org/). Clone the repository with
+
+    $ git clone --recursive https://github.com/username/MathMLinHTML5-tests.git
+
+If you cloned the repository without --recursive, you will likely have empty
+`resources` and `tools` directories at the root of your cloned repo. You can
+clone the submodules with these additional steps:
+
+    $ cd MathMLinHTML5-tests
+    $ git submodule update --init --recursive
+
+Next, generate the MANIFEST.json file with the following command:
+
+    $ python tools/manifest/update.py
+
+To verify the tests in your browser, you also need to setup a web server whose
+root points to the root of the cloned repo. For a quick setup, you can just run
+the `serve.py` Python script at the root:
+
+    $ python server.py
+
+Finally, open `index.html` at the web server root to get an overview of all the
+tests. Using W3C's wptserve has not been tried but the tests can easily be
+imported into other automated testing framework anyway.
+
+## Note on Web fonts
+
+Many of the tests verify OpenType features and require specific Web fonts for
+that purpose. WOFF fonts are generated using the Python API of
+[fontforge](https://github.com/fontforge/fontforge/). A recent enough version
+of FontForge is necessary so that it includes fixes for [WOFF checkSumAdjustment](https://github.com/fontforge/fontforge/issues/926), [USE_TYPO_METRICS flag](https://github.com/fontforge/fontforge/pull/2274) and various bugs in OpenType
+MATH.
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptsspaceafterscript3000woff"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-spaceafterscript3000.woff (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-spaceafterscript3000.woff                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-spaceafterscript3000.woff        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+wOFFOTTO\x90 \x98CFF &lt;\xC1\xF3\xD9pMFFTMyS\xE1\xDAMATHiX*OS/2X&gt;`
+\xF0cmap\xEC7B+\xC6head*6]\xFBOhhea4$O\xDFhmtx\x88\xD0maxpPPname\x98QB\xDFJ\x94\x98post$ \xFF\x863x\x9Cc`d``\xE2uO\xC7\xF3\xDB|e\xE0f~a\xB8,\xD7\x99\x86&amp;2\xF1        x\x9Cc`d``\xFC\xC2\xF8\x85!\x8A\xF902\xA0&amp;Z&lt;4Px\x9Cc`a~\xC18\x81\x81\x95\x81\x81\xA9\x8BiC\x84f|\xC0`\xC8\xC8e`\xE5d\x80Ft\xD0\xC0\xA0\xC0\xA0\xC0\xF8\x85\xF1 C\x86\xA0 #)        x\x9C\xB5\x91\xBFj\xC30\xC6?;h;\x943h)$Pن\x90:\x84@\x86\x92\xACٍqb-\x91\xB0%}\xA6ҥOч\xE9\xD4\xE8g[\x85 \xA5\x94B,$\xFD\xA4\xBB\xEF|wp\x8DWh\xBF;\xAC=\xE0\xC5s\x88[|z\xEE`&lt;{\xEEb|x\xEE\xE1&amp;\xBC\xF7\xDC\xC7 |\xA2gн\xE4\xE9\xB1Q\xD5`\x8A\xCAs\x88!\xDE=w`\x82 \xCF]\xC6\xF3܃\xAF&lt;\xF71+\xB0\x84\x86\xC1\x91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pč\x
 B0cFQ\x86\xBFW\x81l1 \xAD\xA4\xC1&amp;0\x82!*O\x88y\x84$\xE4p\xBA
+\xA2R\xA8B\xCC\xE2\x9B \x85\xD1HXJ @\xE8\xE8
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssubscriptbaselinedropmin9000woff"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subscriptbaselinedropmin9000.woff (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subscriptbaselinedropmin9000.woff                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subscriptbaselinedropmin9000.woff        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+wOFFOTTO\xB0         (CFF T\xC9 \x8Bc\xAC\xC8FFTM yS\xE1\xDAMATH&lt;jX0\x9AOS/2X&gt;`
+\xF0cmap7B+\xC6head*6]\xFBOhhea4$O\xDFhmtx\xA8\xD0maxpPPname\x98i\xBAY\xFB\xB2post&lt; \xFF\x863x\x9Cc`d``\xE2\xD0\xE5-\x92\xF1\xFC6_\xB8\x99_E.\xCB\xDF5E\xA6\xA1\x80\x83\x81        D\xBCCx\x9Cc`d``\xFC\xC2\xF8\x85!\x8A\xF902\xA0&amp;Z&lt;4Px\x9Cc`a~\xC18\x81\x81\x95\x81\x81\xA9\x8BiC\x84f|\xC0`\xC8\xC8e`\xE5d\x80Ft\xD0\xC0\xA0\xC0\xA0\xC0\xF8\x85\xF1 C\x86\xA0 #)        x\x9C\xBD\x92\xBFN\xC30\xC6?\xA7$\xC4\x83\x87&quot;\xB5C\xAA$\x95\xAA\xB6UEU\xA1v힤Qc\xD4Ƒ\x9D\xDDx^\x81W\xE0/\xC3\xC4C\xB0pv\xCC\xC0\x82B\x8De\xDD\xEF\xEC\xBB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99X\x92\x99\x9FG\x8C#\x88r(02012*)w\xEF\xFD^\xBB\x97q\xEFޟ[\xF62\xEF\xFB%\xF1
 \xFD\xE1?        \xB6\xBD\xBF׋~\xAF\xFD\xB9\xE5w-;߯\x91n\xD1n.\x99RY!x\x9Cc```d\x82\xCB&quot;\xEA\xF9`Z\xFE\xAE)\x8C7\x9A\x87x\x9Cc`d``\xE0bx\xC0\xA8\xC7\xC0`\xC3z\x87'P\xD6\xC0-G\x98\xC6\xC0\xC0G\x84:#\x88Z0+c#\x99\x81&quot;n\x843\x8A20\xFC\xBD
+d\xDB0p0\x88i \xCD6\x81 Qy*@\xCC\xC3 \xC4 \xC1 \x87\xD3U\x95&quot;@*`\xD8\\x88(\x8CF\x82\xE0\x8F \xC8\xE8\xE8
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssubscriptshiftdown6000woff"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subscriptshiftdown6000.woff (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subscriptshiftdown6000.woff                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subscriptshiftdown6000.woff        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+wOFFOTTO\x94 \xBCCFF @\xC2\xF9`76FFTMyS\xE1\xDAMATH jX$\xE2OS/2X&gt;`
+\xF0cmap\xF07B+\xC6head*6]\xFBOhhea4$O\xDFhmtx\x8C\xD0maxpPPname\x98X`t\x84\xBA\xB7post( \xFF\x863x\x9Cc`d``ⲷ\xD3\xE3\xF9m\xBE2p3\xBF\x8A0\\x96\xBFk\x8ALC\x885\xCE        %x\x9Cc`d``\xFC\xC2\xF8\x85!\x8A\xF902\xA0&amp;Z&lt;4Px\x9Cc`a~\xC18\x81\x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6-.M\x82232\xD3JR\xF2\xCB\xF3\xCC \x99\xB4\xF03\xFC\x90f\xFC!\xC3\xF4C\x96\xF9\x87Kc7\xB0\xCA0\xE3\x97a`\x90a8)(\xC3\xC0!\xC3\xF0Q\x88\x81\xA4A\x8D\xC1\x85!\xC99\xBF\xA0\xB2(3=\xA3DA#YS\xC1\xC8\xC0\xD0L\xC17\xB1$\xC3\xD7G\xC1\xB1\xB88
 ?93\xB1$3?\xBF\xF5\x8C L\x8C\x8CJ\xCA\xDD{\xBF\xD7\xEEeܻ\xF7疽\xCC{\xC5~I|\xF8O\x82m\xEF\xEF\xF5\xA2\xDFkn\xF9]\xCB\xCE\xC7\xF7\xABF\xA4[\xB4\x9B\x87 \xAB\xA0R\x97x\x9Cc```d\x82\xCB&quot;\xEA\xF9`Z\xFE\xAE)\x8C7\x9A\x87x\x9Cc`d``\xE0bx\xC0\xA8\xC7\xC0`\xC3z\x87\x88`\x8A\x91\xA6100\xC6\xA1\xCE\xA2L\xC3\xD8Hf\xA0\x88anj\xA2 \xAF\xD96  b@ZH3\x82M`CT\x9E
+\xF301H0\xC8\xE1tD\xA5P\x85
+\x98\xC56&quot;
+\xA3\x91 +V \xE8\xE8
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssubscripttopmax4000woff"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subscripttopmax4000.woff (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subscripttopmax4000.woff                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subscripttopmax4000.woff        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+wOFFOTTO\x88 \x84CFF 8\xC0\xF0w\xAF\xED\xD6FFTM\xF8yS\xE1\xDAMATHjXOS/2X&gt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C0zk,\xFFI\x99 댮\x92\xC6'葜(x\x9Cc```f\x80`F\xB0\xF2\xC1| \xCD\x84 \xBE\xC2\xFF\xFF\xF2\xFFC\xA8JF6' $?\xD4Ya\xD3x\x9Cc`f\x83\xFF\xCD F@\x8A\x91+(U\xB9x\x9Ccd`aa`dd\x94)N.\xCA,()\xD6-.M\x820K\xF2 r+L \x99\xB4\xF03\xFC\x90f\xFC!\xC3\xF4C\x96\xF9\x87Kc7\xB0\xCA0\xEC\xE5\x97a`\x90a8 (\xC3\xC0!\xC3\xF0B\x88\x81\xA4A\x8D\xC1\x91!\xC69\xBF\xA0\xB2(3=\xA3DA#YS\xC1\xC8\xC0\xD0L\xC17\xB1$\xC3\xD7G\xC1\xB1\xB88?93\xB1$3?\x8F\xDD\xF8\x9C\x8C L\x8C\x8CJ\xCA\xDD{\xBF\xD7\xEEeܻ\xF7疽\xCC{\xC5~I|\xF8O\x82m\xEF\xEF\xF5\xA2\xDFkn\x
 F9]\xCB\xCE\xC7\xF7\xABF\xA4[\xB4\x9B\x87 \x82GN\xB3x\x9Cc```d\x82\xCB&quot;\xEA\xF9`Z\xFE\xAE)\x8C7\x9A\x87x\x9Cc`d``\xE0bx\xC0\xA8\xC7\xC0`\xC3z\x87+\xE0_\x80]\x9C$0\x8D\x81\x811\x8EuF\xB5`\xC6F2E\xDC;fe`\xF8{ȶa\xE0`\xD2*@\x9Al#\xA2\xF2T\x80\x98\x87A\x88A\x82A\xA7\xAB *E\x80*T\xC0,&gt;\xB0\xB9Q\x8DX\xDA ,\xE8\xE8
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssubsuperscriptgapmin11000superscriptbottommaxwithsubscript3000woff"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000-superscriptbottommaxwithsubscript3000.woff (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000-superscriptbottommaxwithsubscript3000.woff                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000-superscriptbottommaxwithsubscript3000.woff        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+wOFFOTTO\xE8 \x9CCFF t\xDDt\xFC\x9E\xDAFFTMTyS\xE1\xDAMATHpmXD&quot;OS/2X&gt;`
+\xF0cmap$7B+\xC6head*6]\xFBOhhea4$O\xDFhmtx\xE0\xD0maxpPPname\x98\x8A\xC7Ώ0\xA0post\ \xFF\x863x\x9Cc`d``\xE2.\x8E \x93\xE3\xF9m\xBE2p3\xBF\x8A0\\x96\xBFk\x8ALC\x88\xDD\x9Fx\x9Cc`d``\xFC\xC2\xF8\x85!\x8A\xF902\xA0&amp;Z&lt;4Px\x9Cc`a~\xC18\x81\x81\x95\x81\x81\xA9\x8BiC\x84f|\xC0`\xC8\xC8e`\xE5d\x80Ft\xD0\xC0\xA0\xC0\xA0\xC0\xF8\x85\xF1 C\x86\xA0 #)        x\x9C\xDDS1N\xC30}I G\xF0\x82C*'\x95*\xB5 \xAA*\xB5jW\xF64\xAA\xA9\xA3\xD8Ua\xE1=
+\xC7\xE8\xC0'\xE2\xC51\x82\x85        $\xB1l\xBF\xEF\xFF\xFF\xF3\x8B\xFD+\xA0\x8F'\xE8\xBEK,=\xB0B\x8FC\xDC\xCF\x{1D01EF}GX\xF4\x8E\x9F\xE0&quot;\x92\x9Fb\xBD02\x88\xCEhݺ\xAC8\xA0\xF18\xC4cp\xEBq\xC7\xF0\xDC\xE3\x87\xDE\xC8\xE3\x88\xA8\xEF\xF1)\xD13h\xD4x \x8BB\x81W\xC8q\xCD9\x85D\x82\xD1
+=%\xE7%\xAD) \x9Bf\x94r\xEB\x8Ax \xCCt\xFDШ\xA2\xB4\xE2*\xBF\xA9LFb\x95\xD9r\xB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xE0bx\xC0\xA8\xC7\xC0`\xC3z\x87\x81$\xA0\x{143041}{\x91\x8A\xA7100\xC6\xA1\xCE\xA2
 L\xC3\xD8Hf\xA0\x88anj\xA2 \xAF\xD96  b@ZH3\x82M`CT\x9E
+\xF301H0\xC8\xE1tD\xA5P\x85
+\x98\xC56&quot;
+\xA3\x91 \x99\xE1+b\xE8\xE8
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssubsuperscriptgapmin11000woff"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000.woff (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000.woff                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000.woff        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+wOFFOTTO\x9C \xF4CFF D\xC5T*\xB2\xD0FFTM yS\xE1\xDAMATH(iX8jOS/2X&gt;`
+\xF0cmap\xF47B+\xC6head*6]\xFBOhhea4$O\xDFhmtx\x94\xD0maxpPPname\x98\\x8D-\xA2\xE6post, \xFF\x863x\x9Cc`d``b\x99\xD3\xE5\xE1\xF1\xFC6_\xB8\x99_E.\xCB\xDF5E\xA6\xA1\x80\x83\x81        D_x\x9Cc`d``\xFC\xC2\xF8\x85!\x8A\xF902\xA0&amp;Z&lt;4Px\x9Cc`a~\xC18\x81\x81\x95\x81\x81\xA9\x8BiC\x84f|\xC0`\xC8\xC8e`\xE5d\x80Ft\xD0\xC0\xA0\xC0\xA0\xC0\xF8\x85\xF1 C\x86\xA0 #)        x\x9C\xBD\x92\xBFj\xC30\xC6?9\xA0PJ\xD7n
+\xB4%l        tHJ\xB2fw\x8C\xB15\xC4\x963\xA4\x8F\xD3\xE8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xC1\xB1\xB88?93\xB1$3?\x8F\xA0 ;\x98\x80\xBEQ\xEE\xDE\xFB\xBDv/\xE3޽?\xB7\xECe\xDE+\xF6K\xE2\xFB\xC3l{\xAF\xFD^\xFBs\xCB\xEFZv&gt;\xBE_5&quot;ݢ\xDD&lt;\\xA1\xA9U\xC1x\x9Cc```d\x82\xCB&quot;\xEA\xF9`Z\xFE\xAE)\x8C7\x9A\x87x\x9Cc`d``\xE0bx\xC0\xA8\xC7\xC0`\xC3z\x87\x81$\xA0\xF5\x83\xC5\xD3\xE3\x88PgQ \xA6al$3Pč\xB0cFQ\x86\xBFW\x81l1 \xAD\xA4\xC1&amp;0\x82!*O\x88y\x84$\xE4p\xBA
+\xA2R\xA8B\xCC\xE2\x9B \x85\xD1H\xC6\xC8 \x9F\xE8\xE8
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssuperscriptbaselinedropmax10000woff"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptbaselinedropmax10000.woff (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptbaselinedropmax10000.woff                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptbaselinedropmax10000.woff        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+wOFFOTTO\xB0         \CFF T\xCBA\x8B\xB91FFTM yS\xE1\xDAMATH&lt;jX4\x82OS/2X&gt;`
+\xF0cmap7B+\xC6head*6]\xFBOhhea4$O\xDFhmtx\xA8\xD0maxpPPname\x98i\xE7\xA5Tpost&lt; \xFF\x863x\x9Cc`d``\xE2L\xA7\xB0\xBB\xF1\xFC6_\xB8\x99_E.\xCB\xDF5E\xA6\xA1\x80\x83\x81        D\x97\x88x\x9Cc`d``\xFC\xC2\xF8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CD F@\x8A\x91+(U\xB9x\x9Ccd`aa`dd\xD4(N.\xCA,()\xD6-.-H-\x82p\x92\x8BSs2\xF3RS\x8A\xF2 r+ +\x80\x80\x81\x91\x89\x81\x91A\xFB?\xC3i\xC62L?d\x99H\xB0\xF4\xF00v\xAB \xC3C~\x86'\x822 2\x8C&lt;B \xCC +j \xBE %\xCE\xF9\x95E\x99\xE9%
+ɚ
+F\x86f
+\xBE\x89%\xBE&gt;
+\x8E\xC5\xC5\xF9ə\x89%\x99\xF9yD\xBA\x83X\xE7##\xA3\x92r\xF7\xDE\xEF\xB5{\xF7\xEE\xFD\xB9e/\xF3^\xB1_\xDF\xFE\x93`\xDB\xFB{\xBD\xE8\xF7ڟ[~ײ\xF3\xF1\xFD\xAA\xE9\xED\xE6\xE1\xE2\ux\x9Cc```d\x82\xCB&quot;\xEA\xF9`Z\xFE\xAE)\x8C7\x9A\x87x\x9Cc`d``\xE0bx\xC0\xA8\xC7\xC0`\xC3z\x87\x81h\xA0.@\xBCZ0\x98\xC6\xC0\xC0G\x84:#\x88Z0+c#\x99\x81&quot;n\x843\x8A20\xFC\xBD
+d\xDB0p0\x88i \xCD6\x81 Qy*@\xCC\xC3 \xC4 \xC1 \x87\xD3U\x95&quot;@*`\xD8\\x88(\x8CF\x82ş \xB4\xE8\xE8
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssuperscriptbottommin8000woff"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptbottommin8000.woff (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptbottommin8000.woff                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptbottommin8000.woff        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+wOFFOTTO\x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FBY\x86\xBC\xF1r\xCD\xEBK\x97\xBB\xC94}a\xC3D\xBE\xB8\x8C\xA2xPx\x8E\xAA&gt; \xB0\xE6x\x9Cc```f\x80`F\xB0\xF2\xC1| \xCD\x84 \xBE\xC2\xFF\xFF\xF2\xFFC\xA8JF6' $?\xD4Ya\xD3x\x9Cc`f\x83\xFF\xCD F@\x8A\x91+(U\xB9x\x9Ccd`aa`ddT,N.\xCA,()\xD6-.-H-\x82p\x92\xF2KJ\xF2ss3\xF3, \x99\xB4\xF03\xFC\x90f\xFC!\xC3\xF4C\x96\xF9\x87Kc7\xB0\xCA0\x9C\xE1\x97a`\x90a8/(\xC3\xC0!\xC3\xF0]\x88\x81\xA4A\x8D\xC1\x8D!\xCD9\xBF\xA0\xB2(3=\xA3DA#YS\xC1\xC8\xC0\xD0L\xC17\xB1$\xC3\xD7G\xC1\xB1\xB88?93\xB1$3?\x8F\x90:\x98\x95\x94\xBB\xF7~\xAF\xDD˸w\xEF\xCF-{\x99\xF7\x8A\xFD\x92\xF8\xFE\xF0\x9F\xDB\xDE\xDF\xEBE\xBF\xD7\xFE\xDC򻖝\x8F\xEFW\x8DH\xB7h7\xFC\xACUox\x9Cc```d\x82\xCB&quot;\xEA\xF9`Z\xFE\xAE)\x8C7\x9A\x87x\x9Cc`d``\xE0bx\xC0\xA8\xC7\xC0`\xC3z\x87\x81( 
 \xEF@\x9C:0\x8D\x81\x811\x8EuF\xB5`\xC6F2E\xDC;fe`\xF8{ȶa\xE0`\xD2*@\x9Al#\xA2\xF2T\x80\x98\x87A\x88A\x82A\xA7\xAB *E\x80*T\xC0,&gt;\xB0\xB9Q\x8D\xF3\x9B \xDC\xE8\xE8
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssuperscriptshiftup7000woff"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptshiftup7000.woff (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptshiftup7000.woff                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptshiftup7000.woff        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+wOFFOTTO\x90 \xBCCFF &lt;\xC2\xF9~3EFFTMyS\xE1\xDAMATHjX(\xCAOS/2X&gt;`
+\xF0cmap\xEC7B+\xC6head*6]\xFBOhhea4$O\xDFhmtx\x88\xD0maxpPPname\x98S`\xB8\xAE\xCD\xF4post$ \xFF\x863x\x9Cc`d``\xE2M \x93\xFE\xC7\xF3\xDB|e\xE0f~a\xB8,\xD7\x99\x86&amp;?.        ^x\x9Cc`d``\xFC\xC2\xF8\x85!\x8A\xF902\xA0&amp;Z&lt;4Px\x9Cc`a~\xC18\x81\x81\x95\x81\x81\xA9\x8BiC\x84f|\xC0`\xC8\xC8e`\xE5d\x80Ft\xD0\xC0\xA0\xC0\xA0\xC0\xF8\x85\xF1 C\x86\xA0 #)        x\x9C\xB5\x91\xBFj\xC30\xC6?9\xA0K\xE9P:Q($Pہ\x84\x84,!!CI\xC6fƉ\xB5D\xC6R\x86\xBCB׾G\xE9Kt\xEE\xFA\xC9V\x87-\x94 q\xBF\xD3\xDDw֝\\xE2\xF5w\x87\x95g\x81^=\xB8\xC1\x87\xE7&amp;\xE2\xC9s\x9D\xA0ṅ\xAB`\xE1\xB9\xCD\xF3gf\x8A\xE6\xBD\x87J\xE5X`\x8A\xD2s\x80{\xBC{n\xC0\x8Ak\xCFMLś\xE7dp빍i\xF0\x8894
+\x9CXEa\x8F]\xA4\xE8\xD1&amp;\x88cHZc\xCBHN\xBB\xA27\x83\xE1\xD2\xCCRչ&quot;\x80\xB9.N\xA5\xDA\xE7VvӞL\xA2x(\xD7[\x9B\xAFWrf\x8CN\xD5\xD6*\xCD4C\x9D\xFB[A\xA5A\xC8}$g&l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end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5fontsmathscriptssuperscriptshiftupcramped5000woff"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptshiftupcramped5000.woff (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptshiftupcramped5000.woff                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/fonts/math/scripts-superscriptshiftupcramped5000.woff        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+wOFFOTTO\xA8         &lt;CFF L\xC9δ4GFFTMyS\xE1\xDAMATH4jX \xFAOS/2X&gt;`
+\xF0cmap\xFC7B+\xC6head*6]\xFBOhhea4$O\xDFhmtx\xA0\xD0maxpPPname\x98bɟN~`post4 \xFF\x863x\x9Cc`d``b\x97\xF8k\x8D\xF1\xFC6_\xB8\x99_E.\xCB\xDF5E\xA6\xA1\x80\x83\x81        D\x96\xA4x\x9Cc`d``\xFC\xC2\xF8\x85!\x8A\xF902\xA0&amp;Z&lt;4Px\x9Cc`a~\xC18\x81\x81\x95\x81\x81\xA9\x8BiC\x84f|\xC0`\xC8\xC8e`\xE5d\x80Ft\xD0\xC0\xA0\xC0\xA0\xC0\xF8\x85\xF1 C\x86\xA0 #)        x\x9CŒ\xB1j\xC30\x86;N\xA0K\xE9 \xB4\x92\xC1\xC1vH 
+!\x90!$\xD0)\xBBq\x9CXCbc)\x85\xAC}\x8A\xBEB\x97&gt;B\x87&gt;K_\xA1{\xC9\xEAХZ\x88\x84\xB8\xEFNw'\xE9N\xAE\xF1\xCD\xE8b\xE5\xD8#\xBF:\xF6q\xEB        \xC7-̼7\xC7\xBA\xFE\xBD\xE36n\xFC'\xC7\xDA?\xE8\xE9WԖ6ʰG\xAE\xFB\x98\xE2\xDDq \x8Fޝ\xE3K?p܆\xF0wh\xC6%*\x9C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xFE\xAE)\x8C7\x9A\x87x\x9Cc`d``\xE0bx\xC0\xA8\xC7\xC0`\xC3z\x87\x81 \xEE \xAC+\x98\xC6\xC0\xC0G\x84:#\x88Z0+c#\x99\x81&quot;n\x843\x8A20\xFC\xBD
+d\xDB0p0\x88i \xCD6\x81 Qy*@\xCC\xC3 \xC4 \xC1 \x87\xD3U\x95&quot;@*`\xD8\\x88(\x8CF\x829\xC6 \xE8\xE8
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5mathmlpresentationmarkupscriptssubsupparameters1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1-expected.txt (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1-expected.txt        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+ 


+
+
+
+
+
+
+
+
+
+
+
+PASS SpaceAfterScript 
+PASS SuperscriptShiftUp 
+PASS SubscriptShiftDown 
+PASS SubSuperscriptGapMin 
+PASS SuperscriptBottomMaxWithSubscript 
+PASS SubscriptTopMax 
+PASS SuperscriptBottomMin 
+PASS SubscriptBaselineDrop 
+PASS SuperscriptBaselineDrop 
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5mathmlpresentationmarkupscriptssubsupparameters1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1.html (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1.html                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1.html        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,338 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Subscripts and Superscripts parameters&lt;/title&gt;
+&lt;link rel=&quot;help&quot; href=&quot;http://www.mathml-association.org/MathMLinHTML5/S3.html#SS4&quot;&gt;
+&lt;meta name=&quot;assert&quot; content=&quot;Elements msub, msup, subsup and msubsup correctly use the subscript and superscript parameters from the MATH table.&quot;&gt;
+&lt;script src=&quot;../../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+  math, mspace {
+    font-size: 10px;
+  }
+  @font-face {
+    font-family: spaceafterscript3000;
+    src: url(&quot;../../../fonts/math/scripts-spaceafterscript3000.woff&quot;);
+  }
+  @font-face {
+    font-family: superscriptshiftup7000;
+    src: url(&quot;../../../fonts/math/scripts-superscriptshiftup7000.woff&quot;);
+  }
+  @font-face {
+    font-family: superscriptshiftupcramped5000;
+    src: url(&quot;../../../fonts/math/scripts-superscriptshiftupcramped5000.woff&quot;);
+  }
+  @font-face {
+    font-family: subscriptshiftdown6000;
+    src: url(&quot;../../../fonts/math/scripts-subscriptshiftdown6000.woff&quot;);
+  }
+  @font-face {
+    font-family: subsuperscriptgapmin11000;
+    src: url(&quot;../../../fonts/math/scripts-subsuperscriptgapmin11000.woff&quot;);
+  }
+  @font-face {
+    font-family: subsuperscriptgapmin11000superscriptbottommaxwithsubscript3000;
+    src: url(&quot;../../../fonts/math/scripts-subsuperscriptgapmin11000-superscriptbottommaxwithsubscript3000.woff&quot;);
+  }
+  @font-face {
+    font-family: subscripttopmax4000;
+    src: url(&quot;../../../fonts/math/scripts-subscripttopmax4000.woff&quot;);
+  }
+  @font-face {
+    font-family: superscriptbottommin8000;
+    src: url(&quot;../../../fonts/math/scripts-superscriptbottommin8000.woff&quot;);
+  }
+  @font-face {
+    font-family: subscriptbaselinedropmin9000;
+    src: url(&quot;../../../fonts/math/scripts-subscriptbaselinedropmin9000.woff&quot;);
+  }
+  @font-face {
+    font-family: superscriptbaselinedropmax10000;
+    src: url(&quot;../../../fonts/math/scripts-superscriptbaselinedropmax10000.woff&quot;);
+  }
+&lt;/style&gt;
+&lt;script&gt;
+  var emToPx = 10 / 1000; // font-size: 10px, font.em = 1000
+  var epsilon = 1;
+
+  function getBox(aId) {
+    return document.getElementById(aId).getBoundingClientRect();
+  }
+
+  setup({ &quot;explicit_done&quot;: true });
+  window.addEventListener(&quot;load&quot;, function() {
+    document.fonts.ready.then(function() {
+      window.setTimeout(runTests, 250);
+    });
+  });
+
+  function runTests() {
+    test(function() {
+      var v = 3000 * emToPx;
+      assert_approx_equals(getBox(&quot;ref001&quot;).left - getBox(&quot;sub001&quot;).right, v, epsilon, &quot;msub: Space after subscript&quot;);
+      assert_approx_equals(getBox(&quot;ref002&quot;).left - getBox(&quot;sup002&quot;).right, v, epsilon, &quot;msup: Space after superscript&quot;);
+      assert_approx_equals(getBox(&quot;ref003&quot;).left - getBox(&quot;sup003&quot;).right, v, epsilon, &quot;msubsup: Space after superscript&quot;);
+      assert_approx_equals(getBox(&quot;sup0042&quot;).left - getBox(&quot;sup0041&quot;).right, v, epsilon, &quot;mmultiscripts: Space after first superscript&quot;);
+      assert_approx_equals(getBox(&quot;sup0043&quot;).left - getBox(&quot;sup0042&quot;).right, v, epsilon, &quot;mmultiscripts: Space after second superscript&quot;);
+      assert_approx_equals(getBox(&quot;ref004&quot;).left - getBox(&quot;sup0043&quot;).right, v, epsilon, &quot;mmultiscripts: Space after last superscript&quot;);
+    }, &quot;SpaceAfterScript&quot;);
+
+    test(function() {
+      var v = 7000 * emToPx;
+      assert_approx_equals(getBox(&quot;ref101&quot;).bottom - getBox(&quot;sup102&quot;).bottom, v, epsilon, &quot;msup: Superscript shift&quot;);
+      assert_approx_equals(getBox(&quot;ref101&quot;).bottom - getBox(&quot;sup103&quot;).bottom, v, epsilon, &quot;msubsup: Superscript shift&quot;);
+      assert_approx_equals(getBox(&quot;ref101&quot;).bottom - getBox(&quot;sup1041&quot;).bottom, v, epsilon, &quot;mmultiscripts: First superscript shift&quot;);
+      assert_approx_equals(getBox(&quot;ref101&quot;).bottom - getBox(&quot;sup1042&quot;).bottom, v, epsilon, &quot;mmultiscripts: Second superscript shift&quot;);
+      assert_approx_equals(getBox(&quot;ref101&quot;).bottom - getBox(&quot;sup1043&quot;).bottom, v, epsilon, &quot;mmultiscripts: Last superscript shift&quot;);
+    }, &quot;SuperscriptShiftUp&quot;);
+
+    /* FIXME: We do not support SuperscriptShiftUpCramped yet.
+       See http://webkit.org/b/156401
+    test(function() {
+      var v = 5000 * emToPx;
+      assert_approx_equals(getBox(&quot;ref201&quot;).bottom - getBox(&quot;sup202&quot;).bottom, v, epsilon, &quot;msup: Superscript shift&quot;);
+      assert_approx_equals(getBox(&quot;ref201&quot;).bottom - getBox(&quot;sup203&quot;).bottom, v, epsilon, &quot;msubsup: Superscript shift&quot;);
+      assert_approx_equals(getBox(&quot;ref201&quot;).bottom - getBox(&quot;sup2041&quot;).bottom, v, epsilon, &quot;mmultiscripts: First superscript shift&quot;);
+      assert_approx_equals(getBox(&quot;ref201&quot;).bottom - getBox(&quot;sup2042&quot;).bottom, v, epsilon, &quot;mmultiscripts: Second superscript shift&quot;);
+      assert_approx_equals(getBox(&quot;ref201&quot;).bottom - getBox(&quot;sup2043&quot;).bottom, v, epsilon, &quot;mmultiscripts: Last superscript shift&quot;);
+    }, &quot;SuperscriptShiftUpCramped&quot;); */
+
+    test(function() {
+      var v = 6000 * emToPx;
+      assert_approx_equals(getBox(&quot;sub301&quot;).bottom - getBox(&quot;ref300&quot;).bottom, v, epsilon, &quot;msup: Subscript shift&quot;);
+      assert_approx_equals(getBox(&quot;sub302&quot;).bottom - getBox(&quot;ref300&quot;).bottom, v, epsilon, &quot;msubsup: Subscript shift&quot;);
+      assert_approx_equals(getBox(&quot;sub303&quot;).bottom - getBox(&quot;ref300&quot;).bottom, v, epsilon, &quot;mmultiscripts: First subscript shift&quot;);
+      assert_approx_equals(getBox(&quot;sub304&quot;).bottom - getBox(&quot;ref300&quot;).bottom, v, epsilon, &quot;mmultiscripts: Second subscript shift&quot;);
+    }, &quot;SubscriptShiftDown&quot;);
+
+    test(function() {
+      var v = 11000 * emToPx;
+      assert_approx_equals(getBox(&quot;sub4011&quot;).top - getBox(&quot;sup4012&quot;).bottom, v, epsilon, &quot;msubsup: SubSuperscript gap&quot;);
+      assert_approx_equals(getBox(&quot;sub4021&quot;).top - getBox(&quot;sup4022&quot;).bottom, v, epsilon, &quot;mmultiscripts: SubSuperscript gap&quot;);
+    }, &quot;SubSuperscriptGapMin&quot;);
+
+    test(function() {
+      var v1 = 11000 * emToPx;
+      var v2 = 3000 * emToPx;
+      assert_approx_equals(getBox(&quot;sub501&quot;).top - getBox(&quot;sup501&quot;).bottom, v1, epsilon, &quot;msubsup: SubSuperscript gap&quot;);
+      assert_approx_equals(getBox(&quot;ref500&quot;).bottom - getBox(&quot;sup501&quot;).bottom, v2, epsilon, &quot;msubsup: Superscript bottom&quot;);
+      assert_approx_equals(getBox(&quot;sub502&quot;).top - getBox(&quot;sup502&quot;).bottom, v1, epsilon, &quot;mmultiscripts: SubSuperscript gap&quot;);
+      assert_approx_equals(getBox(&quot;ref500&quot;).bottom - getBox(&quot;sup502&quot;).bottom, v2, epsilon, &quot;mmultiscripts: Superscript bottom&quot;);
+    }, &quot;SuperscriptBottomMaxWithSubscript&quot;);
+
+    test(function() {
+      var v = 4000 * emToPx;
+      assert_approx_equals(getBox(&quot;ref600&quot;).bottom - getBox(&quot;sub601&quot;).top, v, epsilon, &quot;msub: Subscript top&quot;);
+    }, &quot;SubscriptTopMax&quot;);
+
+    test(function() {
+      var v = 8000 * emToPx;
+      assert_approx_equals(getBox(&quot;ref700&quot;).bottom - getBox(&quot;sub701&quot;).bottom, v, epsilon, &quot;msub: Superscript bottom&quot;);
+    }, &quot;SuperscriptBottomMin&quot;);
+
+    test(function() {
+      var v = 9000 * emToPx;
+      assert_approx_equals(getBox(&quot;sub801&quot;).bottom - getBox(&quot;base801&quot;).bottom, v, epsilon, &quot;msub: Superscript drop&quot;);
+    }, &quot;SubscriptBaselineDrop&quot;);
+
+    test(function() {
+      var v = 10000 * emToPx;
+      assert_approx_equals(getBox(&quot;sup901&quot;).bottom - getBox(&quot;base901&quot;).top, v, epsilon, &quot;msup: Superscript drop&quot;);
+    }, &quot;SuperscriptBaselineDrop&quot;);
+
+    done();
+  }
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;
+      &lt;math style=&quot;font-family: spaceafterscript3000;&quot;&gt;
+        &lt;msub&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace id=&quot;sub001&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/msub&gt;
+        &lt;mspace id=&quot;ref001&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;green&quot;/&gt;
+      &lt;/math&gt;
+      &lt;math style=&quot;font-family: spaceafterscript3000;&quot;&gt;
+        &lt;msup&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace id=&quot;sup002&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/msup&gt;
+        &lt;mspace id=&quot;ref002&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;green&quot;/&gt;
+      &lt;/math&gt;
+      &lt;math style=&quot;font-family: spaceafterscript3000;&quot;&gt;
+        &lt;msubsup&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace/&gt;
+          &lt;mspace id=&quot;sup003&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/msubsup&gt;
+        &lt;mspace id=&quot;ref003&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;green&quot;/&gt;
+      &lt;/math&gt;
+      &lt;math style=&quot;font-family: spaceafterscript3000;&quot;&gt;
+        &lt;mmultiscripts&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;none/&gt;
+          &lt;mspace id=&quot;sup0041&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;none/&gt;
+          &lt;mspace id=&quot;sup0042&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;none/&gt;
+          &lt;mspace id=&quot;sup0043&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/mmultiscripts&gt;
+        &lt;mspace id=&quot;ref004&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;green&quot;/&gt;
+      &lt;/math&gt;
+    &lt;/p&gt;
+    &lt;hr/&gt;
+    &lt;p&gt;
+      &lt;math style=&quot;font-family: superscriptshiftup7000;&quot;&gt;
+        &lt;mspace id=&quot;ref101&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;green&quot;/&gt;
+        &lt;msup&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace id=&quot;sup102&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/msup&gt;
+        &lt;msubsup&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;mspace id=&quot;sup103&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/msubsup&gt;
+        &lt;mmultiscripts&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;none/&gt;
+          &lt;mspace id=&quot;sup1041&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;none/&gt;
+          &lt;mspace id=&quot;sup1042&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;none/&gt;
+          &lt;mspace id=&quot;sup1043&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/mmultiscripts&gt;
+      &lt;/math&gt;
+    &lt;/p&gt;
+    &lt;hr/&gt;
+    &lt;p&gt;
+      &lt;math style=&quot;font-family: superscriptshiftupcramped5000;&quot;&gt;
+        &lt;msqrt&gt;
+          &lt;mspace id=&quot;ref201&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;green&quot;/&gt;
+          &lt;msup&gt;
+            &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+            &lt;mspace id=&quot;sup202&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;/msup&gt;
+          &lt;msubsup&gt;
+            &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+            &lt;mspace height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;blue&quot;/&gt;
+            &lt;mspace id=&quot;sup203&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;/msubsup&gt;
+          &lt;mmultiscripts&gt;
+            &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+            &lt;none/&gt;
+            &lt;mspace id=&quot;sup2041&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+            &lt;none/&gt;
+            &lt;mspace id=&quot;sup2042&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+            &lt;none/&gt;
+            &lt;mspace id=&quot;sup2043&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;/mmultiscripts&gt;
+        &lt;/msqrt&gt;
+      &lt;/math&gt;
+    &lt;/p&gt;
+    &lt;hr/&gt;
+    &lt;p&gt;
+      &lt;math style=&quot;font-family: subscriptshiftdown6000;&quot;&gt;
+        &lt;mspace id=&quot;ref300&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;green&quot;/&gt;
+        &lt;msub&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace id=&quot;sub301&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/msub&gt;
+        &lt;msubsup&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace id=&quot;sub302&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;mspace height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;blue&quot;/&gt;
+        &lt;/msubsup&gt;
+        &lt;mmultiscripts&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace id=&quot;sub303&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;none/&gt;
+          &lt;mspace id=&quot;sub304&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;none/&gt;
+        &lt;/mmultiscripts&gt;
+      &lt;/math&gt;
+    &lt;/p&gt;
+    &lt;hr/&gt;
+    &lt;p&gt;
+      &lt;math style=&quot;font-family: subsuperscriptgapmin11000;&quot;&gt;
+        &lt;msubsup&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace id=&quot;sub4011&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;mspace id=&quot;sup4012&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/msubsup&gt;
+        &lt;mmultiscripts&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;none/&gt;
+          &lt;none/&gt;
+          &lt;mspace id=&quot;sub4021&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;mspace id=&quot;sup4022&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/mmultiscripts&gt;
+      &lt;/math&gt;
+    &lt;/p&gt;
+    &lt;hr/&gt;
+    &lt;p&gt;
+      &lt;math style=&quot;font-family: subsuperscriptgapmin11000superscriptbottommaxwithsubscript3000;&quot;&gt;
+        &lt;mspace id=&quot;ref500&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;green&quot;/&gt;
+        &lt;msubsup&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace id=&quot;sub501&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;mspace id=&quot;sup501&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/msubsup&gt;
+        &lt;mmultiscripts&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;none/&gt;
+          &lt;none/&gt;
+          &lt;mspace id=&quot;sub502&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;mspace id=&quot;sup502&quot; height=&quot;1em&quot; width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/mmultiscripts&gt;
+      &lt;/math&gt;
+    &lt;/p&gt;
+    &lt;hr/&gt;
+    &lt;p&gt;
+      &lt;math style=&quot;font-family: subscripttopmax4000;&quot;&gt;
+        &lt;mspace id=&quot;ref600&quot; height=&quot;1em&quot;
+                width=&quot;1em&quot; mathbackground=&quot;green&quot;/&gt;
+        &lt;msub&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace id=&quot;sub601&quot; height=&quot;10em&quot;
+                  width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/msub&gt;
+      &lt;/math&gt;
+    &lt;/p&gt;
+    &lt;hr/&gt;
+    &lt;p&gt;
+      &lt;math style=&quot;font-family: superscriptbottommin8000;&quot;&gt;
+        &lt;mspace id=&quot;ref700&quot; height=&quot;1em&quot;
+                width=&quot;1em&quot; mathbackground=&quot;green&quot;/&gt;
+        &lt;msup&gt;
+          &lt;mspace height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace id=&quot;sub701&quot; depth=&quot;1em&quot;
+                  width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/msup&gt;
+      &lt;/math&gt;
+    &lt;/p&gt;
+    &lt;hr/&gt;
+    &lt;p&gt;
+      &lt;math style=&quot;font-family: subscriptbaselinedropmin9000;&quot;&gt;
+        &lt;msub&gt;
+          &lt;mspace id=&quot;base801&quot; height=&quot;2em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace id=&quot;sub801&quot; height=&quot;1em&quot;
+                  width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/msub&gt;
+      &lt;/math&gt;
+    &lt;/p&gt;
+    &lt;hr/&gt;
+    &lt;p&gt;
+      &lt;math style=&quot;font-family: superscriptbaselinedropmax10000;&quot;&gt;
+        &lt;msup&gt;
+          &lt;mspace id=&quot;base901&quot; height=&quot;15em&quot; width=&quot;2em&quot; mathbackground=&quot;blue&quot;/&gt;
+          &lt;mspace id=&quot;sup901&quot; height=&quot;1em&quot;
+                  width=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;/msup&gt;
+      &lt;/math&gt;
+    &lt;/p&gt;
+    &lt;hr/&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1.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="trunkLayoutTestsmathmlmsubsupfuzzexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/msubsup-fuzz-expected.txt (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/msubsup-fuzz-expected.txt        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/mathml/msubsup-fuzz-expected.txt        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -1,4 +1,3 @@
</span><span class="cx"> This test passes if it does not crash.
</span><span class="cx"> 
</span><del>-3
</del><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlopentypelargeoperatorsitaliccorrectionexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/opentype/large-operators-italic-correction-expected.txt (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/opentype/large-operators-italic-correction-expected.txt                                (rev 0)
+++ trunk/LayoutTests/mathml/opentype/large-operators-italic-correction-expected.txt        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+This test passes if the difference of horizontal positions between the subscript and superscript corresponds to the italic correction of the integral operator.
+
+
+PASS Large Operators Italic Correction 
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/opentype/large-operators-italic-correction-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsmathmlopentypelargeoperatorsitaliccorrectionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/opentype/large-operators-italic-correction.html (0 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/opentype/large-operators-italic-correction.html                                (rev 0)
+++ trunk/LayoutTests/mathml/opentype/large-operators-italic-correction.html        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;Large Operators Italic Correction&lt;/title&gt;
+    &lt;meta charset=&quot;utf-8&quot;&gt;
+    &lt;script src=&quot;../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+    &lt;style type=&quot;text/css&quot;&gt;
+      /* For Latin Modern Math,
+         italic correction of ∫ = 591
+         em = 1000
+         so the actual italic correction will be 591 * 64 / 1000;
+       */
+      math {
+        font-family: &quot;Latin Modern Math&quot;;
+        font-size: 64px;
+      }
+    &lt;/style&gt;
+    &lt;script type=&quot;text/javascript&quot;&gt;
+      var epsilon = 1;
+      setup({ &quot;explicit_done&quot;: true });
+      function run() {
+        assert_approx_equals(document.getElementById(&quot;sup&quot;).getBoundingClientRect().left - document.getElementById(&quot;sub&quot;).getBoundingClientRect().left, 591 * 64 / 1000, epsilon);
+        done();
+      }
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body onload=&quot;run()&quot;&gt;
+
+    &lt;p&gt;This test passes if the difference of horizontal positions between the
+      subscript and superscript corresponds to the italic correction of the
+      integral operator.&lt;/p&gt;
+
+    &lt;math display=&quot;block&quot;&gt;
+      &lt;msubsup&gt;
+        &lt;mo&gt;∫&lt;/mo&gt;
+        &lt;mspace id=&quot;sub&quot; width=&quot;10px&quot; height=&quot;10px&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;mspace id=&quot;sup&quot; width=&quot;10px&quot; height=&quot;10px&quot; mathbackground=&quot;green&quot;/&gt;
+      &lt;/msubsup&gt;
+    &lt;/math&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/opentype/large-operators-italic-correction.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="trunkLayoutTestsmathmlpresentationbug95015expectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/bug95015-expected.html (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/bug95015-expected.html        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/mathml/presentation/bug95015-expected.html        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx">         &lt;/mrow&gt;
</span><span class="cx">       &lt;/math&gt;
</span><span class="cx">     &lt;/div&gt;
</span><del>-    &lt;div style=&quot;position: absolute; left: 10px; top: -.2em;&quot;&gt;
</del><ins>+    &lt;div style=&quot;position: absolute; left: 10px; top: -.1em;&quot;&gt;
</ins><span class="cx">       &lt;math&gt;
</span><span class="cx">         &lt;mrow&gt;
</span><span class="cx">           &lt;mspace height=&quot;50px&quot; depth=&quot;50px&quot;/&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationbug95015html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/bug95015.html (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/bug95015.html        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/mathml/presentation/bug95015.html        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx">         &lt;/mrow&gt;
</span><span class="cx">       &lt;/math&gt;
</span><span class="cx">     &lt;/div&gt;
</span><del>-    &lt;div style=&quot;position: absolute; left: 10px; top: -.2em;&quot;&gt;
</del><ins>+    &lt;div style=&quot;position: absolute; left: 10px; top: -.1em;&quot;&gt;
</ins><span class="cx">       &lt;math&gt;
</span><span class="cx">         &lt;mrow&gt;
</span><span class="cx">           &lt;mspace height=&quot;50px&quot; depth=&quot;50px&quot;/&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationmultiscriptsnoscriptsexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/multiscripts-noscripts-expected.html (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/multiscripts-noscripts-expected.html        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/mathml/presentation/multiscripts-noscripts-expected.html        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -11,11 +11,6 @@
</span><span class="cx">         &lt;mrow&gt;
</span><span class="cx">           &lt;mn&gt;1&lt;/mn&gt;
</span><span class="cx">         &lt;/mrow&gt;
</span><del>-      &lt;/math&gt;
-    &lt;/p&gt;
-
-    &lt;p&gt;
-      &lt;math&gt;
</del><span class="cx">         &lt;mrow&gt;
</span><span class="cx">           &lt;mn&gt;2&lt;/mn&gt;
</span><span class="cx">         &lt;/mrow&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationmultiscriptsnoscriptshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/multiscripts-noscripts.html (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/multiscripts-noscripts.html        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/mathml/presentation/multiscripts-noscripts.html        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -13,11 +13,6 @@
</span><span class="cx">           &lt;mn&gt;1&lt;/mn&gt;
</span><span class="cx">           &lt;mprescripts/&gt;
</span><span class="cx">         &lt;/mmultiscripts&gt;
</span><del>-      &lt;/math&gt;
-    &lt;/p&gt;
-
-    &lt;p&gt;
-      &lt;math&gt;
</del><span class="cx">         &lt;mmultiscripts&gt;
</span><span class="cx">           &lt;mn&gt;2&lt;/mn&gt;
</span><span class="cx">         &lt;/mmultiscripts&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationmultiscriptspositionsexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/multiscripts-positions-expected.html (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/multiscripts-positions-expected.html        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/mathml/presentation/multiscripts-positions-expected.html        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">         &lt;/mmultiscripts&gt;
</span><span class="cx">       &lt;/math&gt;
</span><span class="cx">     &lt;/p&gt;
</span><del>-    &lt;p style=&quot;position: absolute; left: -5px; top: 110px;&quot;&gt;
</del><ins>+    &lt;p style=&quot;position: absolute; left: -5px; top: 120px;&quot;&gt;
</ins><span class="cx">       &lt;math&gt;
</span><span class="cx">         &lt;mspace height=&quot;50px&quot; depth=&quot;50px&quot;/&gt;
</span><span class="cx">         &lt;mrow&gt;
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx">         &lt;/mrow&gt;
</span><span class="cx">       &lt;/math&gt;
</span><span class="cx">     &lt;/p&gt;
</span><del>-    &lt;p style=&quot;position: absolute; left: 145px; top: 110px;&quot;&gt;
</del><ins>+    &lt;p style=&quot;position: absolute; left: 145px; top: 120px;&quot;&gt;
</ins><span class="cx">       &lt;math&gt;
</span><span class="cx">         &lt;mspace height=&quot;50px&quot; depth=&quot;50px&quot;/&gt;
</span><span class="cx">         &lt;mrow&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationmultiscriptspositionshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/multiscripts-positions.html (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/multiscripts-positions.html        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/mathml/presentation/multiscripts-positions.html        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx">         &lt;/mmultiscripts&gt;
</span><span class="cx">       &lt;/math&gt;
</span><span class="cx">     &lt;/p&gt;
</span><del>-    &lt;p style=&quot;position: absolute; left: -5px; top: 110px;&quot;&gt;
</del><ins>+    &lt;p style=&quot;position: absolute; left: -5px; top: 120px;&quot;&gt;
</ins><span class="cx">       &lt;math&gt;
</span><span class="cx">         &lt;mspace height=&quot;50px&quot; depth=&quot;50px&quot;/&gt;
</span><span class="cx">         &lt;mrow&gt;
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx">         &lt;/mrow&gt;
</span><span class="cx">       &lt;/math&gt;
</span><span class="cx">     &lt;/p&gt;
</span><del>-    &lt;p style=&quot;position: absolute; left: 145px; top: 110px;&quot;&gt;
</del><ins>+    &lt;p style=&quot;position: absolute; left: 145px; top: 120px;&quot;&gt;
</ins><span class="cx">       &lt;math&gt;
</span><span class="cx">         &lt;mspace height=&quot;50px&quot; depth=&quot;50px&quot;/&gt;
</span><span class="cx">         &lt;mrow&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationscriptsheightexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/scripts-height-expected.html (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/scripts-height-expected.html        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/mathml/presentation/scripts-height-expected.html        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -68,19 +68,19 @@
</span><span class="cx">           &lt;td style=&quot;width: 14em; height: 14em;&quot;&gt;
</span><span class="cx">             &lt;math&gt;
</span><span class="cx">               &lt;mspace height=&quot;7em&quot; depth=&quot;7em&quot;/&gt;
</span><del>-              &lt;mi&gt;x&lt;/mi&gt;
</del><ins>+              &lt;mspace width=&quot;10px&quot; height=&quot;1em&quot; depth=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
</ins><span class="cx">               &lt;msubsup&gt;
</span><del>-                &lt;mi&gt;x&lt;/mi&gt;
</del><ins>+                &lt;mspace width=&quot;10px&quot; height=&quot;1em&quot; depth=&quot;1em&quot; mathbackground=&quot;green&quot;/&gt;
</ins><span class="cx">                 &lt;mspace/&gt;
</span><span class="cx">                 &lt;mspace/&gt;
</span><span class="cx">               &lt;/msubsup&gt;
</span><span class="cx">               &lt;msubsup&gt;
</span><del>-                &lt;mi&gt;x&lt;/mi&gt;
</del><ins>+                &lt;mspace width=&quot;10px&quot; height=&quot;1em&quot; depth=&quot;1em&quot; mathbackground=&quot;blue&quot;/&gt;
</ins><span class="cx">                 &lt;mspace/&gt;
</span><span class="cx">                 &lt;mspace/&gt;
</span><span class="cx">               &lt;/msubsup&gt;
</span><span class="cx">               &lt;msubsup&gt;
</span><del>-                &lt;mi&gt;x&lt;/mi&gt;
</del><ins>+                &lt;mspace width=&quot;10px&quot; height=&quot;1em&quot; depth=&quot;1em&quot; mathbackground=&quot;yellow&quot;/&gt;
</ins><span class="cx">                 &lt;mspace/&gt;
</span><span class="cx">                 &lt;mspace/&gt;
</span><span class="cx">               &lt;/msubsup&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationscriptsheighthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/scripts-height.html (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/scripts-height.html        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/mathml/presentation/scripts-height.html        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -70,19 +70,19 @@
</span><span class="cx">           &lt;td style=&quot;width: 14em; height: 14em;&quot;&gt;
</span><span class="cx">             &lt;math&gt;
</span><span class="cx">               &lt;mspace height=&quot;7em&quot; depth=&quot;7em&quot;/&gt;
</span><del>-              &lt;mi&gt;x&lt;/mi&gt;
</del><ins>+              &lt;mspace width=&quot;10px&quot; height=&quot;1em&quot; depth=&quot;1em&quot; mathbackground=&quot;red&quot;/&gt;
</ins><span class="cx">               &lt;msubsup&gt;
</span><del>-                &lt;mi&gt;x&lt;/mi&gt;
</del><ins>+                &lt;mspace width=&quot;10px&quot; height=&quot;1em&quot; depth=&quot;1em&quot; mathbackground=&quot;green&quot;/&gt;
</ins><span class="cx">                 &lt;mspace height=&quot;4em&quot;/&gt;
</span><span class="cx">                 &lt;mspace height=&quot;1em&quot;/&gt;
</span><span class="cx">               &lt;/msubsup&gt;
</span><span class="cx">               &lt;msubsup&gt;
</span><del>-                &lt;mi&gt;x&lt;/mi&gt;
</del><ins>+                &lt;mspace width=&quot;10px&quot; height=&quot;1em&quot; depth=&quot;1em&quot; mathbackground=&quot;blue&quot;/&gt;
</ins><span class="cx">                 &lt;mspace height=&quot;1em&quot;/&gt;
</span><span class="cx">                 &lt;mspace height=&quot;4em&quot;/&gt;
</span><span class="cx">               &lt;/msubsup&gt;
</span><span class="cx">               &lt;msubsup&gt;
</span><del>-                &lt;mi&gt;x&lt;/mi&gt;
</del><ins>+                &lt;mspace width=&quot;10px&quot; height=&quot;1em&quot; depth=&quot;1em&quot; mathbackground=&quot;yellow&quot;/&gt;
</ins><span class="cx">                 &lt;mspace height=&quot;4em&quot;/&gt;
</span><span class="cx">                 &lt;mspace height=&quot;4em&quot;/&gt;
</span><span class="cx">               &lt;/msubsup&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationscriptshorizontalalignmentexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/scripts-horizontal-alignment-expected.html (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/scripts-horizontal-alignment-expected.html        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/mathml/presentation/scripts-horizontal-alignment-expected.html        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -11,14 +11,12 @@
</span><span class="cx">       &lt;mmultiscripts&gt;
</span><span class="cx">         &lt;mn&gt;0&lt;/mn&gt;
</span><span class="cx">         &lt;mspace width=&quot;10px&quot; height=&quot;50px&quot; mathbackground=&quot;green&quot;/&gt;
</span><ins>+        &lt;mspace width=&quot;10px&quot; depth=&quot;50px&quot; mathbackground=&quot;green&quot;/&gt;
</ins><span class="cx">         &lt;mspace width=&quot;10px&quot; height=&quot;10px&quot;/&gt;
</span><del>-        &lt;mspace width=&quot;10px&quot; height=&quot;10px&quot;/&gt;
-        &lt;none/&gt;
</del><ins>+        &lt;mspace width=&quot;10px&quot; depth=&quot;10px&quot;/&gt;
</ins><span class="cx">         &lt;mprescripts/&gt;
</span><del>-        &lt;none/&gt;
</del><span class="cx">         &lt;mspace width=&quot;10px&quot; height=&quot;10px&quot;/&gt;
</span><del>-        &lt;mspace width=&quot;10px&quot; height=&quot;10px&quot;/&gt;
-        &lt;mspace width=&quot;10px&quot; height=&quot;50px&quot; mathbackground=&quot;green&quot;/&gt;
</del><ins>+        &lt;mspace width=&quot;10px&quot; depth=&quot;10px&quot;/&gt;
</ins><span class="cx">       &lt;/mmultiscripts&gt;
</span><span class="cx">     &lt;/math&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationscriptshorizontalalignmenthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/scripts-horizontal-alignment.html (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/scripts-horizontal-alignment.html        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/mathml/presentation/scripts-horizontal-alignment.html        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -6,24 +6,22 @@
</span><span class="cx">   &lt;/head&gt;
</span><span class="cx">   &lt;body&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- The MathML recommendation does not specify horizontal alignment of scripts.  We align the bottom (respectively top) edge of the subscript (respectively superscript) with the bottom (respectively top) edge of the flex container. --&gt;
</del><ins>+    &lt;!-- The MathML recommendation does not specify horizontal alignment of scripts. We apply the maximum vertical shifts necessary for all subscripts / superscripts. Here we need to shift the tall green scripts to avoid collision and so the red scripts will be shifted by the same distance. --&gt;
</ins><span class="cx">     &lt;math style=&quot;position: absolute;&quot;&gt;
</span><span class="cx">       &lt;mspace height=&quot;100px&quot; depth=&quot;100px&quot;/&gt;
</span><span class="cx">       &lt;mmultiscripts&gt;
</span><span class="cx">         &lt;mn&gt;0&lt;/mn&gt;
</span><span class="cx">         &lt;mspace width=&quot;10px&quot; height=&quot;50px&quot; mathbackground=&quot;green&quot;/&gt;
</span><ins>+        &lt;mspace width=&quot;10px&quot; depth=&quot;50px&quot; mathbackground=&quot;green&quot;/&gt;
</ins><span class="cx">         &lt;mspace width=&quot;10px&quot; height=&quot;10px&quot; mathbackground=&quot;red&quot;/&gt;
</span><del>-        &lt;mspace width=&quot;10px&quot; height=&quot;10px&quot; mathbackground=&quot;blue&quot;/&gt;
-        &lt;none/&gt;
</del><ins>+        &lt;mspace width=&quot;10px&quot; depth=&quot;10px&quot; mathbackground=&quot;red&quot;/&gt;
</ins><span class="cx">         &lt;mprescripts/&gt;
</span><del>-        &lt;none/&gt;
-        &lt;mspace width=&quot;10px&quot; height=&quot;10px&quot; mathbackground=&quot;blue&quot;/&gt;
</del><span class="cx">         &lt;mspace width=&quot;10px&quot; height=&quot;10px&quot; mathbackground=&quot;red&quot;/&gt;
</span><del>-        &lt;mspace width=&quot;10px&quot; height=&quot;50px&quot; mathbackground=&quot;green&quot;/&gt;
</del><ins>+        &lt;mspace width=&quot;10px&quot; depth=&quot;10px&quot; mathbackground=&quot;red&quot;/&gt;
</ins><span class="cx">       &lt;/mmultiscripts&gt;
</span><span class="cx">     &lt;/math&gt;
</span><span class="cx"> 
</span><del>-    &lt;!-- These black rectangles should hide the top/bottom of the &lt;mmultiscripts&gt; element. So the green and red scripts should not be visible --&gt;
</del><ins>+    &lt;!-- These black rectangles should hide the top/bottom of the &lt;mmultiscripts&gt; element. So the red scripts should not be visible --&gt;
</ins><span class="cx">     &lt;math style=&quot;position: absolute; top: -40px;&quot;&gt;
</span><span class="cx">       &lt;mspace height=&quot;100px&quot; depth=&quot;100px&quot;/&gt;
</span><span class="cx">       &lt;mspace width=&quot;200px&quot; height=&quot;40px&quot; depth=&quot;20px&quot; mathbackground=&quot;black&quot;/&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkaccessibilitymathmultiscriptattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/accessibility/math-multiscript-attributes-expected.txt (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/accessibility/math-multiscript-attributes-expected.txt        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/platform/gtk/accessibility/math-multiscript-attributes-expected.txt        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -11,7 +11,7 @@
</span><span class="cx"> AXRole: AXStatic
</span><span class="cx"> AXParent: AXSection
</span><span class="cx"> AXChildren: 0
</span><del>-AXPosition: { 19.000000, -34.000000 }
</del><ins>+AXPosition: { 20.000000, -33.000000 }
</ins><span class="cx"> AXSize: { 15.000000, 106.000000 }
</span><span class="cx"> AXTitle: 
</span><span class="cx"> AXDescription: 
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> AXRole: AXSubscript
</span><span class="cx"> AXParent: AXSection
</span><span class="cx"> AXChildren: 0
</span><del>-AXPosition: { 32.000000, -15.000000 }
</del><ins>+AXPosition: { 33.000000, -14.000000 }
</ins><span class="cx"> AXSize: { 11.000000, 81.000000 }
</span><span class="cx"> AXTitle: 
</span><span class="cx"> AXDescription: 
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> AXRole: AXSuperscript
</span><span class="cx"> AXParent: AXSection
</span><span class="cx"> AXChildren: 0
</span><del>-AXPosition: { 32.000000, -26.000000 }
</del><ins>+AXPosition: { 33.000000, -26.000000 }
</ins><span class="cx"> AXSize: { 11.000000, 80.000000 }
</span><span class="cx"> AXTitle: 
</span><span class="cx"> AXDescription: 
</span><span class="lines">@@ -68,8 +68,8 @@
</span><span class="cx"> AXRole: AXSubscript
</span><span class="cx"> AXParent: AXSection
</span><span class="cx"> AXChildren: 0
</span><del>-AXPosition: { 9.000000, -15.000000 }
-AXSize: { 10.000000, 81.000000 }
</del><ins>+AXPosition: { 9.000000, -14.000000 }
+AXSize: { 11.000000, 81.000000 }
</ins><span class="cx"> AXTitle: 
</span><span class="cx"> AXDescription: 
</span><span class="cx"> AXValue: B
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx"> AXParent: AXSection
</span><span class="cx"> AXChildren: 0
</span><span class="cx"> AXPosition: { 9.000000, -26.000000 }
</span><del>-AXSize: { 10.000000, 80.000000 }
</del><ins>+AXSize: { 11.000000, 80.000000 }
</ins><span class="cx"> AXTitle: 
</span><span class="cx"> AXDescription: 
</span><span class="cx"> AXValue: A
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkmathmlpresentationrootsexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/gtk/mathml/presentation/roots-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkmathmlpresentationrootsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/mathml/presentation/roots-expected.txt (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/mathml/presentation/roots-expected.txt        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/platform/gtk/mathml/presentation/roots-expected.txt        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -51,34 +51,32 @@
</span><span class="cx">       RenderBlock {p} at (0,68) size 784x19
</span><span class="cx">         RenderText {#text} at (0,2) size 222x17
</span><span class="cx">           text run at (0,2) width 222: &quot;long square root with implied row: &quot;
</span><del>-        RenderMathMLMath {math} at (222,0) size 62x19 [padding: 0 1 0 1]
-          RenderMathMLSquareRoot {msqrt} at (1,0) size 60x19
</del><ins>+        RenderMathMLMath {math} at (222,0) size 63x19 [padding: 0 1 0 1]
+          RenderMathMLSquareRoot {msqrt} at (1,0) size 61x19
</ins><span class="cx">             RenderMathMLBlock (anonymous, flex) at (0,0) size 17x19
</span><span class="cx">               RenderMathMLRadicalOperator (anonymous) at (0,0) size 17x19
</span><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (0,0) size 13x18
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 13x18
</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 43x17
-              RenderMathMLScripts {msup} at (0,0) size 16x15
-                Base Wrapper at (0,0) size 10x15 [padding: 7 0 0 0]
-                  RenderMathMLToken {mi} at (0,7) 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;
-                SubSupPair Wrapper at (9,0) size 7x15
-                  RenderMathMLToken {mn} at (0,0) size 6x9
-                    RenderMathMLBlock (anonymous, flex) at (0,0) size 6x9
-                      RenderBlock (anonymous) at (0,0) size 6x9
-                        RenderText {#text} at (0,-35) size 6x80
-                          text run at (0,-35) width 6: &quot;2&quot;
-              RenderMathMLOperator {mo} at (15,4) size 20x12
</del><ins>+            RenderMathMLRootWrapper at (17,2) size 44x17
+              RenderMathMLScripts {msup} at (0,0) size 17x15
+                RenderMathMLToken {mi} at (0,6) size 10x9 [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;
+                RenderMathMLToken {mn} at (9,0) size 7x9
+                  RenderMathMLBlock (anonymous, flex) at (0,0) size 6x9
+                    RenderBlock (anonymous) at (0,0) size 6x9
+                      RenderText {#text} at (0,-35) size 6x80
+                        text run at (0,-35) width 6: &quot;2&quot;
+              RenderMathMLOperator {mo} at (16,4) 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>-              RenderMathMLToken {mn} at (34,3) size 9x12
</del><ins>+              RenderMathMLToken {mn} at (35,3) size 9x12
</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></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -662,11 +662,15 @@
</span><span class="cx"> # These tests require the Latin Modern Math font.
</span><span class="cx"> mathml/opentype/fraction-line.html [ Pass ImageOnlyFailure ]
</span><span class="cx"> mathml/presentation/fractions-linethickness.html [ Pass ImageOnlyFailure ]
</span><ins>+mathml/opentype/large-operators-italic-correction.html [ Pass Failure ]
+mathml/presentation/multiscripts-positions.html [ Pass ImageOnlyFailure ]
+mathml/presentation/scripts-subsup.html [ Pass ImageOnlyFailure ]
</ins><span class="cx"> 
</span><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 class="cx"> mathml/mathml-in-dashboard.html [ Failure ]
</span><ins>+mathml/presentation/scripts-height.html [ Failure ]
</ins><span class="cx"> 
</span><span class="cx"> # &lt;rdar://problem/19221067&gt; ASSERT(m_stretchyData.top().glyph) fails in RenderMathMLOperator.cpp
</span><span class="cx"> mathml/presentation/style-changed.html
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatormathmlpresentationrootsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/mathml/presentation/roots-expected.txt (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/mathml/presentation/roots-expected.txt        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/platform/ios-simulator/mathml/presentation/roots-expected.txt        2016-04-18 14:45:00 UTC (rev 199665)
</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 800x517
-  RenderBlock {html} at (0,0) size 800x517
-    RenderBody {body} at (8,16) size 784x485
</del><ins>+layer at (0,0) size 800x518
+  RenderBlock {html} at (0,0) size 800x518
+    RenderBody {body} at (8,16) size 784x486
</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">@@ -48,42 +48,40 @@
</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>-      RenderBlock {p} at (0,72) size 784x24
-        RenderText {#text} at (0,4) size 227x19
-          text run at (0,4) width 227: &quot;long square root with implied row: &quot;
-        RenderMathMLMath {math} at (226,0) size 54x22 [padding: 0 1 0 1]
-          RenderMathMLSquareRoot {msqrt} at (1,0) size 51x22
-            RenderMathMLBlock (anonymous, flex) at (0,0) size 12x22
-              RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x22
-                RenderMathMLBlock (anonymous, flex) at (0,0) size 9x22
-                  RenderBlock (anonymous) at (0,0) size 9x22
</del><ins>+      RenderBlock {p} at (0,72) size 784x25
+        RenderText {#text} at (0,5) size 227x19
+          text run at (0,5) width 227: &quot;long square root with implied row: &quot;
+        RenderMathMLMath {math} at (226,0) size 57x24 [padding: 0 1 0 1]
+          RenderMathMLSquareRoot {msqrt} at (1,0) size 54x24
+            RenderMathMLBlock (anonymous, flex) at (0,0) size 12x24
+              RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x24
+                RenderMathMLBlock (anonymous, flex) at (0,0) size 9x23
+                  RenderBlock (anonymous) at (0,0) size 9x23
</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 39x19
-              RenderMathMLScripts {msup} at (0,0) size 15x16
-                Base Wrapper at (0,0) size 9x16 [padding: 7 0 0 0]
-                  RenderMathMLToken {mi} at (0,7) 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;
-                SubSupPair Wrapper at (8,0) size 7x16
-                  RenderMathMLToken {mn} at (0,0) size 6x10
-                    RenderMathMLBlock (anonymous, flex) at (0,0) size 6x10
-                      RenderBlock (anonymous) at (0,0) size 6x10
-                        RenderText {#text} at (0,0) size 6x13
-                          text run at (0,0) width 6: &quot;2&quot;
-              RenderMathMLOperator {mo} at (14,7) size 17x9
</del><ins>+            RenderMathMLRootWrapper at (12,3) size 42x21
+              RenderMathMLScripts {msup} at (0,0) size 18x18
+                RenderMathMLToken {mi} at (0,8) size 9x10 [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;
+                RenderMathMLToken {mn} at (8,0) size 7x10
+                  RenderMathMLBlock (anonymous, flex) at (0,0) size 6x10
+                    RenderBlock (anonymous) at (0,0) size 6x10
+                      RenderText {#text} at (0,0) size 6x13
+                        text run at (0,0) width 6: &quot;2&quot;
+              RenderMathMLOperator {mo} at (17,8) size 17x9
</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>-              RenderMathMLToken {mn} at (30,4) size 9x12
</del><ins>+              RenderMathMLToken {mn} at (33,5) size 9x12
</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>-      RenderBlock {p} at (0,112) size 784x37
</del><ins>+      RenderBlock {p} at (0,113) size 784x37
</ins><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><span class="cx">         RenderMathMLMath {math} at (116,0) size 47x38 [padding: 0 1 0 1]
</span><span class="lines">@@ -128,7 +126,7 @@
</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,165) size 784x20
</del><ins>+      RenderBlock {p} at (0,166) size 784x20
</ins><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="cx">         RenderMathMLMath {math} at (176,0) size 23x19 [color=#0000FF] [padding: 0 1 0 1]
</span><span class="lines">@@ -151,7 +149,7 @@
</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,201) size 784x20
</del><ins>+      RenderBlock {p} at (0,202) size 784x20
</ins><span class="cx">         RenderText {#text} at (0,0) size 77x19
</span><span class="cx">           text run at (0,0) width 77: &quot;long index: &quot;
</span><span class="cx">         RenderMathMLMath {math} at (76,0) size 51x18 [padding: 0 1 0 1]
</span><span class="lines">@@ -195,7 +193,7 @@
</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,237) size 784x37
</del><ins>+      RenderBlock {p} at (0,238) size 784x37
</ins><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><span class="cx">         RenderMathMLMath {math} at (187,0) size 76x38 [padding: 0 1 0 1]
</span><span class="lines">@@ -267,7 +265,7 @@
</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,290) size 784x36
</del><ins>+      RenderBlock {p} at (0,291) size 784x36
</ins><span class="cx">         RenderText {#text} at (0,16) size 77x19
</span><span class="cx">           text run at (0,16) width 77: &quot;high index: &quot;
</span><span class="cx">         RenderMathMLMath {math} at (76,0) size 23x35 [padding: 0 1 0 1]
</span><span class="lines">@@ -302,7 +300,7 @@
</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,342) size 784x59
</del><ins>+      RenderBlock {p} at (0,343) 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">@@ -452,7 +450,7 @@
</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,417) size 784x68
</del><ins>+      RenderBlock {p} at (0,418) size 784x68
</ins><span class="cx">         RenderText {#text} at (0,36) size 114x19
</span><span class="cx">           text run at (0,36) width 114: &quot;Imbricated roots: &quot;
</span><span class="cx">         RenderMathMLMath {math} at (113,0) size 292x69 [padding: 0 1 0 1]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -790,6 +790,9 @@
</span><span class="cx"> # These tests require the Latin Modern Math font.
</span><span class="cx"> mathml/opentype/fraction-line.html [ Pass ImageOnlyFailure ]
</span><span class="cx"> mathml/presentation/fractions-linethickness.html [ Pass ImageOnlyFailure ]
</span><ins>+mathml/opentype/large-operators-italic-correction.html [ Pass Failure ]
+mathml/presentation/multiscripts-positions.html [ Pass ImageOnlyFailure ]
+mathml/presentation/scripts-subsup.html [ Pass ImageOnlyFailure ]
</ins><span class="cx"> 
</span><span class="cx"> # Missing references
</span><span class="cx"> webkit.org/b/119038 mathml/presentation/mo-stretch.html [ Failure ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/Source/WebCore/ChangeLog        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2016-04-18  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Refactor RenderMathMLScripts layout to avoid using flexbox
+        https://bugs.webkit.org/show_bug.cgi?id=153917
+
+        Reviewed by Martin Robinson.
+
+        Tests: mathml/mathml-in-html5/subsup-parameters-1.html
+               mathml/opentype/large-operators-italic-correction.html
+
+        Reimplement RenderMathMLScripts without any flexbox or anonymous.
+        We also rely on parameters from the MATH table to improve rendering.
+
+        * css/mathml.css:
+        (msub &gt; * + * + *, msup &gt; * + * + *, msubsup &gt; * + * + * + *, msub &gt; mprescripts, msup &gt; mprescripts, msubsup &gt; mprescripts, msub &gt; none, msup &gt; none, msubsup &gt; none, mmultiscripts &gt; mprescripts ~ mprescripts, mmultiscripts &gt; mprescripts ~ mprescripts ~ *): Deleted.
+        Invalid markup for scripts is now just hidden.
+        * rendering/mathml/RenderMathMLOperator.h: ditto.
+        * rendering/mathml/RenderMathMLScripts.cpp:
+        (WebCore::RenderMathMLScripts::unembellishedOperator): Reimplemented.
+        (WebCore::RenderMathMLScripts::getBaseAndScripts): Helper function to verify whether the
+        child list is valid and retrieve pointers on important children.
+        (WebCore::RenderMathMLScripts::spaceAfterScript): Helper function to get the
+        space after a script.
+        (WebCore::RenderMathMLScripts::italicCorrection): Helper function to read the
+        italic correction of a largeop base.
+        (WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Implement this function.
+        (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): Helper function to get
+        the maximum ascent/descent of all the scripts and determine the minimal
+        sub/sup shifts to apply.
+        (WebCore::RenderMathMLScripts::mirrorIfNeeded): Helper function to calculate the horizontal
+        offset depending on the directionality.
+        (WebCore::RenderMathMLScripts::layoutBlock): Implement this function.
+        (WebCore::RenderMathMLScripts::firstLineBaseline): Implement this function.
+        (WebCore::RenderMathMLScripts::paintChildren): Implement this function.
+        (WebCore::RenderMathMLScripts::RenderMathMLScripts): Deleted.
+        (WebCore::RenderMathMLScripts::base): Deleted.
+        (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair): Deleted.
+        (WebCore::RenderMathMLScripts::fixAnonymousStyles): Deleted.
+        (WebCore::RenderMathMLScripts::addChildInternal): Deleted.
+        (WebCore::RenderMathMLScripts::removeChildInternal): Deleted.
+        (WebCore::RenderMathMLScripts::addChild): Deleted.
+        (WebCore::RenderMathMLScripts::removeChild): Deleted.
+        (WebCore::RenderMathMLScripts::styleDidChange): Deleted.
+        (WebCore::RenderMathMLScripts::layout): Deleted.
+        (WebCore::RenderMathMLScriptsWrapper::createAnonymousWrapper): Deleted.
+        (WebCore::RenderMathMLScriptsWrapper::addChildInternal): Deleted.
+        (WebCore::RenderMathMLScriptsWrapper::addChild): Deleted.
+        (WebCore::RenderMathMLScriptsWrapper::removeChildInternal): Deleted.
+        (WebCore::RenderMathMLScriptsWrapper::removeChild): Deleted.
+        * rendering/mathml/RenderMathMLScripts.h: Update definitions and remove classes
+        for anonymous wrappers.
+
</ins><span class="cx"> 2016-04-18  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [css-grid] Use grid-template-areas to determine the explicit grid
</span></span></pre></div>
<a id="trunkSourceWebCorecssmathmlcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/mathml.css (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/mathml.css        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/Source/WebCore/css/mathml.css        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -101,12 +101,8 @@
</span><span class="cx">     visibility: hidden;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-/* This is a special style for erroneous markup:
-  - &lt;merror&gt; element.
-  - extra children in script elements.
-  - &lt;mprescripts/&gt; and &lt;none/&gt; elements in msub/msup/msubsup.
- */
-merror, msub &gt; * + * + *, msup &gt; * + * + *, msubsup &gt; * + * + * + *, msub &gt; mprescripts, msup &gt; mprescripts, msubsup &gt; mprescripts, msub &gt; none, msup &gt; none, msubsup &gt; none, mmultiscripts &gt; mprescripts ~ mprescripts, mmultiscripts &gt; mprescripts ~ mprescripts ~ * {
</del><ins>+/* This is a special style for erroneous markup. */
+merror {
</ins><span class="cx">     outline: solid thin red;
</span><span class="cx">     font-weight: bold;
</span><span class="cx">     font-family: sans-serif;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLScriptscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Alex Milowski (alex@milowski.com). All rights reserved.
</span><span class="cx">  * Copyright (C) 2013 The MathJax Consortium.
</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">@@ -31,488 +32,416 @@
</span><span class="cx"> #include &quot;RenderMathMLScripts.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;MathMLElement.h&quot;
</span><ins>+#include &quot;RenderMathMLOperator.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx">     
</span><span class="cx"> using namespace MathMLNames;
</span><span class="cx"> 
</span><del>-// RenderMathMLScripts implements various MathML elements drawing scripts attached to a base. For valid MathML elements, the structure of the render tree should be:
-//
-// - msub, msup, msubsup: BaseWrapper SubSupPairWrapper
-// - mmultiscripts: BaseWrapper SubSupPairWrapper* (mprescripts SubSupPairWrapper*)*
-//
-// where BaseWrapper and SubSupPairWrapper do not contain any &lt;mprescripts/&gt; children. In addition, BaseWrapper must have one child and SubSupPairWrapper must have either one child (msub, msup) or two children (msubsup, mmultiscripts).
-//
-// In order to accept invalid markup and to handle the script elements consistently and uniformly, we will use a more general structure that encompasses both valid and invalid elements:
-//
-// BaseWrapper SubSupPairWrapper* (mprescripts SubSupPairWrapper*)*
-//
-// where BaseWrapper can now be empty and SubSupPairWrapper can now have one or two elements.
-//
-
-static bool isPrescript(const RenderObject&amp; renderObject)
</del><ins>+static bool isPrescriptDelimiter(const RenderObject&amp; renderObject)
</ins><span class="cx"> {
</span><span class="cx">     return renderObject.node() &amp;&amp; renderObject.node()-&gt;hasTagName(MathMLNames::mprescriptsTag);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderMathMLScripts::RenderMathMLScripts(Element&amp; element, Ref&lt;RenderStyle&gt;&amp;&amp; style)
</span><span class="cx">     : RenderMathMLBlock(element, WTFMove(style))
</span><del>-    , m_baseWrapper(0)
</del><span class="cx"> {
</span><span class="cx">     // Determine what kind of sub/sup expression we have by element name
</span><span class="cx">     if (element.hasTagName(MathMLNames::msubTag))
</span><del>-        m_kind = Sub;
</del><ins>+        m_scriptType = Sub;
</ins><span class="cx">     else if (element.hasTagName(MathMLNames::msupTag))
</span><del>-        m_kind = Super;
</del><ins>+        m_scriptType = Super;
</ins><span class="cx">     else if (element.hasTagName(MathMLNames::msubsupTag))
</span><del>-        m_kind = SubSup;
</del><ins>+        m_scriptType = SubSup;
</ins><span class="cx">     else {
</span><span class="cx">         ASSERT(element.hasTagName(MathMLNames::mmultiscriptsTag));
</span><del>-        m_kind = Multiscripts;
</del><ins>+        m_scriptType = Multiscripts;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RenderBoxModelObject* RenderMathMLScripts::base() const
</del><ins>+RenderMathMLOperator* RenderMathMLScripts::unembellishedOperator()
</ins><span class="cx"> {
</span><del>-    if (!m_baseWrapper)
</del><ins>+    RenderBox* base = firstChildBox();
+    if (!is&lt;RenderMathMLBlock&gt;(base))
</ins><span class="cx">         return nullptr;
</span><del>-    RenderObject* base = m_baseWrapper-&gt;firstChild();
-    if (!is&lt;RenderBoxModelObject&gt;(base))
-        return nullptr;
-    return downcast&lt;RenderBoxModelObject&gt;(base);
</del><ins>+    return downcast&lt;RenderMathMLBlock&gt;(base)-&gt;unembellishedOperator();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLScripts::fixAnonymousStyleForSubSupPair(RenderObject* subSupPair, bool isPostScript)
</del><ins>+bool RenderMathMLScripts::getBaseAndScripts(RenderBox*&amp; base, RenderBox*&amp; firstPostScript, RenderBox*&amp; firstPreScript)
</ins><span class="cx"> {
</span><del>-    ASSERT(subSupPair &amp;&amp; subSupPair-&gt;style().refCount() == 1);
-    RenderStyle&amp; scriptsStyle = subSupPair-&gt;style();
</del><ins>+    // All scripted elements must have at least one child.
+    // The first child is the base.
+    base = firstChildBox();
+    firstPostScript = nullptr;
+    firstPreScript = nullptr;
+    if (!base)
+        return false;
</ins><span class="cx"> 
</span><del>-    // subSup pairs are drawn in column from bottom (subscript) to top (superscript).
-    scriptsStyle.setFlexDirection(FlowColumnReverse);
</del><ins>+    switch (m_scriptType) {
+    case Sub:
+    case Super:
+        // These elements must have exactly two children.
+        // The second child is a postscript and there are no prescripts.
+        // &lt;msub&gt; base subscript &lt;/msub&gt;
+        // &lt;msup&gt; base superscript &lt;/msup&gt;
+        firstPostScript = base-&gt;nextSiblingBox();
+        return firstPostScript &amp;&amp; !isPrescriptDelimiter(*firstPostScript) &amp;&amp; !firstPostScript-&gt;nextSiblingBox();
+    case SubSup: {
+        // This element must have exactly three children.
+        // The second and third children are postscripts and there are no prescripts.
+        // &lt;msubsup&gt; base subscript superscript &lt;/msubsup&gt;
+        firstPostScript = base-&gt;nextSiblingBox();
+        if (!firstPostScript || isPrescriptDelimiter(*firstPostScript))
+            return false;
+        RenderBox* superScript = firstPostScript-&gt;nextSiblingBox();
+        return superScript &amp;&amp; !isPrescriptDelimiter(*superScript) &amp;&amp; !superScript-&gt;nextSiblingBox();
+    }
+    case Multiscripts: {
+        // This element accepts the following syntax:
+        //
+        // &lt;mmultiscripts&gt;
+        //   base
+        //   (subscript superscript)*
+        //   [ &lt;mprescripts/&gt; (presubscript presuperscript)* ]
+        // &lt;/mmultiscripts&gt;
+        //
+        // https://www.w3.org/TR/MathML3/chapter3.html#presm.mmultiscripts
+        //
+        // We set the first postscript, unless (subscript superscript)* is empty.
+        if (base-&gt;nextSiblingBox() &amp;&amp; !isPrescriptDelimiter(*base-&gt;nextSiblingBox()))
+            firstPostScript = base-&gt;nextSiblingBox();
</ins><span class="cx"> 
</span><del>-    // The MathML specification does not specify horizontal alignment of
-    // scripts. We align the bottom (respectively top) edge of the subscript
-    // (respectively superscript) with the bottom (respectively top) edge of
-    // the flex container. Note that for valid &lt;msub&gt; and &lt;msup&gt; elements, the
-    // subSupPair should actually have only one script.
-    if (m_kind == Sub)
-        scriptsStyle.setJustifyContentPosition(ContentPositionFlexStart);
-    else if (m_kind == Super)
-        scriptsStyle.setJustifyContentPosition(ContentPositionFlexEnd);
-    else
-        scriptsStyle.setJustifyContentDistribution(ContentDistributionSpaceBetween);
</del><ins>+        // We browse the children in order to
+        // 1) Set the first prescript, unless (presubscript presuperscript)* is empty.
+        // 2) Ensure the validity of the element i.e.
+        //   a) That the list of postscripts can be grouped into pairs of subscript/superscript.
+        //   b) That the list of prescripts can be grouped into pairs of subscript/superscript.
+        //   c) That there is at most one &lt;mprescripts/&gt;.
+        bool numberOfScriptIsEven = true;
+        for (RenderBox* script = base-&gt;nextSiblingBox(); script; script = script-&gt;nextSiblingBox()) {
+            if (isPrescriptDelimiter(*script)) {
+                // This is a &lt;mprescripts/&gt;. Let's check 2a) and 2c).
+                if (!numberOfScriptIsEven || firstPreScript)
+                    return false;
+                firstPreScript = script-&gt;nextSiblingBox(); // We do 1).
+                continue;
+            }
+            numberOfScriptIsEven = !numberOfScriptIsEven;
+        }
+        return numberOfScriptIsEven; // We verify 2b).
+    }
+    }
</ins><span class="cx"> 
</span><del>-    // The MathML specification does not specify vertical alignment of scripts.
-    // Let's right align prescripts and left align postscripts.
-    // See http://lists.w3.org/Archives/Public/www-math/2012Aug/0006.html
-    scriptsStyle.setAlignItemsPosition(isPostScript ? ItemPositionFlexStart : ItemPositionFlexEnd);
</del><ins>+    ASSERT_NOT_REACHED();
+    return false;
+}
</ins><span class="cx"> 
</span><del>-    // We set the order property so that the prescripts are drawn before the base.
-    scriptsStyle.setOrder(isPostScript ? 0 : -1);
</del><ins>+LayoutUnit RenderMathMLScripts::spaceAfterScript()
+{
+    const auto&amp; primaryFont = style().fontCascade().primaryFont();
+    if (auto* mathData = primaryFont.mathData())
+        return mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::SpaceAfterScript);
+    return style().fontCascade().size() / 5;
+}
</ins><span class="cx"> 
</span><del>-    // We set this wrapper's font-size for its line-height.
-    LayoutUnit scriptSize = static_cast&lt;int&gt;(0.75 * style().fontSize());
-    scriptsStyle.setFontSize(scriptSize);
</del><ins>+LayoutUnit RenderMathMLScripts::italicCorrection(RenderBox* base)
+{
+    if (is&lt;RenderMathMLBlock&gt;(*base)) {
+        if (auto* renderOperator = downcast&lt;RenderMathMLBlock&gt;(*base).unembellishedOperator())
+            return renderOperator-&gt;italicCorrection();
+    }
+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLScripts::fixAnonymousStyles()
</del><ins>+void RenderMathMLScripts::computePreferredLogicalWidths()
</ins><span class="cx"> {
</span><del>-    // We set the base wrapper's style so that baseHeight in layout() will be an unstretched height.
-    ASSERT(m_baseWrapper &amp;&amp; m_baseWrapper-&gt;style().hasOneRef());
-    m_baseWrapper-&gt;style().setAlignSelfPosition(ItemPositionFlexStart);
</del><ins>+    m_minPreferredLogicalWidth = 0;
+    m_maxPreferredLogicalWidth = 0;
</ins><span class="cx"> 
</span><del>-    // This sets the style for postscript pairs.
-    RenderObject* subSupPair = m_baseWrapper;
-    for (subSupPair = subSupPair-&gt;nextSibling(); subSupPair &amp;&amp; !isPrescript(*subSupPair); subSupPair = subSupPair-&gt;nextSibling())
-        fixAnonymousStyleForSubSupPair(subSupPair, true);
</del><ins>+    RenderBox* base;
+    RenderBox* firstPostScript;
+    RenderBox* firstPreScript;
+    if (!getBaseAndScripts(base, firstPostScript, firstPreScript))
+        return;
</ins><span class="cx"> 
</span><del>-    if (subSupPair &amp;&amp; m_kind == Multiscripts) {
-        // This sets the style for prescript pairs.
-        for (subSupPair = subSupPair-&gt;nextSibling(); subSupPair &amp;&amp; !isPrescript(*subSupPair); subSupPair = subSupPair-&gt;nextSibling())
-            fixAnonymousStyleForSubSupPair(subSupPair, false);
-    }
</del><ins>+    LayoutUnit baseItalicCorrection = std::min(base-&gt;maxPreferredLogicalWidth(), italicCorrection(base));
+    LayoutUnit space = spaceAfterScript();
</ins><span class="cx"> 
</span><del>-    // This resets style for extra subSup pairs.
-    for (; subSupPair; subSupPair = subSupPair-&gt;nextSibling()) {
-        if (!isPrescript(*subSupPair)) {
-            ASSERT(subSupPair &amp;&amp; subSupPair-&gt;style().refCount() == 1);
-            RenderStyle&amp; scriptsStyle = subSupPair-&gt;style();
-            scriptsStyle.setFlexDirection(FlowRow);
-            scriptsStyle.setJustifyContentPosition(ContentPositionFlexStart);
-            scriptsStyle.setAlignItemsPosition(ItemPositionCenter);
-            scriptsStyle.setOrder(0);
-            scriptsStyle.setFontSize(style().fontSize());
</del><ins>+    switch (m_scriptType) {
+    case Sub:
+        m_maxPreferredLogicalWidth += base-&gt;maxPreferredLogicalWidth();
+        m_maxPreferredLogicalWidth += std::max(LayoutUnit(0), firstPostScript-&gt;maxPreferredLogicalWidth() - baseItalicCorrection + space);
+        break;
+    case Super:
+        m_maxPreferredLogicalWidth += base-&gt;maxPreferredLogicalWidth();
+        m_maxPreferredLogicalWidth += std::max(LayoutUnit(0), firstPostScript-&gt;maxPreferredLogicalWidth() + space);
+        break;
+    case SubSup:
+    case Multiscripts: {
+        RenderBox* supScript;
+        for (RenderBox* subScript = firstPreScript; subScript; subScript = supScript-&gt;nextSiblingBox()) {
+            supScript = subScript-&gt;nextSiblingBox();
+            ASSERT(supScript);
+            LayoutUnit subSupPairWidth = std::max(subScript-&gt;maxPreferredLogicalWidth(), supScript-&gt;maxPreferredLogicalWidth());
+            m_maxPreferredLogicalWidth += subSupPairWidth + space;
</ins><span class="cx">         }
</span><ins>+        m_maxPreferredLogicalWidth += base-&gt;maxPreferredLogicalWidth();
+        for (RenderBox* subScript = firstPostScript; subScript &amp;&amp; !isPrescriptDelimiter(*subScript); subScript = supScript-&gt;nextSiblingBox()) {
+            supScript = subScript-&gt;nextSiblingBox();
+            ASSERT(supScript);
+            LayoutUnit subSupPairWidth = std::max(std::max(LayoutUnit(0), subScript-&gt;maxPreferredLogicalWidth() - baseItalicCorrection), supScript-&gt;maxPreferredLogicalWidth());
+            m_maxPreferredLogicalWidth += subSupPairWidth + space;
+        }
</ins><span class="cx">     }
</span><ins>+    }
+
+    m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLScripts::addChildInternal(bool doNotRestructure, RenderObject* child, RenderObject* beforeChild)
</del><ins>+void RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded(RenderBox* base, RenderBox* script, LayoutUnit&amp; minSubScriptShift, LayoutUnit&amp; minSupScriptShift, LayoutUnit&amp; maxScriptDescent, LayoutUnit&amp; maxScriptAscent)
</ins><span class="cx"> {
</span><del>-    if (doNotRestructure) {
-        RenderMathMLBlock::addChild(child, beforeChild);
-        return;
-    }
</del><ins>+    LayoutUnit baseAscent = ascentForChild(*base);
+    LayoutUnit baseDescent = base-&gt;logicalHeight() - baseAscent;
+    LayoutUnit subscriptShiftDown;
+    LayoutUnit superscriptShiftUp;
+    LayoutUnit subscriptBaselineDropMin;
+    LayoutUnit superScriptBaselineDropMax;
+    LayoutUnit subSuperscriptGapMin;
+    LayoutUnit superscriptBottomMin;
+    LayoutUnit subscriptTopMax;
+    LayoutUnit superscriptBottomMaxWithSubscript;
</ins><span class="cx"> 
</span><del>-    if (beforeChild) {
-        // beforeChild may be a grandchild, so we call the addChild function of the corresponding wrapper instead.
-        RenderObject* parent = beforeChild-&gt;parent();
-        if (parent != this) {
-            RenderMathMLBlock&amp; parentBlock = downcast&lt;RenderMathMLBlock&gt;(*parent);
-            if (is&lt;RenderMathMLScriptsWrapper&gt;(parentBlock)) {
-                RenderMathMLScriptsWrapper&amp; wrapper = downcast&lt;RenderMathMLScriptsWrapper&gt;(parentBlock);
-                wrapper.addChildInternal(false, child, beforeChild);
-                return;
-            }
-        }
</del><ins>+    const auto&amp; primaryFont = style().fontCascade().primaryFont();
+    if (auto* mathData = primaryFont.mathData()) {
+        subscriptShiftDown = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::SubscriptShiftDown);
+        superscriptShiftUp = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::SuperscriptShiftUp);
+        subscriptBaselineDropMin = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::SubscriptBaselineDropMin);
+        superScriptBaselineDropMax = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::SuperscriptBaselineDropMax);
+        subSuperscriptGapMin = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::SubSuperscriptGapMin);
+        superscriptBottomMin = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::SuperscriptBottomMin);
+        subscriptTopMax = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::SubscriptTopMax);
+        superscriptBottomMaxWithSubscript = mathData-&gt;getMathConstant(primaryFont, OpenTypeMathData::SuperscriptBottomMaxWithSubscript);
+    } else {
+        // Default heuristic values when you do not have a font.
+        subscriptShiftDown = style().fontMetrics().xHeight() / 3;
+        superscriptShiftUp = style().fontMetrics().xHeight();
+        subscriptBaselineDropMin = style().fontMetrics().xHeight() / 2;
+        superScriptBaselineDropMax = style().fontMetrics().xHeight() / 2;
+        subSuperscriptGapMin = style().fontCascade().size() / 5;
+        superscriptBottomMin = style().fontMetrics().xHeight() / 4;
+        subscriptTopMax = 4 * style().fontMetrics().xHeight() / 5;
+        superscriptBottomMaxWithSubscript = 4 * style().fontMetrics().xHeight() / 5;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (beforeChild == m_baseWrapper) {
-        // This is like inserting the child at the beginning of the base wrapper.
-        m_baseWrapper-&gt;addChildInternal(false, child, m_baseWrapper-&gt;firstChild());
-        return;
</del><ins>+    if (m_scriptType == Sub || m_scriptType == SubSup || m_scriptType == Multiscripts) {
+        LayoutUnit specifiedMinSubShift = 0;
+        parseMathMLLength(element()-&gt;fastGetAttribute(MathMLNames::subscriptshiftAttr), specifiedMinSubShift, &amp;style(), false);
+        minSubScriptShift = std::max(subscriptShiftDown, baseDescent + subscriptBaselineDropMin);
+        minSubScriptShift = std::max(minSubScriptShift, specifiedMinSubShift);
</ins><span class="cx">     }
</span><del>-    
-    if (isPrescript(*child)) {
-        // The new child becomes an &lt;mprescripts/&gt; separator.
-        RenderMathMLBlock::addChild(child, beforeChild);
-        return;
</del><ins>+    if (m_scriptType == Super || m_scriptType == SubSup || m_scriptType == Multiscripts) {
+        LayoutUnit specifiedMinSupShift = 0;
+        parseMathMLLength(element()-&gt;fastGetAttribute(MathMLNames::superscriptshiftAttr), specifiedMinSupShift, &amp;style(), false);
+        minSupScriptShift = std::max(superscriptShiftUp, baseAscent - superScriptBaselineDropMax);
+        minSupScriptShift = std::max(minSupScriptShift, specifiedMinSupShift);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!beforeChild || isPrescript(*beforeChild)) {
-        // We are at the end of a sequence of subSup pairs.
-        RenderMathMLBlock* previousSibling = downcast&lt;RenderMathMLBlock&gt;(beforeChild ? beforeChild-&gt;previousSibling() : lastChild());
-        if (is&lt;RenderMathMLScriptsWrapper&gt;(previousSibling)) {
-            RenderMathMLScriptsWrapper&amp; wrapper = downcast&lt;RenderMathMLScriptsWrapper&gt;(*previousSibling);
-            if ((wrapper.m_kind == RenderMathMLScriptsWrapper::Base &amp;&amp; wrapper.isEmpty()) || (wrapper.m_kind == RenderMathMLScriptsWrapper::SubSupPair &amp;&amp; !wrapper.firstChild()-&gt;nextSibling())) {
-                // The previous sibling is either an empty base or a SubSup pair with a single child so we can insert the new child into that wrapper.
-                wrapper.addChildInternal(true, child);
-                return;
-            }
-        }
-        // Otherwise we create a new subSupPair to store the new child.
-        RenderMathMLScriptsWrapper* subSupPair = RenderMathMLScriptsWrapper::createAnonymousWrapper(this, RenderMathMLScriptsWrapper::SubSupPair);
-        subSupPair-&gt;addChildInternal(true, child);
-        RenderMathMLBlock::addChild(subSupPair, beforeChild);
-        return;
</del><ins>+    switch (m_scriptType) {
+    case Sub: {
+        script-&gt;layoutIfNeeded();
+        LayoutUnit subAscent = ascentForChild(*script);
+        LayoutUnit subDescent = script-&gt;logicalHeight() - subAscent;
+        maxScriptDescent = subDescent;
+        minSubScriptShift = std::max(minSubScriptShift, subAscent - subscriptTopMax);
</ins><span class="cx">     }
</span><del>-
-    // beforeChild is a subSup pair. This is like inserting the new child at the beginning of the subSup wrapper.
-    RenderMathMLScriptsWrapper&amp; wrapper = downcast&lt;RenderMathMLScriptsWrapper&gt;(*beforeChild);
-    ASSERT(wrapper.m_kind == RenderMathMLScriptsWrapper::SubSupPair);
-    ASSERT(!(m_baseWrapper-&gt;isEmpty() &amp;&amp; m_baseWrapper-&gt;nextSibling() == beforeChild));
-    wrapper.addChildInternal(false, child, wrapper.firstChild());
-}
-
-void RenderMathMLScripts::removeChildInternal(bool doNotRestructure, RenderObject&amp; child)
-{
-    if (doNotRestructure) {
-        RenderMathMLBlock::removeChild(child);
-        return;
</del><ins>+        break;
+    case Super: {
+        script-&gt;layoutIfNeeded();
+        LayoutUnit supAscent = ascentForChild(*script);
+        LayoutUnit supDescent = script-&gt;logicalHeight() - supAscent;
+        maxScriptAscent = supAscent;
+        minSupScriptShift = std::max(minSupScriptShift, superscriptBottomMin + supDescent);
</ins><span class="cx">     }
</span><ins>+        break;
+    case SubSup:
+    case Multiscripts: {
+        RenderBox* supScript;
+        for (RenderBox* subScript = script; subScript &amp;&amp; !isPrescriptDelimiter(*subScript); subScript = supScript-&gt;nextSiblingBox()) {
+            supScript = subScript-&gt;nextSiblingBox();
+            ASSERT(supScript);
+            subScript-&gt;layoutIfNeeded();
+            supScript-&gt;layoutIfNeeded();
+            LayoutUnit subAscent = ascentForChild(*subScript);
+            LayoutUnit subDescent = subScript-&gt;logicalHeight() - subAscent;
+            LayoutUnit supAscent = ascentForChild(*supScript);
+            LayoutUnit supDescent = supScript-&gt;logicalHeight() - supAscent;
+            maxScriptAscent = std::max(maxScriptAscent, supAscent);
+            maxScriptDescent = std::max(maxScriptDescent, subDescent);
+            LayoutUnit subScriptShift = std::max(subscriptShiftDown, baseDescent + subscriptBaselineDropMin);
+            subScriptShift = std::max(subScriptShift, subAscent - subscriptTopMax);
+            LayoutUnit supScriptShift = std::max(superscriptShiftUp, baseAscent - superScriptBaselineDropMax);
+            supScriptShift = std::max(supScriptShift, superscriptBottomMin + supDescent);
</ins><span class="cx"> 
</span><del>-    ASSERT(isPrescript(child));
</del><ins>+            LayoutUnit subSuperscriptGap = (subScriptShift - subAscent) + (supScriptShift - supDescent);
+            if (subSuperscriptGap &lt; subSuperscriptGapMin) {
+                // First, we try and push the superscript up.
+                LayoutUnit delta = superscriptBottomMaxWithSubscript - (supScriptShift - supDescent);
+                if (delta &gt; 0) {
+                    delta = std::min(delta, subSuperscriptGapMin - subSuperscriptGap);
+                    supScriptShift += delta;
+                    subSuperscriptGap += delta;
+                }
+                // If that is not enough, we push the subscript down.
+                if (subSuperscriptGap &lt; subSuperscriptGapMin)
+                    subScriptShift += subSuperscriptGapMin - subSuperscriptGap;
+            }
</ins><span class="cx"> 
</span><del>-    RenderObject* previousSibling = child.previousSibling();
-    RenderObject* nextSibling = child.nextSibling();
-    ASSERT(previousSibling);
-
-    if (nextSibling &amp;&amp; !isPrescript(*previousSibling) &amp;&amp; !isPrescript(*nextSibling)) {
-        RenderMathMLScriptsWrapper&amp; previousWrapper = downcast&lt;RenderMathMLScriptsWrapper&gt;(*previousSibling);
-        RenderMathMLScriptsWrapper&amp; nextWrapper = downcast&lt;RenderMathMLScriptsWrapper&gt;(*nextSibling);
-        ASSERT(nextWrapper.m_kind == RenderMathMLScriptsWrapper::SubSupPair &amp;&amp; !nextWrapper.isEmpty());
-        if ((previousWrapper.m_kind == RenderMathMLScriptsWrapper::Base &amp;&amp; previousWrapper.isEmpty()) || (previousWrapper.m_kind == RenderMathMLScriptsWrapper::SubSupPair &amp;&amp; !previousWrapper.firstChild()-&gt;nextSibling())) {
-            RenderObject* script = nextWrapper.firstChild();
-            nextWrapper.removeChildInternal(false, *script);
-            previousWrapper.addChildInternal(true, script);
</del><ins>+            minSubScriptShift = std::max(minSubScriptShift, subScriptShift);
+            minSupScriptShift = std::max(minSupScriptShift, supScriptShift);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><del>-
-    RenderMathMLBlock::removeChild(child);
-}
-
-void RenderMathMLScripts::addChild(RenderObject* child, RenderObject* beforeChild)
-{
-    if (isEmpty()) {
-        m_baseWrapper = RenderMathMLScriptsWrapper::createAnonymousWrapper(this, RenderMathMLScriptsWrapper::Base);
-        RenderMathMLBlock::addChild(m_baseWrapper);
</del><span class="cx">     }
</span><del>-
-    addChildInternal(false, child, beforeChild);
-
-    fixAnonymousStyles();
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLScripts::removeChild(RenderObject&amp; child)
</del><ins>+LayoutUnit RenderMathMLScripts::mirrorIfNeeded(LayoutUnit horizontalOffset, const RenderBox&amp; child)
</ins><span class="cx"> {
</span><del>-    if (beingDestroyed() || documentBeingDestroyed()) {
-        // The renderer is being destroyed so we remove the child normally.
-        RenderMathMLBlock::removeChild(child);
-        return;
-    }
</del><ins>+    if (style().direction() == RTL)
+        return logicalWidth() - child.logicalWidth() - horizontalOffset;
</ins><span class="cx"> 
</span><del>-    removeChildInternal(false, child);
-    fixAnonymousStyles();
</del><ins>+    return horizontalOffset;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLScripts::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
</del><ins>+void RenderMathMLScripts::layoutBlock(bool relayoutChildren, LayoutUnit)
</ins><span class="cx"> {
</span><del>-    RenderMathMLBlock::styleDidChange(diff, oldStyle);
-    
-    if (!isEmpty())
-        fixAnonymousStyles();
-}
</del><ins>+    ASSERT(needsLayout());
</ins><span class="cx"> 
</span><del>-RenderMathMLOperator* RenderMathMLScripts::unembellishedOperator()
-{
-    RenderBoxModelObject* base = this-&gt;base();
-    if (!is&lt;RenderMathMLBlock&gt;(base))
-        return nullptr;
-    return downcast&lt;RenderMathMLBlock&gt;(*base).unembellishedOperator();
-}
</del><ins>+    if (!relayoutChildren &amp;&amp; simplifiedLayout())
+        return;
</ins><span class="cx"> 
</span><del>-void RenderMathMLScripts::layout()
-{
-    RenderMathMLBlock::layout();
-
-    if (!m_baseWrapper)
</del><ins>+    RenderBox* base;
+    RenderBox* firstPostScript;
+    RenderBox* firstPreScript;
+    if (!getBaseAndScripts(base, firstPostScript, firstPreScript)) {
+        setLogicalWidth(0);
+        setLogicalHeight(0);
+        clearNeedsLayout();
</ins><span class="cx">         return;
</span><del>-    RenderBox* base = m_baseWrapper-&gt;firstChildBox();
-    if (!base)
-        return;
</del><ins>+    }
+    recomputeLogicalWidth();
+    base-&gt;layoutIfNeeded();
</ins><span class="cx"> 
</span><del>-    // Our layout rules include: Don't let the superscript go below the &quot;axis&quot; (half x-height above the
-    // baseline), or the subscript above the axis. Also, don't let the superscript's top edge be
-    // below the base's top edge, or the subscript's bottom edge above the base's bottom edge.
</del><ins>+    LayoutUnit supScriptShift = 0;
+    LayoutUnit subScriptShift = 0;
+    LayoutUnit scriptDescent = 0;
+    LayoutUnit scriptAscent = 0;
+    LayoutUnit space = spaceAfterScript();
</ins><span class="cx"> 
</span><del>-    LayoutUnit baseHeight = base-&gt;logicalHeight();
-    LayoutUnit baseBaseline = base-&gt;firstLineBaseline().valueOr(baseHeight);
-    LayoutUnit axis = style().fontMetrics().xHeight() / 2;
-    int fontSize = style().fontSize();
</del><ins>+    if (m_scriptType == Multiscripts)
+        getScriptMetricsAndLayoutIfNeeded(base, firstPreScript, subScriptShift, supScriptShift, scriptDescent, scriptAscent);
+    getScriptMetricsAndLayoutIfNeeded(base, firstPostScript, subScriptShift, supScriptShift, scriptDescent, scriptAscent);
</ins><span class="cx"> 
</span><del>-    ASSERT(m_baseWrapper-&gt;style().hasOneRef());
-    bool needsSecondLayout = false;
</del><ins>+    LayoutUnit baseAscent = ascentForChild(*base);
+    LayoutUnit baseDescent = base-&gt;logicalHeight() - baseAscent;
+    LayoutUnit baseItalicCorrection = std::min(base-&gt;logicalWidth(), italicCorrection(base));
+    LayoutUnit horizontalOffset = 0;
</ins><span class="cx"> 
</span><del>-    LayoutUnit topPadding = 0;
-    LayoutUnit bottomPadding = 0;
</del><ins>+    LayoutUnit ascent = std::max(baseAscent, scriptAscent + supScriptShift);
+    LayoutUnit descent = std::max(baseDescent, scriptDescent + subScriptShift);
+    setLogicalHeight(ascent + descent);
</ins><span class="cx"> 
</span><del>-    Element* scriptElement = element();
-    LayoutUnit superscriptShiftValue = 0;
-    LayoutUnit subscriptShiftValue = 0;
-    if (m_kind == Sub || m_kind == SubSup || m_kind == Multiscripts)
-        parseMathMLLength(scriptElement-&gt;fastGetAttribute(MathMLNames::subscriptshiftAttr), subscriptShiftValue, &amp;style(), false);
-    if (m_kind == Super || m_kind == SubSup || m_kind == Multiscripts)
-        parseMathMLLength(scriptElement-&gt;fastGetAttribute(MathMLNames::superscriptshiftAttr), superscriptShiftValue, &amp;style(), false);
</del><ins>+    switch (m_scriptType) {
+    case Sub: {
+        setLogicalWidth(base-&gt;logicalWidth() + std::max(LayoutUnit(0), firstPostScript-&gt;logicalWidth() - baseItalicCorrection + space));
+        LayoutPoint baseLocation(mirrorIfNeeded(horizontalOffset, *base), ascent - baseAscent);
+        base-&gt;setLocation(baseLocation);
+        horizontalOffset += base-&gt;logicalWidth();
+        LayoutUnit scriptAscent = ascentForChild(*firstPostScript);
+        LayoutPoint scriptLocation(mirrorIfNeeded(horizontalOffset - baseItalicCorrection, *firstPostScript), ascent + subScriptShift - scriptAscent);
+        firstPostScript-&gt;setLocation(scriptLocation);
+    }
+        break;
+    case Super: {
+        setLogicalWidth(base-&gt;logicalWidth() + std::max(LayoutUnit(0), firstPostScript-&gt;logicalWidth() + space));
+        LayoutPoint baseLocation(mirrorIfNeeded(horizontalOffset, *base), ascent - baseAscent);
+        base-&gt;setLocation(baseLocation);
+        horizontalOffset += base-&gt;logicalWidth();
+        LayoutUnit scriptAscent = ascentForChild(*firstPostScript);
+        LayoutPoint scriptLocation(mirrorIfNeeded(horizontalOffset, *firstPostScript), ascent - supScriptShift - scriptAscent);
+        firstPostScript-&gt;setLocation(scriptLocation);
+    }
+        break;
+    case SubSup:
+    case Multiscripts: {
+        RenderBox* supScript;
</ins><span class="cx"> 
</span><del>-    bool isPostScript = true;
-    RenderMathMLBlock* subSupPair = downcast&lt;RenderMathMLBlock&gt;(m_baseWrapper-&gt;nextSibling());
-    for (; subSupPair; subSupPair = downcast&lt;RenderMathMLBlock&gt;(subSupPair-&gt;nextSibling())) {
-
-        // We skip the base and &lt;mprescripts/&gt; elements.
-        if (isPrescript(*subSupPair)) {
-            if (!isPostScript)
-                break;
-            isPostScript = false;
-            continue;
</del><ins>+        // Calculate the logical width.
+        LayoutUnit logicalWidth = 0;
+        for (RenderBox* subScript = firstPreScript; subScript; subScript = supScript-&gt;nextSiblingBox()) {
+            supScript = subScript-&gt;nextSiblingBox();
+            ASSERT(supScript);
+            LayoutUnit subSupPairWidth = std::max(subScript-&gt;logicalWidth(), supScript-&gt;logicalWidth());
+            logicalWidth += subSupPairWidth + space;
</ins><span class="cx">         }
</span><ins>+        logicalWidth += base-&gt;logicalWidth();
+        for (RenderBox* subScript = firstPostScript; subScript &amp;&amp; !isPrescriptDelimiter(*subScript); subScript = supScript-&gt;nextSiblingBox()) {
+            supScript = subScript-&gt;nextSiblingBox();
+            ASSERT(supScript);
+            LayoutUnit subSupPairWidth = std::max(std::max(LayoutUnit(0), subScript-&gt;logicalWidth() - baseItalicCorrection), supScript-&gt;logicalWidth());
+            logicalWidth += subSupPairWidth + space;
+        }
+        setLogicalWidth(logicalWidth);
</ins><span class="cx"> 
</span><del>-        if (RenderBox* superscript = m_kind == Sub ? 0 : subSupPair-&gt;lastChildBox()) {
-            LayoutUnit superscriptHeight = superscript-&gt;logicalHeight();
-            LayoutUnit superscriptBaseline = superscript-&gt;firstLineBaseline().valueOr(superscriptHeight);
-            LayoutUnit minBaseline = std::max&lt;LayoutUnit&gt;(fontSize / 3 + 1 + superscriptBaseline, superscriptHeight + axis + superscriptShiftValue);
-
-            topPadding = std::max&lt;LayoutUnit&gt;(topPadding, minBaseline - baseBaseline);
</del><ins>+        for (RenderBox* subScript = firstPreScript; subScript; subScript = supScript-&gt;nextSiblingBox()) {
+            supScript = subScript-&gt;nextSiblingBox();
+            ASSERT(supScript);
+            LayoutUnit subSupPairWidth = std::max(subScript-&gt;logicalWidth(), supScript-&gt;logicalWidth());
+            horizontalOffset += space + subSupPairWidth;
+            LayoutUnit subAscent = ascentForChild(*subScript);
+            LayoutPoint subScriptLocation(mirrorIfNeeded(horizontalOffset - subScript-&gt;logicalWidth(), *subScript), ascent + subScriptShift - subAscent);
+            subScript-&gt;setLocation(subScriptLocation);
+            LayoutUnit supAscent = ascentForChild(*supScript);
+            LayoutPoint supScriptLocation(mirrorIfNeeded(horizontalOffset - supScript-&gt;logicalWidth(), *supScript), ascent - supScriptShift - supAscent);
+            supScript-&gt;setLocation(supScriptLocation);
</ins><span class="cx">         }
</span><ins>+        LayoutPoint baseLocation(mirrorIfNeeded(horizontalOffset, *base), ascent - baseAscent);
+        base-&gt;setLocation(baseLocation);
+        horizontalOffset += base-&gt;logicalWidth();
+        for (RenderBox* subScript = firstPostScript; subScript &amp;&amp; !isPrescriptDelimiter(*subScript); subScript = supScript-&gt;nextSiblingBox()) {
+            supScript = subScript-&gt;nextSiblingBox();
+            ASSERT(supScript);
+            LayoutUnit subAscent = ascentForChild(*subScript);
+            LayoutPoint subScriptLocation(mirrorIfNeeded(horizontalOffset - baseItalicCorrection, *subScript), ascent + subScriptShift - subAscent);
+            subScript-&gt;setLocation(subScriptLocation);
+            LayoutUnit supAscent = ascentForChild(*supScript);
+            LayoutPoint supScriptLocation(mirrorIfNeeded(horizontalOffset, *supScript), ascent - supScriptShift - supAscent);
+            supScript-&gt;setLocation(supScriptLocation);
</ins><span class="cx"> 
</span><del>-        if (RenderBox* subscript = m_kind == Super ? 0 : subSupPair-&gt;firstChildBox()) {
-            LayoutUnit subscriptHeight = subscript-&gt;logicalHeight();
-            LayoutUnit subscriptBaseline = subscript-&gt;firstLineBaseline().valueOr(subscriptHeight);
-            LayoutUnit baseExtendUnderBaseline = baseHeight - baseBaseline;
-            LayoutUnit subscriptUnderItsBaseline = subscriptHeight - subscriptBaseline;
-            LayoutUnit minExtendUnderBaseline = std::max&lt;LayoutUnit&gt;(fontSize / 5 + 1 + subscriptUnderItsBaseline, subscriptHeight + subscriptShiftValue - axis);
-
-            bottomPadding = std::max&lt;LayoutUnit&gt;(bottomPadding, minExtendUnderBaseline - baseExtendUnderBaseline);
</del><ins>+            LayoutUnit subSupPairWidth = std::max(subScript-&gt;logicalWidth(), supScript-&gt;logicalWidth());
+            horizontalOffset += subSupPairWidth + space;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><del>-
-    Length newPadding(topPadding, Fixed);
-    if (newPadding != m_baseWrapper-&gt;style().paddingTop()) {
-        m_baseWrapper-&gt;style().setPaddingTop(newPadding);
-        needsSecondLayout = true;
</del><span class="cx">     }
</span><span class="cx"> 
</span><del>-    newPadding = Length(bottomPadding, Fixed);
-    if (newPadding != m_baseWrapper-&gt;style().paddingBottom()) {
-        m_baseWrapper-&gt;style().setPaddingBottom(newPadding);
-        needsSecondLayout = true;
-    }
-
-    if (!needsSecondLayout)
-        return;
-
-    setNeedsLayout(MarkOnlyThis);
-    m_baseWrapper-&gt;setChildNeedsLayout(MarkOnlyThis);
-
-    RenderMathMLBlock::layout();
</del><ins>+    clearNeedsLayout();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Optional&lt;int&gt; RenderMathMLScripts::firstLineBaseline() const
</span><span class="cx"> {
</span><del>-    if (m_baseWrapper) {
-        if (Optional&lt;int&gt; baseline = m_baseWrapper-&gt;firstLineBaseline())
-            return baseline;
-    }
-    return RenderMathMLBlock::firstLineBaseline();
</del><ins>+    ASSERT(!needsLayout());
+    RenderBox* base = firstChildBox();
+    if (!base)
+        return Optional&lt;int&gt;();
+    return Optional&lt;int&gt;(static_cast&lt;int&gt;(lroundf(ascentForChild(*base) + base-&gt;logicalTop())));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RenderMathMLScriptsWrapper* RenderMathMLScriptsWrapper::createAnonymousWrapper(RenderMathMLScripts* renderObject, WrapperType type)
</del><ins>+void RenderMathMLScripts::paintChildren(PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset, PaintInfo&amp; paintInfoForChild, bool usePrintRect)
</ins><span class="cx"> {
</span><del>-    RenderMathMLScriptsWrapper* newBlock = new RenderMathMLScriptsWrapper(renderObject-&gt;document(), RenderStyle::createAnonymousStyleWithDisplay(&amp;renderObject-&gt;style(), FLEX), type);
-    newBlock-&gt;initializeStyle();
-    return newBlock;
-}
-
-void RenderMathMLScriptsWrapper::addChildInternal(bool doNotRestructure, RenderObject* child, RenderObject* beforeChild)
-{
-    if (doNotRestructure) {
-        RenderMathMLBlock::addChild(child, beforeChild);
-        return;
-    }
-
-    RenderMathMLScripts* parentNode = downcast&lt;RenderMathMLScripts&gt;(parent());
-
-    if (m_kind == Base) {
-        RenderObject* sibling = nextSibling();
-
-        if (!isEmpty() &amp;&amp; !beforeChild) {
-            // This is like inserting the child after the base wrapper.
-            parentNode-&gt;addChildInternal(false, sibling);
</del><ins>+    for (RenderBox* child = firstChildBox(); child; child = child-&gt;nextSiblingBox()) {
+        if (!paintChild(*child, paintInfo, paintOffset, paintInfoForChild, usePrintRect, PaintAsInlineBlock))
</ins><span class="cx">             return;
</span><del>-        }
-
-        // The old base (if any) becomes a script ; the new child becomes either the base or an &lt;mprescripts&gt; separator.
-        RenderObject* oldBase = firstChild();
-        if (oldBase)
-            RenderMathMLBlock::removeChild(*oldBase);
-        if (isPrescript(*child))
-            parentNode-&gt;addChildInternal(true, child, sibling);
-        else
-            RenderMathMLBlock::addChild(child);
-        if (oldBase)
-            parentNode-&gt;addChildInternal(false, oldBase, sibling);
-        return;
</del><span class="cx">     }
</span><del>-
-    if (isPrescript(*child)) {
-        // We insert an &lt;mprescripts&gt; element.
-        if (!beforeChild)
-            parentNode-&gt;addChildInternal(true, child, nextSibling());
-        else if (beforeChild == firstChild())
-            parentNode-&gt;addChildInternal(true, child, this);
-        else {
-            // We insert the &lt;mprescripts&gt; in the middle of a subSup pair so we must split that pair.
-            RenderObject* sibling = nextSibling();
-            parentNode-&gt;removeChildInternal(true, *this);
-            parentNode-&gt;addChildInternal(true, child, sibling);
-
-            RenderObject* script = firstChild();
-            RenderMathMLBlock::removeChild(*script);
-            parentNode-&gt;addChildInternal(false, script, child);
-
-            script = beforeChild;
-            RenderMathMLBlock::removeChild(*script);
-            parentNode-&gt;addChildInternal(false, script, sibling);
-            destroy();
-        }
-        return;
-    }
-
-    // We first move to the last subSup pair in the curent sequence of scripts.
-    RenderMathMLScriptsWrapper* subSupPair = this;
-    while (subSupPair-&gt;nextSibling() &amp;&amp; !isPrescript(*subSupPair-&gt;nextSibling()))
-        subSupPair = downcast&lt;RenderMathMLScriptsWrapper&gt;(subSupPair-&gt;nextSibling());
-    if (subSupPair-&gt;firstChild()-&gt;nextSibling()) {
-        // The last pair has two children so we need to create a new pair to leave room for the new child.
-        RenderMathMLScriptsWrapper* newPair = createAnonymousWrapper(parentNode, RenderMathMLScriptsWrapper::SubSupPair);
-        parentNode-&gt;addChildInternal(true, newPair, subSupPair-&gt;nextSibling());
-        subSupPair = newPair;
-    }
-
-    // We shift the successors in the current sequence of scripts.
-    for (RenderObject* previousSibling = subSupPair-&gt;previousSibling(); subSupPair != this; previousSibling = previousSibling-&gt;previousSibling()) {
-        RenderMathMLScriptsWrapper&amp; previousSubSupPair = downcast&lt;RenderMathMLScriptsWrapper&gt;(*previousSibling);
-        RenderObject* script = previousSubSupPair.lastChild();
-        previousSubSupPair.removeChildInternal(true, *script);
-        subSupPair-&gt;addChildInternal(true, script, subSupPair-&gt;firstChild());
-        subSupPair = downcast&lt;RenderMathMLScriptsWrapper&gt;(previousSibling);
-    }
-
-    // This subSup pair now contain one element which is either beforeChild or the script that was before. Hence we can insert the new child before of after that element.
-    RenderMathMLBlock::addChild(child, firstChild() == beforeChild ? beforeChild : nullptr);
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLScriptsWrapper::addChild(RenderObject* child, RenderObject* beforeChild)
-{
-    RenderMathMLScripts* parentNode = downcast&lt;RenderMathMLScripts&gt;(parent());
-
-    addChildInternal(false, child, beforeChild);
-
-    parentNode-&gt;fixAnonymousStyles();
-}
-
-void RenderMathMLScriptsWrapper::removeChildInternal(bool doNotRestructure, RenderObject&amp; child)
-{
-    if (doNotRestructure) {
-        RenderMathMLBlock::removeChild(child);
-        return;
-    }
-
-    RenderMathMLScripts* parentNode = downcast&lt;RenderMathMLScripts&gt;(parent());
-
-    if (m_kind == Base) {
-        // We remove the child from the base wrapper.
-        RenderObject* sibling = nextSibling();
-        RenderMathMLBlock::removeChild(child);
-        if (sibling &amp;&amp; !isPrescript(*sibling)) {
-            // If there are postscripts, the first one becomes the base.
-            RenderMathMLScriptsWrapper&amp; wrapper = downcast&lt;RenderMathMLScriptsWrapper&gt;(*sibling);
-            RenderObject* script = wrapper.firstChild();
-            wrapper.removeChildInternal(false, *script);
-            RenderMathMLBlock::addChild(script);
-        }
-        return;
-    }
-
-    // We remove the child and shift the successors in the current sequence of scripts.
-    RenderMathMLBlock::removeChild(child);
-    RenderMathMLScriptsWrapper* subSupPair = this;
-    for (RenderObject* nextSibling = subSupPair-&gt;nextSibling(); nextSibling &amp;&amp; !isPrescript(*nextSibling); nextSibling = nextSibling-&gt;nextSibling()) {
-        RenderMathMLScriptsWrapper&amp; nextSubSupPair = downcast&lt;RenderMathMLScriptsWrapper&gt;(*nextSibling);
-        RenderObject* script = nextSubSupPair.firstChild();
-        nextSubSupPair.removeChildInternal(true, *script);
-        subSupPair-&gt;addChildInternal(true, script);
-        subSupPair = downcast&lt;RenderMathMLScriptsWrapper&gt;(nextSibling);
-    }
-
-    // We remove the last subSup pair if it became empty.
-    if (subSupPair-&gt;isEmpty()) {
-        parentNode-&gt;removeChildInternal(true, *subSupPair);
-        subSupPair-&gt;destroy();
-    }
-}
-
-void RenderMathMLScriptsWrapper::removeChild(RenderObject&amp; child)
-{
-    if (beingDestroyed() || documentBeingDestroyed()) {
-        // The renderer is being destroyed so we remove the child normally.
-        RenderMathMLBlock::removeChild(child);
-        return;
-    }
-
-    RenderMathMLScripts* parentNode = downcast&lt;RenderMathMLScripts&gt;(parent());
-    removeChildInternal(false, child);
-    parentNode-&gt;fixAnonymousStyles();
-}
-
</del><span class="cx"> }    
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(MATHML)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLScriptsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.h (199664 => 199665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.h        2016-04-18 10:36:29 UTC (rev 199664)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.h        2016-04-18 14:45:00 UTC (rev 199665)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Alex Milowski (alex@milowski.com). All rights reserved.
</span><span class="cx">  * Copyright (C) 2013 The MathJax Consortium.
</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">@@ -32,80 +33,33 @@
</span><span class="cx"> #include &quot;RenderMathMLBlock.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><del>-    
-class RenderMathMLScripts;
-
-class RenderMathMLScriptsWrapper final : public RenderMathMLBlock {
-
-friend class RenderMathMLScripts;
-
-public:
-    enum WrapperType { Base, SubSupPair };
-
-    void addChild(RenderObject* child, RenderObject* beforeChild = 0) override;
-    void removeChild(RenderObject&amp;) override;
-
-private:
-    RenderMathMLScriptsWrapper(Document&amp; document, Ref&lt;RenderStyle&gt;&amp;&amp; style, WrapperType kind)
-        : RenderMathMLBlock(document, WTFMove(style))
-        , m_kind(kind)
-    {
-    }
-
-    static RenderMathMLScriptsWrapper* createAnonymousWrapper(RenderMathMLScripts* renderObject, WrapperType);
-
-    void addChildInternal(bool normalInsertion, RenderObject* child, RenderObject* beforeChild = 0);
-    void removeChildInternal(bool normalRemoval, RenderObject&amp; child);
-
-    const char* renderName() const override { return m_kind == Base ? &quot;Base Wrapper&quot; : &quot;SubSupPair Wrapper&quot;; }
-    bool isRenderMathMLScriptsWrapper() const final { return true; }
-
-    RenderMathMLScripts* parentMathMLScripts();
-
-    WrapperType m_kind;
-};
-
</del><span class="cx"> // Render a base with scripts.
</span><span class="cx"> class RenderMathMLScripts final : public RenderMathMLBlock {
</span><del>-
-friend class RenderMathMLScriptsWrapper;
-
</del><span class="cx"> public:
</span><span class="cx">     RenderMathMLScripts(Element&amp;, Ref&lt;RenderStyle&gt;&amp;&amp;);
</span><del>-    void addChild(RenderObject* child, RenderObject* beforeChild = 0) override;
-    void removeChild(RenderObject&amp;) override;
-    
-    RenderMathMLOperator* unembellishedOperator() override;
-    Optional&lt;int&gt; firstLineBaseline() const override;
</del><ins>+    RenderMathMLOperator* unembellishedOperator() final;
+    Optional&lt;int&gt; firstLineBaseline() const final;
+    void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) final;
+    void paintChildren(PaintInfo&amp; forSelf, const LayoutPoint&amp;, PaintInfo&amp; forChild, bool usePrintRect) final;
</ins><span class="cx"> 
</span><del>-protected:
-    void layout() override;
-    
</del><span class="cx"> private:
</span><del>-    void addChildInternal(bool normalInsertion, RenderObject* child, RenderObject* beforeChild = 0);
-    void removeChildInternal(bool normalRemoval, RenderObject&amp; child);
</del><ins>+    bool isRenderMathMLScripts() const final { return true; }
+    const char* renderName() const final { return &quot;RenderMathMLScripts&quot;; }
</ins><span class="cx"> 
</span><del>-    bool isRenderMathMLScripts() const override { return true; }
-    const char* renderName() const override { return &quot;RenderMathMLScripts&quot;; }
</del><ins>+    bool getBaseAndScripts(RenderBox*&amp; base, RenderBox*&amp; firstPostScript, RenderBox*&amp; firstPreScript);
+    LayoutUnit spaceAfterScript();
+    LayoutUnit italicCorrection(RenderBox* base);
+    void computePreferredLogicalWidths() override;
+    void getScriptMetricsAndLayoutIfNeeded(RenderBox* base, RenderBox* script, LayoutUnit&amp; minSubScriptShift, LayoutUnit&amp; minSupScriptShift, LayoutUnit&amp; maxScriptDescent, LayoutUnit&amp; maxScriptAscent);
+    LayoutUnit mirrorIfNeeded(LayoutUnit horizontalOffset, const RenderBox&amp; child);
</ins><span class="cx"> 
</span><del>-    void fixAnonymousStyleForSubSupPair(RenderObject* subSupPair, bool isPostScript);
-    void fixAnonymousStyles();
-
-    void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
-
-    // Omit our subscript and/or superscript. This may return 0 for a non-MathML base (which
-    // won't occur in valid MathML).
-    RenderBoxModelObject* base() const;
-
</del><span class="cx">     enum ScriptsType { Sub, Super, SubSup, Multiscripts };
</span><span class="cx"> 
</span><del>-    ScriptsType m_kind;
-    RenderMathMLScriptsWrapper* m_baseWrapper;
</del><ins>+    ScriptsType m_scriptType;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><del>-SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderMathMLScriptsWrapper, isRenderMathMLScriptsWrapper())
</del><span class="cx"> SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderMathMLScripts, isRenderMathMLScripts())
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(MATHML)
</span></span></pre>
</div>
</div>

</body>
</html>