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

<h3>Log Message</h3>
<pre>Move parsing of display, displaystyle and mathvariant attributes into MathML element classes
https://bugs.webkit.org/show_bug.cgi?id=159623

Patch by Frederic Wang &lt;fwang@igalia.com&gt; on 2016-07-24
Reviewed by Brent Fulgham.

No new tests, already covered by existing tests.

* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::parseMathVariantAttribute): Move helper function to parse the
mathvariant attribute.
(WebCore::MathMLElement::getSpecifiedDisplayStyle): Helper function to set the displaystyle
value from the attribute specified on the MathML element.
(WebCore::MathMLElement::getSpecifiedMathVariant): Helper function to set the mathvariant
value from the attribute specified on the MathML element.
* mathml/MathMLElement.h: Move the enum for mathvariant values and declare new members.
(WebCore::MathMLElement::acceptsDisplayStyleAttribute): Indicate whether the element accepts
displaystyle attribute (false for most of them).
(WebCore::MathMLElement::acceptsMathVariantAttribute): Indicate whether the element accepts
mathvariant attribute (false for most of them).
* mathml/MathMLInlineContainerElement.cpp:
(WebCore::MathMLInlineContainerElement::acceptsDisplayStyleAttribute): Add mstyle and mtable
to the list of elements accepting the displaystyle attribute.
(WebCore::MathMLInlineContainerElement::acceptsMathVariantAttribute): Add mstyle to the list
of elements accepting the mathvariant attribute.
(WebCore::MathMLInlineContainerElement::parseAttribute): Mark displaystyle and mathvariant
dirty if necessary. Also use the new accepts*Attribute function.
* mathml/MathMLInlineContainerElement.h: Declare overridden accepts*Attribute members.
* mathml/MathMLMathElement.cpp:
(WebCore::MathMLMathElement::getSpecifiedDisplayStyle): Override acceptsDisplayStyleAttribute
so that the display attribute is also used to set the default value if the displaystyle
attribute is absent.
(WebCore::MathMLMathElement::parseAttribute): Mark displaystyle and mathvariant dirty if
necessary. We directly MathMLElement::parseAttribute to avoid duplicate work.
* mathml/MathMLMathElement.h: Add the math tag to the list of elements accepting the
displaystyle and mathvariant attributes. Declare overridden getSpecifiedDisplayStyle.
* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::parseAttribute): Mark mathvariant as dirty.
* mathml/MathMLTextElement.h: Add token elements to the list of elements accepting the
mathvariant attribute.
* rendering/mathml/MathMLStyle.cpp:
(WebCore::MathMLStyle::updateStyleIfNeeded): Use the new MathMLElement::MathVariant enum.
(WebCore::MathMLStyle::resolveMathMLStyle):  We no longer parse the display value to
initialize the default value on the math tag, because this is handled in
getSpecifiedDisplayStyle. In general, we also just call getSpecifiedDisplayStyle and
getSpecifiedMathVariant on the MathML elements instead of parsing the displaystyle and
mathvariant attributes here.
(WebCore::MathMLStyle::parseMathVariant): Deleted. This is moved into MathMLElement.
* rendering/mathml/MathMLStyle.h: Use the new MathMLElement::MathVariant enum.
* rendering/mathml/RenderMathMLToken.cpp: Ditto.
(WebCore::mathVariant): Ditto.
(WebCore::RenderMathMLToken::updateMathVariantGlyph): Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLElementcpp">trunk/Source/WebCore/mathml/MathMLElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLElementh">trunk/Source/WebCore/mathml/MathMLElement.h</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLInlineContainerElementcpp">trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLInlineContainerElementh">trunk/Source/WebCore/mathml/MathMLInlineContainerElement.h</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLMathElementcpp">trunk/Source/WebCore/mathml/MathMLMathElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLMathElementh">trunk/Source/WebCore/mathml/MathMLMathElement.h</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLTextElementcpp">trunk/Source/WebCore/mathml/MathMLTextElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLTextElementh">trunk/Source/WebCore/mathml/MathMLTextElement.h</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlMathMLStylecpp">trunk/Source/WebCore/rendering/mathml/MathMLStyle.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlMathMLStyleh">trunk/Source/WebCore/rendering/mathml/MathMLStyle.h</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLTokencpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203678 => 203679)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-25 07:10:18 UTC (rev 203678)
+++ trunk/Source/WebCore/ChangeLog        2016-07-25 07:18:47 UTC (rev 203679)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2016-07-24  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Move parsing of display, displaystyle and mathvariant attributes into MathML element classes
+        https://bugs.webkit.org/show_bug.cgi?id=159623
+
+        Reviewed by Brent Fulgham.
+
+        No new tests, already covered by existing tests.
+
+        * mathml/MathMLElement.cpp:
+        (WebCore::MathMLElement::parseMathVariantAttribute): Move helper function to parse the
+        mathvariant attribute.
+        (WebCore::MathMLElement::getSpecifiedDisplayStyle): Helper function to set the displaystyle
+        value from the attribute specified on the MathML element.
+        (WebCore::MathMLElement::getSpecifiedMathVariant): Helper function to set the mathvariant
+        value from the attribute specified on the MathML element.
+        * mathml/MathMLElement.h: Move the enum for mathvariant values and declare new members.
+        (WebCore::MathMLElement::acceptsDisplayStyleAttribute): Indicate whether the element accepts
+        displaystyle attribute (false for most of them).
+        (WebCore::MathMLElement::acceptsMathVariantAttribute): Indicate whether the element accepts
+        mathvariant attribute (false for most of them).
+        * mathml/MathMLInlineContainerElement.cpp:
+        (WebCore::MathMLInlineContainerElement::acceptsDisplayStyleAttribute): Add mstyle and mtable
+        to the list of elements accepting the displaystyle attribute.
+        (WebCore::MathMLInlineContainerElement::acceptsMathVariantAttribute): Add mstyle to the list
+        of elements accepting the mathvariant attribute.
+        (WebCore::MathMLInlineContainerElement::parseAttribute): Mark displaystyle and mathvariant
+        dirty if necessary. Also use the new accepts*Attribute function.
+        * mathml/MathMLInlineContainerElement.h: Declare overridden accepts*Attribute members.
+        * mathml/MathMLMathElement.cpp:
+        (WebCore::MathMLMathElement::getSpecifiedDisplayStyle): Override acceptsDisplayStyleAttribute
+        so that the display attribute is also used to set the default value if the displaystyle
+        attribute is absent.
+        (WebCore::MathMLMathElement::parseAttribute): Mark displaystyle and mathvariant dirty if
+        necessary. We directly MathMLElement::parseAttribute to avoid duplicate work.
+        * mathml/MathMLMathElement.h: Add the math tag to the list of elements accepting the
+        displaystyle and mathvariant attributes. Declare overridden getSpecifiedDisplayStyle.
+        * mathml/MathMLTextElement.cpp:
+        (WebCore::MathMLTextElement::parseAttribute): Mark mathvariant as dirty.
+        * mathml/MathMLTextElement.h: Add token elements to the list of elements accepting the
+        mathvariant attribute.
+        * rendering/mathml/MathMLStyle.cpp:
+        (WebCore::MathMLStyle::updateStyleIfNeeded): Use the new MathMLElement::MathVariant enum.
+        (WebCore::MathMLStyle::resolveMathMLStyle):  We no longer parse the display value to
+        initialize the default value on the math tag, because this is handled in
+        getSpecifiedDisplayStyle. In general, we also just call getSpecifiedDisplayStyle and
+        getSpecifiedMathVariant on the MathML elements instead of parsing the displaystyle and
+        mathvariant attributes here.
+        (WebCore::MathMLStyle::parseMathVariant): Deleted. This is moved into MathMLElement.
+        * rendering/mathml/MathMLStyle.h: Use the new MathMLElement::MathVariant enum.
+        * rendering/mathml/RenderMathMLToken.cpp: Ditto.
+        (WebCore::mathVariant): Ditto.
+        (WebCore::RenderMathMLToken::updateMathVariantGlyph): Ditto.
+
</ins><span class="cx"> 2016-07-25  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed. Remove unneeded header includes from CoordinatedGraphicsLayer.
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLElement.cpp (203678 => 203679)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLElement.cpp        2016-07-25 07:10:18 UTC (rev 203678)
+++ trunk/Source/WebCore/mathml/MathMLElement.cpp        2016-07-25 07:18:47 UTC (rev 203679)
</span><span class="lines">@@ -2,6 +2,7 @@
</span><span class="cx">  * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
</span><span class="cx">  * Copyright (C) 2010 Apple Inc. All rights reserved.
</span><span class="cx">  * Copyright (C) 2010 François Sausset (sausset@gmail.com). All rights reserved.
</span><ins>+ * Copyright (C) 2016 Igalia S.L.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -543,6 +544,67 @@
</span><span class="cx">     return attribute.value;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+MathMLElement::MathVariant MathMLElement::parseMathVariantAttribute(const AtomicString&amp; attributeValue)
+{
+    // The mathvariant attribute values is case-sensitive.
+    if (attributeValue == &quot;normal&quot;)
+        return MathVariant::Normal;
+    if (attributeValue == &quot;bold&quot;)
+        return MathVariant::Bold;
+    if (attributeValue == &quot;italic&quot;)
+        return MathVariant::Italic;
+    if (attributeValue == &quot;bold-italic&quot;)
+        return MathVariant::BoldItalic;
+    if (attributeValue == &quot;double-struck&quot;)
+        return MathVariant::DoubleStruck;
+    if (attributeValue == &quot;bold-fraktur&quot;)
+        return MathVariant::BoldFraktur;
+    if (attributeValue == &quot;script&quot;)
+        return MathVariant::Script;
+    if (attributeValue == &quot;bold-script&quot;)
+        return MathVariant::BoldScript;
+    if (attributeValue == &quot;fraktur&quot;)
+        return MathVariant::Fraktur;
+    if (attributeValue == &quot;sans-serif&quot;)
+        return MathVariant::SansSerif;
+    if (attributeValue == &quot;bold-sans-serif&quot;)
+        return MathVariant::BoldSansSerif;
+    if (attributeValue == &quot;sans-serif-italic&quot;)
+        return MathVariant::SansSerifItalic;
+    if (attributeValue == &quot;sans-serif-bold-italic&quot;)
+        return MathVariant::SansSerifBoldItalic;
+    if (attributeValue == &quot;monospace&quot;)
+        return MathVariant::Monospace;
+    if (attributeValue == &quot;initial&quot;)
+        return MathVariant::Initial;
+    if (attributeValue == &quot;tailed&quot;)
+        return MathVariant::Tailed;
+    if (attributeValue == &quot;looped&quot;)
+        return MathVariant::Looped;
+    if (attributeValue == &quot;stretched&quot;)
+        return MathVariant::Stretched;
+    return MathVariant::None;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Optional&lt;bool&gt; MathMLElement::specifiedDisplayStyle()
+{
+    if (!acceptsDisplayStyleAttribute())
+        return Optional&lt;bool&gt;();
+    const MathMLElement::BooleanValue&amp; specifiedDisplayStyle = cachedBooleanAttribute(displaystyleAttr, m_displayStyle);
+    return specifiedDisplayStyle == BooleanValue::Default ? Optional&lt;bool&gt;() : Optional&lt;bool&gt;(specifiedDisplayStyle == BooleanValue::True);
+}
+
+Optional&lt;MathMLElement::MathVariant&gt; MathMLElement::specifiedMathVariant()
+{
+    if (!acceptsMathVariantAttribute())
+        return Optional&lt;MathVariant&gt;();
+    if (m_mathVariant.dirty) {
+        m_mathVariant.value = parseMathVariantAttribute(attributeWithoutSynchronization(mathvariantAttr));
+        m_mathVariant.dirty = false;
+    }
+    return m_mathVariant.value == MathVariant::None ? Optional&lt;MathVariant&gt;() : Optional&lt;MathVariant&gt;(m_mathVariant.value);
+}
+
+}
+
</ins><span class="cx"> #endif // ENABLE(MATHML)
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLElement.h (203678 => 203679)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLElement.h        2016-07-25 07:10:18 UTC (rev 203678)
+++ trunk/Source/WebCore/mathml/MathMLElement.h        2016-07-25 07:18:47 UTC (rev 203679)
</span><span class="lines">@@ -2,6 +2,7 @@
</span><span class="cx">  * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
</span><span class="cx">  * Copyright (C) 2010 Apple Inc. All rights reserved.
</span><span class="cx">  * Copyright (C) 2010 François Sausset (sausset@gmail.com). All rights reserved.
</span><ins>+ * Copyright (C) 2016 Igalia S.L.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -72,6 +73,38 @@
</span><span class="cx">         bool dirty { true };
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    // These are the mathvariant values from the MathML recommendation.
+    // The special value none means that no explicit mathvariant value has been specified.
+    // Note that the numeral values are important for the computation performed in the mathVariant function of RenderMathMLToken, do not change them!
+    enum class MathVariant {
+        None = 0,
+        Normal = 1,
+        Bold = 2,
+        Italic = 3,
+        BoldItalic = 4,
+        Script = 5,
+        BoldScript = 6,
+        Fraktur = 7,
+        DoubleStruck = 8,
+        BoldFraktur = 9,
+        SansSerif = 10,
+        BoldSansSerif = 11,
+        SansSerifItalic = 12,
+        SansSerifBoldItalic = 13,
+        Monospace = 14,
+        Initial = 15,
+        Tailed = 16,
+        Looped = 17,
+        Stretched = 18
+    };
+    struct MathVariantAttribute {
+        MathVariant value { MathVariant::None };
+        bool dirty { true };
+    };
+
+    virtual Optional&lt;bool&gt; specifiedDisplayStyle();
+    Optional&lt;MathMLElement::MathVariant&gt; specifiedMathVariant();
+
</ins><span class="cx"> protected:
</span><span class="cx">     MathMLElement(const QualifiedName&amp; tagName, Document&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -91,10 +124,17 @@
</span><span class="cx">     const Length&amp; cachedMathMLLength(const QualifiedName&amp;, Length&amp;);
</span><span class="cx">     const BooleanValue&amp; cachedBooleanAttribute(const QualifiedName&amp;, BooleanAttribute&amp;);
</span><span class="cx"> 
</span><ins>+    virtual bool acceptsDisplayStyleAttribute() { return false; }
+    virtual bool acceptsMathVariantAttribute() { return false; }
+
+    BooleanAttribute m_displayStyle;
+    MathVariantAttribute m_mathVariant;
+
</ins><span class="cx"> private:
</span><span class="cx">     virtual void updateSelectedChild() { }
</span><span class="cx">     static Length parseNumberAndUnit(const StringView&amp;);
</span><span class="cx">     static Length parseNamedSpace(const StringView&amp;);
</span><ins>+    static MathVariant parseMathVariantAttribute(const AtomicString&amp; attributeValue);
</ins><span class="cx"> 
</span><span class="cx">     bool canStartSelection() const final;
</span><span class="cx">     bool isFocusable() const final;
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLInlineContainerElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp (203678 => 203679)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp        2016-07-25 07:10:18 UTC (rev 203678)
+++ trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp        2016-07-25 07:18:47 UTC (rev 203679)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
</span><span class="cx">  * Copyright (C) 2010 Apple Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2016 Igalia S.L.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -74,10 +75,24 @@
</span><span class="cx">     return createRenderer&lt;RenderMathMLBlock&gt;(*this, WTFMove(style));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool MathMLInlineContainerElement::acceptsDisplayStyleAttribute()
+{
+    return hasTagName(mstyleTag) || hasTagName(mtableTag);
+}
+
+bool MathMLInlineContainerElement::acceptsMathVariantAttribute()
+{
+    return hasTagName(mstyleTag);
+}
+
</ins><span class="cx"> void MathMLInlineContainerElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
</span><span class="cx"> {
</span><del>-    bool displayStyleAttribute = (name == displaystyleAttr &amp;&amp; (hasTagName(mstyleTag) || hasTagName(mtableTag)));
-    bool mathVariantAttribute = (name == mathvariantAttr &amp;&amp; (hasTagName(mathTag) || hasTagName(mstyleTag)));
</del><ins>+    bool displayStyleAttribute = name == displaystyleAttr &amp;&amp; acceptsDisplayStyleAttribute();
+    bool mathVariantAttribute = name == mathvariantAttr &amp;&amp; acceptsMathVariantAttribute();
+    if (displayStyleAttribute)
+        m_displayStyle.dirty = true;
+    if (mathVariantAttribute)
+        m_mathVariant.dirty = true;
</ins><span class="cx">     if ((displayStyleAttribute || mathVariantAttribute) &amp;&amp; renderer())
</span><span class="cx">         MathMLStyle::resolveMathMLStyleTree(renderer());
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLInlineContainerElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLInlineContainerElement.h (203678 => 203679)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLInlineContainerElement.h        2016-07-25 07:10:18 UTC (rev 203678)
+++ trunk/Source/WebCore/mathml/MathMLInlineContainerElement.h        2016-07-25 07:18:47 UTC (rev 203679)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
</span><span class="cx">  * Copyright (C) 2010 Apple Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2016 Igalia S.L.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -40,6 +41,9 @@
</span><span class="cx">     void childrenChanged(const ChildChange&amp;) override;
</span><span class="cx">     void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span><span class="cx"> 
</span><ins>+    bool acceptsDisplayStyleAttribute() override;
+    bool acceptsMathVariantAttribute() override;
+
</ins><span class="cx"> private:
</span><span class="cx">     RenderPtr&lt;RenderElement&gt; createElementRenderer(RenderStyle&amp;&amp;, const RenderTreePosition&amp;) override;
</span><span class="cx">     bool isPresentationMathML() const final { return true; }
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLMathElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLMathElement.cpp (203678 => 203679)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLMathElement.cpp        2016-07-25 07:10:18 UTC (rev 203678)
+++ trunk/Source/WebCore/mathml/MathMLMathElement.cpp        2016-07-25 07:18:47 UTC (rev 203679)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
</span><span class="cx">  * Copyright (C) 2010 Apple Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2016 Igalia S.L.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -53,12 +54,31 @@
</span><span class="cx">     return createRenderer&lt;RenderMathMLMath&gt;(*this, WTFMove(style));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Optional&lt;bool&gt; MathMLMathElement::specifiedDisplayStyle()
+{
+    if (cachedBooleanAttribute(displaystyleAttr, m_displayStyle) == BooleanValue::Default) {
+        // The default displaystyle value of the &lt;math&gt; depends on the display attribute, so we parse it here.
+        const AtomicString&amp; value = attributeWithoutSynchronization(displayAttr);
+        if (value == &quot;block&quot;)
+            m_displayStyle.value = BooleanValue::True;
+        else if (value == &quot;inline&quot;)
+            m_displayStyle.value = BooleanValue::False;
+    }
+    return m_displayStyle.value == BooleanValue::Default ? Optional&lt;bool&gt;() : Optional&lt;bool&gt;(m_displayStyle.value == BooleanValue::True);
+}
+
</ins><span class="cx"> void MathMLMathElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
</span><span class="cx"> {
</span><del>-    if ((name == displaystyleAttr || name == displayAttr || name == mathvariantAttr) &amp;&amp; renderer())
</del><ins>+    bool displayStyleAttribute = (name == displaystyleAttr || name == displayAttr);
+    bool mathVariantAttribute = name == mathvariantAttr;
+    if (displayStyleAttribute)
+        m_displayStyle.dirty = true;
+    if (mathVariantAttribute)
+        m_mathVariant.dirty = true;
+    if ((displayStyleAttribute || mathVariantAttribute) &amp;&amp; renderer())
</ins><span class="cx">         MathMLStyle::resolveMathMLStyleTree(renderer());
</span><span class="cx"> 
</span><del>-    MathMLInlineContainerElement::parseAttribute(name, value);
</del><ins>+    MathMLElement::parseAttribute(name, value);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MathMLMathElement::didAttachRenderers()
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLMathElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLMathElement.h (203678 => 203679)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLMathElement.h        2016-07-25 07:10:18 UTC (rev 203678)
+++ trunk/Source/WebCore/mathml/MathMLMathElement.h        2016-07-25 07:18:47 UTC (rev 203679)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
</span><span class="cx">  * Copyright (C) 2010 Apple Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2016 Igalia S.L.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -40,6 +41,10 @@
</span><span class="cx">     void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) final;
</span><span class="cx">     void didAttachRenderers() final;
</span><span class="cx"> 
</span><ins>+    bool acceptsDisplayStyleAttribute() final { return true; }
+    bool acceptsMathVariantAttribute() final { return true; }
+    Optional&lt;bool&gt; specifiedDisplayStyle() final;
+
</ins><span class="cx">     RenderPtr&lt;RenderElement&gt; createElementRenderer(RenderStyle&amp;&amp;, const RenderTreePosition&amp;) final;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLTextElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLTextElement.cpp (203678 => 203679)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLTextElement.cpp        2016-07-25 07:10:18 UTC (rev 203678)
+++ trunk/Source/WebCore/mathml/MathMLTextElement.cpp        2016-07-25 07:18:47 UTC (rev 203679)
</span><span class="lines">@@ -71,8 +71,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (name == mathvariantAttr &amp;&amp; renderer())
-        MathMLStyle::resolveMathMLStyleTree(renderer());
</del><ins>+    if (name == mathvariantAttr) {
+        m_mathVariant.dirty = true;
+        if (renderer())
+            MathMLStyle::resolveMathMLStyleTree(renderer());
+    }
</ins><span class="cx"> 
</span><span class="cx">     MathMLElement::parseAttribute(name, value);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLTextElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLTextElement.h (203678 => 203679)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLTextElement.h        2016-07-25 07:10:18 UTC (rev 203678)
+++ trunk/Source/WebCore/mathml/MathMLTextElement.h        2016-07-25 07:18:47 UTC (rev 203679)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
</span><span class="cx">  * Copyright (C) 2010 Apple Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2016 Igalia S.L.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -34,6 +35,7 @@
</span><span class="cx"> class MathMLTextElement final : public MathMLElement {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;MathMLTextElement&gt; create(const QualifiedName&amp; tagName, Document&amp;);
</span><ins>+    bool acceptsMathVariantAttribute() final { return true; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     MathMLTextElement(const QualifiedName&amp; tagName, Document&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlMathMLStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/MathMLStyle.cpp (203678 => 203679)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/MathMLStyle.cpp        2016-07-25 07:10:18 UTC (rev 203678)
+++ trunk/Source/WebCore/rendering/mathml/MathMLStyle.cpp        2016-07-25 07:18:47 UTC (rev 203679)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">     return parentRenderer;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MathMLStyle::updateStyleIfNeeded(RenderObject* renderer, bool oldDisplayStyle, MathVariant oldMathVariant)
</del><ins>+void MathMLStyle::updateStyleIfNeeded(RenderObject* renderer, bool oldDisplayStyle, MathMLElement::MathVariant oldMathVariant)
</ins><span class="cx"> {
</span><span class="cx">     if (oldDisplayStyle != m_displayStyle) {
</span><span class="cx">         renderer-&gt;setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="lines">@@ -98,59 +98,18 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-MathMLStyle::MathVariant MathMLStyle::parseMathVariant(const AtomicString&amp; attributeValue)
-{
-    if (attributeValue == &quot;normal&quot;)
-        return Normal;
-    if (attributeValue == &quot;bold&quot;)
-        return Bold;
-    if (attributeValue == &quot;italic&quot;)
-        return Italic;
-    if (attributeValue == &quot;bold-italic&quot;)
-        return BoldItalic;
-    if (attributeValue == &quot;double-struck&quot;)
-        return DoubleStruck;
-    if (attributeValue == &quot;bold-fraktur&quot;)
-        return BoldFraktur;
-    if (attributeValue == &quot;script&quot;)
-        return Script;
-    if (attributeValue == &quot;bold-script&quot;)
-        return BoldScript;
-    if (attributeValue == &quot;fraktur&quot;)
-        return Fraktur;
-    if (attributeValue == &quot;sans-serif&quot;)
-        return SansSerif;
-    if (attributeValue == &quot;bold-sans-serif&quot;)
-        return BoldSansSerif;
-    if (attributeValue == &quot;sans-serif-italic&quot;)
-        return SansSerifItalic;
-    if (attributeValue == &quot;sans-serif-bold-italic&quot;)
-        return SansSerifBoldItalic;
-    if (attributeValue == &quot;monospace&quot;)
-        return Monospace;
-    if (attributeValue == &quot;initial&quot;)
-        return Initial;
-    if (attributeValue == &quot;tailed&quot;)
-        return Tailed;
-    if (attributeValue == &quot;looped&quot;)
-        return Looped;
-    if (attributeValue == &quot;stretched&quot;)
-        return Stretched;
-    return None;
-}
-
</del><span class="cx"> void MathMLStyle::resolveMathMLStyle(RenderObject* renderer)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(renderer);
</span><span class="cx"> 
</span><span class="cx">     bool oldDisplayStyle = m_displayStyle;
</span><del>-    MathVariant oldMathVariant = m_mathVariant;
</del><ins>+    MathMLElement::MathVariant oldMathVariant = m_mathVariant;
</ins><span class="cx">     auto* parentRenderer = getMathMLParentNode(renderer);
</span><span class="cx">     const MathMLStyle* parentStyle = getMathMLStyle(parentRenderer);
</span><span class="cx"> 
</span><span class="cx">     // By default, we just inherit the style from our parent.
</span><span class="cx">     m_displayStyle = false;
</span><del>-    m_mathVariant = None;
</del><ins>+    m_mathVariant = MathMLElement::MathVariant::None;
</ins><span class="cx">     if (parentStyle) {
</span><span class="cx">         setDisplayStyle(parentStyle-&gt;displayStyle());
</span><span class="cx">         setMathVariant(parentStyle-&gt;mathVariant());
</span><span class="lines">@@ -162,10 +121,8 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (is&lt;RenderMathMLMath&gt;(renderer))
-        m_displayStyle = downcast&lt;RenderElement&gt;(renderer)-&gt;element()-&gt;attributeWithoutSynchronization(displayAttr) == &quot;block&quot;; // The default displaystyle of the &lt;math&gt; element depends on its display attribute.
-    else if (is&lt;RenderMathMLTable&gt;(renderer))
-        m_displayStyle = false; // The default displaystyle of &lt;mtable&gt; is false.
</del><ins>+    if (is&lt;RenderMathMLMath&gt;(renderer) || is&lt;RenderMathMLTable&gt;(renderer))
+        m_displayStyle = false; // The default displaystyle of &lt;math&gt; and &lt;mtable&gt; is false.
</ins><span class="cx">     else if (parentRenderer) {
</span><span class="cx">         if (is&lt;RenderMathMLFraction&gt;(parentRenderer))
</span><span class="cx">             m_displayStyle = false; // &lt;mfrac&gt; sets displaystyle to false within its numerator and denominator.
</span><span class="lines">@@ -177,25 +134,16 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // The displaystyle attribute on the &lt;math&gt;, &lt;mtable&gt; or &lt;mstyle&gt; elements override the default behavior.
-    const auto* element = downcast&lt;RenderElement&gt;(renderer)-&gt;element();
-    const QualifiedName&amp; tagName = element-&gt;tagQName();
-    if (tagName == mathTag || tagName == mtableTag || tagName == mstyleTag) {
-        // We only modify the value of displaystyle if there is an explicit and valid attribute.
-        const AtomicString&amp; attributeValue = element-&gt;attributeWithoutSynchronization(displaystyleAttr);
-        if (attributeValue == &quot;true&quot;)
-            m_displayStyle = true;
-        else if (attributeValue == &quot;false&quot;)
-            m_displayStyle = false;
</del><ins>+    // The displaystyle and mathvariant attributes override the default behavior.
+    auto* element = downcast&lt;RenderElement&gt;(renderer)-&gt;element();
+    if (is&lt;MathMLElement&gt;(element)) {
+        Optional&lt;bool&gt; displayStyle = downcast&lt;MathMLElement&gt;(element)-&gt;specifiedDisplayStyle();
+        if (displayStyle)
+            m_displayStyle = displayStyle.value();
+        Optional&lt;MathMLElement::MathVariant&gt; mathVariant = downcast&lt;MathMLElement&gt;(element)-&gt;specifiedMathVariant();
+        if (mathVariant)
+            m_mathVariant = mathVariant.value();
</ins><span class="cx">     }
</span><del>-
-    // The mathvariant attribute on the &lt;math&gt;, &lt;mstyle&gt; or token elements overrides the default behavior.
-    if (is&lt;RenderMathMLMath&gt;(renderer) || is&lt;RenderMathMLToken&gt;(renderer) || tagName == mstyleTag) {
-        MathVariant mathvariant = parseMathVariant(element-&gt;attributeWithoutSynchronization(mathvariantAttr));
-        if (mathvariant != None)
-            m_mathVariant = mathvariant;
-    }
-
</del><span class="cx">     updateStyleIfNeeded(renderer, oldDisplayStyle, oldMathVariant);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlMathMLStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/MathMLStyle.h (203678 => 203679)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/MathMLStyle.h        2016-07-25 07:10:18 UTC (rev 203678)
+++ trunk/Source/WebCore/rendering/mathml/MathMLStyle.h        2016-07-25 07:18:47 UTC (rev 203679)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #if ENABLE(MATHML)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Element.h&quot;
</span><ins>+#include &quot;MathMLElement.h&quot;
</ins><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -40,32 +41,8 @@
</span><span class="cx">     bool displayStyle() const { return m_displayStyle; }
</span><span class="cx">     void setDisplayStyle(bool displayStyle) { m_displayStyle = displayStyle; }
</span><span class="cx"> 
</span><del>-    // These are the mathvariant values from the MathML recommendation.
-    // The special value none means that no explicit mathvariant value has been specified.
-    // Note that the numeral values are important for the computation performed in the mathVariant function of RenderMathMLToken, do not change them!
-    enum MathVariant {
-        None = 0,
-        Normal = 1,
-        Bold = 2,
-        Italic = 3,
-        BoldItalic = 4,
-        Script = 5,
-        BoldScript = 6,
-        Fraktur = 7,
-        DoubleStruck = 8,
-        BoldFraktur = 9,
-        SansSerif = 10,
-        BoldSansSerif = 11,
-        SansSerifItalic = 12,
-        SansSerifBoldItalic = 13,
-        Monospace = 14,
-        Initial = 15,
-        Tailed = 16,
-        Looped = 17,
-        Stretched = 18
-    };
-    MathVariant mathVariant() const { return m_mathVariant; }
-    void setMathVariant(MathVariant mathvariant) { m_mathVariant = mathvariant; }
</del><ins>+    MathMLElement::MathVariant mathVariant() const { return m_mathVariant; }
+    void setMathVariant(MathMLElement::MathVariant mathvariant) { m_mathVariant = mathvariant; }
</ins><span class="cx"> 
</span><span class="cx">     void resolveMathMLStyle(RenderObject*);
</span><span class="cx">     static void resolveMathMLStyleTree(RenderObject*);
</span><span class="lines">@@ -74,11 +51,10 @@
</span><span class="cx">     bool isDisplayStyleAlwaysFalse(RenderObject*);
</span><span class="cx">     const MathMLStyle* getMathMLStyle(RenderObject* renderer);
</span><span class="cx">     RenderObject* getMathMLParentNode(RenderObject*);
</span><del>-    void updateStyleIfNeeded(RenderObject*, bool, MathVariant);
-    MathVariant parseMathVariant(const AtomicString&amp; attributeValue);
</del><ins>+    void updateStyleIfNeeded(RenderObject*, bool, MathMLElement::MathVariant);
</ins><span class="cx"> 
</span><span class="cx">     bool m_displayStyle { false };
</span><del>-    MathVariant m_mathVariant { None };
</del><ins>+    MathMLElement::MathVariant m_mathVariant { MathMLElement::MathVariant::None };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLTokencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp (203678 => 203679)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp        2016-07-25 07:10:18 UTC (rev 203678)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp        2016-07-25 07:18:47 UTC (rev 203679)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MATHML)
</span><span class="cx"> 
</span><ins>+#include &quot;MathMLElement.h&quot;
</ins><span class="cx"> #include &quot;MathMLNames.h&quot;
</span><span class="cx"> #include &quot;PaintInfo.h&quot;
</span><span class="cx"> #include &quot;RenderElement.h&quot;
</span><span class="lines">@@ -281,15 +282,15 @@
</span><span class="cx"> // Characters without a valid mapping or valid aMathvar value are returned
</span><span class="cx"> // unaltered.
</span><span class="cx"> // Characters already in the mathematical blocks (or are one of the exceptions) are never transformed.
</span><del>-// Acceptable values for mathvariant are specified in MathMLStyle.h
</del><ins>+// Acceptable values for mathvariant are specified in MathMLElement.h
</ins><span class="cx"> // The transformable characters can be found at:
</span><span class="cx"> // http://lists.w3.org/Archives/Public/www-math/2013Sep/0012.html and
</span><span class="cx"> // https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols
</span><del>-static UChar32 mathVariant(UChar32 codePoint, MathMLStyle::MathVariant mathvariant)
</del><ins>+static UChar32 mathVariant(UChar32 codePoint, MathMLElement::MathVariant mathvariant)
</ins><span class="cx"> {
</span><del>-    ASSERT(mathvariant &gt;= MathMLStyle::Normal &amp;&amp; mathvariant &lt;= MathMLStyle::Stretched);
</del><ins>+    ASSERT(mathvariant &gt;= MathMLElement::MathVariant::Normal &amp;&amp; mathvariant &lt;= MathMLElement::MathVariant::Stretched);
</ins><span class="cx"> 
</span><del>-    if (mathvariant == MathMLStyle::Normal)
</del><ins>+    if (mathvariant == MathMLElement::MathVariant::Normal)
</ins><span class="cx">         return codePoint; // Nothing to do here.
</span><span class="cx"> 
</span><span class="cx">     // Exceptional characters with at most one possible transformation.
</span><span class="lines">@@ -296,22 +297,22 @@
</span><span class="cx">     if (codePoint == holeGreekUpperTheta)
</span><span class="cx">         return codePoint; // Nothing at this code point is transformed
</span><span class="cx">     if (codePoint == greekLetterDigamma) {
</span><del>-        if (mathvariant == MathMLStyle::Bold)
</del><ins>+        if (mathvariant == MathMLElement::MathVariant::Bold)
</ins><span class="cx">             return mathBoldCapitalDigamma;
</span><span class="cx">         return codePoint;
</span><span class="cx">     }
</span><span class="cx">     if (codePoint == greekSmallLetterDigamma) {
</span><del>-        if (mathvariant == MathMLStyle::Bold)
</del><ins>+        if (mathvariant == MathMLElement::MathVariant::Bold)
</ins><span class="cx">             return mathBoldSmallDigamma;
</span><span class="cx">         return codePoint;
</span><span class="cx">     }
</span><span class="cx">     if (codePoint == latinSmallLetterDotlessI) {
</span><del>-        if (mathvariant == MathMLStyle::Italic)
</del><ins>+        if (mathvariant == MathMLElement::MathVariant::Italic)
</ins><span class="cx">             return mathItalicSmallDotlessI;
</span><span class="cx">         return codePoint;
</span><span class="cx">     }
</span><span class="cx">     if (codePoint == latinSmallLetterDotlessJ) {
</span><del>-        if (mathvariant == MathMLStyle::Italic)
</del><ins>+        if (mathvariant == MathMLElement::MathVariant::Italic)
</ins><span class="cx">             return mathItalicSmallDotlessJ;
</span><span class="cx">         return codePoint;
</span><span class="cx">     }
</span><span class="lines">@@ -389,19 +390,19 @@
</span><span class="cx">         // For example the beginning of the double struck number range follows immediately after the end of the bold number range.
</span><span class="cx">         // multiplier represents the order of the sequences relative to the first one.
</span><span class="cx">         switch (mathvariant) {
</span><del>-        case MathMLStyle::Bold:
</del><ins>+        case MathMLElement::MathVariant::Bold:
</ins><span class="cx">             multiplier = 0;
</span><span class="cx">             break;
</span><del>-        case MathMLStyle::DoubleStruck:
</del><ins>+        case MathMLElement::MathVariant::DoubleStruck:
</ins><span class="cx">             multiplier = 1;
</span><span class="cx">             break;
</span><del>-        case MathMLStyle::SansSerif:
</del><ins>+        case MathMLElement::MathVariant::SansSerif:
</ins><span class="cx">             multiplier = 2;
</span><span class="cx">             break;
</span><del>-        case MathMLStyle::BoldSansSerif:
</del><ins>+        case MathMLElement::MathVariant::BoldSansSerif:
</ins><span class="cx">             multiplier = 3;
</span><span class="cx">             break;
</span><del>-        case MathMLStyle::Monospace:
</del><ins>+        case MathMLElement::MathVariant::Monospace:
</ins><span class="cx">             multiplier = 4;
</span><span class="cx">             break;
</span><span class="cx">         default:
</span><span class="lines">@@ -416,19 +417,19 @@
</span><span class="cx">     }
</span><span class="cx">     if (varType == Greekish) {
</span><span class="cx">         switch (mathvariant) {
</span><del>-        case MathMLStyle::Bold:
</del><ins>+        case MathMLElement::MathVariant::Bold:
</ins><span class="cx">             multiplier = 0;
</span><span class="cx">             break;
</span><del>-        case MathMLStyle::Italic:
</del><ins>+        case MathMLElement::MathVariant::Italic:
</ins><span class="cx">             multiplier = 1;
</span><span class="cx">             break;
</span><del>-        case MathMLStyle::BoldItalic:
</del><ins>+        case MathMLElement::MathVariant::BoldItalic:
</ins><span class="cx">             multiplier = 2;
</span><span class="cx">             break;
</span><del>-        case MathMLStyle::BoldSansSerif:
</del><ins>+        case MathMLElement::MathVariant::BoldSansSerif:
</ins><span class="cx">             multiplier = 3;
</span><span class="cx">             break;
</span><del>-        case MathMLStyle::SansSerifBoldItalic:
</del><ins>+        case MathMLElement::MathVariant::SansSerifBoldItalic:
</ins><span class="cx">             multiplier = 4;
</span><span class="cx">             break;
</span><span class="cx">         default:
</span><span class="lines">@@ -446,23 +447,23 @@
</span><span class="cx">         const MathVariantMapping* mapTable;
</span><span class="cx">         size_t tableLength;
</span><span class="cx">         switch (mathvariant) {
</span><del>-        case MathMLStyle::Initial:
</del><ins>+        case MathMLElement::MathVariant::Initial:
</ins><span class="cx">             mapTable = arabicInitialMapTable;
</span><span class="cx">             tableLength = WTF_ARRAY_LENGTH(arabicInitialMapTable);
</span><span class="cx">             break;
</span><del>-        case MathMLStyle::Tailed:
</del><ins>+        case MathMLElement::MathVariant::Tailed:
</ins><span class="cx">             mapTable = arabicTailedMapTable;
</span><span class="cx">             tableLength = WTF_ARRAY_LENGTH(arabicTailedMapTable);
</span><span class="cx">             break;
</span><del>-        case MathMLStyle::Stretched:
</del><ins>+        case MathMLElement::MathVariant::Stretched:
</ins><span class="cx">             mapTable = arabicStretchedMapTable;
</span><span class="cx">             tableLength = WTF_ARRAY_LENGTH(arabicStretchedMapTable);
</span><span class="cx">             break;
</span><del>-        case MathMLStyle::Looped:
</del><ins>+        case MathMLElement::MathVariant::Looped:
</ins><span class="cx">             mapTable = arabicLoopedMapTable;
</span><span class="cx">             tableLength = WTF_ARRAY_LENGTH(arabicLoopedMapTable);
</span><span class="cx">             break;
</span><del>-        case MathMLStyle::DoubleStruck:
</del><ins>+        case MathMLElement::MathVariant::DoubleStruck:
</ins><span class="cx">             mapTable = arabicDoubleMapTable;
</span><span class="cx">             tableLength = WTF_ARRAY_LENGTH(arabicDoubleMapTable);
</span><span class="cx">             break;
</span><span class="lines">@@ -472,9 +473,9 @@
</span><span class="cx">         newChar = MathVariantMappingSearch(codePoint, mapTable, tableLength);
</span><span class="cx">     } else {
</span><span class="cx">         // Must be Latin
</span><del>-        if (mathvariant &gt; MathMLStyle::Monospace)
</del><ins>+        if (mathvariant &gt; MathMLElement::MathVariant::Monospace)
</ins><span class="cx">             return codePoint; // Latin doesn't support the Arabic mathvariants
</span><del>-        multiplier = mathvariant - 2;
</del><ins>+        multiplier = static_cast&lt;int&gt;(mathvariant) - 2;
</ins><span class="cx">         // This is possible because the values for NS_MATHML_MATHVARIANT_* are chosen to coincide with the order in which the encoded mathvariant characters are located within their unicode block (less an offset to avoid None and Normal variants)
</span><span class="cx">         // See the Number case for an explanation of the following calculation
</span><span class="cx">         tempChar = baseChar + mathBoldUpperA + multiplier * (mathItalicUpperA - mathBoldUpperA);
</span><span class="lines">@@ -523,9 +524,9 @@
</span><span class="cx">     AtomicString textContent = element().textContent().stripWhiteSpace().simplifyWhiteSpace();
</span><span class="cx">     if (textContent.length() == 1) {
</span><span class="cx">         UChar32 codePoint = textContent[0];
</span><del>-        MathMLStyle::MathVariant mathvariant = mathMLStyle()-&gt;mathVariant();
-        if (mathvariant == MathMLStyle::None)
-            mathvariant = tokenElement.hasTagName(MathMLNames::miTag) ? MathMLStyle::Italic : MathMLStyle::Normal;
</del><ins>+        MathMLElement::MathVariant mathvariant = mathMLStyle()-&gt;mathVariant();
+        if (mathvariant == MathMLElement::MathVariant::None)
+            mathvariant = tokenElement.hasTagName(MathMLNames::miTag) ? MathMLElement::MathVariant::Italic : MathMLElement::MathVariant::Normal;
</ins><span class="cx">         UChar32 transformedCodePoint = mathVariant(codePoint, mathvariant);
</span><span class="cx">         if (transformedCodePoint != codePoint)
</span><span class="cx">             m_mathVariantGlyph = style().fontCascade().glyphDataForCharacter(transformedCodePoint, !style().isLeftToRightDirection());
</span></span></pre>
</div>
</div>

</body>
</html>