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

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

Issue 298873003: SVG: SVGAnimateElement should not cache |m_animatedElements| (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove more asserts 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/SVGAnimateElement.h ('k') | Source/core/svg/SVGAnimatedAngle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGAnimateElement.cpp
diff --git a/Source/core/svg/SVGAnimateElement.cpp b/Source/core/svg/SVGAnimateElement.cpp
index f66d3ac6402a1c22488c7d493569fb9d8b61a372..cceb579b6dd86d3bc914ef9a6d3943a8058ebc51 100644
--- a/Source/core/svg/SVGAnimateElement.cpp
+++ b/Source/core/svg/SVGAnimateElement.cpp
@@ -177,23 +177,22 @@ void SVGAnimateElement::resetAnimatedType()
if (shouldApply == ApplyXMLAnimation) {
// SVG DOM animVal animation code-path.
- m_animatedElements = findElementInstances(targetElement);
- ASSERT(!m_animatedElements.isEmpty());
+ WillBeHeapVector<RawPtrWillBeMember<SVGElement> > animatedElements = findElementInstances(targetElement);
+ ASSERT(!animatedElements.isEmpty());
- WillBeHeapVector<RawPtrWillBeMember<SVGElement> >::const_iterator end = m_animatedElements.end();
- for (WillBeHeapVector<RawPtrWillBeMember<SVGElement> >::const_iterator it = m_animatedElements.begin(); it != end; ++it)
+ WillBeHeapVector<RawPtrWillBeMember<SVGElement> >::const_iterator end = animatedElements.end();
+ for (WillBeHeapVector<RawPtrWillBeMember<SVGElement> >::const_iterator it = animatedElements.begin(); it != end; ++it)
document().accessSVGExtensions().addElementReferencingTarget(this, *it);
if (!m_animatedProperty)
- m_animatedProperty = animator->startAnimValAnimation(m_animatedElements);
+ m_animatedProperty = animator->startAnimValAnimation(animatedElements);
else
- m_animatedProperty = animator->resetAnimValToBaseVal(m_animatedElements);
+ m_animatedProperty = animator->resetAnimValToBaseVal(animatedElements);
return;
}
// CSS properties animation code-path.
- ASSERT(m_animatedElements.isEmpty());
String baseValue;
if (shouldApply == ApplyCSSAnimation) {
@@ -302,7 +301,7 @@ void SVGAnimateElement::clearAnimatedType(SVGElement* targetElement)
return;
}
- if (m_animatedElements.isEmpty()) {
+ if (ensureAnimator()->isAnimatingCSSProperty()) {
// CSS properties animation code-path.
removeCSSPropertyFromTargetAndInstances(targetElement, attributeName());
m_animatedProperty.clear();
@@ -311,11 +310,11 @@ void SVGAnimateElement::clearAnimatedType(SVGElement* targetElement)
// SVG DOM animVal animation code-path.
if (m_animator) {
- m_animator->stopAnimValAnimation(m_animatedElements);
+ WillBeHeapVector<RawPtrWillBeMember<SVGElement> > animatedElements = findElementInstances(targetElement);
+ m_animator->stopAnimValAnimation(animatedElements);
notifyTargetAndInstancesAboutAnimValChange(targetElement, attributeName());
}
- m_animatedElements.clear();
m_animatedProperty.clear();
}
@@ -329,7 +328,7 @@ void SVGAnimateElement::applyResultsToTarget()
if (!m_animatedProperty)
return;
- if (m_animatedElements.isEmpty()) {
+ if (ensureAnimator()->isAnimatingCSSProperty()) {
// CSS properties animation code-path.
// Convert the result of the animation to a String and apply it as CSS property on the target & all instances.
applyCSSPropertyToTargetAndInstances(targetElement(), attributeName(), m_animatedProperty->valueAsString());
@@ -408,9 +407,6 @@ SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator()
void SVGAnimateElement::trace(Visitor* visitor)
{
-#if ENABLE(OILPAN)
- visitor->trace(m_animatedElements);
-#endif
visitor->trace(m_animator);
SVGAnimationElement::trace(visitor);
}
« no previous file with comments | « Source/core/svg/SVGAnimateElement.h ('k') | Source/core/svg/SVGAnimatedAngle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698