<!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>[203896] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/203896">203896</a></dd>
<dt>Author</dt> <dd>fred.wang@free.fr</dd>
<dt>Date</dt> <dd>2016-07-29 00:21:57 -0700 (Fri, 29 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Parse the operator text on the MathMLOperatorElement class.
https://bugs.webkit.org/show_bug.cgi?id=160241

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

The text of the MathML operators is important to determine form or dictionary properties and
hence provide default values when no explicit attributes are privided. Since that text only
depends on the MathML DOM content, it makes sense to move its parsing into
MathMLOperatorElement. Anonymous operators created by the mfenced elements still need to be
handled specially and this will be true for all the operator properties that can just be
determined in MathMLOperatorElement. Hence in a follow-up patch we will introduce a class
to move all the code specific to mfenced in a class derived from RenderMathMLOperator while
we continue to move the corresponding code for non-anonymous into MathMLOperatorElement.

No new tests, behavior is unchanged.

* mathml/MathMLOperatorElement.cpp: Include header for hyphenMinus/minusSign characters.
(WebCore::MathMLOperatorElement::parseOperatorText): Move that code from rebuildTokenContent
(WebCore::MathMLOperatorElement::operatorText): Helper function to get the cached text.
(WebCore::MathMLOperatorElement::childrenChanged): Make the cached text dirty.
* mathml/MathMLOperatorElement.h: Update defitions and add a member for the operator text.
* mathml/MathMLTextElement.h: Make childrenChanged overridable.
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::element): Helper function to cast to a MathMLOperatorElement.
(WebCore::RenderMathMLOperator::textContent): Helper function to call
MathMLOperatorElement::operatorText or fallback to m_textContent for anonymous operators.
m_textContent and this special case can be moved into a derived class later.
(WebCore::RenderMathMLOperator::setOperatorProperties): Call textContent().
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Ditto.
(WebCore::RenderMathMLOperator::rebuildTokenContent): Remove the string parameter and the
parsing of the operator text.
(WebCore::RenderMathMLOperator::updateTokenContent): Call textContent(). The special function
for anonymous operators also parses the text content but this could be moved into a derived
class later.
(WebCore::RenderMathMLOperator::shouldAllowStretching): Call textContent().
(WebCore::RenderMathMLOperator::useMathOperator): Ditto.
(WebCore::RenderMathMLOperator::RenderMathMLOperator): No need to initialize m_textContent
as it is not used anymore for non-anonymous renderers.
* rendering/mathml/RenderMathMLOperator.h: Update definitions and call textContent().</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCoremathmlMathMLTextElementh">trunk/Source/WebCore/mathml/MathMLTextElement.h</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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203895 => 203896)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-29 07:15:01 UTC (rev 203895)
+++ trunk/Source/WebCore/ChangeLog        2016-07-29 07:21:57 UTC (rev 203896)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2016-07-29  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Parse the operator text on the MathMLOperatorElement class.
+        https://bugs.webkit.org/show_bug.cgi?id=160241
+
+        Reviewed by Darin Adler.
+
+        The text of the MathML operators is important to determine form or dictionary properties and
+        hence provide default values when no explicit attributes are privided. Since that text only
+        depends on the MathML DOM content, it makes sense to move its parsing into
+        MathMLOperatorElement. Anonymous operators created by the mfenced elements still need to be
+        handled specially and this will be true for all the operator properties that can just be
+        determined in MathMLOperatorElement. Hence in a follow-up patch we will introduce a class
+        to move all the code specific to mfenced in a class derived from RenderMathMLOperator while
+        we continue to move the corresponding code for non-anonymous into MathMLOperatorElement.
+
+        No new tests, behavior is unchanged.
+
+        * mathml/MathMLOperatorElement.cpp: Include header for hyphenMinus/minusSign characters.
+        (WebCore::MathMLOperatorElement::parseOperatorText): Move that code from rebuildTokenContent
+        (WebCore::MathMLOperatorElement::operatorText): Helper function to get the cached text.
+        (WebCore::MathMLOperatorElement::childrenChanged): Make the cached text dirty.
+        * mathml/MathMLOperatorElement.h: Update defitions and add a member for the operator text.
+        * mathml/MathMLTextElement.h: Make childrenChanged overridable.
+        * rendering/mathml/RenderMathMLOperator.cpp:
+        (WebCore::RenderMathMLOperator::element): Helper function to cast to a MathMLOperatorElement.
+        (WebCore::RenderMathMLOperator::textContent): Helper function to call
+        MathMLOperatorElement::operatorText or fallback to m_textContent for anonymous operators.
+        m_textContent and this special case can be moved into a derived class later.
+        (WebCore::RenderMathMLOperator::setOperatorProperties): Call textContent().
+        (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Ditto.
+        (WebCore::RenderMathMLOperator::rebuildTokenContent): Remove the string parameter and the
+        parsing of the operator text.
+        (WebCore::RenderMathMLOperator::updateTokenContent): Call textContent(). The special function
+        for anonymous operators also parses the text content but this could be moved into a derived
+        class later.
+        (WebCore::RenderMathMLOperator::shouldAllowStretching): Call textContent().
+        (WebCore::RenderMathMLOperator::useMathOperator): Ditto.
+        (WebCore::RenderMathMLOperator::RenderMathMLOperator): No need to initialize m_textContent
+        as it is not used anymore for non-anonymous renderers.
+        * rendering/mathml/RenderMathMLOperator.h: Update definitions and call textContent().
+
</ins><span class="cx"> 2016-07-28  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Binding generator should expose the visible interface name in error messages
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLOperatorElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLOperatorElement.cpp (203895 => 203896)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLOperatorElement.cpp        2016-07-29 07:15:01 UTC (rev 203895)
+++ trunk/Source/WebCore/mathml/MathMLOperatorElement.cpp        2016-07-29 07:21:57 UTC (rev 203896)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;MathMLOperatorElement.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;RenderMathMLOperator.h&quot;
</span><ins>+#include &lt;wtf/unicode/CharacterNames.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -45,6 +46,33 @@
</span><span class="cx">     return adoptRef(*new MathMLOperatorElement(tagName, document));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+UChar MathMLOperatorElement::parseOperatorText(const String&amp; string)
+{
+    // We collapse the whitespace and replace the hyphens by minus signs.
+    AtomicString textContent = string.stripWhiteSpace().simplifyWhiteSpace().replace(hyphenMinus, minusSign).impl();
+
+    // We verify whether the operator text can be represented by a single UChar.
+    // FIXME: This is a really inefficient way to extract a character from a string (https://webkit.org/b/160241#c7).
+    // FIXME: This does not handle surrogate pairs (https://webkit.org/b/122296).
+    // FIXME: This does not handle &lt;mo&gt; operators with multiple characters (https://webkit.org/b/124828).
+    return textContent.length() == 1 ? textContent[0] : 0;
+}
+
+UChar MathMLOperatorElement::operatorText()
+{
+    if (m_operatorText)
+        return m_operatorText.value();
+
+    m_operatorText = Optional&lt;UChar&gt;(parseOperatorText(textContent()));
+    return m_operatorText.value();
+}
+
+void MathMLOperatorElement::childrenChanged(const ChildChange&amp; change)
+{
+    m_operatorText = Optional&lt;UChar&gt;();
+    MathMLTextElement::childrenChanged(change);
+}
+
</ins><span class="cx"> void MathMLOperatorElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
</span><span class="cx"> {
</span><span class="cx">     if ((name == stretchyAttr || name == lspaceAttr || name == rspaceAttr || name == movablelimitsAttr) &amp;&amp; renderer()) {
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLOperatorElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLOperatorElement.h (203895 => 203896)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLOperatorElement.h        2016-07-29 07:15:01 UTC (rev 203895)
+++ trunk/Source/WebCore/mathml/MathMLOperatorElement.h        2016-07-29 07:21:57 UTC (rev 203896)
</span><span class="lines">@@ -33,10 +33,16 @@
</span><span class="cx"> class MathMLOperatorElement final : public MathMLTextElement {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;MathMLOperatorElement&gt; create(const QualifiedName&amp; tagName, Document&amp;);
</span><ins>+    static UChar parseOperatorText(const String&amp;);
+    UChar operatorText();
+
</ins><span class="cx"> private:
</span><span class="cx">     MathMLOperatorElement(const QualifiedName&amp; tagName, Document&amp;);
</span><span class="cx">     RenderPtr&lt;RenderElement&gt; createElementRenderer(RenderStyle&amp;&amp;, const RenderTreePosition&amp;) final;
</span><ins>+    void childrenChanged(const ChildChange&amp;) final;
</ins><span class="cx">     void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) final;
</span><ins>+
+    Optional&lt;UChar&gt; m_operatorText;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLTextElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLTextElement.h (203895 => 203896)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLTextElement.h        2016-07-29 07:15:01 UTC (rev 203895)
+++ trunk/Source/WebCore/mathml/MathMLTextElement.h        2016-07-29 07:21:57 UTC (rev 203896)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     MathMLTextElement(const QualifiedName&amp; tagName, Document&amp;);
</span><ins>+    void childrenChanged(const ChildChange&amp;) override;
</ins><span class="cx">     void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -45,7 +46,6 @@
</span><span class="cx">     RenderPtr&lt;RenderElement&gt; createElementRenderer(RenderStyle&amp;&amp;, const RenderTreePosition&amp;) override;
</span><span class="cx">     bool childShouldCreateRenderer(const Node&amp;) const final;
</span><span class="cx"> 
</span><del>-    void childrenChanged(const ChildChange&amp;) final;
</del><span class="cx">     void didAttachRenderers() final;
</span><span class="cx"> 
</span><span class="cx">     bool isPresentationMathML() const final { return true; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLOperatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp (203895 => 203896)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp        2016-07-29 07:15:01 UTC (rev 203895)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp        2016-07-29 07:21:57 UTC (rev 203896)
</span><span class="lines">@@ -51,7 +51,6 @@
</span><span class="cx">     : RenderMathMLToken(element, WTFMove(style))
</span><span class="cx">     , m_stretchHeightAboveBaseline(0)
</span><span class="cx">     , m_stretchDepthBelowBaseline(0)
</span><del>-    , m_textContent(0)
</del><span class="cx">     , m_isVertical(true)
</span><span class="cx"> {
</span><span class="cx">     updateTokenContent();
</span><span class="lines">@@ -69,6 +68,16 @@
</span><span class="cx">     updateTokenContent(operatorString);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+MathMLOperatorElement&amp; RenderMathMLOperator::element() const
+{
+    return static_cast&lt;MathMLOperatorElement&amp;&gt;(nodeForNonAnonymous());
+}
+
+UChar RenderMathMLOperator::textContent() const
+{
+    return isAnonymous() ? m_textContent : element().operatorText();
+}
+
</ins><span class="cx"> void RenderMathMLOperator::setOperatorFlagFromAttribute(MathMLOperatorDictionary::Flag flag, const QualifiedName&amp; name)
</span><span class="cx"> {
</span><span class="cx">     setOperatorFlagFromAttributeValue(flag, element().attributeWithoutSynchronization(name));
</span><span class="lines">@@ -101,7 +110,7 @@
</span><span class="cx"> void RenderMathMLOperator::setOperatorProperties()
</span><span class="cx"> {
</span><span class="cx">     // We determine the stretch direction (default is vertical).
</span><del>-    m_isVertical = MathMLOperatorDictionary::isVertical(m_textContent);
</del><ins>+    m_isVertical = MathMLOperatorDictionary::isVertical(textContent());
</ins><span class="cx"> 
</span><span class="cx">     // We determine the form of the operator.
</span><span class="cx">     bool explicitForm = true;
</span><span class="lines">@@ -137,14 +146,14 @@
</span><span class="cx">     m_minSize = style().fontCascade().size(); // This sets minsize to &quot;1em&quot;.
</span><span class="cx">     m_maxSize = intMaxForLayoutUnit; // This sets maxsize to &quot;infinity&quot;.
</span><span class="cx"> 
</span><del>-    if (m_textContent) {
</del><ins>+    if (textContent()) {
</ins><span class="cx">         // Then we try to find the default values from the operator dictionary.
</span><del>-        if (const MathMLOperatorDictionary::Entry* entry = MathMLOperatorDictionary::getEntry(m_textContent, m_operatorForm))
</del><ins>+        if (const MathMLOperatorDictionary::Entry* entry = MathMLOperatorDictionary::getEntry(textContent(), m_operatorForm))
</ins><span class="cx">             setOperatorPropertiesFromOpDictEntry(entry);
</span><span class="cx">         else if (!explicitForm) {
</span><span class="cx">             // If we did not find the desired operator form and if it was not set explicitely, we use the first one in the following order: Infix, Prefix, Postfix.
</span><span class="cx">             // This is to handle bad MathML markup without explicit &lt;mrow&gt; delimiters like &quot;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&quot; where the inner parenthesis should not be considered infix.
</span><del>-            if (const MathMLOperatorDictionary::Entry* entry = MathMLOperatorDictionary::getEntry(m_textContent)) {
</del><ins>+            if (const MathMLOperatorDictionary::Entry* entry = MathMLOperatorDictionary::getEntry(textContent())) {
</ins><span class="cx">                 m_operatorForm = static_cast&lt;MathMLOperatorDictionary::Form&gt;(entry-&gt;form); // We override the form previously determined.
</span><span class="cx">                 setOperatorPropertiesFromOpDictEntry(entry);
</span><span class="cx">             }
</span><span class="lines">@@ -246,7 +255,7 @@
</span><span class="cx">         preferredWidth = m_maxPreferredLogicalWidth;
</span><span class="cx">         if (isInvisibleOperator()) {
</span><span class="cx">             // In some fonts, glyphs for invisible operators have nonzero width. Consequently, we subtract that width here to avoid wide gaps.
</span><del>-            GlyphData data = style().fontCascade().glyphDataForCharacter(m_textContent, false);
</del><ins>+            GlyphData data = style().fontCascade().glyphDataForCharacter(textContent(), false);
</ins><span class="cx">             float glyphWidth = data.font ? data.font-&gt;widthForGlyph(data.glyph) : 0;
</span><span class="cx">             ASSERT(glyphWidth &lt;= preferredWidth);
</span><span class="cx">             preferredWidth -= glyphWidth;
</span><span class="lines">@@ -292,15 +301,8 @@
</span><span class="cx">     clearNeedsLayout();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLOperator::rebuildTokenContent(const String&amp; operatorString)
</del><ins>+void RenderMathMLOperator::rebuildTokenContent()
</ins><span class="cx"> {
</span><del>-    // We collapse the whitespace and replace the hyphens by minus signs.
-    AtomicString textContent = operatorString.stripWhiteSpace().simplifyWhiteSpace().replace(hyphenMinus, minusSign).impl();
-
-    // We verify whether the operator text can be represented by a single UChar.
-    // FIXME: This does not handle surrogate pairs (https://bugs.webkit.org/show_bug.cgi?id=122296).
-    // FIXME: This does not handle &lt;mo&gt; operators with multiple characters (https://bugs.webkit.org/show_bug.cgi?id=124828).
-    m_textContent = textContent.length() == 1 ? textContent[0] : 0;
</del><span class="cx">     setOperatorProperties();
</span><span class="cx"> 
</span><span class="cx">     if (useMathOperator()) {
</span><span class="lines">@@ -311,7 +313,7 @@
</span><span class="cx">             type = MathOperator::Type::DisplayOperator;
</span><span class="cx">         else
</span><span class="cx">             type = m_isVertical ? MathOperator::Type::VerticalOperator : MathOperator::Type::HorizontalOperator;
</span><del>-        m_mathOperator.setOperator(style(), m_textContent, type);
</del><ins>+        m_mathOperator.setOperator(style(), textContent(), type);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="lines">@@ -320,7 +322,8 @@
</span><span class="cx"> void RenderMathMLOperator::updateTokenContent(const String&amp; operatorString)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isAnonymous());
</span><del>-    rebuildTokenContent(operatorString);
</del><ins>+    m_textContent = MathMLOperatorElement::parseOperatorText(operatorString);
+    rebuildTokenContent();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderMathMLOperator::updateTokenContent()
</span><span class="lines">@@ -327,7 +330,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!isAnonymous());
</span><span class="cx">     RenderMathMLToken::updateTokenContent();
</span><del>-    rebuildTokenContent(element().textContent());
</del><ins>+    rebuildTokenContent();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderMathMLOperator::updateFromElement()
</span><span class="lines">@@ -343,7 +346,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool RenderMathMLOperator::shouldAllowStretching() const
</span><span class="cx"> {
</span><del>-    return m_textContent &amp;&amp; (hasOperatorFlag(MathMLOperatorDictionary::Stretchy) || isLargeOperatorInDisplayStyle());
</del><ins>+    return textContent() &amp;&amp; (hasOperatorFlag(MathMLOperatorDictionary::Stretchy) || isLargeOperatorInDisplayStyle());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderMathMLOperator::useMathOperator() const
</span><span class="lines">@@ -352,7 +355,7 @@
</span><span class="cx">     // 1) Stretchy and large operators, since they require special painting.
</span><span class="cx">     // 2) The minus sign, since it can be obtained from a hyphen in the DOM.
</span><span class="cx">     // 3) The anonymous operators created by mfenced, since they do not have text content in the DOM.
</span><del>-    return shouldAllowStretching() || m_textContent == minusSign || isAnonymous();
</del><ins>+    return shouldAllowStretching() || textContent() == minusSign || isAnonymous();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderMathMLOperator::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLOperatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h (203895 => 203896)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h        2016-07-29 07:15:01 UTC (rev 203895)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h        2016-07-29 07:21:57 UTC (rev 203896)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> public:
</span><span class="cx">     RenderMathMLOperator(MathMLOperatorElement&amp;, RenderStyle&amp;&amp;);
</span><span class="cx">     RenderMathMLOperator(Document&amp;, RenderStyle&amp;&amp;, const String&amp; operatorString, MathMLOperatorDictionary::Form, unsigned short flags = 0);
</span><ins>+    MathMLOperatorElement&amp; element() const;
</ins><span class="cx"> 
</span><span class="cx">     void stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline);
</span><span class="cx">     void stretchTo(LayoutUnit width);
</span><span class="lines">@@ -56,7 +57,7 @@
</span><span class="cx">     void updateTokenContent() final;
</span><span class="cx">     void updateOperatorProperties();
</span><span class="cx">     void updateFromElement() final;
</span><del>-    UChar textContent() const { return m_textContent; }
</del><ins>+    UChar textContent() const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     virtual void setOperatorProperties();
</span><span class="lines">@@ -72,11 +73,11 @@
</span><span class="cx">     void paintChildren(PaintInfo&amp; forSelf, const LayoutPoint&amp;, PaintInfo&amp; forChild, bool usePrintRect) final;
</span><span class="cx">     bool isRenderMathMLOperator() const final { return true; }
</span><span class="cx">     // The following operators are invisible: U+2061 FUNCTION APPLICATION, U+2062 INVISIBLE TIMES, U+2063 INVISIBLE SEPARATOR, U+2064 INVISIBLE PLUS.
</span><del>-    bool isInvisibleOperator() const { return 0x2061 &lt;= m_textContent &amp;&amp; m_textContent &lt;= 0x2064; }
</del><ins>+    bool isInvisibleOperator() { return 0x2061 &lt;= textContent() &amp;&amp; textContent() &lt;= 0x2064; }
</ins><span class="cx"> 
</span><span class="cx">     Optional&lt;int&gt; firstLineBaseline() const final;
</span><span class="cx">     RenderMathMLOperator* unembellishedOperator() final { return this; }
</span><del>-    void rebuildTokenContent(const String&amp; operatorString);
</del><ins>+    void rebuildTokenContent();
</ins><span class="cx"> 
</span><span class="cx">     bool shouldAllowStretching() const;
</span><span class="cx">     bool useMathOperator() const;
</span></span></pre>
</div>
</div>

</body>
</html>