[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
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()));
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)
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()));
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();
}
}
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
namespace WebCore {
-String CSSWrapShapeRectangle::cssText() const
+String CSSBasicShapeRectangle::cssText() const
{
DEFINE_STATIC_LOCAL(const String, rectangleParen, ("rectangle("));
DEFINE_STATIC_LOCAL(const String, comma, (", "));
return result.toString();
}
-String CSSWrapShapeCircle::cssText() const
+String CSSBasicShapeCircle::cssText() const
{
DEFINE_STATIC_LOCAL(const String, circleParen, ("circle("));
DEFINE_STATIC_LOCAL(const String, comma, (", "));
return result.toString();
}
-String CSSWrapShapeEllipse::cssText() const
+String CSSBasicShapeEllipse::cssText() const
{
DEFINE_STATIC_LOCAL(const String, ellipseParen, ("ellipse("));
DEFINE_STATIC_LOCAL(const String, comma, (", "));
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, "));
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(); }
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;
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(); }
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(); }
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;
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)
{
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)
{
}
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
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:
#if ENABLE(CSS_EXCLUSIONS)
-PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeRectangle(CSSParserValueList* args)
+PassRefPtr<CSSBasicShape> CSSParser::parseBasicShapeRectangle(CSSParserValueList* args)
{
ASSERT(args);
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();
return shape;
}
-PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeCircle(CSSParserValueList* args)
+PassRefPtr<CSSBasicShape> CSSParser::parseBasicShapeCircle(CSSParserValueList* args)
{
ASSERT(args);
if (args->size() != 5)
return 0;
- RefPtr<CSSWrapShapeCircle> shape = CSSWrapShapeCircle::create();
+ RefPtr<CSSBasicShapeCircle> shape = CSSBasicShapeCircle::create();
unsigned argumentNumber = 0;
CSSParserValue* argument = args->current();
return shape;
}
-PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeEllipse(CSSParserValueList* args)
+PassRefPtr<CSSBasicShape> CSSParser::parseBasicShapeEllipse(CSSParserValueList* args)
{
ASSERT(args);
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) {
return shape;
}
-PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapePolygon(CSSParserValueList* args)
+PassRefPtr<CSSBasicShape> CSSParser::parseBasicShapePolygon(CSSParserValueList* args)
{
ASSERT(args);
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) {
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();
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);
class CSSSelectorList;
class CSSValue;
class CSSValueList;
-class CSSWrapShape;
+class CSSBasicShape;
class Document;
class MediaQueryExp;
class MediaQuerySet;
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();
m_value.calc = c.leakRef();
}
-void CSSPrimitiveValue::init(PassRefPtr<CSSWrapShape> shape)
+void CSSPrimitiveValue::init(PassRefPtr<CSSBasicShape> shape)
{
m_primitiveUnitType = CSS_SHAPE;
m_hasCachedCSSText = false;
class RGBColor;
class Rect;
class RenderStyle;
-class CSSWrapShape;
+class CSSBasicShape;
struct Length;
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; }
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;
unsigned rgbcolor;
Pair* pair;
DashboardRegion* region;
- CSSWrapShape* shape;
+ CSSBasicShape* shape;
CSSCalcValue* calc;
} m_value;
};
};
#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()) {
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);
}
};
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();
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()
Type type() const { return m_type; }
protected:
- WrapShape(Type type)
+ BasicShape(Type type)
: m_type(type)
{ }
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; }
void setCornerRadiusY(Length radiusY) { m_cornerRadiusY = radiusY; }
private:
- WrapShapeRectangle()
- : WrapShape(WRAP_SHAPE_RECTANGLE)
+ BasicShapeRectangle()
+ : BasicShape(BASIC_SHAPE_RECTANGLE)
, m_cornerRadiusX(Undefined)
, m_cornerRadiusY(Undefined)
{ }
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; }
void setRadius(Length radius) { m_radius = radius; }
private:
- WrapShapeCircle()
- : WrapShape(WRAP_SHAPE_CIRCLE)
+ BasicShapeCircle()
+ : BasicShape(BASIC_SHAPE_CIRCLE)
{ }
Length m_centerX;
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; }
void setRadiusY(Length radiusY) { m_radiusY = radiusY; }
private:
- WrapShapeEllipse()
- : WrapShape(WRAP_SHAPE_ELLIPSE)
+ BasicShapeEllipse()
+ : BasicShape(BASIC_SHAPE_ELLIPSE)
{ }
Length m_centerX;
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; }
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)
{ }
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); }
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;