| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 HashSet<RenderSVGResourceContainer*> resourceSet; | 77 HashSet<RenderSVGResourceContainer*> resourceSet; |
| 78 resources->buildSetOfResources(resourceSet); | 78 resources->buildSetOfResources(resourceSet); |
| 79 | 79 |
| 80 HashSet<RenderSVGResourceContainer*>::iterator end = resourceSet.end(); | 80 HashSet<RenderSVGResourceContainer*>::iterator end = resourceSet.end(); |
| 81 for (HashSet<RenderSVGResourceContainer*>::iterator it = resourceSet.begin()
; it != end; ++it) | 81 for (HashSet<RenderSVGResourceContainer*>::iterator it = resourceSet.begin()
; it != end; ++it) |
| 82 (*it)->removeClient(object); | 82 (*it)->removeClient(object); |
| 83 } | 83 } |
| 84 | 84 |
| 85 static inline SVGResourcesCache* resourcesCacheFromRenderObject(const RenderObje
ct* renderer) | 85 static inline SVGResourcesCache* resourcesCacheFromRenderObject(const RenderObje
ct* renderer) |
| 86 { | 86 { |
| 87 Document* document = renderer->document(); | 87 Document& document = renderer->document(); |
| 88 ASSERT(document); | |
| 89 | 88 |
| 90 SVGDocumentExtensions* extensions = document->accessSVGExtensions(); | 89 SVGDocumentExtensions* extensions = document.accessSVGExtensions(); |
| 91 ASSERT(extensions); | 90 ASSERT(extensions); |
| 92 | 91 |
| 93 SVGResourcesCache* cache = extensions->resourcesCache(); | 92 SVGResourcesCache* cache = extensions->resourcesCache(); |
| 94 ASSERT(cache); | 93 ASSERT(cache); |
| 95 | 94 |
| 96 return cache; | 95 return cache; |
| 97 } | 96 } |
| 98 | 97 |
| 99 SVGResources* SVGResourcesCache::cachedResourcesForRenderObject(const RenderObje
ct* renderer) | 98 SVGResources* SVGResourcesCache::cachedResourcesForRenderObject(const RenderObje
ct* renderer) |
| 100 { | 99 { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // The resource itself may have clients, that need to be notified. | 191 // The resource itself may have clients, that need to be notified. |
| 193 cache->removeResourcesFromRenderObject(resource); | 192 cache->removeResourcesFromRenderObject(resource); |
| 194 | 193 |
| 195 CacheMap::iterator end = cache->m_cache.end(); | 194 CacheMap::iterator end = cache->m_cache.end(); |
| 196 for (CacheMap::iterator it = cache->m_cache.begin(); it != end; ++it) { | 195 for (CacheMap::iterator it = cache->m_cache.begin(); it != end; ++it) { |
| 197 it->value->resourceDestroyed(resource); | 196 it->value->resourceDestroyed(resource); |
| 198 | 197 |
| 199 // Mark users of destroyed resources as pending resolution based on the
id of the old resource. | 198 // Mark users of destroyed resources as pending resolution based on the
id of the old resource. |
| 200 Element* resourceElement = toElement(resource->node()); | 199 Element* resourceElement = toElement(resource->node()); |
| 201 Element* clientElement = toElement(it->key->node()); | 200 Element* clientElement = toElement(it->key->node()); |
| 202 SVGDocumentExtensions* extensions = clientElement->document()->accessSVG
Extensions(); | 201 SVGDocumentExtensions* extensions = clientElement->document().accessSVGE
xtensions(); |
| 203 | 202 |
| 204 extensions->addPendingResource(resourceElement->fastGetAttribute(HTMLNam
es::idAttr), clientElement); | 203 extensions->addPendingResource(resourceElement->fastGetAttribute(HTMLNam
es::idAttr), clientElement); |
| 205 } | 204 } |
| 206 } | 205 } |
| 207 | 206 |
| 208 } | 207 } |
| OLD | NEW |