Index: third_party/WebKit/Source/core/svg/SVGElement.cpp |
diff --git a/third_party/WebKit/Source/core/svg/SVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGElement.cpp |
index 919c6f352068503cd175c26ecce75b7c31f85797..064c28daa9c79506d8e9949b4059f934c2194f3f 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGElement.cpp |
+++ b/third_party/WebKit/Source/core/svg/SVGElement.cpp |
@@ -238,6 +238,16 @@ void SVGElement::applyActiveWebAnimations() |
} |
template<typename T> |
+static void updateInstancesAnimatedAttributeNoInvalidate(SVGElement* element, const QualifiedName& attribute, T callback) |
+{ |
+ SVGElement::InstanceUpdateBlocker blocker(element); |
+ for (SVGElement* instance : SVGAnimateElement::findElementInstances(element)) { |
+ if (SVGAnimatedPropertyBase* animatedProperty = instance->propertyFromAttribute(attribute)) |
+ callback(*animatedProperty); |
+ } |
+} |
+ |
+template<typename T> |
static void updateInstancesAnimatedAttribute(SVGElement* element, const QualifiedName& attribute, T callback) |
{ |
SVGElement::InstanceUpdateBlocker blocker(element); |
@@ -270,6 +280,20 @@ void SVGElement::clearWebAnimatedAttributes() |
svgRareData()->webAnimatedAttributes().clear(); |
} |
+void SVGElement::setAnimatedAttribute(const QualifiedName& attribute, SVGPropertyBase* value) |
+{ |
+ updateInstancesAnimatedAttributeNoInvalidate(this, attribute, [&value](SVGAnimatedPropertyBase& animatedProperty) { |
+ animatedProperty.setAnimatedValue(value); |
+ }); |
+} |
+ |
+void SVGElement::clearAnimatedAttribute(const QualifiedName& attribute) |
+{ |
+ updateInstancesAnimatedAttributeNoInvalidate(this, attribute, [](SVGAnimatedPropertyBase& animatedProperty) { |
+ animatedProperty.animationEnded(); |
+ }); |
+} |
+ |
AffineTransform SVGElement::localCoordinateSpaceTransform(CTMScope) const |
{ |
// To be overriden by SVGGraphicsElement (or as special case SVGTextElement and SVGPatternElement) |