| Index: Source/core/css/CSSBasicShapes.h
|
| diff --git a/Source/core/css/CSSBasicShapes.h b/Source/core/css/CSSBasicShapes.h
|
| index 35ea4a23a464cf604d4bc4200b8b6ecd3af7eb8d..c37e5e234d36fa8dbe1c4dd0ce5cb39795d91a5f 100644
|
| --- a/Source/core/css/CSSBasicShapes.h
|
| +++ b/Source/core/css/CSSBasicShapes.h
|
| @@ -30,7 +30,7 @@
|
| #ifndef CSSBasicShapes_h
|
| #define CSSBasicShapes_h
|
|
|
| -#include "core/css/CSSPrimitiveValue.h"
|
| +#include "core/css/CSSValue.h"
|
| #include "platform/graphics/GraphicsTypes.h"
|
| #include "wtf/RefPtr.h"
|
| #include "wtf/Vector.h"
|
| @@ -38,7 +38,7 @@
|
|
|
| namespace blink {
|
|
|
| -class CSSBasicShape : public RefCountedWillBeGarbageCollected<CSSBasicShape> {
|
| +class CSSBasicShape : public RefCountedWillBeGarbageCollectedFinalized<CSSBasicShape> {
|
| DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(CSSBasicShape);
|
| public:
|
| enum Type {
|
| @@ -52,8 +52,8 @@ public:
|
| virtual String cssText() const = 0;
|
| virtual bool equals(const CSSBasicShape&) const = 0;
|
|
|
| - CSSPrimitiveValue* referenceBox() const { return m_referenceBox.get(); }
|
| - void setReferenceBox(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> referenceBox) { m_referenceBox = referenceBox; }
|
| + const NullableCSSValue& referenceBox() const { return m_referenceBox; }
|
| + void setReferenceBox(const CSSPrimitiveValue& referenceBox) { m_referenceBox = referenceBox; }
|
|
|
| bool isEllipse() const { return type() == CSSBasicShapeEllipseType; }
|
| bool isPolygon() const { return type() == CSSBasicShapePolygonType; }
|
| @@ -64,7 +64,7 @@ public:
|
|
|
| protected:
|
| CSSBasicShape() { }
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_referenceBox;
|
| + NullableCSSValue m_referenceBox;
|
| };
|
|
|
| class CSSBasicShapeCircle final : public CSSBasicShape {
|
| @@ -74,13 +74,13 @@ public:
|
| virtual String cssText() const override;
|
| virtual bool equals(const CSSBasicShape&) const override;
|
|
|
| - CSSPrimitiveValue* centerX() const { return m_centerX.get(); }
|
| - CSSPrimitiveValue* centerY() const { return m_centerY.get(); }
|
| - CSSPrimitiveValue* radius() const { return m_radius.get(); }
|
| + const NullableCSSValue& centerX() const { return m_centerX; }
|
| + const NullableCSSValue& centerY() const { return m_centerY; }
|
| + const NullableCSSValue& radius() const { return m_radius; }
|
|
|
| - void setCenterX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX; }
|
| - void setCenterY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY; }
|
| - void setRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_radius = radius; }
|
| + void setCenterX(const CSSPrimitiveValue& centerX) { m_centerX = centerX; }
|
| + void setCenterY(const CSSPrimitiveValue& centerY) { m_centerY = centerY; }
|
| + void setRadius(const CSSPrimitiveValue& radius) { m_radius = radius; }
|
|
|
| DECLARE_VIRTUAL_TRACE();
|
|
|
| @@ -89,9 +89,9 @@ private:
|
|
|
| virtual Type type() const override { return CSSBasicShapeCircleType; }
|
|
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_centerX;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_centerY;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_radius;
|
| + NullableCSSValue m_centerX;
|
| + NullableCSSValue m_centerY;
|
| + NullableCSSValue m_radius;
|
| };
|
|
|
| class CSSBasicShapeEllipse final : public CSSBasicShape {
|
| @@ -101,15 +101,15 @@ public:
|
| virtual String cssText() const override;
|
| virtual bool equals(const CSSBasicShape&) const override;
|
|
|
| - CSSPrimitiveValue* centerX() const { return m_centerX.get(); }
|
| - CSSPrimitiveValue* centerY() const { return m_centerY.get(); }
|
| - CSSPrimitiveValue* radiusX() const { return m_radiusX.get(); }
|
| - CSSPrimitiveValue* radiusY() const { return m_radiusY.get(); }
|
| + const NullableCSSValue& centerX() const { return m_centerX; }
|
| + const NullableCSSValue& centerY() const { return m_centerY; }
|
| + const NullableCSSValue& radiusX() const { return m_radiusX; }
|
| + const NullableCSSValue& radiusY() const { return m_radiusY; }
|
|
|
| - void setCenterX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX; }
|
| - void setCenterY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY; }
|
| - void setRadiusX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX; }
|
| - void setRadiusY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY; }
|
| + void setCenterX(CSSPrimitiveValue centerX) { m_centerX = centerX; }
|
| + void setCenterY(CSSPrimitiveValue centerY) { m_centerY = centerY; }
|
| + void setRadiusX(CSSPrimitiveValue radiusX) { m_radiusX = radiusX; }
|
| + void setRadiusY(CSSPrimitiveValue radiusY) { m_radiusY = radiusY; }
|
|
|
| DECLARE_VIRTUAL_TRACE();
|
|
|
| @@ -118,25 +118,25 @@ private:
|
|
|
| virtual Type type() const override { return CSSBasicShapeEllipseType; }
|
|
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_centerX;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_centerY;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_radiusX;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_radiusY;
|
| + NullableCSSValue m_centerX;
|
| + NullableCSSValue m_centerY;
|
| + NullableCSSValue m_radiusX;
|
| + NullableCSSValue m_radiusY;
|
| };
|
|
|
| class CSSBasicShapePolygon final : public CSSBasicShape {
|
| public:
|
| static PassRefPtrWillBeRawPtr<CSSBasicShapePolygon> create() { return adoptRefWillBeNoop(new CSSBasicShapePolygon); }
|
|
|
| - void appendPoint(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> x, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> y)
|
| + void appendPoint(const CSSPrimitiveValue& x, const CSSPrimitiveValue& y)
|
| {
|
| m_values.append(x);
|
| m_values.append(y);
|
| }
|
|
|
| - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> getXAt(unsigned i) const { return m_values.at(i * 2); }
|
| - PassRefPtrWillBeRawPtr<CSSPrimitiveValue> getYAt(unsigned i) const { return m_values.at(i * 2 + 1); }
|
| - const WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>>& values() const { return m_values; }
|
| + const CSSPrimitiveValue& getXAt(unsigned i) const { return toCSSPrimitiveValue(m_values.at(i * 2)); }
|
| + const CSSPrimitiveValue& getYAt(unsigned i) const { return toCSSPrimitiveValue(m_values.at(i * 2 + 1)); }
|
| + const WillBeHeapVector<CSSValue>& values() const { return m_values; }
|
|
|
| void setWindRule(WindRule w) { m_windRule = w; }
|
| WindRule windRule() const { return m_windRule; }
|
| @@ -154,7 +154,7 @@ private:
|
|
|
| virtual Type type() const override { return CSSBasicShapePolygonType; }
|
|
|
| - WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>> m_values;
|
| + WillBeHeapVector<CSSValue> m_values;
|
| WindRule m_windRule;
|
| };
|
|
|
| @@ -162,22 +162,22 @@ class CSSBasicShapeInset final : public CSSBasicShape {
|
| public:
|
| static PassRefPtrWillBeRawPtr<CSSBasicShapeInset> create() { return adoptRefWillBeNoop(new CSSBasicShapeInset); }
|
|
|
| - CSSPrimitiveValue* top() const { return m_top.get(); }
|
| - CSSPrimitiveValue* right() const { return m_right.get(); }
|
| - CSSPrimitiveValue* bottom() const { return m_bottom.get(); }
|
| - CSSPrimitiveValue* left() const { return m_left.get(); }
|
| + const CSSPrimitiveValue& top() const { return toCSSPrimitiveValue(m_top); }
|
| + const CSSPrimitiveValue& right() const { return toCSSPrimitiveValue(m_right); }
|
| + const CSSPrimitiveValue& bottom() const { return toCSSPrimitiveValue(m_bottom); }
|
| + const CSSPrimitiveValue& left() const { return toCSSPrimitiveValue(m_left); }
|
|
|
| - CSSPrimitiveValue* topLeftRadius() const { return m_topLeftRadius.get(); }
|
| - CSSPrimitiveValue* topRightRadius() const { return m_topRightRadius.get(); }
|
| - CSSPrimitiveValue* bottomRightRadius() const { return m_bottomRightRadius.get(); }
|
| - CSSPrimitiveValue* bottomLeftRadius() const { return m_bottomLeftRadius.get(); }
|
| + const NullableCSSValue& topLeftRadius() const { return m_topLeftRadius; }
|
| + const NullableCSSValue& topRightRadius() const { return m_topRightRadius; }
|
| + const NullableCSSValue& bottomRightRadius() const { return m_bottomRightRadius; }
|
| + const NullableCSSValue& bottomLeftRadius() const { return m_bottomLeftRadius; }
|
|
|
| - void setTop(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> top) { m_top = top; }
|
| - void setRight(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> right) { m_right = right; }
|
| - void setBottom(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> bottom) { m_bottom = bottom; }
|
| - void setLeft(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> left) { m_left = left; }
|
| + void setTop(const CSSPrimitiveValue& top) { m_top = top; }
|
| + void setRight(const CSSPrimitiveValue& right) { m_right = right; }
|
| + void setBottom(const CSSPrimitiveValue& bottom) { m_bottom = bottom; }
|
| + void setLeft(const CSSPrimitiveValue& left) { m_left = left; }
|
|
|
| - void updateShapeSize4Values(CSSPrimitiveValue* top, CSSPrimitiveValue* right, CSSPrimitiveValue* bottom, CSSPrimitiveValue* left)
|
| + void updateShapeSize4Values(const CSSPrimitiveValue& top, const CSSPrimitiveValue& right, const CSSPrimitiveValue& bottom, const CSSPrimitiveValue& left)
|
| {
|
| setTop(top);
|
| setRight(right);
|
| @@ -185,26 +185,26 @@ public:
|
| setLeft(left);
|
| }
|
|
|
| - void updateShapeSize1Value(CSSPrimitiveValue* value1)
|
| + void updateShapeSize1Value(const CSSPrimitiveValue& value1)
|
| {
|
| updateShapeSize4Values(value1, value1, value1, value1);
|
| }
|
|
|
| - void updateShapeSize2Values(CSSPrimitiveValue* value1, CSSPrimitiveValue* value2)
|
| + void updateShapeSize2Values(const CSSPrimitiveValue& value1, const CSSPrimitiveValue& value2)
|
| {
|
| updateShapeSize4Values(value1, value2, value1, value2);
|
| }
|
|
|
| - void updateShapeSize3Values(CSSPrimitiveValue* value1, CSSPrimitiveValue* value2, CSSPrimitiveValue* value3)
|
| + void updateShapeSize3Values(const CSSPrimitiveValue& value1, const CSSPrimitiveValue& value2, const CSSPrimitiveValue& value3)
|
| {
|
| updateShapeSize4Values(value1, value2, value3, value2);
|
| }
|
|
|
|
|
| - void setTopLeftRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_topLeftRadius = radius; }
|
| - void setTopRightRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_topRightRadius = radius; }
|
| - void setBottomRightRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_bottomRightRadius = radius; }
|
| - void setBottomLeftRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_bottomLeftRadius = radius; }
|
| + void setTopLeftRadius(const CSSPrimitiveValue& radius) { m_topLeftRadius = radius; }
|
| + void setTopRightRadius(const CSSPrimitiveValue& radius) { m_topRightRadius = radius; }
|
| + void setBottomRightRadius(const CSSPrimitiveValue& radius) { m_bottomRightRadius = radius; }
|
| + void setBottomLeftRadius(const CSSPrimitiveValue& radius) { m_bottomLeftRadius = radius; }
|
|
|
| virtual String cssText() const override;
|
| virtual bool equals(const CSSBasicShape&) const override;
|
| @@ -216,15 +216,15 @@ private:
|
|
|
| virtual Type type() const override { return CSSBasicShapeInsetType; }
|
|
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_top;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_right;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_bottom;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_left;
|
| + NullableCSSValue m_top;
|
| + NullableCSSValue m_right;
|
| + NullableCSSValue m_bottom;
|
| + NullableCSSValue m_left;
|
|
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_topLeftRadius;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_topRightRadius;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_bottomRightRadius;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_bottomLeftRadius;
|
| + NullableCSSValue m_topLeftRadius;
|
| + NullableCSSValue m_topRightRadius;
|
| + NullableCSSValue m_bottomRightRadius;
|
| + NullableCSSValue m_bottomLeftRadius;
|
| };
|
|
|
| DEFINE_TYPE_CASTS(CSSBasicShapeCircle, CSSBasicShape, shape, shape->isCircle(), shape.isCircle());
|
|
|