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

Unified Diff: Source/core/layout/svg/SVGResourcesCache.cpp

Issue 1068073005: Handle layer clients in LayoutSVGResourceContainer::registerResource (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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
Index: Source/core/layout/svg/SVGResourcesCache.cpp
diff --git a/Source/core/layout/svg/SVGResourcesCache.cpp b/Source/core/layout/svg/SVGResourcesCache.cpp
index d58b141e3e78a65a0e2c7808e9ab13784c6b63c9..a1079ffc45a392a357146c8e1c76c25c551974aa 100644
--- a/Source/core/layout/svg/SVGResourcesCache.cpp
+++ b/Source/core/layout/svg/SVGResourcesCache.cpp
@@ -116,7 +116,6 @@ void SVGResourcesCache::clientStyleChanged(LayoutObject* layoutObject, StyleDiff
{
ASSERT(layoutObject);
ASSERT(layoutObject->node());
- ASSERT(layoutObject->node()->isSVGElement());
if (!diff.hasDifference() || !layoutObject->parent())
return;
@@ -125,6 +124,10 @@ void SVGResourcesCache::clientStyleChanged(LayoutObject* layoutObject, StyleDiff
if (layoutObject->isSVGResourceFilterPrimitive() && !diff.needsLayout())
return;
+ // If it's not an SVGElement, we can leave early because none of the below will have any effect.
+ if (!layoutObject->node()->isSVGElement())
+ return;
+
// Dynamic changes of CSS properties like 'clip-path' may require us to recompute the associated resources for a layoutObject.
// FIXME: Avoid passing in a useless StyleDifference, but instead compare oldStyle/newStyle to see which resources changed
// to be able to selectively rebuild individual resources, instead of all of them.

Powered by Google App Engine
This is Rietveld 408576698