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

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

Issue 2478233002: Make 'transform' a presentation attribute on SVG elements (Closed)
Patch Set: Rebase Created 4 years, 1 month 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: third_party/WebKit/Source/core/svg/SVGAnimatedTypeAnimator.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedTypeAnimator.cpp b/third_party/WebKit/Source/core/svg/SVGAnimatedTypeAnimator.cpp
index 55284321ab1fb37f2d4b219e0995ce0a132d41db..f31c0741286a831d04184cf7f9e5461f1e281629 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedTypeAnimator.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedTypeAnimator.cpp
@@ -52,19 +52,24 @@ void SVGAnimatedTypeAnimator::reset(const SVGElement& contextElement) {
if (m_animatedProperty) {
m_type = m_animatedProperty->type();
m_cssProperty = m_animatedProperty->cssPropertyId();
+
+ if (m_type == AnimatedTransformList) {
+ // Only <animateTransform> is allowed to animate AnimatedTransformList.
+ // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties
+ if (!isSVGAnimateTransformElement(*m_animationElement))
+ m_type = AnimatedUnknown;
+ // Because of the syntactic mismatch between the CSS and SVGProperty
+ // representations, disallow CSS animations of transform list for
+ // now. (We also reject this case via
+ // SVGAnimateTransformElement::hasValidAttributeType ATM.)
+ m_cssProperty = CSSPropertyInvalid;
+ }
} else {
m_type = SVGElement::animatedPropertyTypeForCSSAttribute(attributeName);
m_cssProperty = m_type != AnimatedUnknown
? cssPropertyID(attributeName.localName())
: CSSPropertyInvalid;
- }
-
- // Only <animateTransform> is allowed to animate AnimatedTransformList.
- // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties
- if (m_type == AnimatedTransformList &&
- !isSVGAnimateTransformElement(*m_animationElement)) {
- m_type = AnimatedUnknown;
- m_cssProperty = CSSPropertyInvalid;
+ DCHECK_NE(m_type, AnimatedTransformList);
}
DCHECK(m_type != AnimatedPoint && m_type != AnimatedStringList &&
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.h ('k') | third_party/WebKit/Source/core/svg/SVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698