Chromium Code Reviews| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 extensions.clearHasPendingResourcesIfPossible(pendingClient); | 238 extensions.clearHasPendingResourcesIfPossible(pendingClient); |
| 239 LayoutObject* layoutObject = pendingClient->layoutObject(); | 239 LayoutObject* layoutObject = pendingClient->layoutObject(); |
| 240 if (!layoutObject) | 240 if (!layoutObject) |
| 241 continue; | 241 continue; |
| 242 | 242 |
| 243 const ComputedStyle& style = layoutObject->styleRef(); | 243 const ComputedStyle& style = layoutObject->styleRef(); |
| 244 | 244 |
| 245 // If the client has a layer (is a non-SVGElement) we need to signal | 245 // If the client has a layer (is a non-SVGElement) we need to signal |
| 246 // invalidation in the same way as is done in markAllResourceClientsForI nvalidation above. | 246 // invalidation in the same way as is done in markAllResourceClientsForI nvalidation above. |
| 247 if (layoutObject->hasLayer() && resourceType() == FilterResourceType) { | 247 if (layoutObject->hasLayer() && resourceType() == FilterResourceType) { |
| 248 if (style.hasFilter()) | 248 if (!style.hasFilter()) |
| 249 toLayoutBoxModelObject(layoutObject)->layer()->filterNeedsPaintI nvalidation(); | |
| 250 // If this is the SVG root, we could have both 'filter' and | |
| 251 // '-webkit-filter' applied, so we need to do the invalidation | |
| 252 // below as well, unless we can optimistically determine that | |
| 253 // 'filter' does not apply to the element in question. | |
| 254 if (!layoutObject->isSVGRoot() || !style.svgStyle().hasFilter()) | |
| 255 continue; | 249 continue; |
| 250 toLayoutBoxModelObject(layoutObject)->layer()->filterNeedsPaintInval idation(); | |
| 251 if (!layoutObject->isSVGRoot()) | |
|
chrishtr
2016/06/16 04:55:21
DCHECK(layoutObject->isSVGRoot())
fs
2016/06/16 23:06:41
|layoutObject| can be a non-SVG element here. Or d
chrishtr
2016/06/17 06:33:45
Right, ok. Ignore my comment then.
| |
| 252 continue; | |
| 253 // A root SVG element with a filter, however, still needs to run | |
| 254 // the full invalidation step below. | |
| 256 } | 255 } |
| 257 | 256 |
| 258 StyleDifference diff; | 257 StyleDifference diff; |
| 259 diff.setNeedsFullLayout(); | 258 diff.setNeedsFullLayout(); |
| 260 SVGResourcesCache::clientStyleChanged(layoutObject, diff, style); | 259 SVGResourcesCache::clientStyleChanged(layoutObject, diff, style); |
| 261 layoutObject->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationR eason::SvgResourceInvalidated); | 260 layoutObject->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationR eason::SvgResourceInvalidated); |
| 262 } | 261 } |
| 263 } | 262 } |
| 264 | 263 |
| 265 static inline void removeFromCacheAndInvalidateDependencies(LayoutObject* object , bool needsLayout) | 264 static inline void removeFromCacheAndInvalidateDependencies(LayoutObject* object , bool needsLayout) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 // This will process the rest of the ancestors. | 320 // This will process the rest of the ancestors. |
| 322 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); | 321 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); |
| 323 break; | 322 break; |
| 324 } | 323 } |
| 325 | 324 |
| 326 current = current->parent(); | 325 current = current->parent(); |
| 327 } | 326 } |
| 328 } | 327 } |
| 329 | 328 |
| 330 } // namespace blink | 329 } // namespace blink |
| OLD | NEW |