Chromium Code Reviews| Index: Source/core/svg/SVGAnimationElement.cpp |
| diff --git a/Source/core/svg/SVGAnimationElement.cpp b/Source/core/svg/SVGAnimationElement.cpp |
| index 718ca2137efa405de26f962e938ef3525a9e65ba..04cb6a2d318aa1cf9f4f84f87423acf02f37be44 100644 |
| --- a/Source/core/svg/SVGAnimationElement.cpp |
| +++ b/Source/core/svg/SVGAnimationElement.cpp |
| @@ -489,6 +489,26 @@ void SVGAnimationElement::currentValuesFromKeyPoints(float percent, float& effec |
| to = m_values[index + 1]; |
| } |
| +AnimatedPropertyType SVGAnimationElement::determineAnimatedPropertyType() const |
| +{ |
| + if (!targetElement()) |
| + return AnimatedString; |
| + |
| + AnimatedPropertyType propertyType; |
|
fs
2014/03/05 11:53:32
Nit: Move this into the if-block (first definition
kouhei (in TOK)
2014/03/06 03:53:30
Done.
|
| + RefPtr<NewSVGAnimatedPropertyBase> property = targetElement()->propertyFromAttribute(attributeName()); |
| + if (property) { |
| + propertyType = property->type(); |
| + |
| + // Only <animatedTransform> is allowed to animate AnimatedTransformList. |
| + if (propertyType == AnimatedTransformList && !hasTagName(SVGNames::animateTransformTag)) |
| + return AnimatedUnknown; |
| + |
| + return propertyType; |
| + } |
| + |
| + return SVGElement::animatedPropertyTypeForCSSAttribute(attributeName()); |
| +} |
| + |
| void SVGAnimationElement::currentValuesForValuesAnimation(float percent, float& effectivePercent, String& from, String& to) |
| { |
| unsigned valuesCount = m_values.size(); |
| @@ -504,7 +524,7 @@ void SVGAnimationElement::currentValuesForValuesAnimation(float percent, float& |
| CalcMode calcMode = this->calcMode(); |
| if (hasTagName(SVGNames::animateTag)) { |
| - AnimatedPropertyType attributeType = toSVGAnimateElement(this)->determineAnimatedPropertyType(targetElement()); |
| + AnimatedPropertyType attributeType = determineAnimatedPropertyType(); |
| // Fall back to discrete animations for Strings. |
| if (attributeType == AnimatedBoolean |
| || attributeType == AnimatedEnumeration |