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

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

Issue 303093002: SVG: remove |SVGAnimateElement::m_animatedPropertyType| (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: s/<animatedTransform>/<animateTransform> Created 6 years, 7 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
« no previous file with comments | « Source/core/svg/SVGAnimatedTypeAnimator.h ('k') | Source/core/svg/SVGAnimationElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGAnimatedTypeAnimator.cpp
diff --git a/Source/core/svg/SVGAnimatedTypeAnimator.cpp b/Source/core/svg/SVGAnimatedTypeAnimator.cpp
index e1ab094d7f8374abfbe30ff12f836fe521be09ad..c981f53617e2a86243b523936834db13cf1a912c 100644
--- a/Source/core/svg/SVGAnimatedTypeAnimator.cpp
+++ b/Source/core/svg/SVGAnimatedTypeAnimator.cpp
@@ -35,22 +35,26 @@
namespace WebCore {
-SVGAnimatedTypeAnimator::SVGAnimatedTypeAnimator(AnimatedPropertyType type, SVGAnimationElement* animationElement, SVGElement* contextElement)
- : m_type(type)
- , m_animationElement(animationElement)
+SVGAnimatedTypeAnimator::SVGAnimatedTypeAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement)
+ : m_animationElement(animationElement)
, m_contextElement(contextElement)
{
ASSERT(m_animationElement);
ASSERT(m_contextElement);
- ASSERT(m_type != AnimatedPoint
- && m_type != AnimatedStringList
- && m_type != AnimatedTransform
- && m_type != AnimatedUnknown);
const QualifiedName& attributeName = m_animationElement->attributeName();
m_animatedProperty = m_contextElement->propertyFromAttribute(attributeName);
- if (m_animatedProperty)
- ASSERT(m_animatedProperty->type() == m_type);
+ m_type = m_animatedProperty ? m_animatedProperty->type()
+ : SVGElement::animatedPropertyTypeForCSSAttribute(attributeName);
+
+ // Only <animateTransform> is allowed to animate AnimatedTransformList.
+ // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties
+ if (m_type == AnimatedTransformList && !isSVGAnimateTransformElement(*animationElement))
+ m_type = AnimatedUnknown;
+
+ ASSERT(m_type != AnimatedPoint
+ && m_type != AnimatedStringList
+ && m_type != AnimatedTransform);
}
SVGAnimatedTypeAnimator::~SVGAnimatedTypeAnimator()
@@ -105,27 +109,24 @@ PassRefPtr<SVGPropertyBase> SVGAnimatedTypeAnimator::createPropertyForAnimation(
return property.release();
}
- // These types don't appear in the table in SVGElement::cssPropertyToTypeMap() and thus don't need support.
+ // These types don't appear in the table in SVGElement::animatedPropertyTypeForCSSAttribute() and thus don't need support.
+ case AnimatedAngle:
case AnimatedBoolean:
+ case AnimatedEnumeration:
+ case AnimatedInteger:
+ case AnimatedIntegerOptionalInteger:
case AnimatedNumberList:
case AnimatedNumberOptionalNumber:
+ case AnimatedPath:
case AnimatedPoint:
case AnimatedPoints:
+ case AnimatedPreserveAspectRatio:
case AnimatedRect:
+ case AnimatedStringList:
case AnimatedTransform:
case AnimatedTransformList:
ASSERT_NOT_REACHED();
- // These properties are not yet migrated to NewProperty implementation. see http://crbug.com/308818
- case AnimatedAngle:
- case AnimatedEnumeration:
- case AnimatedInteger:
- case AnimatedIntegerOptionalInteger:
- case AnimatedPath:
- case AnimatedPreserveAspectRatio:
- case AnimatedStringList:
- ASSERT_NOT_REACHED();
-
case AnimatedUnknown:
ASSERT_NOT_REACHED();
};
« no previous file with comments | « Source/core/svg/SVGAnimatedTypeAnimator.h ('k') | Source/core/svg/SVGAnimationElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698