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

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

Issue 1083893002: The default for x1, y1 and y2 is 0% for LinearGradient (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Align with review comments Created 5 years, 8 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 | « LayoutTests/fast/svg/linear-gradient-default-length.html ('k') | no next file » | 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 ec7a890eef226f4b93f11e01ed7e8303236f8c75..8fb442732261a7e480b4ab700fc4b1f19359b5bf 100644
--- a/Source/core/svg/SVGLinearGradientElement.cpp
+++ b/Source/core/svg/SVGLinearGradientElement.cpp
@@ -37,6 +37,12 @@ inline SVGLinearGradientElement::SVGLinearGradientElement(Document& document)
, m_x2(SVGAnimatedLength::create(this, SVGNames::x2Attr, SVGLength::create(SVGLengthMode::Width), AllowNegativeLengths))
, m_y2(SVGAnimatedLength::create(this, SVGNames::y2Attr, SVGLength::create(SVGLengthMode::Height), AllowNegativeLengths))
{
+
+ // Spec: If the x1|y1|y2 attribute is not specified, the effect is as if a value of "0%" were specified.
+ m_x1->setDefaultValueAsString("0%");
+ m_y1->setDefaultValueAsString("0%");
+ m_y2->setDefaultValueAsString("0%");
+
// Spec: If the x2 attribute is not specified, the effect is as if a value of "100%" were specified.
m_x2->setDefaultValueAsString("100%");
« no previous file with comments | « LayoutTests/fast/svg/linear-gradient-default-length.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698