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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/svg/linear-gradient-default-length.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 19 matching lines...) Expand all
30 30
31 namespace blink { 31 namespace blink {
32 32
33 inline SVGLinearGradientElement::SVGLinearGradientElement(Document& document) 33 inline SVGLinearGradientElement::SVGLinearGradientElement(Document& document)
34 : SVGGradientElement(SVGNames::linearGradientTag, document) 34 : SVGGradientElement(SVGNames::linearGradientTag, document)
35 , m_x1(SVGAnimatedLength::create(this, SVGNames::x1Attr, SVGLength::create(S VGLengthMode::Width), AllowNegativeLengths)) 35 , m_x1(SVGAnimatedLength::create(this, SVGNames::x1Attr, SVGLength::create(S VGLengthMode::Width), AllowNegativeLengths))
36 , m_y1(SVGAnimatedLength::create(this, SVGNames::y1Attr, SVGLength::create(S VGLengthMode::Height), AllowNegativeLengths)) 36 , m_y1(SVGAnimatedLength::create(this, SVGNames::y1Attr, SVGLength::create(S VGLengthMode::Height), AllowNegativeLengths))
37 , m_x2(SVGAnimatedLength::create(this, SVGNames::x2Attr, SVGLength::create(S VGLengthMode::Width), AllowNegativeLengths)) 37 , m_x2(SVGAnimatedLength::create(this, SVGNames::x2Attr, SVGLength::create(S VGLengthMode::Width), AllowNegativeLengths))
38 , m_y2(SVGAnimatedLength::create(this, SVGNames::y2Attr, SVGLength::create(S VGLengthMode::Height), AllowNegativeLengths)) 38 , m_y2(SVGAnimatedLength::create(this, SVGNames::y2Attr, SVGLength::create(S VGLengthMode::Height), AllowNegativeLengths))
39 { 39 {
40
41 // Spec: If the x1|y1|y2 attribute is not specified, the effect is as if a v alue of "0%" were specified.
42 m_x1->setDefaultValueAsString("0%");
43 m_y1->setDefaultValueAsString("0%");
44 m_y2->setDefaultValueAsString("0%");
45
40 // Spec: If the x2 attribute is not specified, the effect is as if a value o f "100%" were specified. 46 // Spec: If the x2 attribute is not specified, the effect is as if a value o f "100%" were specified.
41 m_x2->setDefaultValueAsString("100%"); 47 m_x2->setDefaultValueAsString("100%");
42 48
43 addToPropertyMap(m_x1); 49 addToPropertyMap(m_x1);
44 addToPropertyMap(m_y1); 50 addToPropertyMap(m_y1);
45 addToPropertyMap(m_x2); 51 addToPropertyMap(m_x2);
46 addToPropertyMap(m_y2); 52 addToPropertyMap(m_y2);
47 } 53 }
48 54
49 DEFINE_TRACE(SVGLinearGradientElement) 55 DEFINE_TRACE(SVGLinearGradientElement)
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 170
165 bool SVGLinearGradientElement::selfHasRelativeLengths() const 171 bool SVGLinearGradientElement::selfHasRelativeLengths() const
166 { 172 {
167 return m_x1->currentValue()->isRelative() 173 return m_x1->currentValue()->isRelative()
168 || m_y1->currentValue()->isRelative() 174 || m_y1->currentValue()->isRelative()
169 || m_x2->currentValue()->isRelative() 175 || m_x2->currentValue()->isRelative()
170 || m_y2->currentValue()->isRelative(); 176 || m_y2->currentValue()->isRelative();
171 } 177 }
172 178
173 } // namespace blink 179 } // namespace blink
OLDNEW
« 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