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

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: Rebase after 164114 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
Index: Source/core/css/CSSBasicShapes.h
diff --git a/Source/core/css/CSSBasicShapes.h b/Source/core/css/CSSBasicShapes.h
index 8383c0593186fc0741e2697e82b9c2c9036e417d..fb13f196944d96bb54d22306d8e27b6efe8e6c8f 100644
--- a/Source/core/css/CSSBasicShapes.h
+++ b/Source/core/css/CSSBasicShapes.h
@@ -42,10 +42,11 @@ class CSSBasicShape : public RefCounted<CSSBasicShape> {
public:
enum Type {
CSSBasicShapeRectangleType = 1,
- CSSBasicShapeCircleType = 2,
+ CSSDeprecatedBasicShapeCircleType = 2,
CSSBasicShapeEllipseType = 3,
CSSBasicShapePolygonType = 4,
- CSSBasicShapeInsetRectangleType = 5
+ CSSBasicShapeInsetRectangleType = 5,
+ CSSBasicShapeCircleType = 6
Bem Jones-Bey (adobe) 2013/12/18 21:57:57 The explicit numbers were removed in a subsequent
};
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;

Powered by Google App Engine
This is Rietveld 408576698