Title: [204021] trunk/Source/WebCore
Revision
204021
Author
[email protected]
Date
2016-08-02 02:43:01 -0700 (Tue, 02 Aug 2016)

Log Message

Use Optional members to store parsed MathML attributes.
https://bugs.webkit.org/show_bug.cgi?id=160400

Patch by Frederic Wang <fwang.igalia.com> on 2016-08-02
Reviewed by Darin Adler.

Parsed MathML attributes are stored on the element classes using the memoize pattern to
minimize the number of parsing updates. Currently, a dirty flag for each member
indicate when it must be parsed again. We change this to wrap these members into an
Optional<T> container instead, where a null value indicates that the member is dirty.

No new tests, behavior is unchanged.

* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::cachedMathMLLength):
(WebCore::MathMLElement::cachedBooleanAttribute):
(WebCore::MathMLElement::parseMathVariantAttribute):
(WebCore::MathMLElement::specifiedDisplayStyle):
(WebCore::MathMLElement::specifiedMathVariant):
* mathml/MathMLElement.h:
* mathml/MathMLFractionElement.cpp:
(WebCore::MathMLFractionElement::lineThickness):
(WebCore::MathMLFractionElement::cachedFractionAlignment):
(WebCore::MathMLFractionElement::parseAttribute):
* mathml/MathMLFractionElement.h:
* mathml/MathMLInlineContainerElement.cpp:
(WebCore::MathMLInlineContainerElement::parseAttribute):
* mathml/MathMLMathElement.cpp:
(WebCore::MathMLMathElement::specifiedDisplayStyle):
(WebCore::MathMLMathElement::parseAttribute):
* mathml/MathMLOperatorElement.cpp:
(WebCore::MathMLOperatorElement::operatorText):
* mathml/MathMLPaddedElement.cpp:
(WebCore::MathMLPaddedElement::parseAttribute):
* mathml/MathMLPaddedElement.h:
* mathml/MathMLScriptsElement.cpp:
(WebCore::MathMLScriptsElement::parseAttribute):
* mathml/MathMLScriptsElement.h:
* mathml/MathMLSpaceElement.cpp:
(WebCore::MathMLSpaceElement::parseAttribute):
* mathml/MathMLSpaceElement.h:
* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::parseAttribute):
* mathml/MathMLUnderOverElement.cpp:
(WebCore::MathMLUnderOverElement::parseAttribute):
* mathml/MathMLUnderOverElement.h:
* rendering/mathml/MathMLStyle.cpp:
(WebCore::MathMLStyle::resolveMathMLStyle):
* rendering/mathml/MathMLStyle.h:
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::mathVariant):
(WebCore::RenderMathMLToken::updateMathVariantGlyph):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (204020 => 204021)


--- trunk/Source/WebCore/ChangeLog	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/ChangeLog	2016-08-02 09:43:01 UTC (rev 204021)
@@ -1,3 +1,57 @@
+2016-08-02  Frederic Wang  <fwang.igalia.com>
+
+        Use Optional members to store parsed MathML attributes.
+        https://bugs.webkit.org/show_bug.cgi?id=160400
+
+        Reviewed by Darin Adler.
+
+        Parsed MathML attributes are stored on the element classes using the memoize pattern to
+        minimize the number of parsing updates. Currently, a dirty flag for each member
+        indicate when it must be parsed again. We change this to wrap these members into an
+        Optional<T> container instead, where a null value indicates that the member is dirty.
+
+        No new tests, behavior is unchanged.
+
+        * mathml/MathMLElement.cpp:
+        (WebCore::MathMLElement::cachedMathMLLength):
+        (WebCore::MathMLElement::cachedBooleanAttribute):
+        (WebCore::MathMLElement::parseMathVariantAttribute):
+        (WebCore::MathMLElement::specifiedDisplayStyle):
+        (WebCore::MathMLElement::specifiedMathVariant):
+        * mathml/MathMLElement.h:
+        * mathml/MathMLFractionElement.cpp:
+        (WebCore::MathMLFractionElement::lineThickness):
+        (WebCore::MathMLFractionElement::cachedFractionAlignment):
+        (WebCore::MathMLFractionElement::parseAttribute):
+        * mathml/MathMLFractionElement.h:
+        * mathml/MathMLInlineContainerElement.cpp:
+        (WebCore::MathMLInlineContainerElement::parseAttribute):
+        * mathml/MathMLMathElement.cpp:
+        (WebCore::MathMLMathElement::specifiedDisplayStyle):
+        (WebCore::MathMLMathElement::parseAttribute):
+        * mathml/MathMLOperatorElement.cpp:
+        (WebCore::MathMLOperatorElement::operatorText):
+        * mathml/MathMLPaddedElement.cpp:
+        (WebCore::MathMLPaddedElement::parseAttribute):
+        * mathml/MathMLPaddedElement.h:
+        * mathml/MathMLScriptsElement.cpp:
+        (WebCore::MathMLScriptsElement::parseAttribute):
+        * mathml/MathMLScriptsElement.h:
+        * mathml/MathMLSpaceElement.cpp:
+        (WebCore::MathMLSpaceElement::parseAttribute):
+        * mathml/MathMLSpaceElement.h:
+        * mathml/MathMLTextElement.cpp:
+        (WebCore::MathMLTextElement::parseAttribute):
+        * mathml/MathMLUnderOverElement.cpp:
+        (WebCore::MathMLUnderOverElement::parseAttribute):
+        * mathml/MathMLUnderOverElement.h:
+        * rendering/mathml/MathMLStyle.cpp:
+        (WebCore::MathMLStyle::resolveMathMLStyle):
+        * rendering/mathml/MathMLStyle.h:
+        * rendering/mathml/RenderMathMLToken.cpp:
+        (WebCore::mathVariant):
+        (WebCore::RenderMathMLToken::updateMathVariantGlyph):
+
 2016-08-02  Youenn Fablet  <[email protected]>
 
         [Fetch API] Fetch promises should not reject or resolve when ActiveDOMObjects are being stopped

Modified: trunk/Source/WebCore/mathml/MathMLElement.cpp (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLElement.cpp	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLElement.cpp	2016-08-02 09:43:01 UTC (rev 204021)
@@ -517,31 +517,29 @@
     return parseNamedSpace(stringView);
 }
 
-const MathMLElement::Length& MathMLElement::cachedMathMLLength(const QualifiedName& name, Length& length)
+const MathMLElement::Length& MathMLElement::cachedMathMLLength(const QualifiedName& name, Optional<Length>& length)
 {
-    if (length.dirty) {
-        length = parseMathMLLength(attributeWithoutSynchronization(name));
-        length.dirty = false;
-    }
-    return length;
+    if (length)
+        return length.value();
+    length = parseMathMLLength(attributeWithoutSynchronization(name));
+    return length.value();
 }
 
-const MathMLElement::BooleanValue& MathMLElement::cachedBooleanAttribute(const QualifiedName& name, BooleanAttribute& attribute)
+const MathMLElement::BooleanValue& MathMLElement::cachedBooleanAttribute(const QualifiedName& name, Optional<BooleanValue>& attribute)
 {
-    if (!attribute.dirty)
-        return attribute.value;
+    if (attribute)
+        return attribute.value();
 
     // In MathML, attribute values are case-sensitive.
     const AtomicString& value = attributeWithoutSynchronization(name);
     if (value == "true")
-        attribute.value = BooleanValue::True;
+        attribute = BooleanValue::True;
     else if (value == "false")
-        attribute.value = BooleanValue::False;
+        attribute = BooleanValue::False;
     else
-        attribute.value = BooleanValue::Default;
-    attribute.dirty = false;
+        attribute = BooleanValue::Default;
 
-    return attribute.value;
+    return attribute.value();
 }
 
 MathMLElement::MathVariant MathMLElement::parseMathVariantAttribute(const AtomicString& attributeValue)
@@ -589,20 +587,18 @@
 Optional<bool> MathMLElement::specifiedDisplayStyle()
 {
     if (!acceptsDisplayStyleAttribute())
-        return Optional<bool>();
+        return Nullopt;
     const MathMLElement::BooleanValue& specifiedDisplayStyle = cachedBooleanAttribute(displaystyleAttr, m_displayStyle);
-    return specifiedDisplayStyle == BooleanValue::Default ? Optional<bool>() : Optional<bool>(specifiedDisplayStyle == BooleanValue::True);
+    return toOptionalBool(specifiedDisplayStyle);
 }
 
 Optional<MathMLElement::MathVariant> MathMLElement::specifiedMathVariant()
 {
     if (!acceptsMathVariantAttribute())
-        return Optional<MathVariant>();
-    if (m_mathVariant.dirty) {
-        m_mathVariant.value = parseMathVariantAttribute(attributeWithoutSynchronization(mathvariantAttr));
-        m_mathVariant.dirty = false;
-    }
-    return m_mathVariant.value == MathVariant::None ? Optional<MathVariant>() : Optional<MathVariant>(m_mathVariant.value);
+        return Nullopt;
+    if (!m_mathVariant)
+        m_mathVariant = parseMathVariantAttribute(attributeWithoutSynchronization(mathvariantAttr));
+    return m_mathVariant.value() == MathVariant::None ? Nullopt : m_mathVariant;
 }
 
 }

Modified: trunk/Source/WebCore/mathml/MathMLElement.h (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLElement.h	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLElement.h	2016-08-02 09:43:01 UTC (rev 204021)
@@ -63,15 +63,10 @@
     struct Length {
         LengthType type { LengthType::ParsingFailed };
         float value { 0 };
-        bool dirty { true };
     };
     static Length parseMathMLLength(const String&);
 
     enum class BooleanValue { True, False, Default };
-    struct BooleanAttribute {
-        BooleanValue value { BooleanValue::Default };
-        bool dirty { true };
-    };
 
     // These are the mathvariant values from the MathML recommendation.
     // The special value none means that no explicit mathvariant value has been specified.
@@ -97,13 +92,9 @@
         Looped = 17,
         Stretched = 18
     };
-    struct MathVariantAttribute {
-        MathVariant value { MathVariant::None };
-        bool dirty { true };
-    };
 
     virtual Optional<bool> specifiedDisplayStyle();
-    Optional<MathMLElement::MathVariant> specifiedMathVariant();
+    Optional<MathVariant> specifiedMathVariant();
 
 protected:
     MathMLElement(const QualifiedName& tagName, Document&);
@@ -121,14 +112,15 @@
     bool willRespondToMouseClickEvents() override;
     void defaultEventHandler(Event*) override;
 
-    const Length& cachedMathMLLength(const QualifiedName&, Length&);
-    const BooleanValue& cachedBooleanAttribute(const QualifiedName&, BooleanAttribute&);
+    const Length& cachedMathMLLength(const QualifiedName&, Optional<Length>&);
+    const BooleanValue& cachedBooleanAttribute(const QualifiedName&, Optional<BooleanValue>&);
 
     virtual bool acceptsDisplayStyleAttribute() { return false; }
     virtual bool acceptsMathVariantAttribute() { return false; }
 
-    BooleanAttribute m_displayStyle;
-    MathVariantAttribute m_mathVariant;
+    static Optional<bool> toOptionalBool(const BooleanValue& value) { return value == BooleanValue::Default ? Nullopt : Optional<bool>(value == BooleanValue::True); }
+    Optional<BooleanValue> m_displayStyle;
+    Optional<MathVariant> m_mathVariant;
 
 private:
     virtual void updateSelectedChild() { }

Modified: trunk/Source/WebCore/mathml/MathMLFractionElement.cpp (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLFractionElement.cpp	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLFractionElement.cpp	2016-08-02 09:43:01 UTC (rev 204021)
@@ -47,42 +47,41 @@
 
 const MathMLElement::Length& MathMLFractionElement::lineThickness()
 {
-    if (!m_lineThickness.dirty)
-        return m_lineThickness;
+    if (m_lineThickness)
+        return m_lineThickness.value();
 
     // The MathML3 recommendation states that "medium" is the default thickness.
     // However, it only states that "thin" and "thick" are respectively thiner and thicker.
     // The MathML in HTML5 implementation note suggests 50% and 200% and these values are also used in Gecko.
-    String thickness = attributeWithoutSynchronization(linethicknessAttr);
+    auto& thickness = attributeWithoutSynchronization(linethicknessAttr);
+    m_lineThickness = Length();
     if (equalLettersIgnoringASCIICase(thickness, "thin")) {
-        m_lineThickness.type = LengthType::UnitLess;
-        m_lineThickness.value = .5;
+        m_lineThickness.value().type = LengthType::UnitLess;
+        m_lineThickness.value().value = .5;
     } else if (equalLettersIgnoringASCIICase(thickness, "medium")) {
-        m_lineThickness.type = LengthType::UnitLess;
-        m_lineThickness.value = 1;
+        m_lineThickness.value().type = LengthType::UnitLess;
+        m_lineThickness.value().value = 1;
     } else if (equalLettersIgnoringASCIICase(thickness, "thick")) {
-        m_lineThickness.type = LengthType::UnitLess;
-        m_lineThickness.value = 2;
+        m_lineThickness.value().type = LengthType::UnitLess;
+        m_lineThickness.value().value = 2;
     } else
         m_lineThickness = parseMathMLLength(thickness);
-    m_lineThickness.dirty = false;
-    return m_lineThickness;
+    return m_lineThickness.value();
 }
 
-MathMLFractionElement::FractionAlignment MathMLFractionElement::cachedFractionAlignment(const QualifiedName& name, FractionAlignmentAttribute& alignment)
+MathMLFractionElement::FractionAlignment MathMLFractionElement::cachedFractionAlignment(const QualifiedName& name, Optional<FractionAlignment>& alignment)
 {
-    if (!alignment.dirty)
-        return alignment.value;
+    if (alignment)
+        return alignment.value();
 
-    String value = attributeWithoutSynchronization(name);
+    auto& value = attributeWithoutSynchronization(name);
     if (equalLettersIgnoringASCIICase(value, "left"))
-        alignment.value = FractionAlignmentLeft;
+        alignment = FractionAlignmentLeft;
     else if (equalLettersIgnoringASCIICase(value, "right"))
-        alignment.value = FractionAlignmentRight;
+        alignment = FractionAlignmentRight;
     else
-        alignment.value = FractionAlignmentCenter;
-    alignment.dirty = false;
-    return alignment.value;
+        alignment = FractionAlignmentCenter;
+    return alignment.value();
 }
 
 MathMLFractionElement::FractionAlignment MathMLFractionElement::numeratorAlignment()
@@ -98,11 +97,11 @@
 void MathMLFractionElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == linethicknessAttr)
-        m_lineThickness.dirty = true;
+        m_lineThickness = Nullopt;
     else if (name == numalignAttr)
-        m_numeratorAlignment.dirty = true;
+        m_numeratorAlignment = Nullopt;
     else if (name == denomalignAttr)
-        m_denominatorAlignment.dirty = true;
+        m_denominatorAlignment = Nullopt;
 
     MathMLElement::parseAttribute(name, value);
 }

Modified: trunk/Source/WebCore/mathml/MathMLFractionElement.h (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLFractionElement.h	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLFractionElement.h	2016-08-02 09:43:01 UTC (rev 204021)
@@ -47,15 +47,11 @@
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
     void parseAttribute(const QualifiedName&, const AtomicString&) final;
 
-    struct FractionAlignmentAttribute {
-        FractionAlignment value { FractionAlignmentCenter };
-        bool dirty { true };
-    };
-    FractionAlignment cachedFractionAlignment(const QualifiedName&, FractionAlignmentAttribute&);
+    FractionAlignment cachedFractionAlignment(const QualifiedName&, Optional<FractionAlignment>&);
 
-    Length m_lineThickness;
-    FractionAlignmentAttribute m_numeratorAlignment;
-    FractionAlignmentAttribute m_denominatorAlignment;
+    Optional<Length> m_lineThickness;
+    Optional<FractionAlignment> m_numeratorAlignment;
+    Optional<FractionAlignment> m_denominatorAlignment;
 };
 
 }

Modified: trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp	2016-08-02 09:43:01 UTC (rev 204021)
@@ -90,9 +90,9 @@
     bool displayStyleAttribute = name == displaystyleAttr && acceptsDisplayStyleAttribute();
     bool mathVariantAttribute = name == mathvariantAttr && acceptsMathVariantAttribute();
     if (displayStyleAttribute)
-        m_displayStyle.dirty = true;
+        m_displayStyle = Nullopt;
     if (mathVariantAttribute)
-        m_mathVariant.dirty = true;
+        m_mathVariant = Nullopt;
     if ((displayStyleAttribute || mathVariantAttribute) && renderer())
         MathMLStyle::resolveMathMLStyleTree(renderer());
 

Modified: trunk/Source/WebCore/mathml/MathMLMathElement.cpp (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLMathElement.cpp	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLMathElement.cpp	2016-08-02 09:43:01 UTC (rev 204021)
@@ -58,13 +58,13 @@
 {
     if (cachedBooleanAttribute(displaystyleAttr, m_displayStyle) == BooleanValue::Default) {
         // The default displaystyle value of the <math> depends on the display attribute, so we parse it here.
-        const AtomicString& value = attributeWithoutSynchronization(displayAttr);
+        auto& value = attributeWithoutSynchronization(displayAttr);
         if (value == "block")
-            m_displayStyle.value = BooleanValue::True;
+            m_displayStyle = BooleanValue::True;
         else if (value == "inline")
-            m_displayStyle.value = BooleanValue::False;
+            m_displayStyle = BooleanValue::False;
     }
-    return m_displayStyle.value == BooleanValue::Default ? Optional<bool>() : Optional<bool>(m_displayStyle.value == BooleanValue::True);
+    return toOptionalBool(m_displayStyle.value());
 }
 
 void MathMLMathElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -72,9 +72,9 @@
     bool displayStyleAttribute = (name == displaystyleAttr || name == displayAttr);
     bool mathVariantAttribute = name == mathvariantAttr;
     if (displayStyleAttribute)
-        m_displayStyle.dirty = true;
+        m_displayStyle = Nullopt;
     if (mathVariantAttribute)
-        m_mathVariant.dirty = true;
+        m_mathVariant = Nullopt;
     if ((displayStyleAttribute || mathVariantAttribute) && renderer())
         MathMLStyle::resolveMathMLStyleTree(renderer());
 

Modified: trunk/Source/WebCore/mathml/MathMLOperatorElement.cpp (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLOperatorElement.cpp	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLOperatorElement.cpp	2016-08-02 09:43:01 UTC (rev 204021)
@@ -63,13 +63,13 @@
     if (m_operatorText)
         return m_operatorText.value();
 
-    m_operatorText = Optional<UChar>(parseOperatorText(textContent()));
+    m_operatorText = parseOperatorText(textContent());
     return m_operatorText.value();
 }
 
 void MathMLOperatorElement::childrenChanged(const ChildChange& change)
 {
-    m_operatorText = Optional<UChar>();
+    m_operatorText = Nullopt;
     MathMLTextElement::childrenChanged(change);
 }
 

Modified: trunk/Source/WebCore/mathml/MathMLPaddedElement.cpp (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLPaddedElement.cpp	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLPaddedElement.cpp	2016-08-02 09:43:01 UTC (rev 204021)
@@ -73,15 +73,15 @@
 void MathMLPaddedElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == widthAttr)
-        m_width.dirty = true;
+        m_width = Nullopt;
     else if (name == heightAttr)
-        m_height.dirty = true;
+        m_height = Nullopt;
     else if (name == depthAttr)
-        m_depth.dirty = true;
+        m_depth = Nullopt;
     else if (name == lspaceAttr)
-        m_lspace.dirty = true;
+        m_lspace = Nullopt;
     else if (name == voffsetAttr)
-        m_voffset.dirty = true;
+        m_voffset = Nullopt;
 
     MathMLElement::parseAttribute(name, value);
 }

Modified: trunk/Source/WebCore/mathml/MathMLPaddedElement.h (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLPaddedElement.h	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLPaddedElement.h	2016-08-02 09:43:01 UTC (rev 204021)
@@ -44,11 +44,11 @@
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
     void parseAttribute(const QualifiedName&, const AtomicString&) final;
 
-    Length m_width;
-    Length m_height;
-    Length m_depth;
-    Length m_lspace;
-    Length m_voffset;
+    Optional<Length> m_width;
+    Optional<Length> m_height;
+    Optional<Length> m_depth;
+    Optional<Length> m_lspace;
+    Optional<Length> m_voffset;
 };
 
 }

Modified: trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp	2016-08-02 09:43:01 UTC (rev 204021)
@@ -58,9 +58,9 @@
 void MathMLScriptsElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == subscriptshiftAttr)
-        m_subscriptShift.dirty = true;
+        m_subscriptShift = Nullopt;
     else if (name == superscriptshiftAttr)
-        m_superscriptShift.dirty = true;
+        m_superscriptShift = Nullopt;
 
     MathMLElement::parseAttribute(name, value);
 }

Modified: trunk/Source/WebCore/mathml/MathMLScriptsElement.h (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLScriptsElement.h	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLScriptsElement.h	2016-08-02 09:43:01 UTC (rev 204021)
@@ -43,8 +43,8 @@
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
     void parseAttribute(const QualifiedName&, const AtomicString&) override;
 
-    Length m_subscriptShift;
-    Length m_superscriptShift;
+    Optional<Length> m_subscriptShift;
+    Optional<Length> m_superscriptShift;
 };
 
 }

Modified: trunk/Source/WebCore/mathml/MathMLSpaceElement.cpp (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLSpaceElement.cpp	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLSpaceElement.cpp	2016-08-02 09:43:01 UTC (rev 204021)
@@ -63,11 +63,11 @@
 void MathMLSpaceElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == widthAttr)
-        m_width.dirty = true;
+        m_width = Nullopt;
     else if (name == heightAttr)
-        m_height.dirty = true;
+        m_height = Nullopt;
     else if (name == depthAttr)
-        m_depth.dirty = true;
+        m_depth = Nullopt;
 
     MathMLElement::parseAttribute(name, value);
 }

Modified: trunk/Source/WebCore/mathml/MathMLSpaceElement.h (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLSpaceElement.h	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLSpaceElement.h	2016-08-02 09:43:01 UTC (rev 204021)
@@ -42,9 +42,9 @@
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
     void parseAttribute(const QualifiedName&, const AtomicString&) final;
 
-    Length m_width;
-    Length m_height;
-    Length m_depth;
+    Optional<Length> m_width;
+    Optional<Length> m_height;
+    Optional<Length> m_depth;
 };
 
 }

Modified: trunk/Source/WebCore/mathml/MathMLTextElement.cpp (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLTextElement.cpp	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLTextElement.cpp	2016-08-02 09:43:01 UTC (rev 204021)
@@ -65,7 +65,7 @@
 void MathMLTextElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == mathvariantAttr) {
-        m_mathVariant.dirty = true;
+        m_mathVariant = Nullopt;
         if (renderer())
             MathMLStyle::resolveMathMLStyleTree(renderer());
     }

Modified: trunk/Source/WebCore/mathml/MathMLUnderOverElement.cpp (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLUnderOverElement.cpp	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLUnderOverElement.cpp	2016-08-02 09:43:01 UTC (rev 204021)
@@ -58,9 +58,9 @@
 void MathMLUnderOverElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == accentAttr)
-        m_accent.dirty = true;
+        m_accent = Nullopt;
     else if (name == accentunderAttr)
-        m_accentUnder.dirty = true;
+        m_accentUnder = Nullopt;
 
     MathMLElement::parseAttribute(name, value);
 }

Modified: trunk/Source/WebCore/mathml/MathMLUnderOverElement.h (204020 => 204021)


--- trunk/Source/WebCore/mathml/MathMLUnderOverElement.h	2016-08-02 08:07:28 UTC (rev 204020)
+++ trunk/Source/WebCore/mathml/MathMLUnderOverElement.h	2016-08-02 09:43:01 UTC (rev 204021)
@@ -41,8 +41,8 @@
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
     void parseAttribute(const QualifiedName&, const AtomicString&) final;
 
-    BooleanAttribute m_accent;
-    BooleanAttribute m_accentUnder;
+    Optional<BooleanValue> m_accent;
+    Optional<BooleanValue> m_accentUnder;
 };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to