Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Unified Diff: third_party/WebKit/Source/core/svg/SVGElement.cpp

Issue 2281643003: Move animVal invalidation from SVGAnimateElement to SVGElement (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 064c28daa9c79506d8e9949b4059f934c2194f3f..283f3a12db89ad40c9c4735fc5c31295adcf34d0 100644
--- a/third_party/WebKit/Source/core/svg/SVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGElement.cpp
@@ -247,6 +247,12 @@ static void updateInstancesAnimatedAttributeNoInvalidate(SVGElement* element, co
}
}
+static inline void notifyAnimValChanged(SVGElement* targetElement, const QualifiedName& attributeName)
+{
+ targetElement->invalidateSVGAttributes();
+ targetElement->svgAttributeChanged(attributeName);
+}
+
template<typename T>
static void updateInstancesAnimatedAttribute(SVGElement* element, const QualifiedName& attribute, T callback)
{
@@ -254,8 +260,7 @@ static void updateInstancesAnimatedAttribute(SVGElement* element, const Qualifie
for (SVGElement* instance : SVGAnimateElement::findElementInstances(element)) {
if (SVGAnimatedPropertyBase* animatedProperty = instance->propertyFromAttribute(attribute)) {
callback(*animatedProperty);
- instance->invalidateSVGAttributes();
- instance->svgAttributeChanged(attribute);
+ notifyAnimValChanged(instance, attribute);
}
}
}
@@ -287,6 +292,15 @@ void SVGElement::setAnimatedAttribute(const QualifiedName& attribute, SVGPropert
});
}
+void SVGElement::invalidateAnimatedAttribute(const QualifiedName& attribute)
+{
+ InstanceUpdateBlocker blocker(this);
+ notifyAnimValChanged(this, attribute);
+
+ for (SVGElement* element : instancesForElement())
+ notifyAnimValChanged(element, attribute);
+}
+
void SVGElement::clearAnimatedAttribute(const QualifiedName& attribute)
{
updateInstancesAnimatedAttributeNoInvalidate(this, attribute, [](SVGAnimatedPropertyBase& animatedProperty) {
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698