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

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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGRadialGradientElement.cpp
diff --git a/Source/core/svg/SVGRadialGradientElement.cpp b/Source/core/svg/SVGRadialGradientElement.cpp
index d8fe2a87533664771aa6a0172e1ccf679ad55592..71961cd1dfd21368d3d536c2fa2bee917452ae62 100644
--- a/Source/core/svg/SVGRadialGradientElement.cpp
+++ b/Source/core/svg/SVGRadialGradientElement.cpp
@@ -134,7 +134,6 @@ bool SVGRadialGradientElement::collectGradientAttributes(RadialGradientAttribute
{
HashSet<SVGGradientElement*> processedGradients;
- bool isRadial = true;
SVGGradientElement* current = this;
while (current) {
@@ -159,28 +158,6 @@ bool SVGRadialGradientElement::collectGradientAttributes(RadialGradientAttribute
attributes.setStops(stops);
}
- if (isRadial) {
- SVGRadialGradientElement* radial = toSVGRadialGradientElement(current);
-
- if (!attributes.hasCx() && current->hasAttribute(SVGNames::cxAttr))
- attributes.setCx(radial->cx()->currentValue());
-
- if (!attributes.hasCy() && current->hasAttribute(SVGNames::cyAttr))
- attributes.setCy(radial->cy()->currentValue());
-
- if (!attributes.hasR() && current->hasAttribute(SVGNames::rAttr))
- attributes.setR(radial->r()->currentValue());
-
- if (!attributes.hasFx() && current->hasAttribute(SVGNames::fxAttr))
- attributes.setFx(radial->fx()->currentValue());
-
- if (!attributes.hasFy() && current->hasAttribute(SVGNames::fyAttr))
- attributes.setFy(radial->fy()->currentValue());
-
- if (!attributes.hasFr() && current->hasAttribute(SVGNames::frAttr))
- attributes.setFr(radial->fr()->currentValue());
- }
-
processedGradients.add(current);
// Respect xlink:href, take attributes from referenced element
@@ -194,7 +171,27 @@ bool SVGRadialGradientElement::collectGradientAttributes(RadialGradientAttribute
break;
}
- isRadial = current->hasTagName(SVGNames::radialGradientTag);
+ if (current->hasTagName(SVGNames::radialGradientTag)) {
gyuyoung-inactive 2014/01/13 16:12:13 This moving do wrong behavior. I will update this
+ SVGRadialGradientElement* radial = toSVGRadialGradientElement(current);
+
+ if (!attributes.hasCx() && current->hasAttribute(SVGNames::cxAttr))
+ attributes.setCx(radial->cx()->currentValue());
+
+ if (!attributes.hasCy() && current->hasAttribute(SVGNames::cyAttr))
+ attributes.setCy(radial->cy()->currentValue());
+
+ if (!attributes.hasR() && current->hasAttribute(SVGNames::rAttr))
+ attributes.setR(radial->r()->currentValue());
+
+ if (!attributes.hasFx() && current->hasAttribute(SVGNames::fxAttr))
+ attributes.setFx(radial->fx()->currentValue());
+
+ if (!attributes.hasFy() && current->hasAttribute(SVGNames::fyAttr))
+ attributes.setFy(radial->fy()->currentValue());
+
+ if (!attributes.hasFr() && current->hasAttribute(SVGNames::frAttr))
+ attributes.setFr(radial->fr()->currentValue());
+ }
} else
current = 0;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698