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

Side by Side Diff: Source/core/svg/SVGMarkerElement.cpp

Issue 966923003: Make SVGLengthMode an enum class (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGLinearGradientElement.cpp ('k') | Source/core/svg/SVGMaskElement.cpp » ('j') | 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, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org> 2 * Copyright (C) 2004, 2005, 2006, 2007, 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) Research In Motion Limited 2009-2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 24 matching lines...) Expand all
35 if (entries.isEmpty()) { 35 if (entries.isEmpty()) {
36 entries.append(std::make_pair(SVGMarkerUnitsUserSpaceOnUse, "userSpaceOn Use")); 36 entries.append(std::make_pair(SVGMarkerUnitsUserSpaceOnUse, "userSpaceOn Use"));
37 entries.append(std::make_pair(SVGMarkerUnitsStrokeWidth, "strokeWidth")) ; 37 entries.append(std::make_pair(SVGMarkerUnitsStrokeWidth, "strokeWidth")) ;
38 } 38 }
39 return entries; 39 return entries;
40 } 40 }
41 41
42 42
43 inline SVGMarkerElement::SVGMarkerElement(Document& document) 43 inline SVGMarkerElement::SVGMarkerElement(Document& document)
44 : SVGElement(SVGNames::markerTag, document) 44 : SVGElement(SVGNames::markerTag, document)
45 , m_refX(SVGAnimatedLength::create(this, SVGNames::refXAttr, SVGLength::crea te(LengthModeWidth), AllowNegativeLengths)) 45 , m_refX(SVGAnimatedLength::create(this, SVGNames::refXAttr, SVGLength::crea te(SVGLengthMode::Width), AllowNegativeLengths))
46 , m_refY(SVGAnimatedLength::create(this, SVGNames::refYAttr, SVGLength::crea te(LengthModeHeight), AllowNegativeLengths)) 46 , m_refY(SVGAnimatedLength::create(this, SVGNames::refYAttr, SVGLength::crea te(SVGLengthMode::Height), AllowNegativeLengths))
47 , m_markerWidth(SVGAnimatedLength::create(this, SVGNames::markerWidthAttr, S VGLength::create(LengthModeWidth), ForbidNegativeLengths)) 47 , m_markerWidth(SVGAnimatedLength::create(this, SVGNames::markerWidthAttr, S VGLength::create(SVGLengthMode::Width), ForbidNegativeLengths))
48 , m_markerHeight(SVGAnimatedLength::create(this, SVGNames::markerHeightAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths)) 48 , m_markerHeight(SVGAnimatedLength::create(this, SVGNames::markerHeightAttr, SVGLength::create(SVGLengthMode::Height), ForbidNegativeLengths))
49 , m_orientAngle(SVGAnimatedAngle::create(this)) 49 , m_orientAngle(SVGAnimatedAngle::create(this))
50 , m_markerUnits(SVGAnimatedEnumeration<SVGMarkerUnitsType>::create(this, SVG Names::markerUnitsAttr, SVGMarkerUnitsStrokeWidth)) 50 , m_markerUnits(SVGAnimatedEnumeration<SVGMarkerUnitsType>::create(this, SVG Names::markerUnitsAttr, SVGMarkerUnitsStrokeWidth))
51 { 51 {
52 SVGFitToViewBox::initialize(this); 52 SVGFitToViewBox::initialize(this);
53 53
54 // Spec: If the markerWidth/markerHeight attribute is not specified, the eff ect is as if a value of "3" were specified. 54 // Spec: If the markerWidth/markerHeight attribute is not specified, the eff ect is as if a value of "3" were specified.
55 m_markerWidth->setDefaultValueAsString("3"); 55 m_markerWidth->setDefaultValueAsString("3");
56 m_markerHeight->setDefaultValueAsString("3"); 56 m_markerHeight->setDefaultValueAsString("3");
57 57
58 addToPropertyMap(m_refX); 58 addToPropertyMap(m_refX);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 bool SVGMarkerElement::selfHasRelativeLengths() const 157 bool SVGMarkerElement::selfHasRelativeLengths() const
158 { 158 {
159 return m_refX->currentValue()->isRelative() 159 return m_refX->currentValue()->isRelative()
160 || m_refY->currentValue()->isRelative() 160 || m_refY->currentValue()->isRelative()
161 || m_markerWidth->currentValue()->isRelative() 161 || m_markerWidth->currentValue()->isRelative()
162 || m_markerHeight->currentValue()->isRelative(); 162 || m_markerHeight->currentValue()->isRelative();
163 } 163 }
164 164
165 } // namespace blink 165 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/svg/SVGLinearGradientElement.cpp ('k') | Source/core/svg/SVGMaskElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698