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

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

Issue 10778043: Merge 122278 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 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 | « no previous file | Source/WebCore/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/svg/SVGDocumentExtensions.cpp
===================================================================
--- Source/WebCore/svg/SVGDocumentExtensions.cpp (revision 122881)
+++ Source/WebCore/svg/SVGDocumentExtensions.cpp (working copy)
@@ -169,14 +169,20 @@
void SVGDocumentExtensions::removeAllAnimationElementsFromTarget(SVGElement* targetElement)
{
ASSERT(targetElement);
- HashSet<SVGSMILElement*>* animationElementsForTarget = m_animatedElements.take(targetElement);
- if (!animationElementsForTarget)
+ HashMap<SVGElement*, HashSet<SVGSMILElement*>* >::iterator it = m_animatedElements.find(targetElement);
+ if (it == m_animatedElements.end())
return;
- HashSet<SVGSMILElement*>::iterator it = animationElementsForTarget->begin();
+
+ HashSet<SVGSMILElement*>* animationElementsForTarget = it->second;
+ Vector<SVGSMILElement*> toBeReset;
+
HashSet<SVGSMILElement*>::iterator end = animationElementsForTarget->end();
- for (; it != end; ++it)
- (*it)->resetTargetElement();
- delete animationElementsForTarget;
+ for (HashSet<SVGSMILElement*>::iterator it = animationElementsForTarget->begin(); it != end; ++it)
+ toBeReset.append(*it);
+
+ Vector<SVGSMILElement*>::iterator vectorEnd = toBeReset.end();
+ for (Vector<SVGSMILElement*>::iterator vectorIt = toBeReset.begin(); vectorIt != vectorEnd; ++vectorIt)
+ (*vectorIt)->resetTargetElement();
}
// FIXME: Callers should probably use ScriptController::eventHandlerLineNumber()
« no previous file with comments | « no previous file | Source/WebCore/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698