<!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>[204037] 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/204037">204037</a></dd>
<dt>Author</dt> <dd>fred.wang@free.fr</dd>
<dt>Date</dt> <dd>2016-08-02 12:53:57 -0700 (Tue, 02 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move parsing of operator length attributes to MathMLOperatorElement
https://bugs.webkit.org/show_bug.cgi?id=160301

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

Source/WebCore:

We move parsing of operator attributes lspace, rspace minsize, maxsize into the class
MathMLOperatorElement. We rely on the existing MathMLElement::Length structure and expand
it to handle the &quot;infinity&quot; case of maxsize that we always resolve as intMaxForLayoutUnit.
We also improve the resolution of a negative value for minsize and maxsize since the MathML
recommendation says it should be rounded up to the nearest valid value (which is zero)
instead of ignoring the attribute and using the default value. This is similar to <a href="http://trac.webkit.org/projects/webkit/changeset/203285">r203285</a>
for mfrac@linethickness. We also update the existing test for minsize/maxsize to take into
account that change.

No new tests, already covered by existing tests.

* mathml/MathMLElement.h: Add an &quot;Infinity&quot; type for MathML Length.
* mathml/MathMLOperatorElement.cpp:
(WebCore::MathMLOperatorElement::leadingSpace): Helper function to retrieve the cached value
for the lspace attribute, parse it if necessary.
(WebCore::MathMLOperatorElement::trailingSpace): Ditto for rspace.
(WebCore::MathMLOperatorElement::minSize): Ditto for minsize.
(WebCore::MathMLOperatorElement::maxSize): Ditto for maxsize. This attribute also accepts the
&quot;infinity&quot; value.
(WebCore::MathMLOperatorElement::parseAttribute): Mark attributes dirty.
* mathml/MathMLOperatorElement.h: Declare Length members and accessors.
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::toUserUnits): Resolve Infinity as intMaxForLayoutUnit.
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::setOperatorProperties): We use toUserUnits to resolve the
lengths. Negative maxsize and minsize values now fallback to 0 instead of their default
values. We also remove the !isAnonymous() check since setOperatorProperties is overriden
in the RenderMathMLFencedOperator class.

LayoutTests:

* mathml/presentation/stretchy-minsize-maxsize-expected.html: Update the test for negative
minsize and maxsize to align on the behavior suggested in the MathML recommendation.
* mathml/presentation/stretchy-minsize-maxsize.html: Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationstretchyminsizemaxsizeexpectedhtml">trunk/LayoutTests/mathml/presentation/stretchy-minsize-maxsize-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationstretchyminsizemaxsizehtml">trunk/LayoutTests/mathml/presentation/stretchy-minsize-maxsize.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLElementh">trunk/Source/WebCore/mathml/MathMLElement.h</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLOperatorElementcpp">trunk/Source/WebCore/mathml/MathMLOperatorElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLOperatorElementh">trunk/Source/WebCore/mathml/MathMLOperatorElement.h</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLBlockcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLOperatorcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (204036 => 204037)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-08-02 19:23:26 UTC (rev 204036)
+++ trunk/LayoutTests/ChangeLog        2016-08-02 19:53:57 UTC (rev 204037)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-08-02  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Move parsing of operator length attributes to MathMLOperatorElement
+        https://bugs.webkit.org/show_bug.cgi?id=160301
+
+        Reviewed by Darin Adler.
+
+        * mathml/presentation/stretchy-minsize-maxsize-expected.html: Update the test for negative
+        minsize and maxsize to align on the behavior suggested in the MathML recommendation.
+        * mathml/presentation/stretchy-minsize-maxsize.html: Ditto.
+
</ins><span class="cx"> 2016-08-02  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WebIDL] Implement overload resolution algorithm
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationstretchyminsizemaxsizeexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/stretchy-minsize-maxsize-expected.html (204036 => 204037)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/stretchy-minsize-maxsize-expected.html        2016-08-02 19:23:26 UTC (rev 204036)
+++ trunk/LayoutTests/mathml/presentation/stretchy-minsize-maxsize-expected.html        2016-08-02 19:53:57 UTC (rev 204037)
</span><span class="lines">@@ -43,13 +43,13 @@
</span><span class="cx"> 
</span><span class="cx">       &lt;math&gt;
</span><span class="cx">         &lt;mrow&gt;
</span><del>-          &lt;mo symmetric=&quot;false&quot;&gt;|&lt;/mo&gt;
</del><ins>+          &lt;mo symmetric=&quot;false&quot; minsize=&quot;0em&quot;&gt;|&lt;/mo&gt;
</ins><span class="cx">           &lt;mspace height=&quot;4em&quot; depth=&quot;4em&quot;/&gt;
</span><span class="cx">         &lt;/mrow&gt;
</span><span class="cx">       &lt;/math&gt;
</span><span class="cx">       &lt;math&gt;
</span><span class="cx">         &lt;mrow&gt;
</span><del>-          &lt;mo symmetric=&quot;false&quot;&gt;|&lt;/mo&gt;
</del><ins>+          &lt;mo symmetric=&quot;false&quot; maxsize=&quot;0em&quot;&gt;|&lt;/mo&gt;
</ins><span class="cx">           &lt;mspace height=&quot;4em&quot; depth=&quot;4em&quot;/&gt;
</span><span class="cx">         &lt;/mrow&gt;
</span><span class="cx">       &lt;/math&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationstretchyminsizemaxsizehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/stretchy-minsize-maxsize.html (204036 => 204037)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/stretchy-minsize-maxsize.html        2016-08-02 19:23:26 UTC (rev 204036)
+++ trunk/LayoutTests/mathml/presentation/stretchy-minsize-maxsize.html        2016-08-02 19:53:57 UTC (rev 204037)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">         &lt;/mrow&gt;
</span><span class="cx">       &lt;/math&gt;
</span><span class="cx"> 
</span><del>-      &lt;!-- We verify that negative values are ignored. --&gt;
</del><ins>+      &lt;!-- We verify that negative values are treated as 0. --&gt;
</ins><span class="cx">       &lt;math&gt;
</span><span class="cx">         &lt;mrow&gt;
</span><span class="cx">           &lt;mo symmetric=&quot;false&quot; minsize=&quot;-5em&quot;&gt;|&lt;/mo&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204036 => 204037)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-02 19:23:26 UTC (rev 204036)
+++ trunk/Source/WebCore/ChangeLog        2016-08-02 19:53:57 UTC (rev 204037)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2016-08-02  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Move parsing of operator length attributes to MathMLOperatorElement
+        https://bugs.webkit.org/show_bug.cgi?id=160301
+
+        Reviewed by Darin Adler.
+
+        We move parsing of operator attributes lspace, rspace minsize, maxsize into the class
+        MathMLOperatorElement. We rely on the existing MathMLElement::Length structure and expand
+        it to handle the &quot;infinity&quot; case of maxsize that we always resolve as intMaxForLayoutUnit.
+        We also improve the resolution of a negative value for minsize and maxsize since the MathML
+        recommendation says it should be rounded up to the nearest valid value (which is zero)
+        instead of ignoring the attribute and using the default value. This is similar to r203285
+        for mfrac@linethickness. We also update the existing test for minsize/maxsize to take into
+        account that change.
+
+        No new tests, already covered by existing tests.
+
+        * mathml/MathMLElement.h: Add an &quot;Infinity&quot; type for MathML Length.
+        * mathml/MathMLOperatorElement.cpp:
+        (WebCore::MathMLOperatorElement::leadingSpace): Helper function to retrieve the cached value
+        for the lspace attribute, parse it if necessary.
+        (WebCore::MathMLOperatorElement::trailingSpace): Ditto for rspace.
+        (WebCore::MathMLOperatorElement::minSize): Ditto for minsize.
+        (WebCore::MathMLOperatorElement::maxSize): Ditto for maxsize. This attribute also accepts the
+        &quot;infinity&quot; value.
+        (WebCore::MathMLOperatorElement::parseAttribute): Mark attributes dirty.
+        * mathml/MathMLOperatorElement.h: Declare Length members and accessors.
+        * rendering/mathml/RenderMathMLBlock.cpp:
+        (WebCore::toUserUnits): Resolve Infinity as intMaxForLayoutUnit.
+        * rendering/mathml/RenderMathMLOperator.cpp:
+        (WebCore::RenderMathMLOperator::setOperatorProperties): We use toUserUnits to resolve the
+        lengths. Negative maxsize and minsize values now fallback to 0 instead of their default
+        values. We also remove the !isAnonymous() check since setOperatorProperties is overriden
+        in the RenderMathMLFencedOperator class.
+
</ins><span class="cx"> 2016-08-02  Frederic Wang  &lt;fred.wang@free.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed build error fix.
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLElement.h (204036 => 204037)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLElement.h        2016-08-02 19:23:26 UTC (rev 204036)
+++ trunk/Source/WebCore/mathml/MathMLElement.h        2016-08-02 19:53:57 UTC (rev 204037)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     // MathML lengths (https://www.w3.org/TR/MathML3/chapter2.html#fund.units)
</span><span class="cx">     // TeX's Math Unit is used internally for named spaces (1 mu = 1/18 em).
</span><span class="cx">     // Unitless values are interpreted as a multiple of a reference value.
</span><del>-    enum class LengthType { Cm, Em, Ex, In, MathUnit, Mm, ParsingFailed, Pc, Percentage, Pt, Px, UnitLess };
</del><ins>+    enum class LengthType { Cm, Em, Ex, In, MathUnit, Mm, ParsingFailed, Pc, Percentage, Pt, Px, UnitLess, Infinity };
</ins><span class="cx">     struct Length {
</span><span class="cx">         LengthType type { LengthType::ParsingFailed };
</span><span class="cx">         float value { 0 };
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLOperatorElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLOperatorElement.cpp (204036 => 204037)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLOperatorElement.cpp        2016-08-02 19:23:26 UTC (rev 204036)
+++ trunk/Source/WebCore/mathml/MathMLOperatorElement.cpp        2016-08-02 19:53:57 UTC (rev 204037)
</span><span class="lines">@@ -179,6 +179,37 @@
</span><span class="cx">     return space;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const MathMLElement::Length&amp; MathMLOperatorElement::leadingSpace()
+{
+    return cachedMathMLLength(MathMLNames::lspaceAttr, m_leadingSpace);
+}
+
+const MathMLElement::Length&amp; MathMLOperatorElement::trailingSpace()
+{
+    return cachedMathMLLength(MathMLNames::rspaceAttr, m_trailingSpace);
+}
+
+const MathMLElement::Length&amp; MathMLOperatorElement::minSize()
+{
+    return cachedMathMLLength(MathMLNames::minsizeAttr, m_minSize);
+}
+
+const MathMLElement::Length&amp; MathMLOperatorElement::maxSize()
+{
+    if (m_maxSize)
+        return m_maxSize.value();
+
+    const AtomicString&amp; value = attributeWithoutSynchronization(MathMLNames::maxsizeAttr);
+    if (value == &quot;infinity&quot;) {
+        Length maxsize;
+        maxsize.type = LengthType::Infinity;
+        m_maxSize = maxsize;
+    } else
+        m_maxSize = parseMathMLLength(value);
+
+    return m_maxSize.value();
+}
+
</ins><span class="cx"> void MathMLOperatorElement::childrenChanged(const ChildChange&amp; change)
</span><span class="cx"> {
</span><span class="cx">     m_operatorText = Nullopt;
</span><span class="lines">@@ -213,6 +244,14 @@
</span><span class="cx">         m_properties.dirtyFlags = MathMLOperatorDictionary::allFlags;
</span><span class="cx">     } else if (auto flag = attributeNameToPropertyFlag(name))
</span><span class="cx">         m_properties.dirtyFlags |= flag.value();
</span><ins>+    else if (name == lspaceAttr)
+        m_leadingSpace = Nullopt;
+    else if (name == rspaceAttr)
+        m_trailingSpace = Nullopt;
+    else if (name == minsizeAttr)
+        m_minSize = Nullopt;
+    else if (name == maxsizeAttr)
+        m_maxSize = Nullopt;
</ins><span class="cx"> 
</span><span class="cx">     if ((name == stretchyAttr || name == lspaceAttr || name == rspaceAttr || name == movablelimitsAttr) &amp;&amp; renderer()) {
</span><span class="cx">         downcast&lt;RenderMathMLOperator&gt;(*renderer()).updateFromElement();
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLOperatorElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLOperatorElement.h (204036 => 204037)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLOperatorElement.h        2016-08-02 19:23:26 UTC (rev 204036)
+++ trunk/Source/WebCore/mathml/MathMLOperatorElement.h        2016-08-02 19:53:57 UTC (rev 204037)
</span><span class="lines">@@ -41,6 +41,10 @@
</span><span class="cx">     bool hasProperty(MathMLOperatorDictionary::Flag);
</span><span class="cx">     Length defaultLeadingSpace();
</span><span class="cx">     Length defaultTrailingSpace();
</span><ins>+    const Length&amp; leadingSpace();
+    const Length&amp; trailingSpace();
+    const Length&amp; minSize();
+    const Length&amp; maxSize();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     MathMLOperatorElement(const QualifiedName&amp; tagName, Document&amp;);
</span><span class="lines">@@ -68,6 +72,11 @@
</span><span class="cx">     };
</span><span class="cx">     OperatorProperties m_properties;
</span><span class="cx">     void computeOperatorFlag(MathMLOperatorDictionary::Flag);
</span><ins>+
+    Optional&lt;Length&gt; m_leadingSpace;
+    Optional&lt;Length&gt; m_trailingSpace;
+    Optional&lt;Length&gt; m_minSize;
+    Optional&lt;Length&gt; m_maxSize;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp (204036 => 204037)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp        2016-08-02 19:23:26 UTC (rev 204036)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp        2016-08-02 19:53:57 UTC (rev 204037)
</span><span class="lines">@@ -165,6 +165,8 @@
</span><span class="cx">         return referenceValue * length.value;
</span><span class="cx">     case MathMLElement::LengthType::ParsingFailed:
</span><span class="cx">         return referenceValue;
</span><ins>+    case MathMLElement::LengthType::Infinity:
+        return intMaxForLayoutUnit;
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">         return referenceValue;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLOperatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp (204036 => 204037)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp        2016-08-02 19:23:26 UTC (rev 204036)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp        2016-08-02 19:53:57 UTC (rev 204037)
</span><span class="lines">@@ -79,22 +79,19 @@
</span><span class="cx">     // We determine the stretch direction (default is vertical).
</span><span class="cx">     m_isVertical = MathMLOperatorDictionary::isVertical(textContent());
</span><span class="cx"> 
</span><del>-    // Initialize with the default values.
</del><ins>+    // FIXME: Negative leading spaces must be implemented (https://webkit.org/b/124830).
</ins><span class="cx">     m_leadingSpace = toUserUnits(element().defaultLeadingSpace(), style(), 0);
</span><ins>+    m_leadingSpace = std::max&lt;LayoutUnit&gt;(0, toUserUnits(element().leadingSpace(), style(), m_leadingSpace));
+
+    // FIXME: Negative trailing spaces must be implemented (https://webkit.org/b/124830).
</ins><span class="cx">     m_trailingSpace = toUserUnits(element().defaultTrailingSpace(), style(), 0);
</span><del>-    m_minSize = style().fontCascade().size(); // This sets minsize to &quot;1em&quot;.
-    m_maxSize = intMaxForLayoutUnit; // This sets maxsize to &quot;infinity&quot;.
</del><ins>+    m_trailingSpace = std::max&lt;LayoutUnit&gt;(0, toUserUnits(element().trailingSpace(), style(), m_trailingSpace));
</ins><span class="cx"> 
</span><del>-    if (!isAnonymous()) {
-        // Finally, we make the attribute values override the default.
-        parseMathMLLength(element().attributeWithoutSynchronization(MathMLNames::lspaceAttr), m_leadingSpace, &amp;style(), false); // FIXME: Negative leading space must be implemented (https://bugs.webkit.org/show_bug.cgi?id=124830).
-        parseMathMLLength(element().attributeWithoutSynchronization(MathMLNames::rspaceAttr), m_trailingSpace, &amp;style(), false); // FIXME: Negative trailing space must be implemented (https://bugs.webkit.org/show_bug.cgi?id=124830).
</del><ins>+    m_minSize = style().fontCascade().size(); // Default minsize is &quot;1em&quot;.
+    m_minSize = std::max&lt;LayoutUnit&gt;(0, toUserUnits(element().minSize(), style(), m_minSize));
</ins><span class="cx"> 
</span><del>-        parseMathMLLength(element().attributeWithoutSynchronization(MathMLNames::minsizeAttr), m_minSize, &amp;style(), false);
-        const AtomicString&amp; maxsize = element().attributeWithoutSynchronization(MathMLNames::maxsizeAttr);
-        if (maxsize != &quot;infinity&quot;)
-            parseMathMLLength(maxsize, m_maxSize, &amp;style(), false);
-    }
</del><ins>+    m_maxSize = intMaxForLayoutUnit; // Default maxsize is &quot;infinity&quot;.
+    m_maxSize = std::max&lt;LayoutUnit&gt;(0, toUserUnits(element().maxSize(), style(), m_maxSize));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderMathMLOperator::stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline)
</span></span></pre>
</div>
</div>

</body>
</html>