Title: [189139] trunk/Source/WebCore
Revision
189139
Author
bjone...@adobe.com
Date
2015-08-28 19:28:51 -0700 (Fri, 28 Aug 2015)

Log Message

[CSS Shapes] Remove unused CSSBasicShape::m_referenceBox
https://bugs.webkit.org/show_bug.cgi?id=148588

Reviewed by Zoltan Horvath.

At some point, the code was refactored to no longer store the
referenceBox in CSSBasicShape; however, it looks like this code
wasn't cleaned up. This patch rectifies this.

This is based on a Blink patch by Timothy Loh.

No new tests, removing unused code.

* css/CSSBasicShapes.cpp:
(WebCore::buildCircleString):
(WebCore::CSSBasicShapeCircle::cssText):
(WebCore::CSSBasicShapeCircle::equals):
(WebCore::buildEllipseString):
(WebCore::CSSBasicShapeEllipse::cssText):
(WebCore::CSSBasicShapeEllipse::equals):
(WebCore::buildPolygonString):
(WebCore::CSSBasicShapePolygon::cssText):
(WebCore::CSSBasicShapePolygon::equals):
(WebCore::buildInsetString):
(WebCore::CSSBasicShapeInset::cssText):
* css/CSSBasicShapes.h:
(WebCore::CSSBasicShape::referenceBox): Deleted.
(WebCore::CSSBasicShape::setReferenceBox): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (189138 => 189139)


--- trunk/Source/WebCore/ChangeLog	2015-08-29 02:04:36 UTC (rev 189138)
+++ trunk/Source/WebCore/ChangeLog	2015-08-29 02:28:51 UTC (rev 189139)
@@ -1,3 +1,34 @@
+2015-08-28  Bem Jones-Bey  <bjone...@adobe.com>
+
+        [CSS Shapes] Remove unused CSSBasicShape::m_referenceBox
+        https://bugs.webkit.org/show_bug.cgi?id=148588
+
+        Reviewed by Zoltan Horvath.
+
+        At some point, the code was refactored to no longer store the
+        referenceBox in CSSBasicShape; however, it looks like this code
+        wasn't cleaned up. This patch rectifies this.
+
+        This is based on a Blink patch by Timothy Loh.
+
+        No new tests, removing unused code.
+
+        * css/CSSBasicShapes.cpp:
+        (WebCore::buildCircleString):
+        (WebCore::CSSBasicShapeCircle::cssText):
+        (WebCore::CSSBasicShapeCircle::equals):
+        (WebCore::buildEllipseString):
+        (WebCore::CSSBasicShapeEllipse::cssText):
+        (WebCore::CSSBasicShapeEllipse::equals):
+        (WebCore::buildPolygonString):
+        (WebCore::CSSBasicShapePolygon::cssText):
+        (WebCore::CSSBasicShapePolygon::equals):
+        (WebCore::buildInsetString):
+        (WebCore::CSSBasicShapeInset::cssText):
+        * css/CSSBasicShapes.h:
+        (WebCore::CSSBasicShape::referenceBox): Deleted.
+        (WebCore::CSSBasicShape::setReferenceBox): Deleted.
+
 2015-08-28  Eric Carlson  <eric.carl...@apple.com>
 
         [Mac] Restructure WebMediaSessionManager for testing

Modified: trunk/Source/WebCore/css/CSSBasicShapes.cpp (189138 => 189139)


--- trunk/Source/WebCore/css/CSSBasicShapes.cpp	2015-08-29 02:04:36 UTC (rev 189138)
+++ trunk/Source/WebCore/css/CSSBasicShapes.cpp	2015-08-29 02:28:51 UTC (rev 189139)
@@ -82,7 +82,7 @@
     return cssValuePool.createValue(Pair::create(cssValuePool.createValue(side), amount.release()));
 }
 
-static String buildCircleString(const String& radius, const String& centerX, const String& centerY, const String& box)
+static String buildCircleString(const String& radius, const String& centerX, const String& centerY)
 {
     char opening[] = "circle(";
     char at[] = "at";
@@ -102,10 +102,6 @@
         result.append(centerY);
     }
     result.appendLiteral(")");
-    if (box.length()) {
-        result.appendLiteral(separator);
-        result.append(box);
-    }
     return result.toString();
 }
 
@@ -120,8 +116,7 @@
 
     return buildCircleString(radius,
         serializePositionOffset(*normalizedCX->getPairValue(), *normalizedCY->getPairValue()),
-        serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->getPairValue()),
-        m_referenceBox ? m_referenceBox->cssText() : String());
+        serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->getPairValue()));
 }
 
 bool CSSBasicShapeCircle::equals(const CSSBasicShape& shape) const
@@ -132,11 +127,10 @@
     const CSSBasicShapeCircle& other = downcast<CSSBasicShapeCircle>(shape);
     return compareCSSValuePtr(m_centerX, other.m_centerX)
         && compareCSSValuePtr(m_centerY, other.m_centerY)
-        && compareCSSValuePtr(m_radius, other.m_radius)
-        && compareCSSValuePtr(m_referenceBox, other.m_referenceBox);
+        && compareCSSValuePtr(m_radius, other.m_radius);
 }
 
-static String buildEllipseString(const String& radiusX, const String& radiusY, const String& centerX, const String& centerY, const String& box)
+static String buildEllipseString(const String& radiusX, const String& radiusY, const String& centerX, const String& centerY)
 {
     char opening[] = "ellipse(";
     char at[] = "at";
@@ -165,10 +159,6 @@
         result.append(centerY);
     }
     result.appendLiteral(")");
-    if (box.length()) {
-        result.appendLiteral(separator);
-        result.append(box);
-    }
     return result.toString();
 }
 
@@ -193,8 +183,7 @@
     }
     return buildEllipseString(radiusX, radiusY,
         serializePositionOffset(*normalizedCX->getPairValue(), *normalizedCY->getPairValue()),
-        serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->getPairValue()),
-        m_referenceBox ? m_referenceBox->cssText() : String());
+        serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->getPairValue()));
 }
 
 bool CSSBasicShapeEllipse::equals(const CSSBasicShape& shape) const
@@ -206,11 +195,10 @@
     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)
-        && compareCSSValuePtr(m_referenceBox, other.m_referenceBox);
+        && compareCSSValuePtr(m_radiusY, other.m_radiusY);
 }
 
-static String buildPolygonString(const WindRule& windRule, const Vector<String>& points, const String& box)
+static String buildPolygonString(const WindRule& windRule, const Vector<String>& points)
 {
     ASSERT(!(points.size() % 2));
 
@@ -229,9 +217,6 @@
         length += points[i].length() + 1 + points[i + 1].length();
     }
 
-    if (box.length())
-        length += box.length() + 1;
-
     result.reserveCapacity(length);
 
     if (windRule == RULE_EVENODD)
@@ -249,11 +234,6 @@
 
     result.append(')');
 
-    if (box.length()) {
-        result.append(' ');
-        result.append(box);
-    }
-
     return result.toString();
 }
 
@@ -265,7 +245,7 @@
     for (size_t i = 0; i < m_values.size(); ++i)
         points.append(m_values.at(i)->cssText());
 
-    return buildPolygonString(m_windRule, points, m_referenceBox ? m_referenceBox->cssText() : String());
+    return buildPolygonString(m_windRule, points);
 }
 
 bool CSSBasicShapePolygon::equals(const CSSBasicShape& shape) const
@@ -274,8 +254,7 @@
         return false;
 
     const CSSBasicShapePolygon& rhs = downcast<CSSBasicShapePolygon>(shape);
-    return compareCSSValuePtr(m_referenceBox, rhs.m_referenceBox)
-        && compareCSSValueVector<CSSPrimitiveValue>(m_values, rhs.m_values);
+    return compareCSSValueVector<CSSPrimitiveValue>(m_values, rhs.m_values);
 }
 
 static bool buildInsetRadii(Vector<String>& radii, const String& topLeftRadius, const String& topRightRadius, const String& bottomRightRadius, const String& bottomLeftRadius)
@@ -299,8 +278,7 @@
     const String& topLeftRadiusWidth, const String& topLeftRadiusHeight,
     const String& topRightRadiusWidth, const String& topRightRadiusHeight,
     const String& bottomRightRadiusWidth, const String& bottomRightRadiusHeight,
-    const String& bottomLeftRadiusWidth, const String& bottomLeftRadiusHeight,
-    const String& box)
+    const String& bottomLeftRadiusWidth, const String& bottomLeftRadiusHeight)
 {
     char opening[] = "inset(";
     char separator[] = " ";
@@ -354,10 +332,6 @@
         }
     }
     result.append(')');
-    if (box.length()) {
-        result.append(' ');
-        result.append(box);
-    }
     return result.toString();
 }
 
@@ -399,8 +373,7 @@
         bottomRightRadiusWidth,
         bottomRightRadiusHeight,
         bottomLeftRadiusWidth,
-        bottomLeftRadiusHeight,
-        m_referenceBox ? m_referenceBox->cssText() : String());
+        bottomLeftRadiusHeight);
 }
 
 bool CSSBasicShapeInset::equals(const CSSBasicShape& shape) const

Modified: trunk/Source/WebCore/css/CSSBasicShapes.h (189138 => 189139)


--- trunk/Source/WebCore/css/CSSBasicShapes.h	2015-08-29 02:04:36 UTC (rev 189138)
+++ trunk/Source/WebCore/css/CSSBasicShapes.h	2015-08-29 02:28:51 UTC (rev 189139)
@@ -52,9 +52,6 @@
     virtual String cssText() const = 0;
     virtual bool equals(const CSSBasicShape&) const = 0;
 
-    CSSPrimitiveValue* referenceBox() const { return m_referenceBox.get(); }
-    void setReferenceBox(PassRefPtr<CSSPrimitiveValue> referenceBox) { m_referenceBox = referenceBox; }
-
 public:
     virtual ~CSSBasicShape() { }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to