Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(628)

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp

Issue 1364403003: Refine invalidation of filter clients in LayoutSVGResourceContainer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop unused misspellings. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/filters/filter-on-svg-root-w-layer-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
index 8b46803e094506c34d4b7c6286ce423f1d943d8e..dc587c8beaab0eb5f8d46e78b0e6451ce4da8cf3 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
@@ -238,24 +238,31 @@ void LayoutSVGResourceContainer::registerResource()
extensions.addResource(m_id, this);
// Update cached resources of pending clients.
- const SVGDocumentExtensions::SVGPendingElements::const_iterator end = clients->end();
- for (SVGDocumentExtensions::SVGPendingElements::const_iterator it = clients->begin(); it != end; ++it) {
- ASSERT((*it)->hasPendingResources());
- extensions.clearHasPendingResourcesIfPossible(*it);
- LayoutObject* layoutObject = (*it)->layoutObject();
+ for (const auto& pendingClient : *clients) {
+ ASSERT(pendingClient->hasPendingResources());
+ extensions.clearHasPendingResourcesIfPossible(pendingClient);
+ LayoutObject* layoutObject = pendingClient->layoutObject();
if (!layoutObject)
continue;
+ const ComputedStyle& style = layoutObject->styleRef();
+
// If the client has a layer (is a non-SVGElement) we need to signal
// invalidation in the same way as is done in markAllClientLayersForInvalidation above.
if (layoutObject->hasLayer() && resourceType() == FilterResourceType) {
- toLayoutBoxModelObject(layoutObject)->layer()->filterNeedsPaintInvalidation();
- continue;
+ if (style.hasFilter())
+ toLayoutBoxModelObject(layoutObject)->layer()->filterNeedsPaintInvalidation();
+ // If this is the SVG root, we could have both 'filter' and
+ // '-webkit-filter' applied, so we need to do the invalidation
+ // below as well, unless we can optimistically determine that
+ // 'filter' does not apply to the element in question.
+ if (!layoutObject->isSVGRoot() || !style.svgStyle().hasFilter())
+ continue;
}
StyleDifference diff;
diff.setNeedsFullLayout();
- SVGResourcesCache::clientStyleChanged(layoutObject, diff, layoutObject->styleRef());
+ SVGResourcesCache::clientStyleChanged(layoutObject, diff, style);
layoutObject->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReason::SvgResourceInvalidated);
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/filters/filter-on-svg-root-w-layer-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698