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

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

Issue 2408913002: Push hasValidAttributeName/Type down into 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 ca1b9b643d46af86d17cfb8df99b4f256a51660c..36c385f2078736f150b95f586ed2665536de1d53 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
@@ -129,11 +129,18 @@ AnimatedPropertyType SVGAnimateElement::animatedPropertyType() {
return m_animator.type();
}
+bool SVGAnimateElement::hasValidTarget() {
+ return SVGAnimationElement::hasValidTarget() && hasValidAttributeName() &&
+ hasValidAttributeType();
+}
+
+bool SVGAnimateElement::hasValidAttributeName() const {
+ return attributeName() != anyQName();
+}
+
bool SVGAnimateElement::hasValidAttributeType() {
- SVGElement* targetElement = this->targetElement();
- if (!targetElement)
+ if (!targetElement())
return false;
-
return animatedPropertyType() != AnimatedUnknown &&
!hasInvalidCSSAttributeType();
}
@@ -141,9 +148,7 @@ bool SVGAnimateElement::hasValidAttributeType() {
SVGAnimateElement::ShouldApplyAnimationType
SVGAnimateElement::shouldApplyAnimation(SVGElement* targetElement,
const QualifiedName& attributeName) {
- if (!hasValidAttributeType() || attributeName == anyQName() ||
- !targetElement || !targetElement->inActiveDocument() ||
- !targetElement->parentNode())
+ if (!hasValidTarget() || !targetElement->parentNode())
return DontApplyAnimation;
// Always animate CSS properties using the ApplyCSSAnimation code path,
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGAnimateElement.h ('k') | third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698