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

Unified Diff: third_party/WebKit/Source/core/svg/graphics/filters/SVGFilterBuilder.cpp

Issue 1393633007: Always populate the node map in SVGFilterBuilder if one exists (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/display-none-filter-primitive-expected.txt ('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/svg/graphics/filters/SVGFilterBuilder.cpp
diff --git a/third_party/WebKit/Source/core/svg/graphics/filters/SVGFilterBuilder.cpp b/third_party/WebKit/Source/core/svg/graphics/filters/SVGFilterBuilder.cpp
index 36e291aa67f9e3aebdeabbf9351a1cd8883301e9..043a83efcc7df5f0e62bc97c26180380985cd137 100644
--- a/third_party/WebKit/Source/core/svg/graphics/filters/SVGFilterBuilder.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/filters/SVGFilterBuilder.cpp
@@ -44,7 +44,7 @@ void SVGFilterGraphNodeMap::addPrimitive(LayoutObject* object, PassRefPtrWillBeR
// The effect must be a newly created filter effect.
ASSERT(!m_effectReferences.contains(effect));
- ASSERT(object && !m_effectRenderer.contains(object));
+ ASSERT(!object || !m_effectRenderer.contains(object));
m_effectReferences.add(effect, FilterEffectSet());
unsigned numberOfInputEffects = effect->inputEffects().size();
@@ -55,7 +55,11 @@ void SVGFilterGraphNodeMap::addPrimitive(LayoutObject* object, PassRefPtrWillBeR
for (unsigned i = 0; i < numberOfInputEffects; ++i)
effectReferences(effect->inputEffect(i)).add(effect.get());
- m_effectRenderer.add(object, effect.get());
+ // If object is null, that means the element isn't attached for some
+ // reason, which in turn mean that certain types of invalidation will not
+ // work (the LayoutObject -> FilterEffect mapping will not be defined).
+ if (object)
+ m_effectRenderer.add(object, effect.get());
}
void SVGFilterGraphNodeMap::invalidateDependentEffects(FilterEffect* effect)
@@ -130,8 +134,9 @@ void SVGFilterBuilder::buildGraph(Filter* filter, SVGFilterElement& filterElemen
if (!effect)
continue;
- if (m_nodeMap && effectElement->layoutObject())
+ if (m_nodeMap)
m_nodeMap->addPrimitive(effectElement->layoutObject(), effect);
+
effectElement->setStandardAttributes(effect.get());
effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(effectElement, filterElement.primitiveUnits()->currentValue()->enumValue(), referenceBox));
EColorInterpolation colorInterpolation = colorInterpolationForElement(*effectElement, filterColorInterpolation);
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/filters/display-none-filter-primitive-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698