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

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

Issue 2394583002: Move shouldApplyAnimation to SVGAnimateElement (Closed)
Patch Set: Created 4 years, 2 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: third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp b/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
index bd11907d13624b8e09e526f59d96e7cefeaf9ddd..98750224b2ae136853738015b69ef3edd86a8157 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
@@ -112,6 +112,30 @@ bool SVGAnimateElement::hasValidAttributeType() {
!hasInvalidCSSAttributeType();
}
+SVGAnimateElement::ShouldApplyAnimationType
+SVGAnimateElement::shouldApplyAnimation(SVGElement* targetElement,
+ const QualifiedName& attributeName) {
+ if (!hasValidAttributeType() || attributeName == anyQName() ||
+ !targetElement || !targetElement->inActiveDocument() ||
+ !targetElement->parentNode())
+ return DontApplyAnimation;
+
+ // Always animate CSS properties using the ApplyCSSAnimation code path,
+ // regardless of the attributeType value.
+ if (isTargetAttributeCSSProperty(targetElement, attributeName)) {
+ if (targetElement->isPresentationAttributeWithSVGDOM(attributeName))
+ return ApplyXMLandCSSAnimation;
+
+ return ApplyCSSAnimation;
+ }
+ // If attributeType="CSS" and attributeName doesn't point to a CSS property,
+ // ignore the animation.
+ if (getAttributeType() == AttributeTypeCSS)
+ return DontApplyAnimation;
+
+ return ApplyXMLAnimation;
+}
+
SVGPropertyBase* SVGAnimateElement::adjustForInheritance(
SVGPropertyBase* propertyValue,
AnimatedPropertyValueType valueType) const {
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGAnimateElement.h ('k') | third_party/WebKit/Source/core/svg/SVGAnimationElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698