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

Unified Diff: Source/core/svg/SVGElement.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/SVGElement.cpp
diff --git a/Source/core/svg/SVGElement.cpp b/Source/core/svg/SVGElement.cpp
index 6e840b75e4a5f90e0f44eee00700bcb6d222bf13..59b75b66dd61ce8483d1ff83e0831e665e1a84b7 100644
--- a/Source/core/svg/SVGElement.cpp
+++ b/Source/core/svg/SVGElement.cpp
@@ -1042,9 +1042,6 @@ bool SVGElement::hasFocusEventListeners() const
void SVGElement::invalidateInstances()
{
- if (!inDocument())
- return;
-
if (instanceUpdatesBlocked())
return;
@@ -1052,9 +1049,14 @@ void SVGElement::invalidateInstances()
if (set.isEmpty())
return;
+ // Take snapshot of the |set|, as it may be be modified from |invalidateShadowTree()|.
+ WillBeHeapVector<RawPtrWillBeWeakMember<SVGElement> > snapshot;
+ for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = set.begin(), end = set.end(); it != end; ++it) {
+ snapshot.append(*it);
esprehn 2014/05/23 04:38:17 I think you want copyToVector? Also these braces a
kouhei (in TOK) 2014/05/23 07:17:15 Done.
+ }
+
// Mark all use elements referencing 'element' for rebuilding
- const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator end = set.end();
- for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = set.begin(); it != end; ++it) {
+ for (WillBeHeapVector<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = snapshot.begin(), end = snapshot.end(); it != end; ++it) {
(*it)->setCorrespondingElement(0);
if (SVGUseElement* element = (*it)->correspondingUseElement()) {
@@ -1063,7 +1065,8 @@ void SVGElement::invalidateInstances()
}
}
- document().updateRenderTreeIfNeeded();
+ if (inDocument())
+ document().updateUseShadowTreesIfNeeded();
}
SVGElement::InstanceUpdateBlocker::InstanceUpdateBlocker(SVGElement* targetElement)

Powered by Google App Engine
This is Rietveld 408576698