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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 if (it == m_elementDependencies.end()) | 403 if (it == m_elementDependencies.end()) |
404 return; | 404 return; |
405 ASSERT(it->first == referencedElement); | 405 ASSERT(it->first == referencedElement); |
406 Vector<SVGElement*> toBeNotified; | 406 Vector<SVGElement*> toBeNotified; |
407 | 407 |
408 HashSet<SVGElement*>* referencingElements = it->second.get(); | 408 HashSet<SVGElement*>* referencingElements = it->second.get(); |
409 HashSet<SVGElement*>::iterator setEnd = referencingElements->end(); | 409 HashSet<SVGElement*>::iterator setEnd = referencingElements->end(); |
410 for (HashSet<SVGElement*>::iterator setIt = referencingElements->begin(); se
tIt != setEnd; ++setIt) | 410 for (HashSet<SVGElement*>::iterator setIt = referencingElements->begin(); se
tIt != setEnd; ++setIt) |
411 toBeNotified.append(*setIt); | 411 toBeNotified.append(*setIt); |
412 | 412 |
413 m_elementDependencies.remove(it); | |
414 | |
415 // Force rebuilding the referencingElement so it knows about this change. | 413 // Force rebuilding the referencingElement so it knows about this change. |
416 Vector<SVGElement*>::iterator vectorEnd = toBeNotified.end(); | 414 Vector<SVGElement*>::iterator vectorEnd = toBeNotified.end(); |
417 for (Vector<SVGElement*>::iterator vectorIt = toBeNotified.begin(); vectorIt
!= vectorEnd; ++vectorIt) | 415 for (Vector<SVGElement*>::iterator vectorIt = toBeNotified.begin(); vectorIt
!= vectorEnd; ++vectorIt) { |
418 (*vectorIt)->svgAttributeChanged(XLinkNames::hrefAttr); | 416 // Before rebuilding referencingElement ensure it was not removed from u
nder us. |
| 417 if (HashSet<SVGElement*>* referencingElements = setOfElementsReferencing
Target(referencedElement)) { |
| 418 if (referencingElements->contains(*vectorIt)) |
| 419 (*vectorIt)->svgAttributeChanged(XLinkNames::hrefAttr); |
| 420 } |
| 421 } |
| 422 |
| 423 m_elementDependencies.remove(referencedElement); |
419 } | 424 } |
420 | 425 |
421 #if ENABLE(SVG_FONTS) | 426 #if ENABLE(SVG_FONTS) |
422 void SVGDocumentExtensions::registerSVGFontFaceElement(SVGFontFaceElement* eleme
nt) | 427 void SVGDocumentExtensions::registerSVGFontFaceElement(SVGFontFaceElement* eleme
nt) |
423 { | 428 { |
424 m_svgFontFaceElements.add(element); | 429 m_svgFontFaceElements.add(element); |
425 } | 430 } |
426 | 431 |
427 void SVGDocumentExtensions::unregisterSVGFontFaceElement(SVGFontFaceElement* ele
ment) | 432 void SVGDocumentExtensions::unregisterSVGFontFaceElement(SVGFontFaceElement* ele
ment) |
428 { | 433 { |
429 ASSERT(m_svgFontFaceElements.contains(element)); | 434 ASSERT(m_svgFontFaceElements.contains(element)); |
430 m_svgFontFaceElements.remove(element); | 435 m_svgFontFaceElements.remove(element); |
431 } | 436 } |
432 #endif | 437 #endif |
433 | 438 |
434 } | 439 } |
435 | 440 |
436 #endif | 441 #endif |
OLD | NEW |