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

Unified Diff: Source/core/svg/SVGLinearGradientElement.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
« no previous file with comments | « Source/core/svg/SVGLengthContext.cpp ('k') | Source/core/svg/SVGRadialGradientElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGLinearGradientElement.cpp
diff --git a/Source/core/svg/SVGLinearGradientElement.cpp b/Source/core/svg/SVGLinearGradientElement.cpp
index 19df4d50b46b7eedc0f0ac5a5057ca7f93c6c38b..72e584755ccd19f2aff7be8627c2eb3a868d0082 100644
--- a/Source/core/svg/SVGLinearGradientElement.cpp
+++ b/Source/core/svg/SVGLinearGradientElement.cpp
@@ -119,10 +119,9 @@ bool SVGLinearGradientElement::collectGradientAttributes(LinearGradientAttribute
{
HashSet<SVGGradientElement*> processedGradients;
- bool isLinear = true;
SVGGradientElement* current = this;
- while (current) {
+ do {
if (!current->renderer())
return false;
@@ -144,7 +143,7 @@ bool SVGLinearGradientElement::collectGradientAttributes(LinearGradientAttribute
attributes.setStops(stops);
}
- if (isLinear) {
+ if (current->hasTagName(SVGNames::linearGradientTag)) {
SVGLinearGradientElement* linear = toSVGLinearGradientElement(current);
if (!attributes.hasX1() && current->hasAttribute(SVGNames::x1Attr))
@@ -172,11 +171,9 @@ bool SVGLinearGradientElement::collectGradientAttributes(LinearGradientAttribute
current = 0;
break;
}
-
- isLinear = current->hasTagName(SVGNames::linearGradientTag);
} else
current = 0;
Stephen Chennney 2014/01/14 13:44:16 Need braces here.
- }
+ } while (current);
return true;
}
« no previous file with comments | « Source/core/svg/SVGLengthContext.cpp ('k') | Source/core/svg/SVGRadialGradientElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698