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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/BasicShapeFunctions.cpp ('k') | Source/core/css/CSSBasicShapes.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSBasicShapes.h
diff --git a/Source/core/css/CSSBasicShapes.h b/Source/core/css/CSSBasicShapes.h
index 8383c0593186fc0741e2697e82b9c2c9036e417d..c23021772324f42f3878a14e3b5f8b62ae5f0c26 100644
--- a/Source/core/css/CSSBasicShapes.h
+++ b/Source/core/css/CSSBasicShapes.h
@@ -41,11 +41,12 @@ namespace WebCore {
class CSSBasicShape : public RefCounted<CSSBasicShape> {
public:
enum Type {
- CSSBasicShapeRectangleType = 1,
- CSSBasicShapeCircleType = 2,
- CSSBasicShapeEllipseType = 3,
- CSSBasicShapePolygonType = 4,
- CSSBasicShapeInsetRectangleType = 5
+ CSSBasicShapeRectangleType,
+ CSSDeprecatedBasicShapeCircleType,
+ CSSBasicShapeEllipseType,
+ CSSBasicShapePolygonType,
+ CSSBasicShapeInsetRectangleType,
+ CSSBasicShapeCircleType
};
virtual Type type() const = 0;
@@ -142,6 +143,33 @@ class CSSBasicShapeCircle : public CSSBasicShape {
public:
static PassRefPtr<CSSBasicShapeCircle> create() { return adoptRef(new CSSBasicShapeCircle); }
+ virtual Type type() const OVERRIDE { return CSSBasicShapeCircleType; }
+ virtual String cssText() const;
+ virtual bool equals(const CSSBasicShape&) const;
+
+ CSSPrimitiveValue* centerX() const { return m_centerX.get(); }
+ CSSPrimitiveValue* centerY() const { return m_centerY.get(); }
+ CSSPrimitiveValue* radius() const { return m_radius.get(); }
+
+ void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX; }
+ void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY; }
+ void setRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_radius = radius; }
+
+ virtual String serializeResolvingVariables(const HashMap<AtomicString, String>&) const;
+ virtual bool hasVariableReference() const;
+
+private:
+ CSSBasicShapeCircle() { }
+
+ RefPtr<CSSPrimitiveValue> m_centerX;
+ RefPtr<CSSPrimitiveValue> m_centerY;
+ RefPtr<CSSPrimitiveValue> m_radius;
+};
+
+class CSSDeprecatedBasicShapeCircle : public CSSBasicShape {
+public:
+ static PassRefPtr<CSSDeprecatedBasicShapeCircle> create() { return adoptRef(new CSSDeprecatedBasicShapeCircle); }
+
CSSPrimitiveValue* centerX() const { return m_centerX.get(); }
CSSPrimitiveValue* centerY() const { return m_centerY.get(); }
CSSPrimitiveValue* radius() const { return m_radius.get(); }
@@ -150,7 +178,8 @@ public:
void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY; }
void setRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_radius = radius; }
- virtual Type type() const { return CSSBasicShapeCircleType; }
+ virtual Type type() const OVERRIDE { return CSSDeprecatedBasicShapeCircleType; }
+
virtual String cssText() const;
virtual bool equals(const CSSBasicShape&) const;
@@ -158,7 +187,7 @@ public:
virtual bool hasVariableReference() const;
private:
- CSSBasicShapeCircle() { }
+ CSSDeprecatedBasicShapeCircle() { }
RefPtr<CSSPrimitiveValue> m_centerY;
RefPtr<CSSPrimitiveValue> m_centerX;
« 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