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

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

Issue 180113007: [SVG] refactor determineAnimatedPropertyType logic. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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/SVGAnimateElement.cpp
diff --git a/Source/core/svg/SVGAnimateElement.cpp b/Source/core/svg/SVGAnimateElement.cpp
index 2f2c9daa77acd057619e01042dc18618b8c7d8f5..09c255f14e478b1f592fc3039b83b3eacd97f0e0 100644
--- a/Source/core/svg/SVGAnimateElement.cpp
+++ b/Source/core/svg/SVGAnimateElement.cpp
@@ -62,29 +62,6 @@ bool SVGAnimateElement::hasValidAttributeType()
return m_animatedPropertyType != AnimatedUnknown && !hasInvalidCSSAttributeType();
}
-AnimatedPropertyType SVGAnimateElement::determineAnimatedPropertyType(SVGElement* targetElement) const
-{
- ASSERT(targetElement);
-
- Vector<AnimatedPropertyType> propertyTypes;
- targetElement->animatedPropertyTypeForAttribute(attributeName(), propertyTypes);
- if (propertyTypes.isEmpty())
- return AnimatedUnknown;
-
- ASSERT(propertyTypes.size() <= 2);
- AnimatedPropertyType type = propertyTypes[0];
-
- // Animations of transform lists are not allowed for <animate> or <set>
- // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties
haraken 2014/03/05 14:26:49 Keep this spec link.
kouhei (in TOK) 2014/03/06 03:53:30 Done.
- if (type == AnimatedTransformList && !hasTagName(SVGNames::animateTransformTag))
- return AnimatedUnknown;
-
- if (propertyTypes.size() == 2)
- ASSERT(propertyTypes[0] == propertyTypes[1]);
-
- return type;
-}
-
void SVGAnimateElement::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement)
{
ASSERT(resultElement);
@@ -92,7 +69,7 @@ void SVGAnimateElement::calculateAnimatedValue(float percentage, unsigned repeat
if (!targetElement || !isSVGAnimateElement(*resultElement))
return;
- ASSERT(m_animatedPropertyType == determineAnimatedPropertyType(targetElement));
+ ASSERT(m_animatedPropertyType == determineAnimatedPropertyType());
ASSERT(percentage >= 0 && percentage <= 1);
ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag));
@@ -419,7 +396,7 @@ void SVGAnimateElement::resetAnimatedPropertyType()
m_toProperty.clear();
m_toAtEndOfDurationProperty.clear();
m_animator.clear();
- m_animatedPropertyType = targetElement() ? determineAnimatedPropertyType(targetElement()) : AnimatedString;
+ m_animatedPropertyType = determineAnimatedPropertyType();
}
SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator()

Powered by Google App Engine
This is Rietveld 408576698