- Revision
- 122848
- Author
- [email protected]
- Date
- 2012-07-17 09:54:59 -0700 (Tue, 17 Jul 2012)
Log Message
Rename CSS Exclusions CSSWrapShape class properties to match Exclusion shape function parameters
https://bugs.webkit.org/show_bug.cgi?id=89669
Patch by Hans Muller <[email protected]> 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (122847 => 122848)
--- trunk/Source/WebCore/ChangeLog 2012-07-17 16:32:25 UTC (rev 122847)
+++ trunk/Source/WebCore/ChangeLog 2012-07-17 16:54:59 UTC (rev 122848)
@@ -1,3 +1,63 @@
+2012-07-17 Hans Muller <[email protected]>
+
+ 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 <[email protected]>
Web Inspector: implement search / replace in source files (behind experiment flag)
Modified: trunk/Source/WebCore/css/CSSParser.cpp (122847 => 122848)
--- trunk/Source/WebCore/css/CSSParser.cpp 2012-07-17 16:32:25 UTC (rev 122847)
+++ trunk/Source/WebCore/css/CSSParser.cpp 2012-07-17 16:54:59 UTC (rev 122848)
@@ -4466,10 +4466,10 @@
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 @@
{
ASSERT(args);
- // circle(x, y, r)
+ // circle(centerX, centerY, radius)
if (args->size() != 5)
return 0;
@@ -4519,10 +4519,10 @@
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 @@
{
ASSERT(args);
- // ellipse(x, y, rx, ry)
+ // ellipse(centerX, centerY, radiusX, radiusY)
if (args->size() != 7)
return 0;
@@ -4562,10 +4562,10 @@
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);
Modified: trunk/Source/WebCore/css/CSSWrapShapes.cpp (122847 => 122848)
--- trunk/Source/WebCore/css/CSSWrapShapes.cpp 2012-07-17 16:32:25 UTC (rev 122847)
+++ trunk/Source/WebCore/css/CSSWrapShapes.cpp 2012-07-17 16:54:59 UTC (rev 122848)
@@ -46,10 +46,10 @@
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 @@
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 @@
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());
Modified: trunk/Source/WebCore/css/CSSWrapShapes.h (122847 => 122848)
--- trunk/Source/WebCore/css/CSSWrapShapes.h 2012-07-17 16:32:25 UTC (rev 122847)
+++ trunk/Source/WebCore/css/CSSWrapShapes.h 2012-07-17 16:54:59 UTC (rev 122848)
@@ -61,15 +61,15 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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;
};
Modified: trunk/Source/WebCore/css/WrapShapeFunctions.cpp (122847 => 122848)
--- trunk/Source/WebCore/css/WrapShapeFunctions.cpp 2012-07-17 16:32:25 UTC (rev 122847)
+++ trunk/Source/WebCore/css/WrapShapeFunctions.cpp 2012-07-17 16:54:59 UTC (rev 122848)
@@ -46,8 +46,8 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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()));
Modified: trunk/Source/WebCore/rendering/style/WrapShapes.h (122847 => 122848)
--- trunk/Source/WebCore/rendering/style/WrapShapes.h 2012-07-17 16:32:25 UTC (rev 122847)
+++ trunk/Source/WebCore/rendering/style/WrapShapes.h 2012-07-17 16:54:59 UTC (rev 122848)
@@ -55,15 +55,15 @@
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 @@
, 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 @@
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 @@
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 @@
private:
WrapShapeEllipse() { }
- Length m_top;
- Length m_left;
+ Length m_centerX;
+ Length m_centerY;
Length m_radiusX;
Length m_radiusY;
};