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

Unified Diff: Source/core/svg/SVGDocumentExtensions.cpp

Issue 298873003: SVG: SVGAnimateElement should not cache |m_animatedElements| (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove_unused_line Created 6 years, 7 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
Index: Source/core/svg/SVGDocumentExtensions.cpp
diff --git a/Source/core/svg/SVGDocumentExtensions.cpp b/Source/core/svg/SVGDocumentExtensions.cpp
index 6f678e64e5167d0c64efa8a5029687b7485050a9..a1344f842d0c214c89b48c80b61ffa3ced765536 100644
--- a/Source/core/svg/SVGDocumentExtensions.cpp
+++ b/Source/core/svg/SVGDocumentExtensions.cpp
@@ -31,6 +31,7 @@
#include "core/svg/SVGViewSpec.h"
#include "core/svg/SVGZoomAndPan.h"
#include "core/svg/animation/SMILTimeContainer.h"
+#include "core/svg/animation/SVGSMILElement.h"
#include "wtf/TemporaryChange.h"
#include "wtf/text/AtomicString.h"
@@ -351,7 +352,7 @@ void SVGDocumentExtensions::removeAllTargetReferencesForElement(SVGElement* refe
m_elementDependencies.removeAll(toBeRemoved);
}
-void SVGDocumentExtensions::rebuildAllElementReferencesForTarget(SVGElement* referencedElement)
+void SVGDocumentExtensions::rebuildAllElementReferencesForTarget(SVGElement* referencedElement, bool onlySMILElements)
esprehn 2014/05/23 04:38:17 An enum would be nicer, then it's more clear. Smil
kouhei (in TOK) 2014/05/23 07:17:15 Done.
{
ASSERT(referencedElement);
HashMap<SVGElement*, OwnPtr<HashSet<SVGElement*> > >::iterator it = m_elementDependencies.find(referencedElement);
@@ -369,13 +370,22 @@ void SVGDocumentExtensions::rebuildAllElementReferencesForTarget(SVGElement* ref
Vector<SVGElement*>::iterator vectorEnd = toBeNotified.end();
for (Vector<SVGElement*>::iterator vectorIt = toBeNotified.begin(); vectorIt != vectorEnd; ++vectorIt) {
// Before rebuilding referencingElement ensure it was not removed from under us.
- if (HashSet<SVGElement*>* referencingElements = setOfElementsReferencingTarget(referencedElement)) {
- if (referencingElements->contains(*vectorIt))
- (*vectorIt)->svgAttributeChanged(XLinkNames::hrefAttr);
- }
+ HashSet<SVGElement*>* referencingElements = setOfElementsReferencingTarget(referencedElement);
+ if (!referencingElements || !referencingElements->contains(*vectorIt))
+ continue;
+
+ if (onlySMILElements && !isSVGSMILElement(**vectorIt))
+ continue;
+
+ (*vectorIt)->svgAttributeChanged(XLinkNames::hrefAttr);
}
}
+void SVGDocumentExtensions::rebuildSMILElementReferencesForTarget(SVGElement* referencedElement)
+{
+ rebuildAllElementReferencesForTarget(referencedElement, true);
+}
+
void SVGDocumentExtensions::removeAllElementReferencesForTarget(SVGElement* referencedElement)
{
ASSERT(referencedElement);

Powered by Google App Engine
This is Rietveld 408576698