| 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 bbd51b21574a35c9dcdd52889ad94759766b2ffc..624e96da669ea297558581a7e125e3c4809cda0e 100644
|
| --- a/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
|
| +++ b/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
|
| @@ -85,27 +85,6 @@
|
| return animatedPropertyType() != AnimatedUnknown && !hasInvalidCSSAttributeType();
|
| }
|
|
|
| -namespace {
|
| -
|
| -class ParsePropertyFromString {
|
| - STACK_ALLOCATED();
|
| -public:
|
| - explicit ParsePropertyFromString(SVGAnimatedTypeAnimator* animator)
|
| - : m_animator(animator)
|
| - {
|
| - }
|
| -
|
| - SVGPropertyBase* operator()(SVGAnimationElement*, const String& value)
|
| - {
|
| - return m_animator->createPropertyForAnimation(value);
|
| - }
|
| -
|
| -private:
|
| - SVGAnimatedTypeAnimator* m_animator;
|
| -};
|
| -
|
| -}
|
| -
|
| void SVGAnimateElement::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement)
|
| {
|
| ASSERT(resultElement);
|
| @@ -133,31 +112,16 @@
|
| // Target element might have changed.
|
| m_animator.setContextElement(targetElement);
|
|
|
| - // Values-animation accumulates using the last values entry corresponding to
|
| - // the end of duration time.
|
| - SVGPropertyBase* animatedValue = resultAnimationElement->m_animatedProperty;
|
| - SVGPropertyBase* toAtEndOfDurationValue =
|
| - m_toAtEndOfDurationProperty ? m_toAtEndOfDurationProperty : m_toProperty;
|
| - SVGPropertyBase* fromValue =
|
| - getAnimationMode() == ToAnimation ? animatedValue : m_fromProperty.get();
|
| - SVGPropertyBase* toValue = m_toProperty;
|
| -
|
| - // Apply CSS inheritance rules.
|
| - ParsePropertyFromString parsePropertyFromString(&m_animator);
|
| - adjustForInheritance<SVGPropertyBase*, ParsePropertyFromString>(
|
| - parsePropertyFromString, fromPropertyValueType(), fromValue, targetElement);
|
| - adjustForInheritance<SVGPropertyBase*, ParsePropertyFromString>(
|
| - parsePropertyFromString, toPropertyValueType(), toValue, targetElement);
|
| -
|
| - animatedValue->calculateAnimatedValue(
|
| - this, percentage, repeatCount, fromValue, toValue, toAtEndOfDurationValue, targetElement);
|
| + // Values-animation accumulates using the last values entry corresponding to the end of duration time.
|
| + SVGPropertyBase* toAtEndOfDurationProperty = m_toAtEndOfDurationProperty ? m_toAtEndOfDurationProperty.get() : m_toProperty.get();
|
| + m_animator.calculateAnimatedValue(percentage, repeatCount, m_fromProperty.get(), m_toProperty.get(), toAtEndOfDurationProperty, resultAnimationElement->m_animatedProperty.get());
|
| }
|
|
|
| bool SVGAnimateElement::calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString)
|
| {
|
| if (toAtEndOfDurationString.isEmpty())
|
| return false;
|
| - m_toAtEndOfDurationProperty = m_animator.createPropertyForAnimation(toAtEndOfDurationString);
|
| + m_toAtEndOfDurationProperty = m_animator.createAnimatedValueFromString(toAtEndOfDurationString);
|
| return true;
|
| }
|
|
|
| @@ -168,8 +132,7 @@
|
| return false;
|
|
|
| determinePropertyValueTypes(fromString, toString);
|
| - m_fromProperty = m_animator.createPropertyForAnimation(fromString);
|
| - m_toProperty = m_animator.createPropertyForAnimation(toString);
|
| + m_animator.calculateFromAndToValues(m_fromProperty, m_toProperty, fromString, toString);
|
| return true;
|
| }
|
|
|
| @@ -189,9 +152,7 @@
|
| ASSERT(!isSVGSetElement(*this));
|
|
|
| determinePropertyValueTypes(fromString, byString);
|
| - m_fromProperty = m_animator.createPropertyForAnimation(fromString);
|
| - m_toProperty = m_animator.createPropertyForAnimation(byString);
|
| - m_toProperty->add(m_fromProperty, targetElement);
|
| + m_animator.calculateFromAndByValues(m_fromProperty, m_toProperty, fromString, byString);
|
| return true;
|
| }
|
|
|
| @@ -218,7 +179,7 @@
|
| DCHECK(isTargetAttributeCSSProperty(targetElement, attributeName));
|
| computeCSSPropertyValue(targetElement, cssPropertyID(attributeName.localName()), baseValue);
|
|
|
| - m_animatedProperty = m_animator.createPropertyForAnimation(baseValue);
|
| + m_animatedProperty = m_animator.createAnimatedValueFromString(baseValue);
|
| }
|
|
|
| void SVGAnimateElement::clearAnimatedType()
|
| @@ -317,9 +278,8 @@
|
| SVGElement* targetElement = this->targetElement();
|
| if (!targetElement)
|
| return -1;
|
| - SVGPropertyBase* fromValue = m_animator.createPropertyForAnimation(fromString);
|
| - SVGPropertyBase* toValue = m_animator.createPropertyForAnimation(toString);
|
| - return fromValue->calculateDistance(toValue, targetElement);
|
| +
|
| + return m_animator.calculateDistance(fromString, toString);
|
| }
|
|
|
| void SVGAnimateElement::setTargetElement(SVGElement* target)
|
|
|