| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 4 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 4 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 animationElementsForTarget->remove(animationElement); | 162 animationElementsForTarget->remove(animationElement); |
| 163 if (animationElementsForTarget->isEmpty()) { | 163 if (animationElementsForTarget->isEmpty()) { |
| 164 m_animatedElements.remove(it); | 164 m_animatedElements.remove(it); |
| 165 delete animationElementsForTarget; | 165 delete animationElementsForTarget; |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 void SVGDocumentExtensions::removeAllAnimationElementsFromTarget(SVGElement* tar
getElement) | 169 void SVGDocumentExtensions::removeAllAnimationElementsFromTarget(SVGElement* tar
getElement) |
| 170 { | 170 { |
| 171 ASSERT(targetElement); | 171 ASSERT(targetElement); |
| 172 HashSet<SVGSMILElement*>* animationElementsForTarget = m_animatedElements.ta
ke(targetElement); | 172 HashMap<SVGElement*, HashSet<SVGSMILElement*>* >::iterator it = m_animatedEl
ements.find(targetElement); |
| 173 if (!animationElementsForTarget) | 173 if (it == m_animatedElements.end()) |
| 174 return; | 174 return; |
| 175 HashSet<SVGSMILElement*>::iterator it = animationElementsForTarget->begin(); | 175 |
| 176 HashSet<SVGSMILElement*>* animationElementsForTarget = it->second; |
| 177 Vector<SVGSMILElement*> toBeReset; |
| 178 |
| 176 HashSet<SVGSMILElement*>::iterator end = animationElementsForTarget->end(); | 179 HashSet<SVGSMILElement*>::iterator end = animationElementsForTarget->end(); |
| 177 for (; it != end; ++it) | 180 for (HashSet<SVGSMILElement*>::iterator it = animationElementsForTarget->beg
in(); it != end; ++it) |
| 178 (*it)->resetTargetElement(); | 181 toBeReset.append(*it); |
| 179 delete animationElementsForTarget; | 182 |
| 183 Vector<SVGSMILElement*>::iterator vectorEnd = toBeReset.end(); |
| 184 for (Vector<SVGSMILElement*>::iterator vectorIt = toBeReset.begin(); vectorI
t != vectorEnd; ++vectorIt) |
| 185 (*vectorIt)->resetTargetElement(); |
| 180 } | 186 } |
| 181 | 187 |
| 182 // FIXME: Callers should probably use ScriptController::eventHandlerLineNumber() | 188 // FIXME: Callers should probably use ScriptController::eventHandlerLineNumber() |
| 183 static int parserLineNumber(Document* document) | 189 static int parserLineNumber(Document* document) |
| 184 { | 190 { |
| 185 ScriptableDocumentParser* parser = document->scriptableDocumentParser(); | 191 ScriptableDocumentParser* parser = document->scriptableDocumentParser(); |
| 186 if (!parser) | 192 if (!parser) |
| 187 return 1; | 193 return 1; |
| 188 return parser->lineNumber().oneBasedInt(); | 194 return parser->lineNumber().oneBasedInt(); |
| 189 } | 195 } |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 void SVGDocumentExtensions::unregisterSVGFontFaceElement(SVGFontFaceElement* ele
ment) | 438 void SVGDocumentExtensions::unregisterSVGFontFaceElement(SVGFontFaceElement* ele
ment) |
| 433 { | 439 { |
| 434 ASSERT(m_svgFontFaceElements.contains(element)); | 440 ASSERT(m_svgFontFaceElements.contains(element)); |
| 435 m_svgFontFaceElements.remove(element); | 441 m_svgFontFaceElements.remove(element); |
| 436 } | 442 } |
| 437 #endif | 443 #endif |
| 438 | 444 |
| 439 } | 445 } |
| 440 | 446 |
| 441 #endif | 447 #endif |
| OLD | NEW |