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

Unified Diff: Source/core/svg/SVGLinearGradientElement.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
Index: Source/core/svg/SVGLinearGradientElement.cpp
diff --git a/Source/core/svg/SVGLinearGradientElement.cpp b/Source/core/svg/SVGLinearGradientElement.cpp
index 8a596e44944328a425c13512bd5d2d1486448084..82d0d6c325988672f778f8d91058ddcb1d7e1f15 100644
--- a/Source/core/svg/SVGLinearGradientElement.cpp
+++ b/Source/core/svg/SVGLinearGradientElement.cpp
@@ -117,13 +117,13 @@ RenderObject* SVGLinearGradientElement::createRenderer(RenderStyle*)
static void setGradientAttributes(SVGGradientElement* element, LinearGradientAttributes& attributes, bool isLinear = 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);
@@ -138,16 +138,16 @@ static void setGradientAttributes(SVGGradientElement* element, LinearGradientAtt
if (isLinear) {
SVGLinearGradientElement* linear = toSVGLinearGradientElement(element);
- if (!attributes.hasX1() && element->hasAttribute(SVGNames::x1Attr))
+ if (!attributes.hasX1() && linear->x1()->isSpecified())
attributes.setX1(linear->x1()->currentValue());
- if (!attributes.hasY1() && element->hasAttribute(SVGNames::y1Attr))
+ if (!attributes.hasY1() && linear->y1()->isSpecified())
attributes.setY1(linear->y1()->currentValue());
- if (!attributes.hasX2() && element->hasAttribute(SVGNames::x2Attr))
+ if (!attributes.hasX2() && linear->x2()->isSpecified())
attributes.setX2(linear->x2()->currentValue());
- if (!attributes.hasY2() && element->hasAttribute(SVGNames::y2Attr))
+ if (!attributes.hasY2() && linear->y2()->isSpecified())
attributes.setY2(linear->y2()->currentValue());
}
}
« no previous file with comments | « LayoutTests/svg/animations/no-attr-radialgradient-spreadmethod-expected.svg ('k') | Source/core/svg/SVGPatternElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698