Rename CSS Exclusions CSSWrapShape class properties to match Exclusion shape function...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jul 2012 16:54:59 +0000 (16:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jul 2012 16:54:59 +0000 (16:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=89669

Patch by Hans Muller <hmuller@adobe.com> on 2012-07-17
Reviewed by Dirk Schulze.

Renamed left,top properties in the exclusion shape types to better match the specification
http://dev.w3.org/csswg/css3-exclusions/#shapes-from-svg-syntax:

WrapShapeRectangle, CSSWrapShapeRectangle - left,top should be x, y
WrapShapeCircle, CSSWrapShapeCircle - left,top should be centerX, centerY
WrapShapeEllipse, CSSWrapShapeEllipse - left,top should be centerX, centerY

No new tests or tests revisions were needed, the existing tests cover these APIs.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseExclusionShapeRectangle):
(WebCore::CSSParser::parseExclusionShapeCircle):
(WebCore::CSSParser::parseExclusionShapeEllipse):
* css/CSSWrapShapes.cpp:
(WebCore::CSSWrapShapeRectangle::cssText):
(WebCore::CSSWrapShapeCircle::cssText):
(WebCore::CSSWrapShapeEllipse::cssText):
* css/CSSWrapShapes.h:
(WebCore::CSSWrapShapeRectangle::x):
(WebCore::CSSWrapShapeRectangle::y):
(WebCore::CSSWrapShapeRectangle::setX):
(WebCore::CSSWrapShapeRectangle::setY):
(CSSWrapShapeRectangle):
(WebCore::CSSWrapShapeCircle::centerX):
(WebCore::CSSWrapShapeCircle::centerY):
(WebCore::CSSWrapShapeCircle::setCenterX):
(WebCore::CSSWrapShapeCircle::setCenterY):
(CSSWrapShapeCircle):
(WebCore::CSSWrapShapeEllipse::centerX):
(WebCore::CSSWrapShapeEllipse::centerY):
(WebCore::CSSWrapShapeEllipse::setCenterX):
(WebCore::CSSWrapShapeEllipse::setCenterY):
(CSSWrapShapeEllipse):
* css/WrapShapeFunctions.cpp:
(WebCore::valueForWrapShape):
(WebCore::wrapShapeForValue):
* rendering/style/WrapShapes.h:
(WebCore::WrapShapeRectangle::x):
(WebCore::WrapShapeRectangle::y):
(WebCore::WrapShapeRectangle::setX):
(WebCore::WrapShapeRectangle::setY):
(WrapShapeRectangle):
(WebCore::WrapShapeCircle::centerX):
(WebCore::WrapShapeCircle::centerY):
(WebCore::WrapShapeCircle::setCenterX):
(WebCore::WrapShapeCircle::setCenterY):
(WrapShapeCircle):
(WebCore::WrapShapeEllipse::centerX):
(WebCore::WrapShapeEllipse::centerY):
(WebCore::WrapShapeEllipse::setCenterX):
(WebCore::WrapShapeEllipse::setCenterY):
(WrapShapeEllipse):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122848 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSWrapShapes.cpp
Source/WebCore/css/CSSWrapShapes.h
Source/WebCore/css/WrapShapeFunctions.cpp
Source/WebCore/rendering/style/WrapShapes.h

index b8480be..0f20ac7 100644 (file)
@@ -1,3 +1,63 @@
+2012-07-17  Hans Muller  <hmuller@adobe.com>
+
+        Rename CSS Exclusions CSSWrapShape class properties to match Exclusion shape function parameters
+        https://bugs.webkit.org/show_bug.cgi?id=89669
+
+        Reviewed by Dirk Schulze.
+
+        Renamed left,top properties in the exclusion shape types to better match the specification
+        http://dev.w3.org/csswg/css3-exclusions/#shapes-from-svg-syntax:
+
+        WrapShapeRectangle, CSSWrapShapeRectangle - left,top should be x, y
+        WrapShapeCircle, CSSWrapShapeCircle - left,top should be centerX, centerY
+        WrapShapeEllipse, CSSWrapShapeEllipse - left,top should be centerX, centerY
+
+        No new tests or tests revisions were needed, the existing tests cover these APIs.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseExclusionShapeRectangle):
+        (WebCore::CSSParser::parseExclusionShapeCircle):
+        (WebCore::CSSParser::parseExclusionShapeEllipse):
+        * css/CSSWrapShapes.cpp:
+        (WebCore::CSSWrapShapeRectangle::cssText):
+        (WebCore::CSSWrapShapeCircle::cssText):
+        (WebCore::CSSWrapShapeEllipse::cssText):
+        * css/CSSWrapShapes.h:
+        (WebCore::CSSWrapShapeRectangle::x):
+        (WebCore::CSSWrapShapeRectangle::y):
+        (WebCore::CSSWrapShapeRectangle::setX):
+        (WebCore::CSSWrapShapeRectangle::setY):
+        (CSSWrapShapeRectangle):
+        (WebCore::CSSWrapShapeCircle::centerX):
+        (WebCore::CSSWrapShapeCircle::centerY):
+        (WebCore::CSSWrapShapeCircle::setCenterX):
+        (WebCore::CSSWrapShapeCircle::setCenterY):
+        (CSSWrapShapeCircle):
+        (WebCore::CSSWrapShapeEllipse::centerX):
+        (WebCore::CSSWrapShapeEllipse::centerY):
+        (WebCore::CSSWrapShapeEllipse::setCenterX):
+        (WebCore::CSSWrapShapeEllipse::setCenterY):
+        (CSSWrapShapeEllipse):
+        * css/WrapShapeFunctions.cpp:
+        (WebCore::valueForWrapShape):
+        (WebCore::wrapShapeForValue):
+        * rendering/style/WrapShapes.h:
+        (WebCore::WrapShapeRectangle::x):
+        (WebCore::WrapShapeRectangle::y):
+        (WebCore::WrapShapeRectangle::setX):
+        (WebCore::WrapShapeRectangle::setY):
+        (WrapShapeRectangle):
+        (WebCore::WrapShapeCircle::centerX):
+        (WebCore::WrapShapeCircle::centerY):
+        (WebCore::WrapShapeCircle::setCenterX):
+        (WebCore::WrapShapeCircle::setCenterY):
+        (WrapShapeCircle):
+        (WebCore::WrapShapeEllipse::centerX):
+        (WebCore::WrapShapeEllipse::centerY):
+        (WebCore::WrapShapeEllipse::setCenterX):
+        (WebCore::WrapShapeEllipse::setCenterY):
+        (WrapShapeEllipse):
+
 2012-07-16  Pavel Feldman  <pfeldman@chromium.org>
 
         Web Inspector: implement search / replace in source files (behind experiment flag)
index eee53cc..b1d0270 100644 (file)
@@ -4466,10 +4466,10 @@ PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeRectangle(CSSParserValueL
         ASSERT(argumentNumber < 6);
         switch (argumentNumber) {
         case 0:
-            shape->setLeft(length);
+            shape->setX(length);
             break;
         case 1:
-            shape->setTop(length);
+            shape->setY(length);
             break;
         case 2:
             shape->setWidth(length);
@@ -4503,7 +4503,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeCircle(CSSParserValueList
 {
     ASSERT(args);
 
-    // circle(x, y, r)
+    // circle(centerX, centerY, radius)
     if (args->size() != 5)
         return 0;
 
@@ -4519,10 +4519,10 @@ PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeCircle(CSSParserValueList
         ASSERT(argumentNumber < 3);
         switch (argumentNumber) {
         case 0:
-            shape->setLeft(length);
+            shape->setCenterX(length);
             break;
         case 1:
-            shape->setTop(length);
+            shape->setCenterY(length);
             break;
         case 2:
             shape->setRadius(length);
@@ -4547,7 +4547,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeEllipse(CSSParserValueLis
 {
     ASSERT(args);
 
-    // ellipse(x, y, rx, ry)
+    // ellipse(centerX, centerY, radiusX, radiusY)
     if (args->size() != 7)
         return 0;
 
@@ -4562,10 +4562,10 @@ PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeEllipse(CSSParserValueLis
         ASSERT(argumentNumber < 4);
         switch (argumentNumber) {
         case 0:
-            shape->setLeft(length);
+            shape->setCenterX(length);
             break;
         case 1:
-            shape->setTop(length);
+            shape->setCenterY(length);
             break;
         case 2:
             shape->setRadiusX(length);
index 49eb3b8..16ecc80 100644 (file)
@@ -46,10 +46,10 @@ String CSSWrapShapeRectangle::cssText() const
     result.reserveCapacity(32);
     result.append(rectangleParen);
 
-    result.append(m_left->cssText());
+    result.append(m_x->cssText());
     result.append(comma);
 
-    result.append(m_top->cssText());
+    result.append(m_y->cssText());
     result.append(comma);
 
     result.append(m_width->cssText());
@@ -81,10 +81,10 @@ String CSSWrapShapeCircle::cssText() const
     result.reserveCapacity(32);
     result.append(circleParen);
 
-    result.append(m_left->cssText());
+    result.append(m_centerX->cssText());
     result.append(comma);
 
-    result.append(m_top->cssText());
+    result.append(m_centerY->cssText());
     result.append(comma);
 
     result.append(m_radius->cssText());
@@ -102,10 +102,10 @@ String CSSWrapShapeEllipse::cssText() const
     result.reserveCapacity(32);
     result.append(ellipseParen);
 
-    result.append(m_left->cssText());
+    result.append(m_centerX->cssText());
     result.append(comma);
 
-    result.append(m_top->cssText());
+    result.append(m_centerY->cssText());
     result.append(comma);
 
     result.append(m_radiusX->cssText());
index 713b8dd..347bb34 100644 (file)
@@ -61,15 +61,15 @@ class CSSWrapShapeRectangle : public CSSWrapShape {
 public:
     static PassRefPtr<CSSWrapShapeRectangle> create() { return adoptRef(new CSSWrapShapeRectangle); }
 
-    CSSPrimitiveValue* left() const { return m_left.get(); }
-    CSSPrimitiveValue* top() const { return m_top.get(); }
+    CSSPrimitiveValue* x() const { return m_x.get(); }
+    CSSPrimitiveValue* y() const { return m_y.get(); }
     CSSPrimitiveValue* width() const { return m_width.get(); }
     CSSPrimitiveValue* height() const { return m_height.get(); }
     CSSPrimitiveValue* radiusX() const { return m_radiusX.get(); }
     CSSPrimitiveValue* radiusY() const { return m_radiusY.get(); }
 
-    void setLeft(PassRefPtr<CSSPrimitiveValue> left) { m_left = left; }
-    void setTop(PassRefPtr<CSSPrimitiveValue> top) { m_top = top; }
+    void setX(PassRefPtr<CSSPrimitiveValue> x) { m_x = x; }
+    void setY(PassRefPtr<CSSPrimitiveValue> y) { m_y = y; }
     void setWidth(PassRefPtr<CSSPrimitiveValue> width) { m_width = width; }
     void setHeight(PassRefPtr<CSSPrimitiveValue> height) { m_height = height; }
     void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX; }
@@ -81,8 +81,8 @@ public:
 private:
     CSSWrapShapeRectangle() { }
 
-    RefPtr<CSSPrimitiveValue> m_top;
-    RefPtr<CSSPrimitiveValue> m_left;
+    RefPtr<CSSPrimitiveValue> m_y;
+    RefPtr<CSSPrimitiveValue> m_x;
     RefPtr<CSSPrimitiveValue> m_width;
     RefPtr<CSSPrimitiveValue> m_height;
     RefPtr<CSSPrimitiveValue> m_radiusX;
@@ -93,12 +93,12 @@ class CSSWrapShapeCircle : public CSSWrapShape {
 public:
     static PassRefPtr<CSSWrapShapeCircle> create() { return adoptRef(new CSSWrapShapeCircle); }
 
-    CSSPrimitiveValue* left() const { return m_left.get(); }
-    CSSPrimitiveValue* top() const { return m_top.get(); }
+    CSSPrimitiveValue* centerX() const { return m_centerX.get(); }
+    CSSPrimitiveValue* centerY() const { return m_centerY.get(); }
     CSSPrimitiveValue* radius() const { return m_radius.get(); }
 
-    void setLeft(PassRefPtr<CSSPrimitiveValue> left) { m_left = left; }
-    void setTop(PassRefPtr<CSSPrimitiveValue> top) { m_top = top; }
+    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 Type type() const { return CSS_WRAP_SHAPE_CIRCLE; }
@@ -107,8 +107,8 @@ public:
 private:
     CSSWrapShapeCircle() { }
 
-    RefPtr<CSSPrimitiveValue> m_top;
-    RefPtr<CSSPrimitiveValue> m_left;
+    RefPtr<CSSPrimitiveValue> m_centerY;
+    RefPtr<CSSPrimitiveValue> m_centerX;
     RefPtr<CSSPrimitiveValue> m_radius;
 };
 
@@ -116,13 +116,13 @@ class CSSWrapShapeEllipse : public CSSWrapShape {
 public:
     static PassRefPtr<CSSWrapShapeEllipse> create() { return adoptRef(new CSSWrapShapeEllipse); }
 
-    CSSPrimitiveValue* left() const { return m_left.get(); }
-    CSSPrimitiveValue* top() const { return m_top.get(); }
+    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(); }
 
-    void setLeft(PassRefPtr<CSSPrimitiveValue> left) { m_left = left; }
-    void setTop(PassRefPtr<CSSPrimitiveValue> top) { m_top = top; }
+    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; }
 
@@ -132,8 +132,8 @@ public:
 private:
     CSSWrapShapeEllipse() { }
 
-    RefPtr<CSSPrimitiveValue> m_top;
-    RefPtr<CSSPrimitiveValue> m_left;
+    RefPtr<CSSPrimitiveValue> m_centerX;
+    RefPtr<CSSPrimitiveValue> m_centerY;
     RefPtr<CSSPrimitiveValue> m_radiusX;
     RefPtr<CSSPrimitiveValue> m_radiusY;
 };
index 33fc5a6..6ca6341 100644 (file)
@@ -46,8 +46,8 @@ PassRefPtr<CSSValue> valueForWrapShape(const WrapShape* wrapShape)
         const WrapShapeRectangle* rectangle = static_cast<const WrapShapeRectangle*>(wrapShape);
         RefPtr<CSSWrapShapeRectangle> rectangleValue = CSSWrapShapeRectangle::create();
 
-        rectangleValue->setLeft(cssValuePool().createValue(rectangle->left()));
-        rectangleValue->setTop(cssValuePool().createValue(rectangle->top()));
+        rectangleValue->setX(cssValuePool().createValue(rectangle->x()));
+        rectangleValue->setY(cssValuePool().createValue(rectangle->y()));
         rectangleValue->setWidth(cssValuePool().createValue(rectangle->width()));
         rectangleValue->setHeight(cssValuePool().createValue(rectangle->height()));
         if (!rectangle->cornerRadiusX().isUndefined()) {
@@ -63,8 +63,8 @@ PassRefPtr<CSSValue> valueForWrapShape(const WrapShape* wrapShape)
         const WrapShapeCircle* circle = static_cast<const WrapShapeCircle*>(wrapShape);
         RefPtr<CSSWrapShapeCircle> circleValue = CSSWrapShapeCircle::create();
 
-        circleValue->setLeft(cssValuePool().createValue(circle->left()));
-        circleValue->setTop(cssValuePool().createValue(circle->top()));
+        circleValue->setCenterX(cssValuePool().createValue(circle->centerX()));
+        circleValue->setCenterY(cssValuePool().createValue(circle->centerY()));
         circleValue->setRadius(cssValuePool().createValue(circle->radius()));
 
         wrapShapeValue = circleValue.release();
@@ -74,8 +74,8 @@ PassRefPtr<CSSValue> valueForWrapShape(const WrapShape* wrapShape)
         const WrapShapeEllipse* ellipse = static_cast<const WrapShapeEllipse*>(wrapShape);
         RefPtr<CSSWrapShapeEllipse> ellipseValue = CSSWrapShapeEllipse::create();
 
-        ellipseValue->setLeft(cssValuePool().createValue(ellipse->left()));
-        ellipseValue->setTop(cssValuePool().createValue(ellipse->top()));
+        ellipseValue->setCenterX(cssValuePool().createValue(ellipse->centerX()));
+        ellipseValue->setCenterY(cssValuePool().createValue(ellipse->centerY()));
         ellipseValue->setRadiusX(cssValuePool().createValue(ellipse->radiusX()));
         ellipseValue->setRadiusY(cssValuePool().createValue(ellipse->radiusY()));
 
@@ -114,8 +114,8 @@ PassRefPtr<WrapShape> wrapShapeForValue(const StyleResolver* styleResolver, cons
         const CSSWrapShapeRectangle* rectValue = static_cast<const CSSWrapShapeRectangle *>(wrapShapeValue);
         RefPtr<WrapShapeRectangle> rect = WrapShapeRectangle::create();
 
-        rect->setLeft(convertToLength(styleResolver, rectValue->left()));
-        rect->setTop(convertToLength(styleResolver, rectValue->top()));
+        rect->setX(convertToLength(styleResolver, rectValue->x()));
+        rect->setY(convertToLength(styleResolver, rectValue->y()));
         rect->setWidth(convertToLength(styleResolver, rectValue->width()));
         rect->setHeight(convertToLength(styleResolver, rectValue->height()));
         if (rectValue->radiusX()) {
@@ -130,8 +130,8 @@ PassRefPtr<WrapShape> wrapShapeForValue(const StyleResolver* styleResolver, cons
         const CSSWrapShapeCircle* circleValue = static_cast<const CSSWrapShapeCircle *>(wrapShapeValue);
         RefPtr<WrapShapeCircle> circle = WrapShapeCircle::create();
 
-        circle->setLeft(convertToLength(styleResolver, circleValue->left()));
-        circle->setTop(convertToLength(styleResolver, circleValue->top()));
+        circle->setCenterX(convertToLength(styleResolver, circleValue->centerX()));
+        circle->setCenterY(convertToLength(styleResolver, circleValue->centerY()));
         circle->setRadius(convertToLength(styleResolver, circleValue->radius()));
 
         wrapShape = circle.release();
@@ -141,8 +141,8 @@ PassRefPtr<WrapShape> wrapShapeForValue(const StyleResolver* styleResolver, cons
         const CSSWrapShapeEllipse* ellipseValue = static_cast<const CSSWrapShapeEllipse *>(wrapShapeValue);
         RefPtr<WrapShapeEllipse> ellipse = WrapShapeEllipse::create();
 
-        ellipse->setLeft(convertToLength(styleResolver, ellipseValue->left()));
-        ellipse->setTop(convertToLength(styleResolver, ellipseValue->top()));
+        ellipse->setCenterX(convertToLength(styleResolver, ellipseValue->centerX()));
+        ellipse->setCenterY(convertToLength(styleResolver, ellipseValue->centerY()));
         ellipse->setRadiusX(convertToLength(styleResolver, ellipseValue->radiusX()));
         ellipse->setRadiusY(convertToLength(styleResolver, ellipseValue->radiusY()));
 
index 57e55ec..61052cb 100644 (file)
@@ -55,15 +55,15 @@ class WrapShapeRectangle : public WrapShape {
 public:
     static PassRefPtr<WrapShapeRectangle> create() { return adoptRef(new WrapShapeRectangle); }
 
-    Length left() const { return m_left; }
-    Length top() const { return m_top; }
+    Length x() const { return m_x; }
+    Length y() const { return m_y; }
     Length width() const { return m_width; }
     Length height() const { return m_height; }
     Length cornerRadiusX() const { return m_cornerRadiusX; }
     Length cornerRadiusY() const { return m_cornerRadiusY; }
 
-    void setLeft(Length left) { m_left = left; }
-    void setTop(Length top) { m_top = top; }
+    void setX(Length x) { m_x = x; }
+    void setY(Length y) { m_y = y; }
     void setWidth(Length width) { m_width = width; }
     void setHeight(Length height) { m_height = height; }
     void setCornerRadiusX(Length radiusX) { m_cornerRadiusX = radiusX; }
@@ -77,8 +77,8 @@ private:
         , m_cornerRadiusY(Undefined)
     { }
 
-    Length m_top;
-    Length m_left;
+    Length m_y;
+    Length m_x;
     Length m_width;
     Length m_height;
     Length m_cornerRadiusX;
@@ -89,20 +89,20 @@ class WrapShapeCircle : public WrapShape {
 public:
     static PassRefPtr<WrapShapeCircle> create() { return adoptRef(new WrapShapeCircle); }
 
-    Length left() const { return m_left; }
-    Length top() const { return m_top; }
+    Length centerX() const { return m_centerX; }
+    Length centerY() const { return m_centerY; }
     Length radius() const { return m_radius; }
 
-    void setLeft(Length left) { m_left = left; }
-    void setTop(Length top) { m_top = top; }
+    void setCenterX(Length centerX) { m_centerX = centerX; }
+    void setCenterY(Length centerY) { m_centerY = centerY; }
     void setRadius(Length radius) { m_radius = radius; }
 
     virtual Type type() const { return WRAP_SHAPE_CIRCLE; }
 private:
     WrapShapeCircle() { }
 
-    Length m_top;
-    Length m_left;
+    Length m_centerX;
+    Length m_centerY;
     Length m_radius;
 };
 
@@ -110,13 +110,13 @@ class WrapShapeEllipse : public WrapShape {
 public:
     static PassRefPtr<WrapShapeEllipse> create() { return adoptRef(new WrapShapeEllipse); }
 
-    Length top() const { return m_top; }
-    Length left() const { return m_left; }
+    Length centerX() const { return m_centerX; }
+    Length centerY() const { return m_centerY; }
     Length radiusX() const { return m_radiusX; }
     Length radiusY() const { return m_radiusY; }
 
-    void setTop(Length top) { m_top = top; }
-    void setLeft(Length left) { m_left = left; }
+    void setCenterX(Length centerX) { m_centerX = centerX; }
+    void setCenterY(Length centerY) { m_centerY = centerY; }
     void setRadiusX(Length radiusX) { m_radiusX = radiusX; }
     void setRadiusY(Length radiusY) { m_radiusY = radiusY; }
 
@@ -124,8 +124,8 @@ public:
 private:
     WrapShapeEllipse() { }
 
-    Length m_top;
-    Length m_left;
+    Length m_centerX;
+    Length m_centerY;
     Length m_radiusX;
     Length m_radiusY;
 };