summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGAnimationElement.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-15 16:08:57 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-15 16:08:57 +0200
commit5466563f4b5b6b86523e3f89bb7f77e5b5270c78 (patch)
tree8caccf7cd03a15207cde3ba282c88bf132482a91 /Source/WebCore/svg/SVGAnimationElement.cpp
parent33b26980cb24288b5a9f2590ccf32a949281bb79 (diff)
downloadqtwebkit-5466563f4b5b6b86523e3f89bb7f77e5b5270c78.tar.gz
Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)
WebKit update which introduces the QtWebKitWidgets module that contains the WK1 widgets based API. (In fact it renames QtWebKit to QtWebKitWidgets while we're working on completing the entire split as part of https://bugs.webkit.org/show_bug.cgi?id=99314
Diffstat (limited to 'Source/WebCore/svg/SVGAnimationElement.cpp')
-rw-r--r--Source/WebCore/svg/SVGAnimationElement.cpp44
1 files changed, 36 insertions, 8 deletions
diff --git a/Source/WebCore/svg/SVGAnimationElement.cpp b/Source/WebCore/svg/SVGAnimationElement.cpp
index 6ace61bee..bbaadbb07 100644
--- a/Source/WebCore/svg/SVGAnimationElement.cpp
+++ b/Source/WebCore/svg/SVGAnimationElement.cpp
@@ -55,6 +55,8 @@ SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document*
, m_fromPropertyValueType(RegularPropertyValue)
, m_toPropertyValueType(RegularPropertyValue)
, m_animationValid(false)
+ , m_attributeType(AttributeTypeAuto)
+ , m_hasInvalidCSSAttributeType(false)
{
registerAnimatedPropertiesForSVGAnimationElement();
}
@@ -145,6 +147,7 @@ bool SVGAnimationElement::isSupportedAttribute(const QualifiedName& attrName)
supportedAttributes.add(SVGNames::keyTimesAttr);
supportedAttributes.add(SVGNames::keyPointsAttr);
supportedAttributes.add(SVGNames::keySplinesAttr);
+ supportedAttributes.add(SVGNames::attributeTypeAttr);
}
return supportedAttributes.contains<QualifiedName, SVGAttributeHashTranslator>(attrName);
}
@@ -185,6 +188,11 @@ void SVGAnimationElement::parseAttribute(const Attribute& attribute)
return;
}
+ if (attribute.name() == SVGNames::attributeTypeAttr) {
+ setAttributeType(attribute.value());
+ return;
+ }
+
if (SVGTests::parseAttribute(attribute))
return;
if (SVGExternalResourcesRequired::parseAttribute(attribute))
@@ -281,16 +289,17 @@ CalcMode SVGAnimationElement::calcMode() const
return hasTagName(SVGNames::animateMotionTag) ? CalcModePaced : CalcModeLinear;
}
-SVGAnimationElement::AttributeType SVGAnimationElement::attributeType() const
-{
+void SVGAnimationElement::setAttributeType(const AtomicString& attributeType)
+{
DEFINE_STATIC_LOCAL(const AtomicString, css, ("CSS"));
DEFINE_STATIC_LOCAL(const AtomicString, xml, ("XML"));
- const AtomicString& value = fastGetAttribute(SVGNames::attributeTypeAttr);
- if (value == css)
- return AttributeTypeCSS;
- if (value == xml)
- return AttributeTypeXML;
- return AttributeTypeAuto;
+ if (attributeType == css)
+ m_attributeType = AttributeTypeCSS;
+ else if (attributeType == xml)
+ m_attributeType = AttributeTypeXML;
+ else
+ m_attributeType = AttributeTypeAuto;
+ checkInvalidCSSAttributeType(targetElement(DoNotResolveNewTarget));
}
String SVGAnimationElement::toValue() const
@@ -648,6 +657,25 @@ void SVGAnimationElement::determinePropertyValueTypes(const String& from, const
m_toPropertyValueType = InheritValue;
}
+void SVGAnimationElement::targetElementWillChange(SVGElement* currentTarget, SVGElement* newTarget)
+{
+ SVGSMILElement::targetElementWillChange(currentTarget, newTarget);
+
+ checkInvalidCSSAttributeType(newTarget);
+}
+
+void SVGAnimationElement::setAttributeName(const QualifiedName& attributeName)
+{
+ SVGSMILElement::setAttributeName(attributeName);
+
+ checkInvalidCSSAttributeType(targetElement(DoNotResolveNewTarget));
+}
+
+void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target)
+{
+ m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attributeType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeName());
+}
+
}
#endif // ENABLE(SVG)