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); |
} |