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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGLinearGradientElement.cpp

Issue 1491023003: Refactor SVGAnimatedLength negative values mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace SVGLengthNegativeValuesMode enum with bool Created 5 years 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
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 14 matching lines...) Expand all
25 #include "core/svg/SVGLinearGradientElement.h" 25 #include "core/svg/SVGLinearGradientElement.h"
26 26
27 #include "core/layout/svg/LayoutSVGResourceLinearGradient.h" 27 #include "core/layout/svg/LayoutSVGResourceLinearGradient.h"
28 #include "core/svg/LinearGradientAttributes.h" 28 #include "core/svg/LinearGradientAttributes.h"
29 #include "core/svg/SVGLength.h" 29 #include "core/svg/SVGLength.h"
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)))
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)))
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)))
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)))
39 { 39 {
40 40
41 // Spec: If the x1|y1|y2 attribute is not specified, the effect is as if a v alue of "0%" were specified. 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%"); 42 m_x1->setDefaultValueAsString("0%");
43 m_y1->setDefaultValueAsString("0%"); 43 m_y1->setDefaultValueAsString("0%");
44 m_y2->setDefaultValueAsString("0%"); 44 m_y2->setDefaultValueAsString("0%");
45 45
46 // 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.
47 m_x2->setDefaultValueAsString("100%"); 47 m_x2->setDefaultValueAsString("100%");
48 48
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 160
161 bool SVGLinearGradientElement::selfHasRelativeLengths() const 161 bool SVGLinearGradientElement::selfHasRelativeLengths() const
162 { 162 {
163 return m_x1->currentValue()->isRelative() 163 return m_x1->currentValue()->isRelative()
164 || m_y1->currentValue()->isRelative() 164 || m_y1->currentValue()->isRelative()
165 || m_x2->currentValue()->isRelative() 165 || m_x2->currentValue()->isRelative()
166 || m_y2->currentValue()->isRelative(); 166 || m_y2->currentValue()->isRelative();
167 } 167 }
168 168
169 } // namespace blink 169 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGLineElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGMarkerElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698