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

Side by Side Diff: Source/core/layout/style/SVGLayoutStyleDefs.h

Issue 983103003: Use Length for the stroke-width property in SVGLayoutStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: lengthSetterForProperty 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
OLDNEW
1 /* 1 /*
2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005 Rob Buis <buis@kde.org> 3 2004, 2005 Rob Buis <buis@kde.org>
4 Copyright (C) Research In Motion Limited 2010. All rights reserved. 4 Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 5
6 Based on khtml code by: 6 Based on khtml code by:
7 Copyright (C) 2000-2003 Lars Knoll (knoll@kde.org) 7 Copyright (C) 2000-2003 Lars Knoll (knoll@kde.org)
8 (C) 2000 Antti Koivisto (koivisto@kde.org) 8 (C) 2000 Antti Koivisto (koivisto@kde.org)
9 (C) 2000-2003 Dirk Mueller (mueller@kde.org) 9 (C) 2000-2003 Dirk Mueller (mueller@kde.org)
10 (C) 2002-2003 Apple Computer, Inc. 10 (C) 2002-2003 Apple Computer, Inc.
(...skipping 10 matching lines...) Expand all
21 21
22 You should have received a copy of the GNU Library General Public License 22 You should have received a copy of the GNU Library General Public License
23 along with this library; see the file COPYING.LIB. If not, write to 23 along with this library; see the file COPYING.LIB. If not, write to
24 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 24 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 Boston, MA 02110-1301, USA. 25 Boston, MA 02110-1301, USA.
26 */ 26 */
27 27
28 #ifndef SVGLayoutStyleDefs_h 28 #ifndef SVGLayoutStyleDefs_h
29 #define SVGLayoutStyleDefs_h 29 #define SVGLayoutStyleDefs_h
30 30
31 #include "core/svg/SVGLength.h"
32 #include "platform/Length.h" 31 #include "platform/Length.h"
33 #include "platform/graphics/Color.h" 32 #include "platform/graphics/Color.h"
34 #include "wtf/OwnPtr.h" 33 #include "wtf/OwnPtr.h"
35 #include "wtf/PassOwnPtr.h" 34 #include "wtf/PassOwnPtr.h"
36 #include "wtf/RefCounted.h" 35 #include "wtf/RefCounted.h"
37 #include "wtf/RefPtr.h" 36 #include "wtf/RefPtr.h"
38 #include "wtf/RefVector.h" 37 #include "wtf/RefVector.h"
39 #include "wtf/text/WTFString.h" 38 #include "wtf/text/WTFString.h"
40 39
41 namespace blink { 40 namespace blink {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 String paintUri; 135 String paintUri;
137 SVGPaintType visitedLinkPaintType; 136 SVGPaintType visitedLinkPaintType;
138 Color visitedLinkPaintColor; 137 Color visitedLinkPaintColor;
139 String visitedLinkPaintUri; 138 String visitedLinkPaintUri;
140 139
141 private: 140 private:
142 StyleFillData(); 141 StyleFillData();
143 StyleFillData(const StyleFillData&); 142 StyleFillData(const StyleFillData&);
144 }; 143 };
145 144
145 class UnzoomedLength {
146 public:
147 explicit UnzoomedLength(const Length& length) : m_length(length) { }
148
149 bool isZero() const { return m_length.isZero(); }
150
151 bool operator==(const UnzoomedLength& other) const { return m_length == othe r.m_length; }
152 bool operator!=(const UnzoomedLength& other) const { return !operator==(othe r); }
153
154 const Length& length() const { return m_length; }
155
156 private:
157 Length m_length;
158 };
159
146 class StyleStrokeData : public RefCounted<StyleStrokeData> { 160 class StyleStrokeData : public RefCounted<StyleStrokeData> {
147 public: 161 public:
148 static PassRefPtr<StyleStrokeData> create() 162 static PassRefPtr<StyleStrokeData> create()
149 { 163 {
150 return adoptRef(new StyleStrokeData); 164 return adoptRef(new StyleStrokeData);
151 } 165 }
152 166
153 PassRefPtr<StyleStrokeData> copy() const 167 PassRefPtr<StyleStrokeData> copy() const
154 { 168 {
155 return adoptRef(new StyleStrokeData(*this)); 169 return adoptRef(new StyleStrokeData(*this));
156 } 170 }
157 171
158 bool operator==(const StyleStrokeData&) const; 172 bool operator==(const StyleStrokeData&) const;
159 bool operator!=(const StyleStrokeData& other) const 173 bool operator!=(const StyleStrokeData& other) const
160 { 174 {
161 return !(*this == other); 175 return !(*this == other);
162 } 176 }
163 177
164 float opacity; 178 float opacity;
165 float miterLimit; 179 float miterLimit;
166 180
167 RefPtrWillBePersistent<SVGLength> width; 181 UnzoomedLength width;
168 Length dashOffset; 182 Length dashOffset;
169 RefPtr<SVGDashArray> dashArray; 183 RefPtr<SVGDashArray> dashArray;
170 184
171 SVGPaintType paintType; 185 SVGPaintType paintType;
172 Color paintColor; 186 Color paintColor;
173 String paintUri; 187 String paintUri;
174 SVGPaintType visitedLinkPaintType; 188 SVGPaintType visitedLinkPaintType;
175 Color visitedLinkPaintColor; 189 Color visitedLinkPaintColor;
176 String visitedLinkPaintUri; 190 String visitedLinkPaintUri;
177 191
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 Length rx; 293 Length rx;
280 Length ry; 294 Length ry;
281 private: 295 private:
282 StyleLayoutData(); 296 StyleLayoutData();
283 StyleLayoutData(const StyleLayoutData&); 297 StyleLayoutData(const StyleLayoutData&);
284 }; 298 };
285 299
286 } // namespace blink 300 } // namespace blink
287 301
288 #endif // SVGLayoutStyleDefs_h 302 #endif // SVGLayoutStyleDefs_h
OLDNEW
« no previous file with comments | « Source/core/layout/style/SVGLayoutStyle.cpp ('k') | Source/core/layout/style/SVGLayoutStyleDefs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698