From 078a95c130134e0697dcbda9a59cdde761c3cfbe Mon Sep 17 00:00:00 2001 From: "krit@webkit.org" Date: Thu, 30 Aug 2012 17:08:00 +0000 Subject: [PATCH] [Cherry-pick] Refactor WrapShape classes to BasicShape [Title] Refactor WrapShape classes to BasicShape [Issues] N/A [Problem] N/A [Solution] Cherry picked. [Cherry-Picker] Sanghyup Lee 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 --- Source/WebCore/css/BasicShapeFunctions.cpp | 80 +++++++++++----------- Source/WebCore/css/BasicShapeFunctions.h | 8 +-- Source/WebCore/css/CSSBasicShapes.cpp | 8 +-- Source/WebCore/css/CSSBasicShapes.h | 46 ++++++------- Source/WebCore/css/CSSComputedStyleDeclaration.cpp | 4 +- Source/WebCore/css/CSSParser.cpp | 30 ++++---- Source/WebCore/css/CSSParser.h | 12 ++-- Source/WebCore/css/CSSPrimitiveValue.cpp | 2 +- Source/WebCore/css/CSSPrimitiveValue.h | 8 +-- Source/WebCore/css/StyleBuilder.cpp | 8 +-- Source/WebCore/rendering/style/BasicShapes.cpp | 18 ++--- Source/WebCore/rendering/style/BasicShapes.h | 44 ++++++------ Source/WebCore/rendering/style/RenderStyle.h | 12 ++-- .../rendering/style/StyleRareNonInheritedData.h | 4 +- 14 files changed, 142 insertions(+), 142 deletions(-) diff --git a/Source/WebCore/css/BasicShapeFunctions.cpp b/Source/WebCore/css/BasicShapeFunctions.cpp index c8d50ec..3a8f795 100644 --- a/Source/WebCore/css/BasicShapeFunctions.cpp +++ b/Source/WebCore/css/BasicShapeFunctions.cpp @@ -38,13 +38,13 @@ namespace WebCore { -PassRefPtr valueForWrapShape(const WrapShape* wrapShape) +PassRefPtr valueForBasicShape(const BasicShape* basicShape) { - RefPtr wrapShapeValue; - switch (wrapShape->type()) { - case WrapShape::WRAP_SHAPE_RECTANGLE: { - const WrapShapeRectangle* rectangle = static_cast(wrapShape); - RefPtr rectangleValue = CSSWrapShapeRectangle::create(); + RefPtr basicShapeValue; + switch (basicShape->type()) { + case BasicShape::BASIC_SHAPE_RECTANGLE: { + const BasicShapeRectangle* rectangle = static_cast(basicShape); + RefPtr rectangleValue = CSSBasicShapeRectangle::create(); rectangleValue->setX(cssValuePool().createValue(rectangle->x())); rectangleValue->setY(cssValuePool().createValue(rectangle->y())); @@ -56,48 +56,48 @@ PassRefPtr 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(wrapShape); - RefPtr circleValue = CSSWrapShapeCircle::create(); + case BasicShape::BASIC_SHAPE_CIRCLE: { + const BasicShapeCircle* circle = static_cast(basicShape); + RefPtr 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(wrapShape); - RefPtr ellipseValue = CSSWrapShapeEllipse::create(); + case BasicShape::BASIC_SHAPE_ELLIPSE: { + const BasicShapeEllipse* ellipse = static_cast(basicShape); + RefPtr 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(wrapShape); - RefPtr polygonValue = CSSWrapShapePolygon::create(); + case BasicShape::BASIC_SHAPE_POLYGON: { + const BasicShapePolygon* polygon = static_cast(basicShape); + RefPtr polygonValue = CSSBasicShapePolygon::create(); polygonValue->setWindRule(polygon->windRule()); const Vector& 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 >(wrapShapeValue.release()); + return cssValuePool().createValue >(basicShapeValue.release()); } static Length convertToLength(const StyleResolver* styleResolver, CSSPrimitiveValue* value) @@ -105,14 +105,14 @@ static Length convertToLength(const StyleResolver* styleResolver, CSSPrimitiveVa return value->convertToLength(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom()); } -PassRefPtr wrapShapeForValue(const StyleResolver* styleResolver, const CSSWrapShape* wrapShapeValue) +PassRefPtr basicShapeForValue(const StyleResolver* styleResolver, const CSSBasicShape* basicShapeValue) { - RefPtr wrapShape; + RefPtr basicShape; - switch (wrapShapeValue->type()) { - case CSSWrapShape::CSS_WRAP_SHAPE_RECTANGLE: { - const CSSWrapShapeRectangle* rectValue = static_cast(wrapShapeValue); - RefPtr rect = WrapShapeRectangle::create(); + switch (basicShapeValue->type()) { + case CSSBasicShape::CSS_BASIC_SHAPE_RECTANGLE: { + const CSSBasicShapeRectangle* rectValue = static_cast(basicShapeValue); + RefPtr rect = BasicShapeRectangle::create(); rect->setX(convertToLength(styleResolver, rectValue->x())); rect->setY(convertToLength(styleResolver, rectValue->y())); @@ -123,47 +123,47 @@ PassRefPtr 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(wrapShapeValue); - RefPtr circle = WrapShapeCircle::create(); + case CSSBasicShape::CSS_BASIC_SHAPE_CIRCLE: { + const CSSBasicShapeCircle* circleValue = static_cast(basicShapeValue); + RefPtr 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(wrapShapeValue); - RefPtr ellipse = WrapShapeEllipse::create(); + case CSSBasicShape::CSS_BASIC_SHAPE_ELLIPSE: { + const CSSBasicShapeEllipse* ellipseValue = static_cast(basicShapeValue); + RefPtr 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(wrapShapeValue); - RefPtr polygon = WrapShapePolygon::create(); + case CSSBasicShape::CSS_BASIC_SHAPE_POLYGON: { + const CSSBasicShapePolygon* polygonValue = static_cast(basicShapeValue); + RefPtr polygon = BasicShapePolygon::create(); polygon->setWindRule(polygonValue->windRule()); const Vector >& 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(); } } diff --git a/Source/WebCore/css/BasicShapeFunctions.h b/Source/WebCore/css/BasicShapeFunctions.h index 50c2934..d3607e9 100644 --- a/Source/WebCore/css/BasicShapeFunctions.h +++ b/Source/WebCore/css/BasicShapeFunctions.h @@ -34,13 +34,13 @@ namespace WebCore { +class BasicShape; +class CSSBasicShape; class CSSValue; -class CSSWrapShape; class StyleResolver; -class WrapShape; -PassRefPtr valueForWrapShape(const WrapShape*); -PassRefPtr wrapShapeForValue(const StyleResolver*, const CSSWrapShape*); +PassRefPtr valueForBasicShape(const BasicShape*); +PassRefPtr basicShapeForValue(const StyleResolver*, const CSSBasicShape*); } #endif diff --git a/Source/WebCore/css/CSSBasicShapes.cpp b/Source/WebCore/css/CSSBasicShapes.cpp index 488d3f4..eac789f 100644 --- a/Source/WebCore/css/CSSBasicShapes.cpp +++ b/Source/WebCore/css/CSSBasicShapes.cpp @@ -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, ")); diff --git a/Source/WebCore/css/CSSBasicShapes.h b/Source/WebCore/css/CSSBasicShapes.h index 865bab5..5102f2f 100644 --- a/Source/WebCore/css/CSSBasicShapes.h +++ b/Source/WebCore/css/CSSBasicShapes.h @@ -38,28 +38,28 @@ namespace WebCore { -class CSSWrapShape : public RefCounted { +class CSSBasicShape : public RefCounted { 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 create() { return adoptRef(new CSSWrapShapeRectangle); } + static PassRefPtr 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 radiusX) { m_radiusX = radiusX; } void setRadiusY(PassRefPtr 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 m_y; RefPtr m_x; @@ -89,9 +89,9 @@ private: RefPtr m_radiusY; }; -class CSSWrapShapeCircle : public CSSWrapShape { +class CSSBasicShapeCircle : public CSSBasicShape { public: - static PassRefPtr create() { return adoptRef(new CSSWrapShapeCircle); } + static PassRefPtr 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 centerY) { m_centerY = centerY; } void setRadius(PassRefPtr 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 m_centerY; RefPtr m_centerX; RefPtr m_radius; }; -class CSSWrapShapeEllipse : public CSSWrapShape { +class CSSBasicShapeEllipse : public CSSBasicShape { public: - static PassRefPtr create() { return adoptRef(new CSSWrapShapeEllipse); } + static PassRefPtr 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 radiusX) { m_radiusX = radiusX; } void setRadiusY(PassRefPtr 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 m_centerX; RefPtr m_centerY; @@ -138,9 +138,9 @@ private: RefPtr m_radiusY; }; -class CSSWrapShapePolygon : public CSSWrapShape { +class CSSBasicShapePolygon : public CSSBasicShape { public: - static PassRefPtr create() { return adoptRef(new CSSWrapShapePolygon); } + static PassRefPtr create() { return adoptRef(new CSSBasicShapePolygon); } void appendPoint(PassRefPtr x, PassRefPtr 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) { } diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp index 3ca7a93..93713fa 100644 --- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp +++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp @@ -2394,11 +2394,11 @@ PassRefPtr 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 diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp index e1788bf..2e043fc 100644 --- a/Source/WebCore/css/CSSParser.cpp +++ b/Source/WebCore/css/CSSParser.cpp @@ -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 CSSParser::parseExclusionShapeRectangle(CSSParserValueList* args) +PassRefPtr CSSParser::parseBasicShapeRectangle(CSSParserValueList* args) { ASSERT(args); @@ -4488,7 +4488,7 @@ PassRefPtr CSSParser::parseExclusionShapeRectangle(CSSParserValueL if (args->size() != 7 && args->size() != 9 && args->size() != 11) return 0; - RefPtr shape = CSSWrapShapeRectangle::create(); + RefPtr shape = CSSBasicShapeRectangle::create(); unsigned argumentNumber = 0; CSSParserValue* argument = args->current(); @@ -4538,7 +4538,7 @@ PassRefPtr CSSParser::parseExclusionShapeRectangle(CSSParserValueL return shape; } -PassRefPtr CSSParser::parseExclusionShapeCircle(CSSParserValueList* args) +PassRefPtr CSSParser::parseBasicShapeCircle(CSSParserValueList* args) { ASSERT(args); @@ -4546,7 +4546,7 @@ PassRefPtr CSSParser::parseExclusionShapeCircle(CSSParserValueList if (args->size() != 5) return 0; - RefPtr shape = CSSWrapShapeCircle::create(); + RefPtr shape = CSSBasicShapeCircle::create(); unsigned argumentNumber = 0; CSSParserValue* argument = args->current(); @@ -4588,7 +4588,7 @@ PassRefPtr CSSParser::parseExclusionShapeCircle(CSSParserValueList return shape; } -PassRefPtr CSSParser::parseExclusionShapeEllipse(CSSParserValueList* args) +PassRefPtr CSSParser::parseBasicShapeEllipse(CSSParserValueList* args) { ASSERT(args); @@ -4596,7 +4596,7 @@ PassRefPtr CSSParser::parseExclusionShapeEllipse(CSSParserValueLis if (args->size() != 7) return 0; - RefPtr shape = CSSWrapShapeEllipse::create(); + RefPtr shape = CSSBasicShapeEllipse::create(); unsigned argumentNumber = 0; CSSParserValue* argument = args->current(); while (argument) { @@ -4639,7 +4639,7 @@ PassRefPtr CSSParser::parseExclusionShapeEllipse(CSSParserValueLis return shape; } -PassRefPtr CSSParser::parseExclusionShapePolygon(CSSParserValueList* args) +PassRefPtr CSSParser::parseBasicShapePolygon(CSSParserValueList* args) { ASSERT(args); @@ -4647,7 +4647,7 @@ PassRefPtr CSSParser::parseExclusionShapePolygon(CSSParserValueLis if (!size) return 0; - RefPtr shape = CSSWrapShapePolygon::create(); + RefPtr shape = CSSBasicShapePolygon::create(); CSSParserValue* argument = args->current(); if (argument->id == CSSValueEvenodd || argument->id == CSSValueNonzero) { @@ -4690,7 +4690,7 @@ PassRefPtr 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 shape; + RefPtr 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); diff --git a/Source/WebCore/css/CSSParser.h b/Source/WebCore/css/CSSParser.h index 6acbba2..86503da 100644 --- a/Source/WebCore/css/CSSParser.h +++ b/Source/WebCore/css/CSSParser.h @@ -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 parseExclusionShapeRectangle(CSSParserValueList* args); - PassRefPtr parseExclusionShapeCircle(CSSParserValueList* args); - PassRefPtr parseExclusionShapeEllipse(CSSParserValueList* args); - PassRefPtr parseExclusionShapePolygon(CSSParserValueList* args); + bool parseBasicShape(bool shapeInside, bool important); + PassRefPtr parseBasicShapeRectangle(CSSParserValueList* args); + PassRefPtr parseBasicShapeCircle(CSSParserValueList* args); + PassRefPtr parseBasicShapeEllipse(CSSParserValueList* args); + PassRefPtr parseBasicShapePolygon(CSSParserValueList* args); bool parseFont(bool important); PassRefPtr parseFontFamily(); diff --git a/Source/WebCore/css/CSSPrimitiveValue.cpp b/Source/WebCore/css/CSSPrimitiveValue.cpp index f12f7ed..b0864d8 100644 --- a/Source/WebCore/css/CSSPrimitiveValue.cpp +++ b/Source/WebCore/css/CSSPrimitiveValue.cpp @@ -353,7 +353,7 @@ void CSSPrimitiveValue::init(PassRefPtr c) m_value.calc = c.leakRef(); } -void CSSPrimitiveValue::init(PassRefPtr shape) +void CSSPrimitiveValue::init(PassRefPtr shape) { m_primitiveUnitType = CSS_SHAPE; m_hasCachedCSSText = false; diff --git a/Source/WebCore/css/CSSPrimitiveValue.h b/Source/WebCore/css/CSSPrimitiveValue.h index 87069c0..e622445 100644 --- a/Source/WebCore/css/CSSPrimitiveValue.h +++ b/Source/WebCore/css/CSSPrimitiveValue.h @@ -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); void init(PassRefPtr); void init(PassRefPtr); // FIXME: Dashboard region should not be a primitive value. - void init(PassRefPtr); + void init(PassRefPtr); void init(PassRefPtr); 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; }; diff --git a/Source/WebCore/css/StyleBuilder.cpp b/Source/WebCore/css/StyleBuilder.cpp index 18c5707..05b2845 100644 --- a/Source/WebCore/css/StyleBuilder.cpp +++ b/Source/WebCore/css/StyleBuilder.cpp @@ -1736,10 +1736,10 @@ public: }; #if ENABLE(CSS_EXCLUSIONS) -template ), WrapShape* (*initialFunction)()> +template ), BasicShape* (*initialFunction)()> class ApplyPropertyWrapShape { public: - static void setValue(RenderStyle* style, PassRefPtr value) { (style->*setterFunction)(value); } + static void setValue(RenderStyle* style, PassRefPtr 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 = wrapShapeForValue(styleResolver, primitiveValue->getShapeValue()); + RefPtr wrapShape = basicShapeForValue(styleResolver, primitiveValue->getShapeValue()); setValue(styleResolver->style(), wrapShape.release()); } } } static PropertyHandler createHandler() { - PropertyHandler handler = ApplyPropertyDefaultBase, setterFunction, WrapShape*, initialFunction>::createHandler(); + PropertyHandler handler = ApplyPropertyDefaultBase, setterFunction, BasicShape*, initialFunction>::createHandler(); return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue); } }; diff --git a/Source/WebCore/rendering/style/BasicShapes.cpp b/Source/WebCore/rendering/style/BasicShapes.cpp index 6dacfd2..2c2b350 100644 --- a/Source/WebCore/rendering/style/BasicShapes.cpp +++ b/Source/WebCore/rendering/style/BasicShapes.cpp @@ -33,20 +33,20 @@ namespace WebCore { -void WrapShape::destroy() +void BasicShape::destroy() { switch (m_type) { - case WRAP_SHAPE_RECTANGLE: - delete static_cast(this); + case BASIC_SHAPE_RECTANGLE: + delete static_cast(this); return; - case WRAP_SHAPE_CIRCLE: - delete static_cast(this); + case BASIC_SHAPE_CIRCLE: + delete static_cast(this); return; - case WRAP_SHAPE_ELLIPSE: - delete static_cast(this); + case BASIC_SHAPE_ELLIPSE: + delete static_cast(this); return; - case WRAP_SHAPE_POLYGON: - delete static_cast(this); + case BASIC_SHAPE_POLYGON: + delete static_cast(this); return; } ASSERT_NOT_REACHED(); diff --git a/Source/WebCore/rendering/style/BasicShapes.h b/Source/WebCore/rendering/style/BasicShapes.h index 9a396a0..1d79df7 100644 --- a/Source/WebCore/rendering/style/BasicShapes.h +++ b/Source/WebCore/rendering/style/BasicShapes.h @@ -37,13 +37,13 @@ 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 create() { return adoptRef(new WrapShapeRectangle); } + static PassRefPtr 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 create() { return adoptRef(new WrapShapeCircle); } + static PassRefPtr 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 create() { return adoptRef(new WrapShapeEllipse); } + static PassRefPtr 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 create() { return adoptRef(new WrapShapePolygon); } + static PassRefPtr create() { return adoptRef(new BasicShapePolygon); } WindRule windRule() const { return m_windRule; } const Vector& 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) { } diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h index a14915f..0726336 100644 --- a/Source/WebCore/rendering/style/RenderStyle.h +++ b/Source/WebCore/rendering/style/RenderStyle.h @@ -1434,22 +1434,22 @@ public: void setKerning(SVGLength k) { accessSVGStyle()->setKerning(k); } #endif - void setWrapShapeInside(PassRefPtr shape) + void setWrapShapeInside(PassRefPtr 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 shape) + void setWrapShapeOutside(PassRefPtr 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); } diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h index b8d3d80..36f0d64 100644 --- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h +++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h @@ -134,8 +134,8 @@ public: LengthSize m_pageSize; - RefPtr m_wrapShapeInside; - RefPtr m_wrapShapeOutside; + RefPtr m_wrapShapeInside; + RefPtr m_wrapShapeOutside; Length m_wrapMargin; Length m_wrapPadding; -- 2.7.4