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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 extensions.addResource(m_id, this); | 231 extensions.addResource(m_id, this); |
232 return; | 232 return; |
233 } | 233 } |
234 | 234 |
235 OwnPtrWillBeRawPtr<SVGDocumentExtensions::SVGPendingElements> clients(extens ions.removePendingResource(m_id)); | 235 OwnPtrWillBeRawPtr<SVGDocumentExtensions::SVGPendingElements> clients(extens ions.removePendingResource(m_id)); |
236 | 236 |
237 // Cache us with the new id. | 237 // Cache us with the new id. |
238 extensions.addResource(m_id, this); | 238 extensions.addResource(m_id, this); |
239 | 239 |
240 // Update cached resources of pending clients. | 240 // Update cached resources of pending clients. |
241 const SVGDocumentExtensions::SVGPendingElements::const_iterator end = client s->end(); | 241 for (const auto& pendingClient : *clients) { |
242 for (SVGDocumentExtensions::SVGPendingElements::const_iterator it = clients- >begin(); it != end; ++it) { | 242 ASSERT(pendingClient->hasPendingResources()); |
243 ASSERT((*it)->hasPendingResources()); | 243 extensions.clearHasPendingResourcesIfPossible(pendingClient); |
244 extensions.clearHasPendingResourcesIfPossible(*it); | 244 LayoutObject* layoutObject = pendingClient->layoutObject(); |
245 LayoutObject* layoutObject = (*it)->layoutObject(); | |
246 if (!layoutObject) | 245 if (!layoutObject) |
247 continue; | 246 continue; |
248 | 247 |
248 const ComputedStyle& style = layoutObject->styleRef(); | |
249 | |
249 // If the client has a layer (is a non-SVGElement) we need to signal | 250 // If the client has a layer (is a non-SVGElement) we need to signal |
250 // invalidation in the same way as is done in markAllClientLayersForInva lidation above. | 251 // invalidation in the same way as is done in markAllClientLayersForInva lidation above. |
251 if (layoutObject->hasLayer() && resourceType() == FilterResourceType) { | 252 if (layoutObject->hasLayer() && resourceType() == FilterResourceType) { |
252 toLayoutBoxModelObject(layoutObject)->layer()->filterNeedsPaintInval idation(); | 253 if (style.hasFilter()) |
253 continue; | 254 toLayoutBoxModelObject(layoutObject)->layer()->filterNeedsPaintI nvalidation(); |
255 // If this is the SVG root, we could have both 'filter' and | |
Stephen White
2015/09/25 14:22:22
Should we log a bug for this case? It seems like a
fs
2015/09/25 14:50:40
I don't think that's necessary - when the properti
| |
256 // '-webkit-filter' applied, so we need to do the invalidation | |
257 // below as well, unless we can optimistically determine that | |
258 // 'filter' does not apply to the element in question. | |
259 if (!layoutObject->isSVGRoot() || !style.svgStyle().hasFilter()) | |
260 continue; | |
254 } | 261 } |
255 | 262 |
256 StyleDifference diff; | 263 StyleDifference diff; |
257 diff.setNeedsFullLayout(); | 264 diff.setNeedsFullLayout(); |
258 SVGResourcesCache::clientStyleChanged(layoutObject, diff, layoutObject-> styleRef()); | 265 SVGResourcesCache::clientStyleChanged(layoutObject, diff, style); |
259 layoutObject->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationR eason::SvgResourceInvalidated); | 266 layoutObject->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationR eason::SvgResourceInvalidated); |
260 } | 267 } |
261 } | 268 } |
262 | 269 |
263 static inline void removeFromCacheAndInvalidateDependencies(LayoutObject* object , bool needsLayout) | 270 static inline void removeFromCacheAndInvalidateDependencies(LayoutObject* object , bool needsLayout) |
264 { | 271 { |
265 ASSERT(object); | 272 ASSERT(object); |
266 if (SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObj ect(object)) { | 273 if (SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObj ect(object)) { |
267 if (LayoutSVGResourceFilter* filter = resources->filter()) | 274 if (LayoutSVGResourceFilter* filter = resources->filter()) |
268 filter->removeClientFromCache(object); | 275 filter->removeClientFromCache(object); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 // This will process the rest of the ancestors. | 326 // This will process the rest of the ancestors. |
320 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); | 327 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); |
321 break; | 328 break; |
322 } | 329 } |
323 | 330 |
324 current = current->parent(); | 331 current = current->parent(); |
325 } | 332 } |
326 } | 333 } |
327 | 334 |
328 } | 335 } |
OLD | NEW |