| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
| 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 if (RenderSVGResourceMasker* masker = resources->masker()) | 168 if (RenderSVGResourceMasker* masker = resources->masker()) |
| 169 masker->removeClientFromCache(object); | 169 masker->removeClientFromCache(object); |
| 170 | 170 |
| 171 if (RenderSVGResourceClipper* clipper = resources->clipper()) | 171 if (RenderSVGResourceClipper* clipper = resources->clipper()) |
| 172 clipper->removeClientFromCache(object); | 172 clipper->removeClientFromCache(object); |
| 173 } | 173 } |
| 174 | 174 |
| 175 if (!object->node() || !object->node()->isSVGElement()) | 175 if (!object->node() || !object->node()->isSVGElement()) |
| 176 return; | 176 return; |
| 177 HashSet<SVGElement*>* dependencies = object->document()->accessSVGExtensions
()->setOfElementsReferencingTarget(toSVGElement(object->node())); | 177 HashSet<SVGElement*>* dependencies = object->document().accessSVGExtensions(
)->setOfElementsReferencingTarget(toSVGElement(object->node())); |
| 178 if (!dependencies) | 178 if (!dependencies) |
| 179 return; | 179 return; |
| 180 HashSet<SVGElement*>::iterator end = dependencies->end(); | 180 HashSet<SVGElement*>::iterator end = dependencies->end(); |
| 181 for (HashSet<SVGElement*>::iterator it = dependencies->begin(); it != end; +
+it) { | 181 for (HashSet<SVGElement*>::iterator it = dependencies->begin(); it != end; +
+it) { |
| 182 if (RenderObject* renderer = (*it)->renderer()) | 182 if (RenderObject* renderer = (*it)->renderer()) |
| 183 RenderSVGResource::markForLayoutAndParentResourceInvalidation(render
er, needsLayout); | 183 RenderSVGResource::markForLayoutAndParentResourceInvalidation(render
er, needsLayout); |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 | 186 |
| 187 void RenderSVGResource::markForLayoutAndParentResourceInvalidation(RenderObject*
object, bool needsLayout) | 187 void RenderSVGResource::markForLayoutAndParentResourceInvalidation(RenderObject*
object, bool needsLayout) |
| 188 { | 188 { |
| 189 ASSERT(object); | 189 ASSERT(object); |
| 190 ASSERT(object->document()); | |
| 191 ASSERT(object->node()); | 190 ASSERT(object->node()); |
| 192 | 191 |
| 193 if (needsLayout) | 192 if (needsLayout) |
| 194 object->setNeedsLayout(); | 193 object->setNeedsLayout(); |
| 195 | 194 |
| 196 removeFromCacheAndInvalidateDependencies(object, needsLayout); | 195 removeFromCacheAndInvalidateDependencies(object, needsLayout); |
| 197 | 196 |
| 198 // Invalidate resources in ancestor chain, if needed. | 197 // Invalidate resources in ancestor chain, if needed. |
| 199 RenderObject* current = object->parent(); | 198 RenderObject* current = object->parent(); |
| 200 while (current) { | 199 while (current) { |
| 201 removeFromCacheAndInvalidateDependencies(current, needsLayout); | 200 removeFromCacheAndInvalidateDependencies(current, needsLayout); |
| 202 | 201 |
| 203 if (current->isSVGResourceContainer()) { | 202 if (current->isSVGResourceContainer()) { |
| 204 // This will process the rest of the ancestors. | 203 // This will process the rest of the ancestors. |
| 205 current->toRenderSVGResourceContainer()->removeAllClientsFromCache()
; | 204 current->toRenderSVGResourceContainer()->removeAllClientsFromCache()
; |
| 206 break; | 205 break; |
| 207 } | 206 } |
| 208 | 207 |
| 209 current = current->parent(); | 208 current = current->parent(); |
| 210 } | 209 } |
| 211 } | 210 } |
| 212 | 211 |
| 213 } | 212 } |
| OLD | NEW |