<!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>[199544] 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/199544">199544</a></dd>
<dt>Author</dt> <dd>fred.wang@free.fr</dd>
<dt>Date</dt> <dd>2016-04-14 11:04:44 -0700 (Thu, 14 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Ensure that RenderMathMLOperator::stretchTo functions are called with stretchy operators that have the correct direction
https://bugs.webkit.org/show_bug.cgi?id=156542

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

Source/WebCore:

In the RenderMathMLUnderOver refactoring (<a href="http://trac.webkit.org/projects/webkit/changeset/199293">r199293</a>), we avoided doing a
horizontal stretchTo call for non-stretchy operators. Here we do the
same for RenderMathMLRow and avoid doing a vertical stretchTo call for
horizontal or non-stretchy operators. We also add appropriate ASSERT in
the RenderMathMLOperator::stretchTo functions. To avoid failing tests
with DOM/style update, we make our updates a bit stricter. Hopefully,
we could manage such things better in the future (bug 156536).

Tests: mathml/presentation/row-nonstretchy-or-horizontal.html
       mathml/presentation/underover-nonstretchy-or-vertical.html

* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::parseAttribute): Replace setOperatorFlagAndScheduleLayoutIfNeeded with a stronger rendering update.
Also ensure that this is done when the lspace/rspace attributes change.
This avoids breaking mathml/presentation/mo-lspace-rspace-dynamic.html
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::stretchTo): Add ASSERT to ensure that it is only called with stretchy operators that have the correct direction.
(WebCore::RenderMathMLOperator::styleDidChange): Do a stronger rendering update when the style changes.
This avoids breaking mathml/presentation/style-changed.html
(WebCore::RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded): Deleted.
* rendering/mathml/RenderMathMLOperator.h: Make updateFromElement public so that it can be called from MathMLTextElement::parseAttribute
Remove setOperatorFlagAndScheduleLayoutIfNeeded and declare styleDidChange.
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::layoutRowItems): Only call stretchTo for vertical stretchy operators.

LayoutTests:

Add a test to ensure that nonstretchy or horizontal operators in a
RenderMathMLRow do not stretch. This is similar to the existing test
for munderover and we improve a bit that one too.
Besides the verification of the rendering, these two tests will also
check that the RenderMathMLOperator::stretchTo calls are not done in a
way that violates the ASSERT at the top of stretchTo.

* mathml/presentation/row-nonstretchy-or-horizontal.html: Added.
* mathml/presentation/row-nonstretchy-or-horizontal-expected.html: Added.
* mathml/presentation/underover-nonstretchy-horizontal.html: Removed.
* mathml/presentation/underover-nonstretchy-horizontal-expected.html: Removed.
* mathml/presentation/underover-nonstretchy-or-vertical.html: Renamed from LayoutTests/mathml/presentation/underover-nonstretchy-horizontal.html.
We now also test the case of vertical operators in munderover.
* mathml/presentation/underover-nonstretchy-or-vertical-expected.html: Renamed from LayoutTests/mathml/presentation/underover-nonstretchy-horizontal-expected.html.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLTextElementcpp">trunk/Source/WebCore/mathml/MathMLTextElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLOperatorcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLOperatorh">trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLRowcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmathmlpresentationrownonstretchyorhorizontalexpectedhtml">trunk/LayoutTests/mathml/presentation/row-nonstretchy-or-horizontal-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationrownonstretchyorhorizontalhtml">trunk/LayoutTests/mathml/presentation/row-nonstretchy-or-horizontal.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationunderovernonstretchyorverticalexpectedhtml">trunk/LayoutTests/mathml/presentation/underover-nonstretchy-or-vertical-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationunderovernonstretchyorverticalhtml">trunk/LayoutTests/mathml/presentation/underover-nonstretchy-or-vertical.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmathmlpresentationunderovernonstretchyhorizontalexpectedhtml">trunk/LayoutTests/mathml/presentation/underover-nonstretchy-horizontal-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationunderovernonstretchyhorizontalhtml">trunk/LayoutTests/mathml/presentation/underover-nonstretchy-horizontal.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199543 => 199544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-14 17:56:31 UTC (rev 199543)
+++ trunk/LayoutTests/ChangeLog        2016-04-14 18:04:44 UTC (rev 199544)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-04-14  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Ensure that RenderMathMLOperator::stretchTo functions are called with stretchy operators that have the correct direction
+        https://bugs.webkit.org/show_bug.cgi?id=156542
+
+        Reviewed by Darin Adler.
+
+        Add a test to ensure that nonstretchy or horizontal operators in a
+        RenderMathMLRow do not stretch. This is similar to the existing test
+        for munderover and we improve a bit that one too.
+        Besides the verification of the rendering, these two tests will also
+        check that the RenderMathMLOperator::stretchTo calls are not done in a
+        way that violates the ASSERT at the top of stretchTo.
+
+        * mathml/presentation/row-nonstretchy-or-horizontal.html: Added.
+        * mathml/presentation/row-nonstretchy-or-horizontal-expected.html: Added.
+        * mathml/presentation/underover-nonstretchy-horizontal.html: Removed.
+        * mathml/presentation/underover-nonstretchy-horizontal-expected.html: Removed.
+        * mathml/presentation/underover-nonstretchy-or-vertical.html: Renamed from LayoutTests/mathml/presentation/underover-nonstretchy-horizontal.html.
+        We now also test the case of vertical operators in munderover.
+        * mathml/presentation/underover-nonstretchy-or-vertical-expected.html: Renamed from LayoutTests/mathml/presentation/underover-nonstretchy-horizontal-expected.html.
+
</ins><span class="cx"> 2016-04-14  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove UsePointersEvenForNonNullableObjectArguments from Internals
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationrownonstretchyorhorizontalexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/row-nonstretchy-or-horizontal-expected.html (0 => 199544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/row-nonstretchy-or-horizontal-expected.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/row-nonstretchy-or-horizontal-expected.html        2016-04-14 18:04:44 UTC (rev 199544)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;p&gt;Horizontal operators or non-stretchy operators inside an mrow element should not stretch.&lt;/p&gt;
+&lt;math&gt;
+  &lt;mrow&gt;
+    &lt;mspace height=&quot;100px&quot; width=&quot;10px&quot; mathbackground=&quot;red&quot;/&gt;
+    &lt;mtext&gt;_&lt;/mtext&gt;
+    &lt;mtext&gt;|&lt;/mtext&gt;
+  &lt;/mrow&gt;
+&lt;/math&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/row-nonstretchy-or-horizontal-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsmathmlpresentationrownonstretchyorhorizontalhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/row-nonstretchy-or-horizontal.html (0 => 199544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/row-nonstretchy-or-horizontal.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/row-nonstretchy-or-horizontal.html        2016-04-14 18:04:44 UTC (rev 199544)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;p&gt;Horizontal operators or non-stretchy operators inside an mrow element should not stretch.&lt;/p&gt;
+&lt;math&gt;
+  &lt;mrow&gt;
+    &lt;mspace height=&quot;100px&quot; width=&quot;10px&quot; mathbackground=&quot;red&quot;/&gt;
+    &lt;mo lspace=&quot;0px&quot; rspace=&quot;0px&quot;&gt;_&lt;/mo&gt; &lt;!-- stretchy horizontal operator --&gt;
+    &lt;mo lspace=&quot;0px&quot; rspace=&quot;0px&quot; stretchy=&quot;false&quot;&gt;|&lt;/mo&gt; &lt;!-- non-stretchy vertical operator --&gt;
+  &lt;/mrow&gt;
+&lt;/math&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/row-nonstretchy-or-horizontal.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="trunkLayoutTestsmathmlpresentationunderovernonstretchyhorizontalexpectedhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/mathml/presentation/underover-nonstretchy-horizontal-expected.html (199543 => 199544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/underover-nonstretchy-horizontal-expected.html        2016-04-14 17:56:31 UTC (rev 199543)
+++ trunk/LayoutTests/mathml/presentation/underover-nonstretchy-horizontal-expected.html        2016-04-14 18:04:44 UTC (rev 199544)
</span><span class="lines">@@ -1,8 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;math&gt;
-  &lt;munderover&gt;
-    &lt;mspace width=&quot;100px&quot; height=&quot;10px&quot; mathbackground=&quot;red&quot;/&gt;
-    &lt;mtext&gt;_&lt;/mtext&gt;
-    &lt;mtext&gt;_&lt;/mtext&gt;
-  &lt;/munderover&gt;
-&lt;/math&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationunderovernonstretchyhorizontalhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/mathml/presentation/underover-nonstretchy-horizontal.html (199543 => 199544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/underover-nonstretchy-horizontal.html        2016-04-14 17:56:31 UTC (rev 199543)
+++ trunk/LayoutTests/mathml/presentation/underover-nonstretchy-horizontal.html        2016-04-14 18:04:44 UTC (rev 199544)
</span><span class="lines">@@ -1,9 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;!-- Horizontal operators set to non-stretchy should not stretch. --&gt;
-&lt;math&gt;
-  &lt;munderover&gt;
-    &lt;mspace width=&quot;100px&quot; height=&quot;10px&quot; mathbackground=&quot;red&quot;/&gt;
-    &lt;mo stretchy=&quot;false&quot; lspace=&quot;0px&quot; rspace=&quot;0px&quot;&gt;_&lt;/mo&gt;
-    &lt;mo stretchy=&quot;false&quot; lspace=&quot;0px&quot; rspace=&quot;0px&quot;&gt;_&lt;/mo&gt;
-  &lt;/munderover&gt;
-&lt;/math&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationunderovernonstretchyorverticalexpectedhtmlfromrev199543trunkLayoutTestsmathmlpresentationunderovernonstretchyhorizontalexpectedhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/mathml/presentation/underover-nonstretchy-or-vertical-expected.html (from rev 199543, trunk/LayoutTests/mathml/presentation/underover-nonstretchy-horizontal-expected.html) (0 => 199544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/underover-nonstretchy-or-vertical-expected.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/underover-nonstretchy-or-vertical-expected.html        2016-04-14 18:04:44 UTC (rev 199544)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;p&gt;Vertical or non-stretchy operators inside an munderover element should not stretch.&lt;/p&gt;
+&lt;math&gt;
+  &lt;munderover&gt;
+    &lt;mspace width=&quot;100px&quot; height=&quot;10px&quot; mathbackground=&quot;red&quot;/&gt;
+    &lt;mtext&gt;|&lt;/mtext&gt;
+    &lt;mtext&gt;_&lt;/mtext&gt;
+  &lt;/munderover&gt;
+&lt;/math&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationunderovernonstretchyorverticalexpectedhtml"></a>
<div class="propset"><h4>Property changes: trunk/LayoutTests/mathml/presentation/underover-nonstretchy-or-vertical-expected.html</h4>
<pre class="diff"><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="trunkLayoutTestsmathmlpresentationunderovernonstretchyorverticalhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/underover-nonstretchy-or-vertical.html (0 => 199544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/underover-nonstretchy-or-vertical.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/underover-nonstretchy-or-vertical.html        2016-04-14 18:04:44 UTC (rev 199544)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;p&gt;Vertical or non-stretchy operators inside an munderover element should not stretch.&lt;/p&gt;
+&lt;math&gt;
+  &lt;munderover&gt;
+    &lt;mspace width=&quot;100px&quot; height=&quot;10px&quot; mathbackground=&quot;red&quot;/&gt;
+    &lt;mo lspace=&quot;0px&quot; rspace=&quot;0px&quot;&gt;|&lt;/mo&gt; &lt;!-- stretchy vertical operator --&gt;
+    &lt;mo lspace=&quot;0px&quot; rspace=&quot;0px&quot; stretchy=&quot;false&quot; &gt;_&lt;/mo&gt; &lt;!-- non-stretchy horizontal operator --&gt;
+  &lt;/munderover&gt;
+&lt;/math&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/underover-nonstretchy-or-vertical.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="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199543 => 199544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-14 17:56:31 UTC (rev 199543)
+++ trunk/Source/WebCore/ChangeLog        2016-04-14 18:04:44 UTC (rev 199544)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2016-04-14  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Ensure that RenderMathMLOperator::stretchTo functions are called with stretchy operators that have the correct direction
+        https://bugs.webkit.org/show_bug.cgi?id=156542
+
+        Reviewed by Darin Adler.
+
+        In the RenderMathMLUnderOver refactoring (r199293), we avoided doing a
+        horizontal stretchTo call for non-stretchy operators. Here we do the
+        same for RenderMathMLRow and avoid doing a vertical stretchTo call for
+        horizontal or non-stretchy operators. We also add appropriate ASSERT in
+        the RenderMathMLOperator::stretchTo functions. To avoid failing tests
+        with DOM/style update, we make our updates a bit stricter. Hopefully,
+        we could manage such things better in the future (bug 156536).
+
+        Tests: mathml/presentation/row-nonstretchy-or-horizontal.html
+               mathml/presentation/underover-nonstretchy-or-vertical.html
+
+        * mathml/MathMLTextElement.cpp:
+        (WebCore::MathMLTextElement::parseAttribute): Replace setOperatorFlagAndScheduleLayoutIfNeeded with a stronger rendering update.
+        Also ensure that this is done when the lspace/rspace attributes change.
+        This avoids breaking mathml/presentation/mo-lspace-rspace-dynamic.html
+        * rendering/mathml/RenderMathMLOperator.cpp:
+        (WebCore::RenderMathMLOperator::stretchTo): Add ASSERT to ensure that it is only called with stretchy operators that have the correct direction.
+        (WebCore::RenderMathMLOperator::styleDidChange): Do a stronger rendering update when the style changes.
+        This avoids breaking mathml/presentation/style-changed.html
+        (WebCore::RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded): Deleted.
+        * rendering/mathml/RenderMathMLOperator.h: Make updateFromElement public so that it can be called from MathMLTextElement::parseAttribute
+        Remove setOperatorFlagAndScheduleLayoutIfNeeded and declare styleDidChange.
+        * rendering/mathml/RenderMathMLRow.cpp:
+        (WebCore::RenderMathMLRow::layoutRowItems): Only call stretchTo for vertical stretchy operators.
+
</ins><span class="cx"> 2016-04-14  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         When FileInputType::setFiles is called with an empty file list, the last set icon is not cleared
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLTextElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLTextElement.cpp (199543 => 199544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLTextElement.cpp        2016-04-14 17:56:31 UTC (rev 199543)
+++ trunk/Source/WebCore/mathml/MathMLTextElement.cpp        2016-04-14 18:04:44 UTC (rev 199544)
</span><span class="lines">@@ -66,9 +66,9 @@
</span><span class="cx"> 
</span><span class="cx"> void MathMLTextElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
</span><span class="cx"> {
</span><del>-    if (name == stretchyAttr) {
</del><ins>+    if (name == stretchyAttr || name == lspaceAttr || name == rspaceAttr) {
</ins><span class="cx">         if (is&lt;RenderMathMLOperator&gt;(renderer()))
</span><del>-            downcast&lt;RenderMathMLOperator&gt;(*renderer()).setOperatorFlagAndScheduleLayoutIfNeeded(MathMLOperatorDictionary::Stretchy, value);
</del><ins>+            downcast&lt;RenderMathMLOperator&gt;(*renderer()).updateFromElement();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLOperatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp (199543 => 199544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp        2016-04-14 17:56:31 UTC (rev 199543)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp        2016-04-14 18:04:44 UTC (rev 199544)
</span><span class="lines">@@ -94,16 +94,6 @@
</span><span class="cx">     updateTokenContent(operatorString);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded(MathMLOperatorDictionary::Flag flag, const AtomicString&amp; attributeValue)
-{
-    unsigned short oldOperatorFlags = m_operatorFlags;
-
-    setOperatorFlagFromAttributeValue(flag, attributeValue);
-
-    if (oldOperatorFlags != m_operatorFlags)
-        setNeedsLayoutAndPrefWidthsRecalc();
-}
-
</del><span class="cx"> void RenderMathMLOperator::setOperatorFlagFromAttribute(MathMLOperatorDictionary::Flag flag, const QualifiedName&amp; name)
</span><span class="cx"> {
</span><span class="cx">     setOperatorFlagFromAttributeValue(flag, element().fastGetAttribute(name));
</span><span class="lines">@@ -215,6 +205,9 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderMathMLOperator::stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline)
</span><span class="cx"> {
</span><ins>+    ASSERT(hasOperatorFlag(MathMLOperatorDictionary::Stretchy));
+    ASSERT(m_isVertical);
+
</ins><span class="cx">     if (!m_isVertical || (heightAboveBaseline == m_stretchHeightAboveBaseline &amp;&amp; depthBelowBaseline == m_stretchDepthBelowBaseline))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -247,6 +240,9 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderMathMLOperator::stretchTo(LayoutUnit width)
</span><span class="cx"> {
</span><ins>+    ASSERT(hasOperatorFlag(MathMLOperatorDictionary::Stretchy));
+    ASSERT(!m_isVertical);
+
</ins><span class="cx">     if (m_isVertical || m_stretchWidth == width)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -373,6 +369,12 @@
</span><span class="cx">     return m_textContent &amp;&amp; (hasOperatorFlag(MathMLOperatorDictionary::Stretchy) || isLargeOperatorInDisplayStyle());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RenderMathMLOperator::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
+{
+    RenderMathMLBlock::styleDidChange(diff, oldStyle);
+    updateOperatorProperties();
+}
+
</ins><span class="cx"> bool RenderMathMLOperator::getGlyphAssemblyFallBack(Vector&lt;OpenTypeMathData::AssemblyPart&gt; assemblyParts, StretchyData&amp; stretchyData) const
</span><span class="cx"> {
</span><span class="cx">     GlyphData top;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLOperatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h (199543 => 199544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h        2016-04-14 17:56:31 UTC (rev 199543)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h        2016-04-14 18:04:44 UTC (rev 199544)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx">     bool isLargeOperatorInDisplayStyle() const { return !hasOperatorFlag(MathMLOperatorDictionary::Stretchy) &amp;&amp; hasOperatorFlag(MathMLOperatorDictionary::LargeOp); }
</span><span class="cx">     bool isVertical() const { return m_isVertical; }
</span><span class="cx"> 
</span><ins>+    void styleDidChange(StyleDifference, const RenderStyle* oldStyle) final;
</ins><span class="cx">     void updateStyle() final;
</span><span class="cx"> 
</span><span class="cx">     void paint(PaintInfo&amp;, const LayoutPoint&amp;) override;
</span><span class="lines">@@ -59,7 +60,7 @@
</span><span class="cx">     void updateTokenContent(const String&amp; operatorString);
</span><span class="cx">     void updateTokenContent() final;
</span><span class="cx">     void updateOperatorProperties();
</span><del>-    void setOperatorFlagAndScheduleLayoutIfNeeded(MathMLOperatorDictionary::Flag, const AtomicString&amp; attributeValue);
</del><ins>+    void updateFromElement() final;
</ins><span class="cx">     LayoutUnit trailingSpaceError();
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="lines">@@ -137,7 +138,6 @@
</span><span class="cx">     Optional&lt;int&gt; firstLineBaseline() const override;
</span><span class="cx">     RenderMathMLOperator* unembellishedOperator() override { return this; }
</span><span class="cx">     void rebuildTokenContent(const String&amp; operatorString);
</span><del>-    void updateFromElement() override;
</del><span class="cx"> 
</span><span class="cx">     bool shouldAllowStretching() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLRowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp (199543 => 199544)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp        2016-04-14 17:56:31 UTC (rev 199543)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp        2016-04-14 18:04:44 UTC (rev 199544)
</span><span class="lines">@@ -120,7 +120,8 @@
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         if (is&lt;RenderMathMLBlock&gt;(child)) {
</span><del>-            if (auto renderOperator = downcast&lt;RenderMathMLBlock&gt;(child)-&gt;unembellishedOperator())
</del><ins>+            auto renderOperator = downcast&lt;RenderMathMLBlock&gt;(child)-&gt;unembellishedOperator();
+            if (renderOperator &amp;&amp; renderOperator-&gt;hasOperatorFlag(MathMLOperatorDictionary::Stretchy) &amp;&amp; renderOperator-&gt;isVertical())
</ins><span class="cx">                 renderOperator-&gt;stretchTo(stretchHeightAboveBaseline, stretchDepthBelowBaseline);
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>