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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 { | 188 { |
189 ASSERT(client); | 189 ASSERT(client); |
190 m_clientLayers.remove(client); | 190 m_clientLayers.remove(client); |
191 } | 191 } |
192 | 192 |
193 void LayoutSVGResourceContainer::invalidateCacheAndMarkForLayout(SubtreeLayoutSc
ope* layoutScope) | 193 void LayoutSVGResourceContainer::invalidateCacheAndMarkForLayout(SubtreeLayoutSc
ope* layoutScope) |
194 { | 194 { |
195 if (selfNeedsLayout()) | 195 if (selfNeedsLayout()) |
196 return; | 196 return; |
197 | 197 |
198 setNeedsLayoutAndFullPaintInvalidation(MarkContainerChain, layoutScope); | 198 setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReason::SvgResource
Invalidated, MarkContainerChain, layoutScope); |
199 | 199 |
200 if (everHadLayout()) | 200 if (everHadLayout()) |
201 removeAllClientsFromCache(); | 201 removeAllClientsFromCache(); |
202 } | 202 } |
203 | 203 |
204 void LayoutSVGResourceContainer::registerResource() | 204 void LayoutSVGResourceContainer::registerResource() |
205 { | 205 { |
206 SVGDocumentExtensions& extensions = svgExtensionsFromElement(element()); | 206 SVGDocumentExtensions& extensions = svgExtensionsFromElement(element()); |
207 if (!extensions.hasPendingResource(m_id)) { | 207 if (!extensions.hasPendingResource(m_id)) { |
208 extensions.addResource(m_id, this); | 208 extensions.addResource(m_id, this); |
(...skipping 10 matching lines...) Expand all Loading... |
219 for (SVGDocumentExtensions::SVGPendingElements::const_iterator it = clients-
>begin(); it != end; ++it) { | 219 for (SVGDocumentExtensions::SVGPendingElements::const_iterator it = clients-
>begin(); it != end; ++it) { |
220 ASSERT((*it)->hasPendingResources()); | 220 ASSERT((*it)->hasPendingResources()); |
221 extensions.clearHasPendingResourcesIfPossible(*it); | 221 extensions.clearHasPendingResourcesIfPossible(*it); |
222 LayoutObject* layoutObject = (*it)->layoutObject(); | 222 LayoutObject* layoutObject = (*it)->layoutObject(); |
223 if (!layoutObject) | 223 if (!layoutObject) |
224 continue; | 224 continue; |
225 | 225 |
226 StyleDifference diff; | 226 StyleDifference diff; |
227 diff.setNeedsFullLayout(); | 227 diff.setNeedsFullLayout(); |
228 SVGResourcesCache::clientStyleChanged(layoutObject, diff, layoutObject->
styleRef()); | 228 SVGResourcesCache::clientStyleChanged(layoutObject, diff, layoutObject->
styleRef()); |
229 layoutObject->setNeedsLayoutAndFullPaintInvalidation(); | 229 layoutObject->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationR
eason::SvgResourceInvalidated); |
230 } | 230 } |
231 } | 231 } |
232 | 232 |
233 static inline void removeFromCacheAndInvalidateDependencies(LayoutObject* object
, bool needsLayout) | 233 static inline void removeFromCacheAndInvalidateDependencies(LayoutObject* object
, bool needsLayout) |
234 { | 234 { |
235 ASSERT(object); | 235 ASSERT(object); |
236 if (SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObj
ect(object)) { | 236 if (SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObj
ect(object)) { |
237 if (LayoutSVGResourceFilter* filter = resources->filter()) | 237 if (LayoutSVGResourceFilter* filter = resources->filter()) |
238 filter->removeClientFromCache(object); | 238 filter->removeClientFromCache(object); |
239 | 239 |
(...skipping 30 matching lines...) Expand all Loading... |
270 } | 270 } |
271 } | 271 } |
272 } | 272 } |
273 | 273 |
274 void LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation(Layo
utObject* object, bool needsLayout) | 274 void LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation(Layo
utObject* object, bool needsLayout) |
275 { | 275 { |
276 ASSERT(object); | 276 ASSERT(object); |
277 ASSERT(object->node()); | 277 ASSERT(object->node()); |
278 | 278 |
279 if (needsLayout && !object->documentBeingDestroyed()) | 279 if (needsLayout && !object->documentBeingDestroyed()) |
280 object->setNeedsLayoutAndFullPaintInvalidation(); | 280 object->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReason:
:SvgResourceInvalidated); |
281 | 281 |
282 removeFromCacheAndInvalidateDependencies(object, needsLayout); | 282 removeFromCacheAndInvalidateDependencies(object, needsLayout); |
283 | 283 |
284 // Invalidate resources in ancestor chain, if needed. | 284 // Invalidate resources in ancestor chain, if needed. |
285 LayoutObject* current = object->parent(); | 285 LayoutObject* current = object->parent(); |
286 while (current) { | 286 while (current) { |
287 removeFromCacheAndInvalidateDependencies(current, needsLayout); | 287 removeFromCacheAndInvalidateDependencies(current, needsLayout); |
288 | 288 |
289 if (current->isSVGResourceContainer()) { | 289 if (current->isSVGResourceContainer()) { |
290 // This will process the rest of the ancestors. | 290 // This will process the rest of the ancestors. |
291 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); | 291 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); |
292 break; | 292 break; |
293 } | 293 } |
294 | 294 |
295 current = current->parent(); | 295 current = current->parent(); |
296 } | 296 } |
297 } | 297 } |
298 | 298 |
299 } | 299 } |
OLD | NEW |