summaryrefslogtreecommitdiff
path: root/Source/WebCore/mathml/MathMLElement.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-24 16:36:50 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-24 16:36:50 +0100
commitad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (patch)
treeb34b0daceb7c8e7fdde4b4ec43650ab7caadb0a9 /Source/WebCore/mathml/MathMLElement.cpp
parent03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (diff)
downloadqtwebkit-ad0d549d4cc13433f77c1ac8f0ab379c83d93f28.tar.gz
Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790)
Diffstat (limited to 'Source/WebCore/mathml/MathMLElement.cpp')
-rw-r--r--Source/WebCore/mathml/MathMLElement.cpp35
1 files changed, 22 insertions, 13 deletions
diff --git a/Source/WebCore/mathml/MathMLElement.cpp b/Source/WebCore/mathml/MathMLElement.cpp
index 830ad45d0..4c00defa3 100644
--- a/Source/WebCore/mathml/MathMLElement.cpp
+++ b/Source/WebCore/mathml/MathMLElement.cpp
@@ -48,33 +48,42 @@ PassRefPtr<MathMLElement> MathMLElement::create(const QualifiedName& tagName, Do
return adoptRef(new MathMLElement(tagName, document));
}
-void MathMLElement::parseAttribute(Attribute* attr)
+bool MathMLElement::isPresentationAttribute(Attribute* attr) const
+{
+ if (attr->name() == mathbackgroundAttr || attr->name() == mathsizeAttr || attr->name() == mathcolorAttr || attr->name() == fontsizeAttr || attr->name() == backgroundAttr || attr->name() == colorAttr || attr->name() == fontstyleAttr || attr->name() == fontweightAttr || attr->name() == fontfamilyAttr)
+ return true;
+ return StyledElement::isPresentationAttribute(attr);
+}
+
+void MathMLElement::collectStyleForAttribute(Attribute* attr, StylePropertySet* style)
{
if (attr->name() == mathbackgroundAttr)
- addCSSProperty(CSSPropertyBackgroundColor, attr->value());
+ addPropertyToAttributeStyle(style, CSSPropertyBackgroundColor, attr->value());
else if (attr->name() == mathsizeAttr) {
// The following three values of mathsize are handled in WebCore/css/mathml.css
if (attr->value() != "normal" && attr->value() != "small" && attr->value() != "big")
- addCSSProperty(CSSPropertyFontSize, attr->value());
+ addPropertyToAttributeStyle(style, CSSPropertyFontSize, attr->value());
} else if (attr->name() == mathcolorAttr)
- addCSSProperty(CSSPropertyColor, attr->value());
+ addPropertyToAttributeStyle(style, CSSPropertyColor, attr->value());
// FIXME: deprecated attributes that should loose in a conflict with a non deprecated attribute
else if (attr->name() == fontsizeAttr)
- addCSSProperty(CSSPropertyFontSize, attr->value());
+ addPropertyToAttributeStyle(style, CSSPropertyFontSize, attr->value());
else if (attr->name() == backgroundAttr)
- addCSSProperty(CSSPropertyBackgroundColor, attr->value());
+ addPropertyToAttributeStyle(style, CSSPropertyBackgroundColor, attr->value());
else if (attr->name() == colorAttr)
- addCSSProperty(CSSPropertyColor, attr->value());
+ addPropertyToAttributeStyle(style, CSSPropertyColor, attr->value());
else if (attr->name() == fontstyleAttr)
- addCSSProperty(CSSPropertyFontStyle, attr->value());
+ addPropertyToAttributeStyle(style, CSSPropertyFontStyle, attr->value());
else if (attr->name() == fontweightAttr)
- addCSSProperty(CSSPropertyFontWeight, attr->value());
+ addPropertyToAttributeStyle(style, CSSPropertyFontWeight, attr->value());
else if (attr->name() == fontfamilyAttr)
- addCSSProperty(CSSPropertyFontFamily, attr->value());
- else
- StyledElement::parseAttribute(attr);
+ addPropertyToAttributeStyle(style, CSSPropertyFontFamily, attr->value());
+ else {
+ ASSERT(!isPresentationAttribute(attr));
+ StyledElement::collectStyleForAttribute(attr, style);
+ }
}
-
+
}
#endif // ENABLE(MATHML)