Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Unified Diff: Source/core/svg/SVGAnimationElement.cpp

Issue 1074813002: Remove isSupportedAttribute in svg (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: invalidation guard tweaks Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/svg/SVGAnimationElement.cpp
diff --git a/Source/core/svg/SVGAnimationElement.cpp b/Source/core/svg/SVGAnimationElement.cpp
index e0ad7e853f3a8f22e88d779fbc62a94da74a9b8c..e64f59ba332659c80e350769efb78941fd1caabd 100644
--- a/Source/core/svg/SVGAnimationElement.cpp
+++ b/Source/core/svg/SVGAnimationElement.cpp
@@ -158,30 +158,8 @@ static bool parseKeySplines(const String& string, Vector<UnitBezier>& result)
return true;
}
-bool SVGAnimationElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- supportedAttributes.add(SVGNames::valuesAttr);
- supportedAttributes.add(SVGNames::keyTimesAttr);
- supportedAttributes.add(SVGNames::keyPointsAttr);
- supportedAttributes.add(SVGNames::keySplinesAttr);
- supportedAttributes.add(SVGNames::attributeTypeAttr);
- supportedAttributes.add(SVGNames::calcModeAttr);
- supportedAttributes.add(SVGNames::fromAttr);
- supportedAttributes.add(SVGNames::toAttr);
- supportedAttributes.add(SVGNames::byAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
void SVGAnimationElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (!isSupportedAttribute(name)) {
- SVGSMILElement::parseAttribute(name, value);
- return;
- }
-
if (name == SVGNames::valuesAttr) {
if (!parseValues(value, m_values)) {
reportAttributeParsingError(ParsingAttributeFailedError, name, value);
@@ -228,17 +206,25 @@ void SVGAnimationElement::parseAttribute(const QualifiedName& name, const Atomic
return;
}
- ASSERT_NOT_REACHED();
+ SVGSMILElement::parseAttribute(name, value);
}
void SVGAnimationElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGSMILElement::svgAttributeChanged(attrName);
+ if (attrName == SVGNames::valuesAttr
+ || attrName == SVGNames::byAttr
+ || attrName == SVGNames::fromAttr
+ || attrName == SVGNames::toAttr
+ || attrName == SVGNames::calcModeAttr
+ || attrName == SVGNames::attributeTypeAttr
+ || attrName == SVGNames::keySplinesAttr
+ || attrName == SVGNames::keyPointsAttr
+ || attrName == SVGNames::keyTimesAttr) {
+ animationAttributeChanged();
return;
}
- animationAttributeChanged();
+ SVGSMILElement::svgAttributeChanged(attrName);
}
void SVGAnimationElement::animationAttributeChanged()

Powered by Google App Engine
This is Rietveld 408576698