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

Unified Diff: Source/core/svg/SVGPatternElement.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/SVGLinearGradientElement.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/SVGPatternElement.cpp
diff --git a/Source/core/svg/SVGPatternElement.cpp b/Source/core/svg/SVGPatternElement.cpp
index 3955d573e8c9da9eaa11045859ad563526a93328..35f290f28c45889fc0e9fdf4e74b25342280c7b1 100644
--- a/Source/core/svg/SVGPatternElement.cpp
+++ b/Source/core/svg/SVGPatternElement.cpp
@@ -168,31 +168,31 @@ RenderObject* SVGPatternElement::createRenderer(RenderStyle*)
static void setPatternAttributes(const SVGPatternElement* element, PatternAttributes& attributes)
{
- if (!attributes.hasX() && element->hasAttribute(SVGNames::xAttr))
+ if (!attributes.hasX() && element->x()->isSpecified())
attributes.setX(element->x()->currentValue());
- if (!attributes.hasY() && element->hasAttribute(SVGNames::yAttr))
+ if (!attributes.hasY() && element->y()->isSpecified())
attributes.setY(element->y()->currentValue());
- if (!attributes.hasWidth() && element->hasAttribute(SVGNames::widthAttr))
+ if (!attributes.hasWidth() && element->width()->isSpecified())
attributes.setWidth(element->width()->currentValue());
- if (!attributes.hasHeight() && element->hasAttribute(SVGNames::heightAttr))
+ if (!attributes.hasHeight() && element->height()->isSpecified())
attributes.setHeight(element->height()->currentValue());
- if (!attributes.hasViewBox() && element->hasAttribute(SVGNames::viewBoxAttr) && element->viewBox()->currentValue()->isValid())
+ if (!attributes.hasViewBox() && element->viewBox()->isSpecified() && element->viewBox()->currentValue()->isValid())
attributes.setViewBox(element->viewBox()->currentValue()->value());
- if (!attributes.hasPreserveAspectRatio() && element->hasAttribute(SVGNames::preserveAspectRatioAttr))
+ if (!attributes.hasPreserveAspectRatio() && element->preserveAspectRatioSpecified())
attributes.setPreserveAspectRatio(element->preserveAspectRatioCurrentValue());
- if (!attributes.hasPatternUnits() && element->hasAttribute(SVGNames::patternUnitsAttr))
+ if (!attributes.hasPatternUnits() && element->patternUnitsSpecified())
attributes.setPatternUnits(element->patternUnitsCurrentValue());
- if (!attributes.hasPatternContentUnits() && element->hasAttribute(SVGNames::patternContentUnitsAttr))
+ if (!attributes.hasPatternContentUnits() && element->patternContentUnitsSpecified())
attributes.setPatternContentUnits(element->patternContentUnitsCurrentValue());
- if (!attributes.hasPatternTransform() && element->hasAttribute(SVGNames::patternTransformAttr)) {
+ if (!attributes.hasPatternTransform() && element->patternTransformSpecified()) {
AffineTransform transform;
element->patternTransformCurrentValue().concatenate(transform);
attributes.setPatternTransform(transform);
« no previous file with comments | « Source/core/svg/SVGLinearGradientElement.cpp ('k') | Source/core/svg/SVGRadialGradientElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698