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

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

Issue 141793002: Allow determining if an SVG value has been specified (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase again. 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/SVGPatternElement.cpp ('k') | Source/core/svg/properties/NewSVGAnimatedProperty.h » ('j') | 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 1a65657773714ad9404494e9800ecd69e667da15..a84c5b61d22a1a1ba07c7899b386b12d18c69a59 100644
--- a/Source/core/svg/SVGRadialGradientElement.cpp
+++ b/Source/core/svg/SVGRadialGradientElement.cpp
@@ -132,13 +132,13 @@ RenderObject* SVGRadialGradientElement::createRenderer(RenderStyle*)
static void setGradientAttributes(SVGGradientElement* element, RadialGradientAttributes& attributes, bool isRadial = true)
{
- if (!attributes.hasSpreadMethod() && element->hasAttribute(SVGNames::spreadMethodAttr))
+ if (!attributes.hasSpreadMethod() && element->spreadMethodSpecified())
attributes.setSpreadMethod(element->spreadMethodCurrentValue());
- if (!attributes.hasGradientUnits() && element->hasAttribute(SVGNames::gradientUnitsAttr))
+ if (!attributes.hasGradientUnits() && element->gradientUnitsSpecified())
attributes.setGradientUnits(element->gradientUnitsCurrentValue());
- if (!attributes.hasGradientTransform() && element->hasAttribute(SVGNames::gradientTransformAttr)) {
+ if (!attributes.hasGradientTransform() && element->gradientTransformSpecified()) {
AffineTransform transform;
element->gradientTransformCurrentValue().concatenate(transform);
attributes.setGradientTransform(transform);
@@ -153,22 +153,22 @@ static void setGradientAttributes(SVGGradientElement* element, RadialGradientAtt
if (isRadial) {
SVGRadialGradientElement* radial = toSVGRadialGradientElement(element);
- if (!attributes.hasCx() && element->hasAttribute(SVGNames::cxAttr))
+ if (!attributes.hasCx() && radial->cx()->isSpecified())
attributes.setCx(radial->cx()->currentValue());
- if (!attributes.hasCy() && element->hasAttribute(SVGNames::cyAttr))
+ if (!attributes.hasCy() && radial->cy()->isSpecified())
attributes.setCy(radial->cy()->currentValue());
- if (!attributes.hasR() && element->hasAttribute(SVGNames::rAttr))
+ if (!attributes.hasR() && radial->r()->isSpecified())
attributes.setR(radial->r()->currentValue());
- if (!attributes.hasFx() && element->hasAttribute(SVGNames::fxAttr))
+ if (!attributes.hasFx() && radial->fx()->isSpecified())
attributes.setFx(radial->fx()->currentValue());
- if (!attributes.hasFy() && element->hasAttribute(SVGNames::fyAttr))
+ if (!attributes.hasFy() && radial->fy()->isSpecified())
attributes.setFy(radial->fy()->currentValue());
- if (!attributes.hasFr() && element->hasAttribute(SVGNames::frAttr))
+ if (!attributes.hasFr() && radial->fr()->isSpecified())
attributes.setFr(radial->fr()->currentValue());
}
}
« no previous file with comments | « Source/core/svg/SVGPatternElement.cpp ('k') | Source/core/svg/properties/NewSVGAnimatedProperty.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698