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

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

Issue 2287983002: Tighten SVGAnimationElement::shouldApplyAnimation (Closed)
Patch Set: Created 4 years, 4 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 | « no previous file | third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2e0795a245334178277aa4aee5861578394bbf7b..afe5581406b860ada890b996b0bde38ac6874459 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
@@ -178,7 +178,6 @@ void SVGAnimateElement::resetAnimatedType()
m_animator.reset(targetElement);
ShouldApplyAnimationType shouldApply = shouldApplyAnimation(targetElement, attributeName);
-
if (shouldApply == DontApplyAnimation)
return;
if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimation) {
@@ -206,12 +205,6 @@ void SVGAnimateElement::resetAnimatedType()
m_animatedProperty = m_animator.constructFromString(baseValue);
}
-static bool targetIsUsable(SVGElement* targetElement, const QualifiedName& attribute)
-{
- return attribute != anyQName()
- && targetElement->isConnected() && targetElement->parentNode();
-}
-
void SVGAnimateElement::clearAnimatedType()
{
if (!m_animatedProperty)
@@ -231,7 +224,7 @@ void SVGAnimateElement::clearAnimatedType()
ShouldApplyAnimationType shouldApply = shouldApplyAnimation(targetElement, attributeName());
if (shouldApply == ApplyXMLandCSSAnimation || m_animator.isAnimatingCSSProperty()) {
// CSS properties animation code-path.
- if (targetIsUsable(targetElement, attributeName())) {
+ if (shouldApply != DontApplyAnimation) {
CSSPropertyID id = cssPropertyID(attributeName().localName());
targetElement->ensureAnimatedSMILStyleProperties()->removeProperty(id);
targetElement->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::Animation));
@@ -240,7 +233,7 @@ void SVGAnimateElement::clearAnimatedType()
if (shouldApply == ApplyXMLandCSSAnimation || m_animator.isAnimatingSVGDom()) {
// SVG DOM animVal animation code-path.
m_animator.stopAnimValAnimation();
- if (targetIsUsable(targetElement, attributeName()))
+ if (shouldApply != DontApplyAnimation)
targetElement->invalidateAnimatedAttribute(attributeName());
}
@@ -259,8 +252,7 @@ void SVGAnimateElement::applyResultsToTarget()
// We do update the style and the animation property independent of each other.
ShouldApplyAnimationType shouldApply = shouldApplyAnimation(targetElement(), attributeName());
- DCHECK(targetElement());
- if (!targetIsUsable(targetElement(), attributeName()))
+ if (shouldApply == DontApplyAnimation)
return;
if (shouldApply == ApplyXMLandCSSAnimation || m_animator.isAnimatingCSSProperty()) {
// CSS properties animation code-path.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698