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

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

Issue 2749593002: Remove argument to LayoutSVGResourceGradient::collectGradientAttributes (Closed)
Patch Set: Rebase Created 3 years, 9 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: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceGradient.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceGradient.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceGradient.cpp
index 7f917dbfc86c1f1ecd10c3446d8a4894e22c57d9..26070522520a2c723f83a25b15a1cdd56995b522 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceGradient.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceGradient.cpp
@@ -52,21 +52,13 @@ SVGPaintServer LayoutSVGResourceGradient::preparePaintServer(
const LayoutObject& object) {
clearInvalidationMask();
- // Be sure to synchronize all SVG properties on the gradientElement _before_
- // processing any further. Otherwhise the call to collectGradientAttributes()
- // in createTileImage(), may cause the SVG DOM property synchronization to
- // kick in, which causes removeAllClientsFromCache() to be called, which in
- // turn deletes our GradientData object! Leaving out the line below will cause
- // svg/dynamic-updates/SVG*GradientElement-svgdom* to crash.
- SVGGradientElement* gradientElement = toSVGGradientElement(element());
- if (!gradientElement)
- return SVGPaintServer::invalid();
-
+ // Validate gradient DOM state before building the actual
+ // gradient. This should avoid tearing down the gradient we're
+ // currently working on. Preferably the state validation should have
+ // no side-effects though.
if (m_shouldCollectGradientAttributes) {
- gradientElement->synchronizeAnimatedSVGAttribute(anyQName());
- if (!collectGradientAttributes(gradientElement))
+ if (!collectGradientAttributes())
return SVGPaintServer::invalid();
-
m_shouldCollectGradientAttributes = false;
}

Powered by Google App Engine
This is Rietveld 408576698