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

Unified Diff: Source/core/css/CSSBasicShapes.cpp

Issue 200633005: [CSS Shapes] Remove deprecated shapes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test expectations Created 6 years, 9 months 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
« no previous file with comments | « Source/core/css/CSSBasicShapes.h ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSBasicShapes.cpp
diff --git a/Source/core/css/CSSBasicShapes.cpp b/Source/core/css/CSSBasicShapes.cpp
index f91a608de1490af4399f9343ceecaf44e43c2e3f..fc0a2f2db1c40c791f375d8b62ef6b5cce62c7bb 100644
--- a/Source/core/css/CSSBasicShapes.cpp
+++ b/Source/core/css/CSSBasicShapes.cpp
@@ -41,74 +41,6 @@ namespace WebCore {
DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(CSSBasicShape)
-static String buildRectangleString(const String& x, const String& y, const String& width, const String& height, const String& radiusX, const String& radiusY, const String& layoutBox)
-{
- const char opening[] = "rectangle(";
- const char separator[] = ", ";
- StringBuilder result;
- // Compute the required capacity in advance to reduce allocations.
- result.reserveCapacity((sizeof(opening) - 1) + (5 * (sizeof(separator) - 1)) + 1 + x.length() + y.length() + width.length() + height.length() + radiusX.length() + radiusY.length() + (layoutBox.isEmpty() ? 0 : layoutBox.length() + 1));
- result.appendLiteral(opening);
- result.append(x);
- result.appendLiteral(separator);
- result.append(y);
- result.appendLiteral(separator);
- result.append(width);
- result.appendLiteral(separator);
- result.append(height);
- if (!radiusX.isNull()) {
- result.appendLiteral(separator);
- result.append(radiusX);
- if (!radiusY.isNull()) {
- result.appendLiteral(separator);
- result.append(radiusY);
- }
- }
- if (!layoutBox.isEmpty()) {
- result.append(' ');
- result.append(layoutBox);
- }
- result.append(')');
- return result.toString();
-}
-
-String CSSBasicShapeRectangle::cssText() const
-{
- return buildRectangleString(m_x->cssText(),
- m_y->cssText(),
- m_width->cssText(),
- m_height->cssText(),
- m_radiusX.get() ? m_radiusX->cssText() : String(),
- m_radiusY.get() ? m_radiusY->cssText() : String(),
- m_layoutBox ? m_layoutBox->cssText() : String());
-}
-
-bool CSSBasicShapeRectangle::equals(const CSSBasicShape& shape) const
-{
- if (shape.type() != CSSBasicShapeRectangleType)
- return false;
-
- const CSSBasicShapeRectangle& other = static_cast<const CSSBasicShapeRectangle&>(shape);
- return compareCSSValuePtr(m_x, other.m_x)
- && compareCSSValuePtr(m_y, other.m_y)
- && compareCSSValuePtr(m_width, other.m_width)
- && compareCSSValuePtr(m_height, other.m_height)
- && compareCSSValuePtr(m_radiusX, other.m_radiusX)
- && compareCSSValuePtr(m_radiusY, other.m_radiusY)
- && compareCSSValuePtr(m_layoutBox, other.m_layoutBox);
-}
-
-void CSSBasicShapeRectangle::trace(Visitor* visitor)
-{
- visitor->trace(m_y);
- visitor->trace(m_x);
- visitor->trace(m_width);
- visitor->trace(m_height);
- visitor->trace(m_radiusX);
- visitor->trace(m_radiusY);
- CSSBasicShape::trace(visitor);
-}
-
static String buildCircleString(const String& radius, const String& centerX, const String& centerY, const String& layoutBox)
{
char at[] = "at";
@@ -208,35 +140,6 @@ void CSSBasicShapeCircle::trace(Visitor* visitor)
CSSBasicShape::trace(visitor);
}
-static String buildDeprecatedCircleString(const String& x, const String& y, const String& radius)
-{
- return "circle(" + x + ", " + y + ", " + radius + ')';
-}
-
-String CSSDeprecatedBasicShapeCircle::cssText() const
-{
- return buildDeprecatedCircleString(m_centerX->cssText(), m_centerY->cssText(), m_radius->cssText());
-}
-
-bool CSSDeprecatedBasicShapeCircle::equals(const CSSBasicShape& shape) const
-{
- if (shape.type() != CSSDeprecatedBasicShapeCircleType)
- return false;
-
- const CSSDeprecatedBasicShapeCircle& other = static_cast<const CSSDeprecatedBasicShapeCircle&>(shape);
- return compareCSSValuePtr(m_centerX, other.m_centerX)
- && compareCSSValuePtr(m_centerY, other.m_centerY)
- && compareCSSValuePtr(m_radius, other.m_radius);
-}
-
-void CSSDeprecatedBasicShapeCircle::trace(Visitor* visitor)
-{
- visitor->trace(m_centerX);
- visitor->trace(m_centerY);
- visitor->trace(m_radius);
- CSSBasicShape::trace(visitor);
-}
-
static String buildEllipseString(const String& radiusX, const String& radiusY, const String& centerX, const String& centerY, const String& box)
{
char at[] = "at";
@@ -306,37 +209,6 @@ void CSSBasicShapeEllipse::trace(Visitor* visitor)
CSSBasicShape::trace(visitor);
}
-static String buildDeprecatedEllipseString(const String& x, const String& y, const String& radiusX, const String& radiusY)
-{
- return "ellipse(" + x + ", " + y + ", " + radiusX + ", " + radiusY + ')';
-}
-
-String CSSDeprecatedBasicShapeEllipse::cssText() const
-{
- return buildDeprecatedEllipseString(m_centerX->cssText(), m_centerY->cssText(), m_radiusX->cssText(), m_radiusY->cssText());
-}
-
-bool CSSDeprecatedBasicShapeEllipse::equals(const CSSBasicShape& shape) const
-{
- if (shape.type() != CSSDeprecatedBasicShapeEllipseType)
- return false;
-
- const CSSDeprecatedBasicShapeEllipse& other = static_cast<const CSSDeprecatedBasicShapeEllipse&>(shape);
- return compareCSSValuePtr(m_centerX, other.m_centerX)
- && compareCSSValuePtr(m_centerY, other.m_centerY)
- && compareCSSValuePtr(m_radiusX, other.m_radiusX)
- && compareCSSValuePtr(m_radiusY, other.m_radiusY);
-}
-
-void CSSDeprecatedBasicShapeEllipse::trace(Visitor* visitor)
-{
- visitor->trace(m_centerX);
- visitor->trace(m_centerY);
- visitor->trace(m_radiusX);
- visitor->trace(m_radiusY);
- CSSBasicShape::trace(visitor);
-}
-
static String buildPolygonString(const WindRule& windRule, const Vector<String>& points, const String& layoutBox)
{
ASSERT(!(points.size() % 2));
@@ -412,76 +284,6 @@ void CSSBasicShapePolygon::trace(Visitor* visitor)
CSSBasicShape::trace(visitor);
}
-static String buildInsetRectangleString(const String& top, const String& right, const String& bottom, const String& left, const String& radiusX, const String& radiusY, const String& layoutBox)
-{
- const char opening[] = "inset-rectangle(";
- const char separator[] = ", ";
- StringBuilder result;
- // Compute the required capacity in advance to reduce allocations.
- result.reserveCapacity((sizeof(opening) - 1) + (5 * (sizeof(separator) - 1)) + 1 + top.length() + right.length() + bottom.length() + left.length() + radiusX.length() + radiusY.length() + (layoutBox.isEmpty() ? 0 : layoutBox.length() + 1));
- result.appendLiteral(opening);
- result.append(top);
- result.appendLiteral(separator);
- result.append(right);
- result.appendLiteral(separator);
- result.append(bottom);
- result.appendLiteral(separator);
- result.append(left);
- if (!radiusX.isNull()) {
- result.appendLiteral(separator);
- result.append(radiusX);
- if (!radiusY.isNull()) {
- result.appendLiteral(separator);
- result.append(radiusY);
- }
- }
- result.append(')');
-
- if (!layoutBox.isEmpty()) {
- result.append(' ');
- result.append(layoutBox);
- }
-
- return result.toString();
-}
-
-String CSSBasicShapeInsetRectangle::cssText() const
-{
- return buildInsetRectangleString(m_top->cssText(),
- m_right->cssText(),
- m_bottom->cssText(),
- m_left->cssText(),
- m_radiusX.get() ? m_radiusX->cssText() : String(),
- m_radiusY.get() ? m_radiusY->cssText() : String(),
- m_layoutBox ? m_layoutBox->cssText() : String());
-}
-
-bool CSSBasicShapeInsetRectangle::equals(const CSSBasicShape& shape) const
-{
- if (shape.type() != CSSBasicShapeInsetRectangleType)
- return false;
-
- const CSSBasicShapeInsetRectangle& other = static_cast<const CSSBasicShapeInsetRectangle&>(shape);
- return compareCSSValuePtr(m_top, other.m_top)
- && compareCSSValuePtr(m_right, other.m_right)
- && compareCSSValuePtr(m_bottom, other.m_bottom)
- && compareCSSValuePtr(m_left, other.m_left)
- && compareCSSValuePtr(m_radiusX, other.m_radiusX)
- && compareCSSValuePtr(m_radiusY, other.m_radiusY)
- && compareCSSValuePtr(m_layoutBox, other.m_layoutBox);
-}
-
-void CSSBasicShapeInsetRectangle::trace(Visitor* visitor)
-{
- visitor->trace(m_right);
- visitor->trace(m_top);
- visitor->trace(m_bottom);
- visitor->trace(m_left);
- visitor->trace(m_radiusX);
- visitor->trace(m_radiusY);
- CSSBasicShape::trace(visitor);
-}
-
static String buildInsetString(const String& top, const String& right, const String& bottom, const String& left,
const String& topLeftRadiusWidth, const String& topLeftRadiusHeight,
const String& topRightRadiusWidth, const String& topRightRadiusHeight,
« no previous file with comments | « Source/core/css/CSSBasicShapes.h ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698