void SVGAnimateElement::clearAnimatedType(SVGElement* targetElement) { if (!m_animatedProperty) return; if (!targetElement) { m_animatedProperty.clear(); return; } if (ensureAnimator()->isAnimatingCSSProperty()) { // CSS properties animation code-path. removeCSSPropertyFromTargetAndInstances(targetElement, attributeName()); m_animatedProperty.clear(); return; } // SVG DOM animVal animation code-path. if (m_animator) { WillBeHeapVector<RawPtrWillBeMember<SVGElement> > animatedElements = findElementInstances(targetElement); m_animator->stopAnimValAnimation(animatedElements); notifyTargetAndInstancesAboutAnimValChange(targetElement, attributeName()); } m_animatedProperty.clear(); }
void SVGAnimateElement::clearAnimatedType(SVGElement* targetElement) { if (!m_animatedType) return; if (!targetElement) { m_animatedType.clear(); return; } if (m_animatedProperties.isEmpty()) { // CSS properties animation code-path. removeCSSPropertyFromTargetAndInstances(targetElement, attributeName()); m_animatedType.clear(); return; } // SVG DOM animVal animation code-path. if (m_animator) { m_animator->stopAnimValAnimation(m_animatedProperties); notifyTargetAndInstancesAboutAnimValChange(targetElement, attributeName()); } m_animatedProperties.clear(); m_animatedType.clear(); }
void SVGAnimateElement::clearAnimatedType() { if (!m_animatedProperty) return; SVGElement* targetElement = this->targetElement(); if (!targetElement) { m_animatedProperty.clear(); return; } ShouldApplyAnimationType shouldApply = shouldApplyAnimation(targetElement, attributeName()); if (shouldApply == ApplyXMLandCSSAnimation) { removeCSSPropertyFromTargetAndInstances(targetElement, attributeName()); } else if (m_animator.isAnimatingCSSProperty()) { // CSS properties animation code-path. removeCSSPropertyFromTargetAndInstances(targetElement, attributeName()); m_animatedProperty.clear(); m_animator.clear(); return; } // SVG DOM animVal animation code-path. if (m_animatedProperty) { SVGElementInstances animatedElements = findElementInstances(targetElement); m_animator.stopAnimValAnimation(animatedElements); notifyTargetAndInstancesAboutAnimValChange(targetElement, attributeName()); } m_animatedProperty.clear(); m_animator.clear(); }
void SVGAnimateElement::applyResultsToTarget() { ASSERT(animatedPropertyType() != AnimatedTransformList || isSVGAnimateTransformElement(*this)); ASSERT(animatedPropertyType() != AnimatedUnknown); // Early exit if our animated type got destructed by a previous endedActiveInterval(). if (!m_animatedProperty) return; // We do update the style and the animation property independent of each other. ShouldApplyAnimationType shouldApply = shouldApplyAnimation(targetElement(), attributeName()); if (shouldApply == ApplyXMLandCSSAnimation) { applyCSSPropertyToTargetAndInstances(targetElement(), attributeName(), m_animatedProperty->valueAsString()); } else if (m_animator.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()); return; } // SVG DOM animVal animation code-path. // At this point the SVG DOM values are already changed, unlike for CSS. // We only have to trigger update notifications here. notifyTargetAndInstancesAboutAnimValChange(targetElement(), attributeName()); }
void SVGAnimateElement::applyResultsToTarget() { ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag)); ASSERT(m_animatedPropertyType != AnimatedUnknown); ASSERT(m_animator); // Early exit if our animated type got destructed by a previous endedActiveInterval(). if (!m_animatedType) return; SVGElement* targetElement = this->targetElement(); const QualifiedName& attributeName = this->attributeName(); if (m_animatedProperties.isEmpty()) { // 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_animatedType->valueAsString()); return; } // We do update the style and the animation property independent of each other. ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName); if (shouldApply == ApplyXMLandCSSAnimation) applyCSSPropertyToTargetAndInstances(targetElement, attributeName, m_animatedType->valueAsString()); // SVG DOM animVal animation code-path. // At this point the SVG DOM values are already changed, unlike for CSS. // We only have to trigger update notifications here. m_animator->animValDidChange(m_animatedProperties); notifyTargetAndInstancesAboutAnimValChange(targetElement, attributeName); }