| Index: Source/core/css/CSSBasicShapes.h
|
| diff --git a/Source/core/css/CSSBasicShapes.h b/Source/core/css/CSSBasicShapes.h
|
| index 827b5790d1a249f3b373c3a558cb8618824069bd..ed59499e2a2ef97126fad52080082cac26f7bbe6 100644
|
| --- a/Source/core/css/CSSBasicShapes.h
|
| +++ b/Source/core/css/CSSBasicShapes.h
|
| @@ -38,9 +38,12 @@
|
|
|
| namespace blink {
|
|
|
| -class CSSBasicShape : public RefCountedWillBeGarbageCollected<CSSBasicShape> {
|
| - DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(CSSBasicShape);
|
| +class CSSBasicShape : public RefCounted<CSSBasicShape> {
|
| public:
|
| + virtual ~CSSBasicShape()
|
| + {
|
| + }
|
| +
|
| enum Type {
|
| CSSBasicShapeEllipseType,
|
| CSSBasicShapePolygonType,
|
| @@ -53,23 +56,21 @@ public:
|
| virtual bool equals(const CSSBasicShape&) const = 0;
|
|
|
| CSSPrimitiveValue* referenceBox() const { return m_referenceBox.get(); }
|
| - void setReferenceBox(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> referenceBox) { m_referenceBox = referenceBox; }
|
| + void setReferenceBox(PassRefPtr<CSSPrimitiveValue> referenceBox) { m_referenceBox = referenceBox; }
|
|
|
| bool isEllipse() const { return type() == CSSBasicShapeEllipseType; }
|
| bool isPolygon() const { return type() == CSSBasicShapePolygonType; }
|
| bool isCircle() const { return type() == CSSBasicShapeCircleType; }
|
| bool isInset() const { return type() == CSSBasicShapeInsetType; }
|
|
|
| - DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(m_referenceBox); }
|
| -
|
| protected:
|
| CSSBasicShape() { }
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_referenceBox;
|
| + RefPtr<CSSPrimitiveValue> m_referenceBox;
|
| };
|
|
|
| class CSSBasicShapeCircle final : public CSSBasicShape {
|
| public:
|
| - static PassRefPtrWillBeRawPtr<CSSBasicShapeCircle> create() { return adoptRefWillBeNoop(new CSSBasicShapeCircle); }
|
| + static PassRefPtr<CSSBasicShapeCircle> create() { return adoptRef(new CSSBasicShapeCircle); }
|
|
|
| String cssText() const override;
|
| bool equals(const CSSBasicShape&) const override;
|
| @@ -78,25 +79,23 @@ public:
|
| CSSPrimitiveValue* centerY() const { return m_centerY.get(); }
|
| CSSPrimitiveValue* radius() const { return m_radius.get(); }
|
|
|
| - void setCenterX(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX; }
|
| - void setCenterY(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY; }
|
| - void setRadius(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> radius) { m_radius = radius; }
|
| -
|
| - DECLARE_VIRTUAL_TRACE();
|
| + void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX; }
|
| + void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY; }
|
| + void setRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_radius = radius; }
|
|
|
| private:
|
| CSSBasicShapeCircle() { }
|
|
|
| Type type() const override { return CSSBasicShapeCircleType; }
|
|
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_centerX;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_centerY;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_radius;
|
| + RefPtr<CSSPrimitiveValue> m_centerX;
|
| + RefPtr<CSSPrimitiveValue> m_centerY;
|
| + RefPtr<CSSPrimitiveValue> m_radius;
|
| };
|
|
|
| class CSSBasicShapeEllipse final : public CSSBasicShape {
|
| public:
|
| - static PassRefPtrWillBeRawPtr<CSSBasicShapeEllipse> create() { return adoptRefWillBeNoop(new CSSBasicShapeEllipse); }
|
| + static PassRefPtr<CSSBasicShapeEllipse> create() { return adoptRef(new CSSBasicShapeEllipse); }
|
|
|
| String cssText() const override;
|
| bool equals(const CSSBasicShape&) const override;
|
| @@ -106,37 +105,35 @@ public:
|
| CSSPrimitiveValue* radiusX() const { return m_radiusX.get(); }
|
| CSSPrimitiveValue* radiusY() const { return m_radiusY.get(); }
|
|
|
| - 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; }
|
| -
|
| - DECLARE_VIRTUAL_TRACE();
|
| + void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX; }
|
| + void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY; }
|
| + void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX; }
|
| + void setRadiusY(PassRefPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY; }
|
|
|
| private:
|
| CSSBasicShapeEllipse() { }
|
|
|
| Type type() const override { return CSSBasicShapeEllipseType; }
|
|
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_centerX;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_centerY;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_radiusX;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_radiusY;
|
| + RefPtr<CSSPrimitiveValue> m_centerX;
|
| + RefPtr<CSSPrimitiveValue> m_centerY;
|
| + RefPtr<CSSPrimitiveValue> m_radiusX;
|
| + RefPtr<CSSPrimitiveValue> m_radiusY;
|
| };
|
|
|
| class CSSBasicShapePolygon final : public CSSBasicShape {
|
| public:
|
| - static PassRefPtrWillBeRawPtr<CSSBasicShapePolygon> create() { return adoptRefWillBeNoop(new CSSBasicShapePolygon); }
|
| + static PassRefPtr<CSSBasicShapePolygon> create() { return adoptRef(new CSSBasicShapePolygon); }
|
|
|
| - void appendPoint(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> x, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> y)
|
| + void appendPoint(PassRefPtr<CSSPrimitiveValue> x, PassRefPtr<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; }
|
| + PassRefPtr<CSSPrimitiveValue> getXAt(unsigned i) const { return m_values.at(i * 2); }
|
| + PassRefPtr<CSSPrimitiveValue> getYAt(unsigned i) const { return m_values.at(i * 2 + 1); }
|
| + const Vector<RefPtr<CSSPrimitiveValue>>& values() const { return m_values; }
|
|
|
| void setWindRule(WindRule w) { m_windRule = w; }
|
| WindRule windRule() const { return m_windRule; }
|
| @@ -144,8 +141,6 @@ public:
|
| String cssText() const override;
|
| bool equals(const CSSBasicShape&) const override;
|
|
|
| - DECLARE_VIRTUAL_TRACE();
|
| -
|
| private:
|
| CSSBasicShapePolygon()
|
| : m_windRule(RULE_NONZERO)
|
| @@ -154,13 +149,13 @@ private:
|
|
|
| Type type() const override { return CSSBasicShapePolygonType; }
|
|
|
| - WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>> m_values;
|
| + Vector<RefPtr<CSSPrimitiveValue>> m_values;
|
| WindRule m_windRule;
|
| };
|
|
|
| class CSSBasicShapeInset final : public CSSBasicShape {
|
| public:
|
| - static PassRefPtrWillBeRawPtr<CSSBasicShapeInset> create() { return adoptRefWillBeNoop(new CSSBasicShapeInset); }
|
| + static PassRefPtr<CSSBasicShapeInset> create() { return adoptRef(new CSSBasicShapeInset); }
|
|
|
| CSSPrimitiveValue* top() const { return m_top.get(); }
|
| CSSPrimitiveValue* right() const { return m_right.get(); }
|
| @@ -172,10 +167,10 @@ public:
|
| CSSPrimitiveValue* bottomRightRadius() const { return m_bottomRightRadius.get(); }
|
| CSSPrimitiveValue* bottomLeftRadius() const { return m_bottomLeftRadius.get(); }
|
|
|
| - 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(PassRefPtr<CSSPrimitiveValue> top) { m_top = top; }
|
| + void setRight(PassRefPtr<CSSPrimitiveValue> right) { m_right = right; }
|
| + void setBottom(PassRefPtr<CSSPrimitiveValue> bottom) { m_bottom = bottom; }
|
| + void setLeft(PassRefPtr<CSSPrimitiveValue> left) { m_left = left; }
|
|
|
| void updateShapeSize4Values(CSSPrimitiveValue* top, CSSPrimitiveValue* right, CSSPrimitiveValue* bottom, CSSPrimitiveValue* left)
|
| {
|
| @@ -201,30 +196,28 @@ public:
|
| }
|
|
|
|
|
| - 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(PassRefPtr<CSSPrimitiveValue> radius) { m_topLeftRadius = radius; }
|
| + void setTopRightRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_topRightRadius = radius; }
|
| + void setBottomRightRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_bottomRightRadius = radius; }
|
| + void setBottomLeftRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_bottomLeftRadius = radius; }
|
|
|
| String cssText() const override;
|
| bool equals(const CSSBasicShape&) const override;
|
|
|
| - DECLARE_VIRTUAL_TRACE();
|
| -
|
| private:
|
| CSSBasicShapeInset() { }
|
|
|
| Type type() const override { return CSSBasicShapeInsetType; }
|
|
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_top;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_right;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_bottom;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_left;
|
| + RefPtr<CSSPrimitiveValue> m_top;
|
| + RefPtr<CSSPrimitiveValue> m_right;
|
| + RefPtr<CSSPrimitiveValue> m_bottom;
|
| + RefPtr<CSSPrimitiveValue> m_left;
|
|
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_topLeftRadius;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_topRightRadius;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_bottomRightRadius;
|
| - RefPtrWillBeMember<CSSPrimitiveValue> m_bottomLeftRadius;
|
| + RefPtr<CSSPrimitiveValue> m_topLeftRadius;
|
| + RefPtr<CSSPrimitiveValue> m_topRightRadius;
|
| + RefPtr<CSSPrimitiveValue> m_bottomRightRadius;
|
| + RefPtr<CSSPrimitiveValue> m_bottomLeftRadius;
|
| };
|
|
|
| DEFINE_TYPE_CASTS(CSSBasicShapeCircle, CSSBasicShape, shape, shape->isCircle(), shape.isCircle());
|
|
|