OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 #if ENABLE(FILTERS) | 148 #if ENABLE(FILTERS) |
149 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(
renderer); | 149 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(
renderer); |
150 if (resources && resources->filter()) | 150 if (resources && resources->filter()) |
151 resources->removeClientFromCache(renderer); | 151 resources->removeClientFromCache(renderer); |
152 #endif | 152 #endif |
153 } | 153 } |
154 | 154 |
155 void SVGResourcesCache::clientDestroyed(RenderObject* renderer) | 155 void SVGResourcesCache::clientDestroyed(RenderObject* renderer) |
156 { | 156 { |
157 ASSERT(renderer); | 157 ASSERT(renderer); |
| 158 |
| 159 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(
renderer); |
| 160 if (resources) |
| 161 resources->removeClientFromCache(renderer); |
| 162 |
158 SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer); | 163 SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer); |
159 cache->removeResourcesFromRenderObject(renderer); | 164 cache->removeResourcesFromRenderObject(renderer); |
160 } | 165 } |
161 | 166 |
162 void SVGResourcesCache::resourceDestroyed(RenderSVGResourceContainer* resource) | 167 void SVGResourcesCache::resourceDestroyed(RenderSVGResourceContainer* resource) |
163 { | 168 { |
164 ASSERT(resource); | 169 ASSERT(resource); |
165 SVGResourcesCache* cache = resourcesCacheFromRenderObject(resource); | 170 SVGResourcesCache* cache = resourcesCacheFromRenderObject(resource); |
166 | 171 |
167 // The resource itself may have clients, that need to be notified. | 172 // The resource itself may have clients, that need to be notified. |
168 cache->removeResourcesFromRenderObject(resource); | 173 cache->removeResourcesFromRenderObject(resource); |
169 | 174 |
170 HashMap<RenderObject*, SVGResources*>::iterator end = cache->m_cache.end(); | 175 HashMap<RenderObject*, SVGResources*>::iterator end = cache->m_cache.end(); |
171 for (HashMap<RenderObject*, SVGResources*>::iterator it = cache->m_cache.beg
in(); it != end; ++it) { | 176 for (HashMap<RenderObject*, SVGResources*>::iterator it = cache->m_cache.beg
in(); it != end; ++it) { |
172 it->second->resourceDestroyed(resource); | 177 it->second->resourceDestroyed(resource); |
173 | 178 |
174 // Mark users of destroyed resources as pending resolution based on the
id of the old resource. | 179 // Mark users of destroyed resources as pending resolution based on the
id of the old resource. |
175 Element* resourceElement = toElement(resource->node()); | 180 Element* resourceElement = toElement(resource->node()); |
176 SVGStyledElement* clientElement = toSVGStyledElement(it->first->node()); | 181 SVGStyledElement* clientElement = toSVGStyledElement(it->first->node()); |
177 SVGDocumentExtensions* extensions = clientElement->document()->accessSVG
Extensions(); | 182 SVGDocumentExtensions* extensions = clientElement->document()->accessSVG
Extensions(); |
178 | 183 |
179 extensions->addPendingResource(resourceElement->fastGetAttribute(HTMLNam
es::idAttr), clientElement); | 184 extensions->addPendingResource(resourceElement->fastGetAttribute(HTMLNam
es::idAttr), clientElement); |
180 } | 185 } |
181 } | 186 } |
182 | 187 |
183 } | 188 } |
184 | 189 |
185 #endif | 190 #endif |
OLD | NEW |