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

Side by Side Diff: Source/core/css/CSSBasicShapes.h

Issue 98723006: Parse new circle shape syntax (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix stated issues Created 7 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
« no previous file with comments | « Source/core/css/BasicShapeFunctions.cpp ('k') | Source/core/css/CSSBasicShapes.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) 2011 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 23 matching lines...) Expand all
34 #include "platform/graphics/WindRule.h" 34 #include "platform/graphics/WindRule.h"
35 #include "wtf/RefPtr.h" 35 #include "wtf/RefPtr.h"
36 #include "wtf/Vector.h" 36 #include "wtf/Vector.h"
37 #include "wtf/text/WTFString.h" 37 #include "wtf/text/WTFString.h"
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 class CSSBasicShape : public RefCounted<CSSBasicShape> { 41 class CSSBasicShape : public RefCounted<CSSBasicShape> {
42 public: 42 public:
43 enum Type { 43 enum Type {
44 CSSBasicShapeRectangleType = 1, 44 CSSBasicShapeRectangleType,
45 CSSBasicShapeCircleType = 2, 45 CSSDeprecatedBasicShapeCircleType,
46 CSSBasicShapeEllipseType = 3, 46 CSSBasicShapeEllipseType,
47 CSSBasicShapePolygonType = 4, 47 CSSBasicShapePolygonType,
48 CSSBasicShapeInsetRectangleType = 5 48 CSSBasicShapeInsetRectangleType,
49 CSSBasicShapeCircleType
49 }; 50 };
50 51
51 virtual Type type() const = 0; 52 virtual Type type() const = 0;
52 virtual String cssText() const = 0; 53 virtual String cssText() const = 0;
53 virtual bool equals(const CSSBasicShape&) const = 0; 54 virtual bool equals(const CSSBasicShape&) const = 0;
54 55
55 CSSPrimitiveValue* layoutBox() const { return m_layoutBox.get(); } 56 CSSPrimitiveValue* layoutBox() const { return m_layoutBox.get(); }
56 void setLayoutBox(PassRefPtr<CSSPrimitiveValue> layoutBox) { m_layoutBox = l ayoutBox; } 57 void setLayoutBox(PassRefPtr<CSSPrimitiveValue> layoutBox) { m_layoutBox = l ayoutBox; }
57 58
58 virtual String serializeResolvingVariables(const HashMap<AtomicString, Strin g>&) const = 0; 59 virtual String serializeResolvingVariables(const HashMap<AtomicString, Strin g>&) const = 0;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 RefPtr<CSSPrimitiveValue> m_bottom; 136 RefPtr<CSSPrimitiveValue> m_bottom;
136 RefPtr<CSSPrimitiveValue> m_left; 137 RefPtr<CSSPrimitiveValue> m_left;
137 RefPtr<CSSPrimitiveValue> m_radiusX; 138 RefPtr<CSSPrimitiveValue> m_radiusX;
138 RefPtr<CSSPrimitiveValue> m_radiusY; 139 RefPtr<CSSPrimitiveValue> m_radiusY;
139 }; 140 };
140 141
141 class CSSBasicShapeCircle : public CSSBasicShape { 142 class CSSBasicShapeCircle : public CSSBasicShape {
142 public: 143 public:
143 static PassRefPtr<CSSBasicShapeCircle> create() { return adoptRef(new CSSBas icShapeCircle); } 144 static PassRefPtr<CSSBasicShapeCircle> create() { return adoptRef(new CSSBas icShapeCircle); }
144 145
146 virtual Type type() const OVERRIDE { return CSSBasicShapeCircleType; }
147 virtual String cssText() const;
148 virtual bool equals(const CSSBasicShape&) const;
149
145 CSSPrimitiveValue* centerX() const { return m_centerX.get(); } 150 CSSPrimitiveValue* centerX() const { return m_centerX.get(); }
146 CSSPrimitiveValue* centerY() const { return m_centerY.get(); } 151 CSSPrimitiveValue* centerY() const { return m_centerY.get(); }
147 CSSPrimitiveValue* radius() const { return m_radius.get(); } 152 CSSPrimitiveValue* radius() const { return m_radius.get(); }
153
154 void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX ; }
155 void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY ; }
156 void setRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_radius = radius; }
157
158 virtual String serializeResolvingVariables(const HashMap<AtomicString, Strin g>&) const;
159 virtual bool hasVariableReference() const;
160
161 private:
162 CSSBasicShapeCircle() { }
163
164 RefPtr<CSSPrimitiveValue> m_centerX;
165 RefPtr<CSSPrimitiveValue> m_centerY;
166 RefPtr<CSSPrimitiveValue> m_radius;
167 };
168
169 class CSSDeprecatedBasicShapeCircle : public CSSBasicShape {
170 public:
171 static PassRefPtr<CSSDeprecatedBasicShapeCircle> create() { return adoptRef( new CSSDeprecatedBasicShapeCircle); }
172
173 CSSPrimitiveValue* centerX() const { return m_centerX.get(); }
174 CSSPrimitiveValue* centerY() const { return m_centerY.get(); }
175 CSSPrimitiveValue* radius() const { return m_radius.get(); }
148 176
149 void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX ; } 177 void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX ; }
150 void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY ; } 178 void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY ; }
151 void setRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_radius = radius; } 179 void setRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_radius = radius; }
152 180
153 virtual Type type() const { return CSSBasicShapeCircleType; } 181 virtual Type type() const OVERRIDE { return CSSDeprecatedBasicShapeCircleTyp e; }
182
154 virtual String cssText() const; 183 virtual String cssText() const;
155 virtual bool equals(const CSSBasicShape&) const; 184 virtual bool equals(const CSSBasicShape&) const;
156 185
157 virtual String serializeResolvingVariables(const HashMap<AtomicString, Strin g>&) const; 186 virtual String serializeResolvingVariables(const HashMap<AtomicString, Strin g>&) const;
158 virtual bool hasVariableReference() const; 187 virtual bool hasVariableReference() const;
159 188
160 private: 189 private:
161 CSSBasicShapeCircle() { } 190 CSSDeprecatedBasicShapeCircle() { }
162 191
163 RefPtr<CSSPrimitiveValue> m_centerY; 192 RefPtr<CSSPrimitiveValue> m_centerY;
164 RefPtr<CSSPrimitiveValue> m_centerX; 193 RefPtr<CSSPrimitiveValue> m_centerX;
165 RefPtr<CSSPrimitiveValue> m_radius; 194 RefPtr<CSSPrimitiveValue> m_radius;
166 }; 195 };
167 196
168 class CSSBasicShapeEllipse : public CSSBasicShape { 197 class CSSBasicShapeEllipse : public CSSBasicShape {
169 public: 198 public:
170 static PassRefPtr<CSSBasicShapeEllipse> create() { return adoptRef(new CSSBa sicShapeEllipse); } 199 static PassRefPtr<CSSBasicShapeEllipse> create() { return adoptRef(new CSSBa sicShapeEllipse); }
171 200
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 { 253 {
225 } 254 }
226 255
227 Vector<RefPtr<CSSPrimitiveValue> > m_values; 256 Vector<RefPtr<CSSPrimitiveValue> > m_values;
228 WindRule m_windRule; 257 WindRule m_windRule;
229 }; 258 };
230 259
231 } // namespace WebCore 260 } // namespace WebCore
232 261
233 #endif // CSSBasicShapes_h 262 #endif // CSSBasicShapes_h
OLDNEW
« no previous file with comments | « Source/core/css/BasicShapeFunctions.cpp ('k') | Source/core/css/CSSBasicShapes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698