[Cherry-pick] Refactor WrapShape classes to BasicShape
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Aug 2012 17:08:00 +0000 (17:08 +0000)
committerSanghyup Lee <sh53.lee@samsung.com>
Tue, 26 Mar 2013 06:35:15 +0000 (15:35 +0900)
[Title] Refactor WrapShape classes to BasicShape
[Issues] N/A
[Problem] N/A
[Solution] Cherry picked.
[Cherry-Picker] Sanghyup Lee <sh53.lee@samsung.com>

Refactor WrapShape classes to BasicShape
https://bugs.webkit.org/show_bug.cgi?id=95461

Reviewed by Rob Buis.

This is a follow up patch of bug 95411. While the previous patch
just renamed the files, this patch renames the classes, enumerations
and functions.

Just refactoring of internal names. No new tests.

* css/BasicShapeFunctions.cpp:
(WebCore::valueForBasicShape):
(WebCore::basicShapeForValue):
* css/BasicShapeFunctions.h:
(WebCore):
* css/CSSBasicShapes.cpp:
(WebCore::CSSBasicShapeRectangle::cssText):
(WebCore::CSSBasicShapeCircle::cssText):
(WebCore::CSSBasicShapeEllipse::cssText):
(WebCore::CSSBasicShapePolygon::cssText):
* css/CSSBasicShapes.h:
(WebCore::CSSBasicShape::~CSSBasicShape):
(WebCore::CSSBasicShape::CSSBasicShape):
(WebCore::CSSBasicShapeRectangle::create):
(WebCore::CSSBasicShapeRectangle::type):
(WebCore::CSSBasicShapeRectangle::CSSBasicShapeRectangle):
(WebCore::CSSBasicShapeCircle::create):
(WebCore::CSSBasicShapeCircle::type):
(WebCore::CSSBasicShapeCircle::CSSBasicShapeCircle):
(WebCore::CSSBasicShapeEllipse::create):
(WebCore::CSSBasicShapeEllipse::type):
(WebCore::CSSBasicShapeEllipse::CSSBasicShapeEllipse):
(WebCore::CSSBasicShapePolygon::create):
(WebCore::CSSBasicShapePolygon::type):
(WebCore::CSSBasicShapePolygon::CSSBasicShapePolygon):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseBasicShapeRectangle):
(WebCore::CSSParser::parseBasicShapeCircle):
(WebCore::CSSParser::parseBasicShapeEllipse):
(WebCore::CSSParser::parseBasicShapePolygon):
(WebCore::CSSParser::parseBasicShape):
* css/CSSParser.h:
(WebCore):
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::init):
* css/CSSPrimitiveValue.h:
(WebCore):
(WebCore::CSSPrimitiveValue::getShapeValue):
(CSSPrimitiveValue):
* css/StyleBuilder.cpp:
(WebCore):
(WebCore::ApplyPropertyWrapShape::setValue):
(WebCore::ApplyPropertyWrapShape::applyValue):
(WebCore::ApplyPropertyWrapShape::createHandler):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateWrapShapeInfoAfterStyleChange):
* rendering/RenderBlock.h:
(RenderBlock):
* rendering/WrapShapeInfo.cpp:
(WebCore::WrapShapeInfo::isWrapShapeInfoEnabledForRenderBlock):
(WebCore::WrapShapeInfo::computeShapeSize):
* rendering/style/BasicShapes.cpp:
(WebCore::BasicShape::destroy):
* rendering/style/BasicShapes.h:
(WebCore::BasicShape::BasicShape):
(WebCore::BasicShapeRectangle::create):
(WebCore::BasicShapeRectangle::BasicShapeRectangle):
(WebCore::BasicShapeCircle::create):
(WebCore::BasicShapeCircle::BasicShapeCircle):
(WebCore::BasicShapeEllipse::create):
(WebCore::BasicShapeEllipse::BasicShapeEllipse):
(WebCore::BasicShapePolygon::create):
(WebCore::BasicShapePolygon::BasicShapePolygon):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.h:
(StyleRareNonInheritedData):

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

Conflicts:

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/WrapShapeInfo.cpp

14 files changed:
Source/WebCore/css/BasicShapeFunctions.cpp
Source/WebCore/css/BasicShapeFunctions.h
Source/WebCore/css/CSSBasicShapes.cpp
Source/WebCore/css/CSSBasicShapes.h
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/StyleBuilder.cpp
Source/WebCore/rendering/style/BasicShapes.cpp
Source/WebCore/rendering/style/BasicShapes.h
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.h

index c8d50ec..3a8f795 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<CSSValue> valueForWrapShape(const WrapShape* wrapShape)
+PassRefPtr<CSSValue> valueForBasicShape(const BasicShape* basicShape)
 {
-    RefPtr<CSSWrapShape> wrapShapeValue;
-    switch (wrapShape->type()) {
-    case WrapShape::WRAP_SHAPE_RECTANGLE: {
-        const WrapShapeRectangle* rectangle = static_cast<const WrapShapeRectangle*>(wrapShape);
-        RefPtr<CSSWrapShapeRectangle> rectangleValue = CSSWrapShapeRectangle::create();
+    RefPtr<CSSBasicShape> basicShapeValue;
+    switch (basicShape->type()) {
+    case BasicShape::BASIC_SHAPE_RECTANGLE: {
+        const BasicShapeRectangle* rectangle = static_cast<const BasicShapeRectangle*>(basicShape);
+        RefPtr<CSSBasicShapeRectangle> rectangleValue = CSSBasicShapeRectangle::create();
 
         rectangleValue->setX(cssValuePool().createValue(rectangle->x()));
         rectangleValue->setY(cssValuePool().createValue(rectangle->y()));
@@ -56,48 +56,48 @@ PassRefPtr<CSSValue> valueForWrapShape(const WrapShape* wrapShape)
                 rectangleValue->setRadiusY(cssValuePool().createValue(rectangle->cornerRadiusY()));
         }
 
-        wrapShapeValue = rectangleValue.release();
+        basicShapeValue = rectangleValue.release();
         break;
     }
-    case WrapShape::WRAP_SHAPE_CIRCLE: {
-        const WrapShapeCircle* circle = static_cast<const WrapShapeCircle*>(wrapShape);
-        RefPtr<CSSWrapShapeCircle> circleValue = CSSWrapShapeCircle::create();
+    case BasicShape::BASIC_SHAPE_CIRCLE: {
+        const BasicShapeCircle* circle = static_cast<const BasicShapeCircle*>(basicShape);
+        RefPtr<CSSBasicShapeCircle> circleValue = CSSBasicShapeCircle::create();
 
         circleValue->setCenterX(cssValuePool().createValue(circle->centerX()));
         circleValue->setCenterY(cssValuePool().createValue(circle->centerY()));
         circleValue->setRadius(cssValuePool().createValue(circle->radius()));
 
-        wrapShapeValue = circleValue.release();
+        basicShapeValue = circleValue.release();
         break;
     }
-    case WrapShape::WRAP_SHAPE_ELLIPSE: {
-        const WrapShapeEllipse* ellipse = static_cast<const WrapShapeEllipse*>(wrapShape);
-        RefPtr<CSSWrapShapeEllipse> ellipseValue = CSSWrapShapeEllipse::create();
+    case BasicShape::BASIC_SHAPE_ELLIPSE: {
+        const BasicShapeEllipse* ellipse = static_cast<const BasicShapeEllipse*>(basicShape);
+        RefPtr<CSSBasicShapeEllipse> ellipseValue = CSSBasicShapeEllipse::create();
 
         ellipseValue->setCenterX(cssValuePool().createValue(ellipse->centerX()));
         ellipseValue->setCenterY(cssValuePool().createValue(ellipse->centerY()));
         ellipseValue->setRadiusX(cssValuePool().createValue(ellipse->radiusX()));
         ellipseValue->setRadiusY(cssValuePool().createValue(ellipse->radiusY()));
 
-        wrapShapeValue = ellipseValue.release();
+        basicShapeValue = ellipseValue.release();
         break;
     }
-    case WrapShape::WRAP_SHAPE_POLYGON: {
-        const WrapShapePolygon* polygon = static_cast<const WrapShapePolygon*>(wrapShape);
-        RefPtr<CSSWrapShapePolygon> polygonValue = CSSWrapShapePolygon::create();
+    case BasicShape::BASIC_SHAPE_POLYGON: {
+        const BasicShapePolygon* polygon = static_cast<const BasicShapePolygon*>(basicShape);
+        RefPtr<CSSBasicShapePolygon> polygonValue = CSSBasicShapePolygon::create();
 
         polygonValue->setWindRule(polygon->windRule());
         const Vector<Length>& values = polygon->values();
         for (unsigned i = 0; i < values.size(); i += 2)
             polygonValue->appendPoint(cssValuePool().createValue(values.at(i)), cssValuePool().createValue(values.at(i + 1)));
 
-        wrapShapeValue = polygonValue.release();
+        basicShapeValue = polygonValue.release();
         break;
     }
     default:
         break;
     }
-    return cssValuePool().createValue<PassRefPtr<CSSWrapShape> >(wrapShapeValue.release());
+    return cssValuePool().createValue<PassRefPtr<CSSBasicShape> >(basicShapeValue.release());
 }
 
 static Length convertToLength(const StyleResolver* styleResolver, CSSPrimitiveValue* value)
@@ -105,14 +105,14 @@ static Length convertToLength(const StyleResolver* styleResolver, CSSPrimitiveVa
     return value->convertToLength<FixedIntegerConversion | FixedFloatConversion | PercentConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
 }
 
-PassRefPtr<WrapShape> wrapShapeForValue(const StyleResolver* styleResolver, const CSSWrapShape* wrapShapeValue)
+PassRefPtr<BasicShape> basicShapeForValue(const StyleResolver* styleResolver, const CSSBasicShape* basicShapeValue)
 {
-    RefPtr<WrapShape> wrapShape;
+    RefPtr<BasicShape> basicShape;
 
-    switch (wrapShapeValue->type()) {
-    case CSSWrapShape::CSS_WRAP_SHAPE_RECTANGLE: {
-        const CSSWrapShapeRectangle* rectValue = static_cast<const CSSWrapShapeRectangle *>(wrapShapeValue);
-        RefPtr<WrapShapeRectangle> rect = WrapShapeRectangle::create();
+    switch (basicShapeValue->type()) {
+    case CSSBasicShape::CSS_BASIC_SHAPE_RECTANGLE: {
+        const CSSBasicShapeRectangle* rectValue = static_cast<const CSSBasicShapeRectangle *>(basicShapeValue);
+        RefPtr<BasicShapeRectangle> rect = BasicShapeRectangle::create();
 
         rect->setX(convertToLength(styleResolver, rectValue->x()));
         rect->setY(convertToLength(styleResolver, rectValue->y()));
@@ -123,47 +123,47 @@ PassRefPtr<WrapShape> wrapShapeForValue(const StyleResolver* styleResolver, cons
             if (rectValue->radiusY())
                 rect->setCornerRadiusY(convertToLength(styleResolver, rectValue->radiusY()));
         }
-        wrapShape = rect.release();
+        basicShape = rect.release();
         break;
     }
-    case CSSWrapShape::CSS_WRAP_SHAPE_CIRCLE: {
-        const CSSWrapShapeCircle* circleValue = static_cast<const CSSWrapShapeCircle *>(wrapShapeValue);
-        RefPtr<WrapShapeCircle> circle = WrapShapeCircle::create();
+    case CSSBasicShape::CSS_BASIC_SHAPE_CIRCLE: {
+        const CSSBasicShapeCircle* circleValue = static_cast<const CSSBasicShapeCircle *>(basicShapeValue);
+        RefPtr<BasicShapeCircle> circle = BasicShapeCircle::create();
 
         circle->setCenterX(convertToLength(styleResolver, circleValue->centerX()));
         circle->setCenterY(convertToLength(styleResolver, circleValue->centerY()));
         circle->setRadius(convertToLength(styleResolver, circleValue->radius()));
 
-        wrapShape = circle.release();
+        basicShape = circle.release();
         break;
     }
-    case CSSWrapShape::CSS_WRAP_SHAPE_ELLIPSE: {
-        const CSSWrapShapeEllipse* ellipseValue = static_cast<const CSSWrapShapeEllipse *>(wrapShapeValue);
-        RefPtr<WrapShapeEllipse> ellipse = WrapShapeEllipse::create();
+    case CSSBasicShape::CSS_BASIC_SHAPE_ELLIPSE: {
+        const CSSBasicShapeEllipse* ellipseValue = static_cast<const CSSBasicShapeEllipse *>(basicShapeValue);
+        RefPtr<BasicShapeEllipse> ellipse = BasicShapeEllipse::create();
 
         ellipse->setCenterX(convertToLength(styleResolver, ellipseValue->centerX()));
         ellipse->setCenterY(convertToLength(styleResolver, ellipseValue->centerY()));
         ellipse->setRadiusX(convertToLength(styleResolver, ellipseValue->radiusX()));
         ellipse->setRadiusY(convertToLength(styleResolver, ellipseValue->radiusY()));
 
-        wrapShape = ellipse.release();
+        basicShape = ellipse.release();
         break;
     }
-    case CSSWrapShape::CSS_WRAP_SHAPE_POLYGON: {
-        const CSSWrapShapePolygon* polygonValue = static_cast<const CSSWrapShapePolygon *>(wrapShapeValue);
-        RefPtr<WrapShapePolygon> polygon = WrapShapePolygon::create();
+    case CSSBasicShape::CSS_BASIC_SHAPE_POLYGON: {
+        const CSSBasicShapePolygon* polygonValue = static_cast<const CSSBasicShapePolygon *>(basicShapeValue);
+        RefPtr<BasicShapePolygon> polygon = BasicShapePolygon::create();
 
         polygon->setWindRule(polygonValue->windRule());
         const Vector<RefPtr<CSSPrimitiveValue> >& values = polygonValue->values();
         for (unsigned i = 0; i < values.size(); i += 2)
             polygon->appendPoint(convertToLength(styleResolver, values.at(i).get()), convertToLength(styleResolver, values.at(i + 1).get()));
 
-        wrapShape = polygon.release();
+        basicShape = polygon.release();
         break;
     }
     default:
         break;
     }
-    return wrapShape.release();
+    return basicShape.release();
 }
 }
index 50c2934..d3607e9 100644 (file)
 
 namespace WebCore {
 
+class BasicShape;
+class CSSBasicShape;
 class CSSValue;
-class CSSWrapShape;
 class StyleResolver;
-class WrapShape;
 
-PassRefPtr<CSSValue> valueForWrapShape(const WrapShape*);
-PassRefPtr<WrapShape> wrapShapeForValue(const StyleResolver*, const CSSWrapShape*);
+PassRefPtr<CSSValue> valueForBasicShape(const BasicShape*);
+PassRefPtr<BasicShape> basicShapeForValue(const StyleResolver*, const CSSBasicShape*);
 
 }
 #endif
index 488d3f4..eac789f 100644 (file)
@@ -37,7 +37,7 @@ using namespace WTF;
 
 namespace WebCore {
 
-String CSSWrapShapeRectangle::cssText() const
+String CSSBasicShapeRectangle::cssText() const
 {
     DEFINE_STATIC_LOCAL(const String, rectangleParen, ("rectangle("));
     DEFINE_STATIC_LOCAL(const String, comma, (", "));
@@ -72,7 +72,7 @@ String CSSWrapShapeRectangle::cssText() const
     return result.toString();
 }
 
-String CSSWrapShapeCircle::cssText() const
+String CSSBasicShapeCircle::cssText() const
 {
     DEFINE_STATIC_LOCAL(const String, circleParen, ("circle("));
     DEFINE_STATIC_LOCAL(const String, comma, (", "));
@@ -93,7 +93,7 @@ String CSSWrapShapeCircle::cssText() const
     return result.toString();
 }
 
-String CSSWrapShapeEllipse::cssText() const
+String CSSBasicShapeEllipse::cssText() const
 {
     DEFINE_STATIC_LOCAL(const String, ellipseParen, ("ellipse("));
     DEFINE_STATIC_LOCAL(const String, comma, (", "));
@@ -117,7 +117,7 @@ String CSSWrapShapeEllipse::cssText() const
     return result.toString();
 }
 
-String CSSWrapShapePolygon::cssText() const
+String CSSBasicShapePolygon::cssText() const
 {
     DEFINE_STATIC_LOCAL(const String, polygonParenEvenOdd, ("polygon(evenodd, "));
     DEFINE_STATIC_LOCAL(const String, polygonParenNonZero, ("polygon(nonzero, "));
index 865bab5..5102f2f 100644 (file)
 
 namespace WebCore {
 
-class CSSWrapShape : public RefCounted<CSSWrapShape> {
+class CSSBasicShape : public RefCounted<CSSBasicShape> {
 public:
     enum Type {
-        CSS_WRAP_SHAPE_RECTANGLE = 1,
-        CSS_WRAP_SHAPE_CIRCLE = 2,
-        CSS_WRAP_SHAPE_ELLIPSE = 3,
-        CSS_WRAP_SHAPE_POLYGON = 4
+        CSS_BASIC_SHAPE_RECTANGLE = 1,
+        CSS_BASIC_SHAPE_CIRCLE = 2,
+        CSS_BASIC_SHAPE_ELLIPSE = 3,
+        CSS_BASIC_SHAPE_POLYGON = 4
     };
 
     virtual Type type() const = 0;
     virtual String cssText() const = 0;
 
 public:
-    virtual ~CSSWrapShape() { }
+    virtual ~CSSBasicShape() { }
 
 protected:
-    CSSWrapShape() { }
+    CSSBasicShape() { }
 };
 
-class CSSWrapShapeRectangle : public CSSWrapShape {
+class CSSBasicShapeRectangle : public CSSBasicShape {
 public:
-    static PassRefPtr<CSSWrapShapeRectangle> create() { return adoptRef(new CSSWrapShapeRectangle); }
+    static PassRefPtr<CSSBasicShapeRectangle> create() { return adoptRef(new CSSBasicShapeRectangle); }
 
     CSSPrimitiveValue* x() const { return m_x.get(); }
     CSSPrimitiveValue* y() const { return m_y.get(); }
@@ -75,11 +75,11 @@ public:
     void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX; }
     void setRadiusY(PassRefPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY; }
 
-    virtual Type type() const { return CSS_WRAP_SHAPE_RECTANGLE; }
+    virtual Type type() const { return CSS_BASIC_SHAPE_RECTANGLE; }
     virtual String cssText() const;
 
 private:
-    CSSWrapShapeRectangle() { }
+    CSSBasicShapeRectangle() { }
 
     RefPtr<CSSPrimitiveValue> m_y;
     RefPtr<CSSPrimitiveValue> m_x;
@@ -89,9 +89,9 @@ private:
     RefPtr<CSSPrimitiveValue> m_radiusY;
 };
 
-class CSSWrapShapeCircle : public CSSWrapShape {
+class CSSBasicShapeCircle : public CSSBasicShape {
 public:
-    static PassRefPtr<CSSWrapShapeCircle> create() { return adoptRef(new CSSWrapShapeCircle); }
+    static PassRefPtr<CSSBasicShapeCircle> create() { return adoptRef(new CSSBasicShapeCircle); }
 
     CSSPrimitiveValue* centerX() const { return m_centerX.get(); }
     CSSPrimitiveValue* centerY() const { return m_centerY.get(); }
@@ -101,20 +101,20 @@ public:
     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; }
+    virtual Type type() const { return CSS_BASIC_SHAPE_CIRCLE; }
     virtual String cssText() const;
 
 private:
-    CSSWrapShapeCircle() { }
+    CSSBasicShapeCircle() { }
 
     RefPtr<CSSPrimitiveValue> m_centerY;
     RefPtr<CSSPrimitiveValue> m_centerX;
     RefPtr<CSSPrimitiveValue> m_radius;
 };
 
-class CSSWrapShapeEllipse : public CSSWrapShape {
+class CSSBasicShapeEllipse : public CSSBasicShape {
 public:
-    static PassRefPtr<CSSWrapShapeEllipse> create() { return adoptRef(new CSSWrapShapeEllipse); }
+    static PassRefPtr<CSSBasicShapeEllipse> create() { return adoptRef(new CSSBasicShapeEllipse); }
 
     CSSPrimitiveValue* centerX() const { return m_centerX.get(); }
     CSSPrimitiveValue* centerY() const { return m_centerY.get(); }
@@ -126,11 +126,11 @@ public:
     void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX; }
     void setRadiusY(PassRefPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY; }
 
-    virtual Type type() const { return CSS_WRAP_SHAPE_ELLIPSE; }
+    virtual Type type() const { return CSS_BASIC_SHAPE_ELLIPSE; }
     virtual String cssText() const;
 
 private:
-    CSSWrapShapeEllipse() { }
+    CSSBasicShapeEllipse() { }
 
     RefPtr<CSSPrimitiveValue> m_centerX;
     RefPtr<CSSPrimitiveValue> m_centerY;
@@ -138,9 +138,9 @@ private:
     RefPtr<CSSPrimitiveValue> m_radiusY;
 };
 
-class CSSWrapShapePolygon : public CSSWrapShape {
+class CSSBasicShapePolygon : public CSSBasicShape {
 public:
-    static PassRefPtr<CSSWrapShapePolygon> create() { return adoptRef(new CSSWrapShapePolygon); }
+    static PassRefPtr<CSSBasicShapePolygon> create() { return adoptRef(new CSSBasicShapePolygon); }
 
     void appendPoint(PassRefPtr<CSSPrimitiveValue> x, PassRefPtr<CSSPrimitiveValue> y)
     {
@@ -155,11 +155,11 @@ public:
     void setWindRule(WindRule w) { m_windRule = w; }
     WindRule windRule() const { return m_windRule; }
 
-    virtual Type type() const { return CSS_WRAP_SHAPE_POLYGON; }
+    virtual Type type() const { return CSS_BASIC_SHAPE_POLYGON; }
     virtual String cssText() const;
 
 private:
-    CSSWrapShapePolygon()
+    CSSBasicShapePolygon()
         : m_windRule(RULE_NONZERO)
     {
     }
index 3ca7a93..93713fa 100644 (file)
@@ -2394,11 +2394,11 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
         case CSSPropertyWebkitShapeInside:
             if (!style->wrapShapeInside())
                 return cssValuePool().createIdentifierValue(CSSValueAuto);
-            return valueForWrapShape(style->wrapShapeInside());
+            return valueForBasicShape(style->wrapShapeInside());
         case CSSPropertyWebkitShapeOutside:
             if (!style->wrapShapeOutside())
                 return cssValuePool().createIdentifierValue(CSSValueAuto);
-            return valueForWrapShape(style->wrapShapeOutside());
+            return valueForBasicShape(style->wrapShapeOutside());
         case CSSPropertyWebkitWrapThrough:
             return cssValuePool().createValue(style->wrapThrough());
 #endif
index e1788bf..2e043fc 100644 (file)
@@ -2699,7 +2699,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
         if (id == CSSValueAuto)
             validPrimitive = true;
         else if (value->unit == CSSParserValue::Function)
-            return parseExclusionShape((propId == CSSPropertyWebkitShapeInside), important);
+            return parseBasicShape((propId == CSSPropertyWebkitShapeInside), important);
         break;
     case CSSPropertyWebkitWrapMargin:
     case CSSPropertyWebkitWrapPadding:
@@ -4480,7 +4480,7 @@ bool CSSParser::parseClipShape(CSSPropertyID propId, bool important)
 
 #if ENABLE(CSS_EXCLUSIONS)
 
-PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeRectangle(CSSParserValueList* args)
+PassRefPtr<CSSBasicShape> CSSParser::parseBasicShapeRectangle(CSSParserValueList* args)
 {
     ASSERT(args);
 
@@ -4488,7 +4488,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeRectangle(CSSParserValueL
     if (args->size() != 7 && args->size() != 9 && args->size() != 11)
         return 0;
 
-    RefPtr<CSSWrapShapeRectangle> shape = CSSWrapShapeRectangle::create();
+    RefPtr<CSSBasicShapeRectangle> shape = CSSBasicShapeRectangle::create();
 
     unsigned argumentNumber = 0;
     CSSParserValue* argument = args->current();
@@ -4538,7 +4538,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeRectangle(CSSParserValueL
     return shape;
 }
 
-PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeCircle(CSSParserValueList* args)
+PassRefPtr<CSSBasicShape> CSSParser::parseBasicShapeCircle(CSSParserValueList* args)
 {
     ASSERT(args);
 
@@ -4546,7 +4546,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeCircle(CSSParserValueList
     if (args->size() != 5)
         return 0;
 
-    RefPtr<CSSWrapShapeCircle> shape = CSSWrapShapeCircle::create();
+    RefPtr<CSSBasicShapeCircle> shape = CSSBasicShapeCircle::create();
 
     unsigned argumentNumber = 0;
     CSSParserValue* argument = args->current();
@@ -4588,7 +4588,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeCircle(CSSParserValueList
     return shape;
 }
 
-PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeEllipse(CSSParserValueList* args)
+PassRefPtr<CSSBasicShape> CSSParser::parseBasicShapeEllipse(CSSParserValueList* args)
 {
     ASSERT(args);
 
@@ -4596,7 +4596,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeEllipse(CSSParserValueLis
     if (args->size() != 7)
         return 0;
 
-    RefPtr<CSSWrapShapeEllipse> shape = CSSWrapShapeEllipse::create();
+    RefPtr<CSSBasicShapeEllipse> shape = CSSBasicShapeEllipse::create();
     unsigned argumentNumber = 0;
     CSSParserValue* argument = args->current();
     while (argument) {
@@ -4639,7 +4639,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeEllipse(CSSParserValueLis
     return shape;
 }
 
-PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapePolygon(CSSParserValueList* args)
+PassRefPtr<CSSBasicShape> CSSParser::parseBasicShapePolygon(CSSParserValueList* args)
 {
     ASSERT(args);
 
@@ -4647,7 +4647,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapePolygon(CSSParserValueLis
     if (!size)
         return 0;
 
-    RefPtr<CSSWrapShapePolygon> shape = CSSWrapShapePolygon::create();
+    RefPtr<CSSBasicShapePolygon> shape = CSSBasicShapePolygon::create();
 
     CSSParserValue* argument = args->current();
     if (argument->id == CSSValueEvenodd || argument->id == CSSValueNonzero) {
@@ -4690,7 +4690,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapePolygon(CSSParserValueLis
     return shape;
 }
 
-bool CSSParser::parseExclusionShape(bool shapeInside, bool important)
+bool CSSParser::parseBasicShape(bool shapeInside, bool important)
 {
     CSSParserValue* value = m_valueList->current();
     CSSParserValueList* args = value->function->args.get();
@@ -4698,16 +4698,16 @@ bool CSSParser::parseExclusionShape(bool shapeInside, bool important)
     if (!args)
         return false;
 
-    RefPtr<CSSWrapShape> shape;
+    RefPtr<CSSBasicShape> shape;
 
     if (equalIgnoringCase(value->function->name, "rectangle("))
-        shape = parseExclusionShapeRectangle(args);
+        shape = parseBasicShapeRectangle(args);
     else if (equalIgnoringCase(value->function->name, "circle("))
-        shape = parseExclusionShapeCircle(args);
+        shape = parseBasicShapeCircle(args);
     else if (equalIgnoringCase(value->function->name, "ellipse("))
-        shape = parseExclusionShapeEllipse(args);
+        shape = parseBasicShapeEllipse(args);
     else if (equalIgnoringCase(value->function->name, "polygon("))
-        shape = parseExclusionShapePolygon(args);
+        shape = parseBasicShapePolygon(args);
 
     if (shape) {
         addProperty(shapeInside ? CSSPropertyWebkitShapeInside : CSSPropertyWebkitShapeOutside, cssValuePool().createValue(shape.release()), important);
index 6acbba2..86503da 100644 (file)
@@ -51,7 +51,7 @@ class CSSProperty;
 class CSSSelectorList;
 class CSSValue;
 class CSSValueList;
-class CSSWrapShape;
+class CSSBasicShape;
 class Document;
 class MediaQueryExp;
 class MediaQuerySet;
@@ -142,11 +142,11 @@ public:
 
     bool parseClipShape(CSSPropertyID, bool important);
 
-    bool parseExclusionShape(bool shapeInside, bool important);
-    PassRefPtr<CSSWrapShape> parseExclusionShapeRectangle(CSSParserValueList* args);
-    PassRefPtr<CSSWrapShape> parseExclusionShapeCircle(CSSParserValueList* args);
-    PassRefPtr<CSSWrapShape> parseExclusionShapeEllipse(CSSParserValueList* args);
-    PassRefPtr<CSSWrapShape> parseExclusionShapePolygon(CSSParserValueList* args);
+    bool parseBasicShape(bool shapeInside, bool important);
+    PassRefPtr<CSSBasicShape> parseBasicShapeRectangle(CSSParserValueList* args);
+    PassRefPtr<CSSBasicShape> parseBasicShapeCircle(CSSParserValueList* args);
+    PassRefPtr<CSSBasicShape> parseBasicShapeEllipse(CSSParserValueList* args);
+    PassRefPtr<CSSBasicShape> parseBasicShapePolygon(CSSParserValueList* args);
 
     bool parseFont(bool important);
     PassRefPtr<CSSValueList> parseFontFamily();
index f12f7ed..b0864d8 100644 (file)
@@ -353,7 +353,7 @@ void CSSPrimitiveValue::init(PassRefPtr<CSSCalcValue> c)
     m_value.calc = c.leakRef();
 }
 
-void CSSPrimitiveValue::init(PassRefPtr<CSSWrapShape> shape)
+void CSSPrimitiveValue::init(PassRefPtr<CSSBasicShape> shape)
 {
     m_primitiveUnitType = CSS_SHAPE;
     m_hasCachedCSSText = false;
index 87069c0..e622445 100644 (file)
@@ -38,7 +38,7 @@ class Quad;
 class RGBColor;
 class Rect;
 class RenderStyle;
-class CSSWrapShape;
+class CSSBasicShape;
 
 struct Length;
 
@@ -284,7 +284,7 @@ public:
 
     DashboardRegion* getDashboardRegionValue() const { return m_primitiveUnitType != CSS_DASHBOARD_REGION ? 0 : m_value.region; }
 
-    CSSWrapShape* getShapeValue() const { return m_primitiveUnitType != CSS_SHAPE ? 0 : m_value.shape; }
+    CSSBasicShape* getShapeValue() const { return m_primitiveUnitType != CSS_SHAPE ? 0 : m_value.shape; }
     
     CSSCalcValue* cssCalcValue() const { return m_primitiveUnitType != CSS_CALC ? 0 : m_value.calc; }
 
@@ -338,7 +338,7 @@ private:
     void init(PassRefPtr<Pair>);
     void init(PassRefPtr<Quad>);
     void init(PassRefPtr<DashboardRegion>); // FIXME: Dashboard region should not be a primitive value.
-    void init(PassRefPtr<CSSWrapShape>);
+    void init(PassRefPtr<CSSBasicShape>);
     void init(PassRefPtr<CSSCalcValue>);
     bool getDoubleValueInternal(UnitTypes targetUnitType, double* result) const;
 
@@ -354,7 +354,7 @@ private:
         unsigned rgbcolor;
         Pair* pair;
         DashboardRegion* region;
-        CSSWrapShape* shape;
+        CSSBasicShape* shape;
         CSSCalcValue* calc;
     } m_value;
 };
index 18c5707..05b2845 100644 (file)
@@ -1736,10 +1736,10 @@ public:
 };
 
 #if ENABLE(CSS_EXCLUSIONS)
-template <WrapShape* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<WrapShape>), WrapShape* (*initialFunction)()>
+template <BasicShape* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<BasicShape>), BasicShape* (*initialFunction)()>
 class ApplyPropertyWrapShape {
 public:
-    static void setValue(RenderStyle* style, PassRefPtr<WrapShape> value) { (style->*setterFunction)(value); }
+    static void setValue(RenderStyle* style, PassRefPtr<BasicShape> value) { (style->*setterFunction)(value); }
     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
     {
         if (value->isPrimitiveValue()) {
@@ -1747,14 +1747,14 @@ public:
             if (primitiveValue->getIdent() == CSSValueAuto)
                 setValue(styleResolver->style(), 0);
             else if (primitiveValue->isShape()) {
-                RefPtr<WrapShape> wrapShape = wrapShapeForValue(styleResolver, primitiveValue->getShapeValue());
+                RefPtr<BasicShape> wrapShape = basicShapeForValue(styleResolver, primitiveValue->getShapeValue());
                 setValue(styleResolver->style(), wrapShape.release());
             }
         }
     }
     static PropertyHandler createHandler()
     {
-        PropertyHandler handler = ApplyPropertyDefaultBase<WrapShape*, getterFunction, PassRefPtr<WrapShape>, setterFunction, WrapShape*, initialFunction>::createHandler();
+        PropertyHandler handler = ApplyPropertyDefaultBase<BasicShape*, getterFunction, PassRefPtr<BasicShape>, setterFunction, BasicShape*, initialFunction>::createHandler();
         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
     }
 };
index 6dacfd2..2c2b350 100644 (file)
 
 namespace WebCore {
 
-void WrapShape::destroy()
+void BasicShape::destroy()
 {
     switch (m_type) {
-    case WRAP_SHAPE_RECTANGLE:
-        delete static_cast<WrapShapeRectangle*>(this);
+    case BASIC_SHAPE_RECTANGLE:
+        delete static_cast<BasicShapeRectangle*>(this);
         return;
-    case WRAP_SHAPE_CIRCLE:
-        delete static_cast<WrapShapeCircle*>(this);
+    case BASIC_SHAPE_CIRCLE:
+        delete static_cast<BasicShapeCircle*>(this);
         return;
-    case WRAP_SHAPE_ELLIPSE:
-        delete static_cast<WrapShapeEllipse*>(this);
+    case BASIC_SHAPE_ELLIPSE:
+        delete static_cast<BasicShapeEllipse*>(this);
         return;
-    case WRAP_SHAPE_POLYGON:
-        delete static_cast<WrapShapePolygon*>(this);
+    case BASIC_SHAPE_POLYGON:
+        delete static_cast<BasicShapePolygon*>(this);
         return;
     }
     ASSERT_NOT_REACHED();
index 9a396a0..1d79df7 100644 (file)
 
 namespace WebCore {
 
-class WrapShape : public WTF::RefCountedBase {
+class BasicShape : public WTF::RefCountedBase {
 public:
     enum Type {
-        WRAP_SHAPE_RECTANGLE = 1,
-        WRAP_SHAPE_CIRCLE = 2,
-        WRAP_SHAPE_ELLIPSE = 3,
-        WRAP_SHAPE_POLYGON = 4
+        BASIC_SHAPE_RECTANGLE = 1,
+        BASIC_SHAPE_CIRCLE = 2,
+        BASIC_SHAPE_ELLIPSE = 3,
+        BASIC_SHAPE_POLYGON = 4
     };
     
     void deref() 
@@ -55,7 +55,7 @@ public:
     Type type() const { return m_type; }
 
 protected:
-    WrapShape(Type type)
+    BasicShape(Type type)
         : m_type(type)
     { }
     
@@ -64,9 +64,9 @@ private:
     Type m_type;
 };
 
-class WrapShapeRectangle : public WrapShape {
+class BasicShapeRectangle : public BasicShape {
 public:
-    static PassRefPtr<WrapShapeRectangle> create() { return adoptRef(new WrapShapeRectangle); }
+    static PassRefPtr<BasicShapeRectangle> create() { return adoptRef(new BasicShapeRectangle); }
 
     Length x() const { return m_x; }
     Length y() const { return m_y; }
@@ -83,8 +83,8 @@ public:
     void setCornerRadiusY(Length radiusY) { m_cornerRadiusY = radiusY; }
     
 private:
-    WrapShapeRectangle()
-        : WrapShape(WRAP_SHAPE_RECTANGLE)
+    BasicShapeRectangle()
+        : BasicShape(BASIC_SHAPE_RECTANGLE)
         , m_cornerRadiusX(Undefined)
         , m_cornerRadiusY(Undefined)
     { }
@@ -97,9 +97,9 @@ private:
     Length m_cornerRadiusY;
 };
 
-class WrapShapeCircle : public WrapShape {
+class BasicShapeCircle : public BasicShape {
 public:
-    static PassRefPtr<WrapShapeCircle> create() { return adoptRef(new WrapShapeCircle); }
+    static PassRefPtr<BasicShapeCircle> create() { return adoptRef(new BasicShapeCircle); }
 
     Length centerX() const { return m_centerX; }
     Length centerY() const { return m_centerY; }
@@ -110,8 +110,8 @@ public:
     void setRadius(Length radius) { m_radius = radius; }
 
 private:
-    WrapShapeCircle() 
-        : WrapShape(WRAP_SHAPE_CIRCLE)
+    BasicShapeCircle() 
+        : BasicShape(BASIC_SHAPE_CIRCLE)
     { }
 
     Length m_centerX;
@@ -119,9 +119,9 @@ private:
     Length m_radius;
 };
 
-class WrapShapeEllipse : public WrapShape {
+class BasicShapeEllipse : public BasicShape {
 public:
-    static PassRefPtr<WrapShapeEllipse> create() { return adoptRef(new WrapShapeEllipse); }
+    static PassRefPtr<BasicShapeEllipse> create() { return adoptRef(new BasicShapeEllipse); }
 
     Length centerX() const { return m_centerX; }
     Length centerY() const { return m_centerY; }
@@ -134,8 +134,8 @@ public:
     void setRadiusY(Length radiusY) { m_radiusY = radiusY; }
 
 private:
-    WrapShapeEllipse() 
-        : WrapShape(WRAP_SHAPE_ELLIPSE)
+    BasicShapeEllipse() 
+        : BasicShape(BASIC_SHAPE_ELLIPSE)
     { }
 
     Length m_centerX;
@@ -144,9 +144,9 @@ private:
     Length m_radiusY;
 };
 
-class WrapShapePolygon : public WrapShape {
+class BasicShapePolygon : public BasicShape {
 public:
-    static PassRefPtr<WrapShapePolygon> create() { return adoptRef(new WrapShapePolygon); }
+    static PassRefPtr<BasicShapePolygon> create() { return adoptRef(new BasicShapePolygon); }
 
     WindRule windRule() const { return m_windRule; }
     const Vector<Length>& values() const { return m_values; }
@@ -157,8 +157,8 @@ public:
     void appendPoint(Length x, Length y) { m_values.append(x); m_values.append(y); }
 
 private:
-    WrapShapePolygon()
-        : WrapShape(WRAP_SHAPE_POLYGON)
+    BasicShapePolygon()
+        : BasicShape(BASIC_SHAPE_POLYGON)
         , m_windRule(RULE_NONZERO)
     { }
 
index a14915f..0726336 100644 (file)
@@ -1434,22 +1434,22 @@ public:
     void setKerning(SVGLength k) { accessSVGStyle()->setKerning(k); }
 #endif
 
-    void setWrapShapeInside(PassRefPtr<WrapShape> shape)
+    void setWrapShapeInside(PassRefPtr<BasicShape> shape)
     {
         if (rareNonInheritedData->m_wrapShapeInside != shape)
             rareNonInheritedData.access()->m_wrapShapeInside = shape;
     }
-    WrapShape* wrapShapeInside() const { return rareNonInheritedData->m_wrapShapeInside.get(); }
+    BasicShape* wrapShapeInside() const { return rareNonInheritedData->m_wrapShapeInside.get(); }
 
-    void setWrapShapeOutside(PassRefPtr<WrapShape> shape)
+    void setWrapShapeOutside(PassRefPtr<BasicShape> shape)
     {
         if (rareNonInheritedData->m_wrapShapeOutside != shape)
             rareNonInheritedData.access()->m_wrapShapeOutside = shape;
     }
-    WrapShape* wrapShapeOutside() const { return rareNonInheritedData->m_wrapShapeOutside.get(); }
+    BasicShape* wrapShapeOutside() const { return rareNonInheritedData->m_wrapShapeOutside.get(); }
 
-    static WrapShape* initialWrapShapeInside() { return 0; }
-    static WrapShape* initialWrapShapeOutside() { return 0; }
+    static BasicShape* initialWrapShapeInside() { return 0; }
+    static BasicShape* initialWrapShapeOutside() { return 0; }
 
     Length wrapPadding() const { return rareNonInheritedData->m_wrapPadding; }
     void setWrapPadding(Length wrapPadding) { SET_VAR(rareNonInheritedData, m_wrapPadding, wrapPadding); }
index b8d3d80..36f0d64 100644 (file)
@@ -134,8 +134,8 @@ public:
 
     LengthSize m_pageSize;
 
-    RefPtr<WrapShape> m_wrapShapeInside;
-    RefPtr<WrapShape> m_wrapShapeOutside;
+    RefPtr<BasicShape> m_wrapShapeInside;
+    RefPtr<BasicShape> m_wrapShapeOutside;
     Length m_wrapMargin;
     Length m_wrapPadding;