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

Unified Diff: Source/core/svg/SVGRadialGradientElement.cpp

Issue 135913002: Do refactor in collectGradientAttributes() and renderStyleForLengthResolve() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/svg/SVGRadialGradientElement.cpp
diff --git a/Source/core/svg/SVGRadialGradientElement.cpp b/Source/core/svg/SVGRadialGradientElement.cpp
index d8fe2a87533664771aa6a0172e1ccf679ad55592..d70807cf15c956597ae025935ad6635322e11736 100644
--- a/Source/core/svg/SVGRadialGradientElement.cpp
+++ b/Source/core/svg/SVGRadialGradientElement.cpp
@@ -133,11 +133,9 @@ RenderObject* SVGRadialGradientElement::createRenderer(RenderStyle*)
bool SVGRadialGradientElement::collectGradientAttributes(RadialGradientAttributes& attributes)
{
HashSet<SVGGradientElement*> processedGradients;
-
- bool isRadial = true;
SVGGradientElement* current = this;
- while (current) {
+ do {
if (!current->renderer())
return false;
@@ -159,7 +157,7 @@ bool SVGRadialGradientElement::collectGradientAttributes(RadialGradientAttribute
attributes.setStops(stops);
}
- if (isRadial) {
+ if (current->hasTagName(SVGNames::radialGradientTag)) {
SVGRadialGradientElement* radial = toSVGRadialGradientElement(current);
if (!attributes.hasCx() && current->hasAttribute(SVGNames::cxAttr))
@@ -193,11 +191,9 @@ bool SVGRadialGradientElement::collectGradientAttributes(RadialGradientAttribute
current = 0;
break;
}
-
- isRadial = current->hasTagName(SVGNames::radialGradientTag);
} else
current = 0;
- }
+ } while (current);
// Handle default values for fx/fy
if (!attributes.hasFx())
« Source/core/svg/SVGLinearGradientElement.cpp ('K') | « Source/core/svg/SVGLinearGradientElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698