LayoutBox is a terrible name
authorbjonesbe@adobe.com <bjonesbe@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Mar 2014 20:58:38 +0000 (20:58 +0000)
committerbjonesbe@adobe.com <bjonesbe@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Mar 2014 20:58:38 +0000 (20:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=130351

Reviewed by Simon Fraser.

Rename LayoutBox to CSSBoxType. Also rename the functions and methods
that mention "LayoutBox" to something that makes sense for each
specific situation.

No new tests, no behavior change.

* css/BasicShapeFunctions.cpp:
(WebCore::valueForBasicShape):
(WebCore::basicShapeForValue):
* css/CSSBasicShapes.cpp:
(WebCore::CSSBasicShapeCircle::cssText):
(WebCore::CSSBasicShapeCircle::equals):
(WebCore::CSSBasicShapeEllipse::cssText):
(WebCore::CSSBasicShapeEllipse::equals):
(WebCore::CSSBasicShapePolygon::cssText):
(WebCore::CSSBasicShapePolygon::equals):
(WebCore::CSSBasicShapeInset::cssText):
* css/CSSBasicShapes.h:
(WebCore::CSSBasicShape::referenceBox):
(WebCore::CSSBasicShape::setReferenceBox):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::shapePropertyValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator CSSBoxType):
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyClipPath::applyValue):
(WebCore::ApplyPropertyShape::applyValue):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
* rendering/ClipPathOperation.h:
(WebCore::ShapeClipPathOperation::setReferenceBox):
(WebCore::ShapeClipPathOperation::referenceBox):
(WebCore::BoxClipPathOperation::create):
(WebCore::BoxClipPathOperation::referenceBox):
(WebCore::BoxClipPathOperation::BoxClipPathOperation):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createBoxShape):
* rendering/shapes/Shape.h:
* rendering/shapes/ShapeInfo.cpp:
(WebCore::ShapeInfo<RenderType>::computedShape):
* rendering/shapes/ShapeInfo.h:
* rendering/shapes/ShapeInsideInfo.h:
* rendering/shapes/ShapeOutsideInfo.h:
* rendering/style/BasicShapes.cpp:
(WebCore::BasicShape::canBlend):
* rendering/style/BasicShapes.h:
(WebCore::BasicShape::referenceBox):
(WebCore::BasicShape::setReferenceBox):
(WebCore::BasicShape::BasicShape):
* rendering/style/RenderStyleConstants.h:
* rendering/style/ShapeValue.h:
(WebCore::ShapeValue::createShapeValue):
(WebCore::ShapeValue::createBoxShapeValue):
(WebCore::ShapeValue::cssBox):
(WebCore::ShapeValue::ShapeValue):

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

19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/BasicShapeFunctions.cpp
Source/WebCore/css/CSSBasicShapes.cpp
Source/WebCore/css/CSSBasicShapes.h
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/DeprecatedStyleBuilder.cpp
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/rendering/ClipPathOperation.h
Source/WebCore/rendering/shapes/Shape.cpp
Source/WebCore/rendering/shapes/Shape.h
Source/WebCore/rendering/shapes/ShapeInfo.cpp
Source/WebCore/rendering/shapes/ShapeInfo.h
Source/WebCore/rendering/shapes/ShapeInsideInfo.h
Source/WebCore/rendering/shapes/ShapeOutsideInfo.h
Source/WebCore/rendering/style/BasicShapes.cpp
Source/WebCore/rendering/style/BasicShapes.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/ShapeValue.h

index 23d8e9a..5dd4105 100644 (file)
@@ -1,3 +1,67 @@
+2014-03-18  Bem Jones-Bey  <bjonesbe@adobe.com>
+
+        LayoutBox is a terrible name
+        https://bugs.webkit.org/show_bug.cgi?id=130351
+
+        Reviewed by Simon Fraser.
+
+        Rename LayoutBox to CSSBoxType. Also rename the functions and methods
+        that mention "LayoutBox" to something that makes sense for each
+        specific situation.
+
+        No new tests, no behavior change.
+
+        * css/BasicShapeFunctions.cpp:
+        (WebCore::valueForBasicShape):
+        (WebCore::basicShapeForValue):
+        * css/CSSBasicShapes.cpp:
+        (WebCore::CSSBasicShapeCircle::cssText):
+        (WebCore::CSSBasicShapeCircle::equals):
+        (WebCore::CSSBasicShapeEllipse::cssText):
+        (WebCore::CSSBasicShapeEllipse::equals):
+        (WebCore::CSSBasicShapePolygon::cssText):
+        (WebCore::CSSBasicShapePolygon::equals):
+        (WebCore::CSSBasicShapeInset::cssText):
+        * css/CSSBasicShapes.h:
+        (WebCore::CSSBasicShape::referenceBox):
+        (WebCore::CSSBasicShape::setReferenceBox):
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::shapePropertyValue):
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator CSSBoxType):
+        * css/DeprecatedStyleBuilder.cpp:
+        (WebCore::ApplyPropertyClipPath::applyValue):
+        (WebCore::ApplyPropertyShape::applyValue):
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::blendFunc):
+        * rendering/ClipPathOperation.h:
+        (WebCore::ShapeClipPathOperation::setReferenceBox):
+        (WebCore::ShapeClipPathOperation::referenceBox):
+        (WebCore::BoxClipPathOperation::create):
+        (WebCore::BoxClipPathOperation::referenceBox):
+        (WebCore::BoxClipPathOperation::BoxClipPathOperation):
+        * rendering/shapes/Shape.cpp:
+        (WebCore::Shape::createBoxShape):
+        * rendering/shapes/Shape.h:
+        * rendering/shapes/ShapeInfo.cpp:
+        (WebCore::ShapeInfo<RenderType>::computedShape):
+        * rendering/shapes/ShapeInfo.h:
+        * rendering/shapes/ShapeInsideInfo.h:
+        * rendering/shapes/ShapeOutsideInfo.h:
+        * rendering/style/BasicShapes.cpp:
+        (WebCore::BasicShape::canBlend):
+        * rendering/style/BasicShapes.h:
+        (WebCore::BasicShape::referenceBox):
+        (WebCore::BasicShape::setReferenceBox):
+        (WebCore::BasicShape::BasicShape):
+        * rendering/style/RenderStyleConstants.h:
+        * rendering/style/ShapeValue.h:
+        (WebCore::ShapeValue::createShapeValue):
+        (WebCore::ShapeValue::createBoxShapeValue):
+        (WebCore::ShapeValue::cssBox):
+        (WebCore::ShapeValue::ShapeValue):
+
 2014-03-18  Daniel Bates  <dabates@apple.com>
 
         REGRESSION (r162334): RenderTableCol::styleDidChange uses out-of-date table information
index cb5f3e8..6339360 100644 (file)
@@ -124,8 +124,8 @@ PassRefPtr<CSSValue> valueForBasicShape(const RenderStyle* style, const BasicSha
         break;
     }
 
-    if (basicShape->layoutBox() != BoxMissing)
-        basicShapeValue->setLayoutBox(pool.createValue(basicShape->layoutBox()));
+    if (basicShape->referenceBox() != BoxMissing)
+        basicShapeValue->setReferenceBox(pool.createValue(basicShape->referenceBox()));
 
     return pool.createValue(basicShapeValue.release());
 }
@@ -264,8 +264,8 @@ PassRefPtr<BasicShape> basicShapeForValue(const RenderStyle* style, const Render
         break;
     }
 
-    if (basicShapeValue->layoutBox())
-        basicShape->setLayoutBox(LayoutBox(*basicShapeValue->layoutBox()));
+    if (basicShapeValue->referenceBox())
+        basicShape->setReferenceBox(CSSBoxType(*basicShapeValue->referenceBox()));
 
     return basicShape.release();
 }
index 923aa75..eeb5429 100644 (file)
@@ -116,7 +116,7 @@ String CSSBasicShapeCircle::cssText() const
     return buildCircleString(m_radius ? m_radius->cssText() : String(),
         serializePositionOffset(*normalizedCX->getPairValue(), *normalizedCY->getPairValue()),
         serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->getPairValue()),
-        m_layoutBox ? m_layoutBox->cssText() : String());
+        m_referenceBox ? m_referenceBox->cssText() : String());
 }
 
 bool CSSBasicShapeCircle::equals(const CSSBasicShape& shape) const
@@ -128,7 +128,7 @@ bool CSSBasicShapeCircle::equals(const CSSBasicShape& shape) const
     return compareCSSValuePtr(m_centerX, other.m_centerX)
         && compareCSSValuePtr(m_centerY, other.m_centerY)
         && compareCSSValuePtr(m_radius, other.m_radius)
-        && compareCSSValuePtr(m_layoutBox, other.m_layoutBox);
+        && compareCSSValuePtr(m_referenceBox, other.m_referenceBox);
 }
 
 static String buildEllipseString(const String& radiusX, const String& radiusY, const String& centerX, const String& centerY, const String& box)
@@ -176,7 +176,7 @@ String CSSBasicShapeEllipse::cssText() const
         m_radiusY ? m_radiusY->cssText() : String(),
         serializePositionOffset(*normalizedCX->getPairValue(), *normalizedCY->getPairValue()),
         serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->getPairValue()),
-        m_layoutBox ? m_layoutBox->cssText() : String());
+        m_referenceBox ? m_referenceBox->cssText() : String());
 }
 
 bool CSSBasicShapeEllipse::equals(const CSSBasicShape& shape) const
@@ -189,7 +189,7 @@ bool CSSBasicShapeEllipse::equals(const CSSBasicShape& shape) const
         && compareCSSValuePtr(m_centerY, other.m_centerY)
         && compareCSSValuePtr(m_radiusX, other.m_radiusX)
         && compareCSSValuePtr(m_radiusY, other.m_radiusY)
-        && compareCSSValuePtr(m_layoutBox, other.m_layoutBox);
+        && compareCSSValuePtr(m_referenceBox, other.m_referenceBox);
 }
 
 static String buildPolygonString(const WindRule& windRule, const Vector<String>& points, const String& box)
@@ -247,7 +247,7 @@ String CSSBasicShapePolygon::cssText() const
     for (size_t i = 0; i < m_values.size(); ++i)
         points.append(m_values.at(i)->cssText());
 
-    return buildPolygonString(m_windRule, points, m_layoutBox ? m_layoutBox->cssText() : String());
+    return buildPolygonString(m_windRule, points, m_referenceBox ? m_referenceBox->cssText() : String());
 }
 
 bool CSSBasicShapePolygon::equals(const CSSBasicShape& shape) const
@@ -256,7 +256,7 @@ bool CSSBasicShapePolygon::equals(const CSSBasicShape& shape) const
         return false;
 
     const CSSBasicShapePolygon& rhs = static_cast<const CSSBasicShapePolygon&>(shape);
-    return compareCSSValuePtr(m_layoutBox, rhs.m_layoutBox)
+    return compareCSSValuePtr(m_referenceBox, rhs.m_referenceBox)
         && compareCSSValueVector<CSSPrimitiveValue>(m_values, rhs.m_values);
 }
 
@@ -358,7 +358,7 @@ String CSSBasicShapeInset::cssText() const
         bottomRightRadiusHeight,
         bottomLeftRadiusWidth,
         bottomLeftRadiusHeight,
-        m_layoutBox ? m_layoutBox->cssText() : String());
+        m_referenceBox ? m_referenceBox->cssText() : String());
 }
 
 bool CSSBasicShapeInset::equals(const CSSBasicShape& shape) const
index e372442..c9210cf 100644 (file)
@@ -51,15 +51,15 @@ public:
     virtual String cssText() const = 0;
     virtual bool equals(const CSSBasicShape&) const = 0;
 
-    CSSPrimitiveValue* layoutBox() const { return m_layoutBox.get(); }
-    void setLayoutBox(PassRefPtr<CSSPrimitiveValue> layoutBox) { m_layoutBox = layoutBox; }
+    CSSPrimitiveValue* referenceBox() const { return m_referenceBox.get(); }
+    void setReferenceBox(PassRefPtr<CSSPrimitiveValue> referenceBox) { m_referenceBox = referenceBox; }
 
 public:
     virtual ~CSSBasicShape() { }
 
 protected:
     CSSBasicShape() { }
-    RefPtr<CSSPrimitiveValue> m_layoutBox;
+    RefPtr<CSSPrimitiveValue> m_referenceBox;
 };
 
 class CSSBasicShapeInset : public CSSBasicShape {
index 532e55e..053463f 100644 (file)
@@ -1630,7 +1630,7 @@ static PassRefPtr<CSSValue> shapePropertyValue(const RenderStyle* style, const S
         return cssValuePool().createIdentifierValue(CSSValueOutsideShape);
 
     if (shapeValue->type() == ShapeValue::Box)
-        return cssValuePool().createValue(shapeValue->layoutBox());
+        return cssValuePool().createValue(shapeValue->cssBox());
 
     if (shapeValue->type() == ShapeValue::Image)
         return shapeValue->image() ? shapeValue->image()->cssValue() : cssValuePool().createIdentifierValue(CSSValueNone);
@@ -1639,8 +1639,8 @@ static PassRefPtr<CSSValue> shapePropertyValue(const RenderStyle* style, const S
 
     RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
     list->append(valueForBasicShape(style, shapeValue->shape()));
-    if (shapeValue->layoutBox() != BoxMissing)
-        list->append(cssValuePool().createValue(shapeValue->layoutBox()));
+    if (shapeValue->cssBox() != BoxMissing)
+        list->append(cssValuePool().createValue(shapeValue->cssBox()));
     return list.release();
 }
 #endif
index 2021249..cc162c9 100644 (file)
@@ -5162,11 +5162,11 @@ template<> inline CSSPrimitiveValue::operator ImageOrientationEnum() const
 
 #endif // ENABLE(CSS_IMAGE_ORIENTATION)
 
-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LayoutBox layoutBox)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CSSBoxType cssBox)
     : CSSValue(PrimitiveClass)
 {
     m_primitiveUnitType = CSS_VALUE_ID;
-    switch (layoutBox) {
+    switch (cssBox) {
     case MarginBox:
         m_value.valueID = CSSValueMarginBox;
         break;
@@ -5195,7 +5195,7 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LayoutBox layoutBox)
     }
 }
 
-template<> inline CSSPrimitiveValue::operator LayoutBox() const
+template<> inline CSSPrimitiveValue::operator CSSBoxType() const
 {
     switch (getValueID()) {
     case CSSValueMarginBox:
index 6dcb919..4de8786 100644 (file)
@@ -2144,7 +2144,7 @@ public:
         }
         if (!value->isValueList())
             return;
-        LayoutBox referenceBox = BoxMissing;
+        CSSBoxType referenceBox = BoxMissing;
         RefPtr<ClipPathOperation> operation;
         auto& valueList = toCSSValueList(*value);
         for (unsigned i = 0; i < valueList.length(); ++i) {
@@ -2159,7 +2159,7 @@ public:
                 || primitiveValue.getValueID() == CSSValueStroke
                 || primitiveValue.getValueID() == CSSValueViewBox)
                 && referenceBox == BoxMissing)
-                referenceBox = LayoutBox(primitiveValue);
+                referenceBox = CSSBoxType(primitiveValue);
             else
                 return;
         }
@@ -2196,7 +2196,7 @@ public:
             setValue(styleResolver->style(), shape.release());
         } else if (value->isValueList()) {
             RefPtr<BasicShape> shape;
-            LayoutBox layoutBox = BoxMissing;
+            CSSBoxType referenceBox = BoxMissing;
             CSSValueList* valueList = toCSSValueList(value);
             for (unsigned i = 0; i < valueList->length(); ++i) {
                 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList->itemWithoutBoundsCheck(i));
@@ -2206,15 +2206,15 @@ public:
                     || primitiveValue->getValueID() == CSSValueBorderBox
                     || primitiveValue->getValueID() == CSSValuePaddingBox
                     || primitiveValue->getValueID() == CSSValueMarginBox)
-                    layoutBox = LayoutBox(*primitiveValue);
+                    referenceBox = CSSBoxType(*primitiveValue);
                 else
                     return;
             }
 
             if (shape)
-                setValue(styleResolver->style(), ShapeValue::createShapeValue(shape.release(), layoutBox));
-            else if (layoutBox != BoxMissing)
-                setValue(styleResolver->style(), ShapeValue::createLayoutBoxValue(layoutBox));
+                setValue(styleResolver->style(), ShapeValue::createShapeValue(shape.release(), referenceBox));
+            else if (referenceBox != BoxMissing)
+                setValue(styleResolver->style(), ShapeValue::createBoxShapeValue(referenceBox));
 
         }
     }
index c63ff35..c55e059 100644 (file)
@@ -148,7 +148,7 @@ static inline PassRefPtr<ShapeValue> blendFunc(const AnimationBase*, ShapeValue*
     if (from->type() != ShapeValue::Shape || to->type() != ShapeValue::Shape)
         return to;
 
-    if (from->layoutBox() != to->layoutBox())
+    if (from->cssBox() != to->cssBox())
         return to;
 
     const BasicShape* fromShape = from->shape();
@@ -157,7 +157,7 @@ static inline PassRefPtr<ShapeValue> blendFunc(const AnimationBase*, ShapeValue*
     if (!fromShape->canBlend(toShape))
         return to;
 
-    return ShapeValue::createShapeValue(toShape->blend(fromShape, progress), to->layoutBox());
+    return ShapeValue::createShapeValue(toShape->blend(fromShape, progress), to->cssBox());
 }
 #endif
 
index 7d71c51..656e7fd 100644 (file)
@@ -112,8 +112,8 @@ public:
         return path;
     }
 
-    void setReferenceBox(LayoutBox referenceBox) { m_referenceBox = referenceBox; }
-    LayoutBox referenceBox() const { return m_referenceBox; }
+    void setReferenceBox(CSSBoxType referenceBox) { m_referenceBox = referenceBox; }
+    CSSBoxType referenceBox() const { return m_referenceBox; }
 
 private:
     virtual bool operator==(const ClipPathOperation& o) const override
@@ -132,12 +132,12 @@ private:
     }
 
     RefPtr<BasicShape> m_shape;
-    LayoutBox m_referenceBox;
+    CSSBoxType m_referenceBox;
 };
 
 class BoxClipPathOperation : public ClipPathOperation {
 public:
-    static PassRefPtr<BoxClipPathOperation> create(LayoutBox referenceBox)
+    static PassRefPtr<BoxClipPathOperation> create(CSSBoxType referenceBox)
     {
         return adoptRef(new BoxClipPathOperation(referenceBox));
     }
@@ -148,7 +148,7 @@ public:
         path.addRoundedRect(boundingRect);
         return path;
     }
-    LayoutBox referenceBox() const { return m_referenceBox; }
+    CSSBoxType referenceBox() const { return m_referenceBox; }
 
 private:
     virtual bool operator==(const ClipPathOperation& o) const override
@@ -159,13 +159,13 @@ private:
         return m_referenceBox == other->m_referenceBox;
     }
 
-    explicit BoxClipPathOperation(LayoutBox referenceBox)
+    explicit BoxClipPathOperation(CSSBoxType referenceBox)
         : ClipPathOperation(Box)
         , m_referenceBox(referenceBox)
     {
     }
 
-    LayoutBox m_referenceBox;
+    CSSBoxType m_referenceBox;
 };
 
 #define CLIP_PATH_OPERATION_CASTS(ToValueTypeName, predicate) \
index ab874b6..cbf3768 100644 (file)
@@ -222,7 +222,7 @@ PassOwnPtr<Shape> Shape::createRasterShape(Image* image, float threshold, const
     return rasterShape.release();
 }
 
-PassOwnPtr<Shape> Shape::createLayoutBoxShape(const RoundedRect& roundedRect, WritingMode writingMode, Length margin, Length padding)
+PassOwnPtr<Shape> Shape::createBoxShape(const RoundedRect& roundedRect, WritingMode writingMode, Length margin, Length padding)
 {
     ASSERT(roundedRect.rect().width() >= 0 && roundedRect.rect().height() >= 0);
 
index 63a935f..4e3793f 100644 (file)
@@ -69,7 +69,7 @@ public:
 
     static PassOwnPtr<Shape> createShape(const BasicShape*, const LayoutSize& logicalBoxSize, WritingMode, Length margin, Length padding);
     static PassOwnPtr<Shape> createRasterShape(Image*, float threshold, const LayoutRect& drawRect, const LayoutRect& clipRect, WritingMode, Length margin, Length padding);
-    static PassOwnPtr<Shape> createLayoutBoxShape(const RoundedRect&, WritingMode, Length margin, Length padding);
+    static PassOwnPtr<Shape> createBoxShape(const RoundedRect&, WritingMode, Length margin, Length padding);
 
     virtual ~Shape() { }
 
index 82c1b08..3901070 100644 (file)
@@ -145,7 +145,7 @@ const Shape& ShapeInfo<RenderType>::computedShape() const
         // FIXME This does not properly compute the rounded corners as specified in all conditions.
         // https://bugs.webkit.org/show_bug.cgi?id=127982
         const RoundedRect& shapeRect = m_renderer.style().getRoundedBorderFor(LayoutRect(LayoutPoint(), m_referenceBoxLogicalSize), &(m_renderer.view()));
-        m_shape = Shape::createLayoutBoxShape(shapeRect, writingMode, margin, padding);
+        m_shape = Shape::createBoxShape(shapeRect, writingMode, margin, padding);
         break;
     }
     case ShapeValue::Outside:
index e77eae8..78c3ba4 100644 (file)
@@ -132,7 +132,7 @@ protected:
     {
     }
 
-    virtual LayoutBox referenceBox() const = 0;
+    virtual CSSBoxType referenceBox() const = 0;
     virtual LayoutRect computedShapeLogicalBoundingBox() const = 0;
     virtual ShapeValue* shapeValue() const = 0;
     virtual void getIntervals(LayoutUnit, LayoutUnit, SegmentList&) const = 0;
index 06b6bec..1bb07fd 100644 (file)
@@ -107,12 +107,12 @@ public:
     }
 
 protected:
-    virtual LayoutBox referenceBox() const override
+    virtual CSSBoxType referenceBox() const override
     {
-        if (shapeValue()->layoutBox() == BoxMissing)
+        if (shapeValue()->cssBox() == BoxMissing)
             return ContentBox;
 
-        return shapeValue()->layoutBox();
+        return shapeValue()->cssBox();
     }
 
     virtual const RenderStyle& styleForWritingMode() const override;
index 69c3763..4881e06 100644 (file)
@@ -63,14 +63,14 @@ public:
     }
 
 protected:
-    virtual LayoutBox referenceBox() const override
+    virtual CSSBoxType referenceBox() const override
     {
-        if (shapeValue()->layoutBox() == BoxMissing) {
+        if (shapeValue()->cssBox() == BoxMissing) {
             if (shapeValue()->type() == ShapeValue::Image)
                 return ContentBox;
             return MarginBox;
         }
-        return shapeValue()->layoutBox();
+        return shapeValue()->cssBox();
     }
 
 private:
index 1ef7ca6..d2a0c4d 100644 (file)
@@ -65,7 +65,7 @@ bool BasicShape::canBlend(const BasicShape* other) const
         return false;
 
     // Both shapes must use the same reference box.
-    if (layoutBox() != other->layoutBox())
+    if (referenceBox() != other->referenceBox())
         return false;
 
     // Just polygons with same number of vertices can be animated.
index 20aa629..f2ab4bd 100644 (file)
@@ -63,17 +63,17 @@ public:
 
     virtual Type type() const = 0;
 
-    LayoutBox layoutBox() const { return m_layoutBox; }
-    void setLayoutBox(LayoutBox layoutBox) { m_layoutBox = layoutBox; }
+    CSSBoxType referenceBox() const { return m_referenceBox; }
+    void setReferenceBox(CSSBoxType referenceBox) { m_referenceBox = referenceBox; }
 
 protected:
     BasicShape()
-        : m_layoutBox(BoxMissing)
+        : m_referenceBox(BoxMissing)
     {
     }
 
 private:
-    LayoutBox m_layoutBox;
+    CSSBoxType m_referenceBox;
 };
 
 class BasicShapeCenterCoordinate {
index 93070b2..3e2e661 100644 (file)
@@ -556,7 +556,7 @@ enum TextIndentType { TextIndentNormal, TextIndentHanging };
 enum Isolation { IsolationAuto, IsolationIsolate };
 
 // Fill, Stroke, ViewBox are just used for SVG.
-enum LayoutBox { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox, Fill, Stroke, ViewBox };
+enum CSSBoxType { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox, Fill, Stroke, ViewBox };
 
 } // namespace WebCore
 
index 53c11a7..15317da 100644 (file)
@@ -48,14 +48,14 @@ public:
         Image
     };
 
-    static PassRefPtr<ShapeValue> createShapeValue(PassRefPtr<BasicShape> shape, LayoutBox layoutBox)
+    static PassRefPtr<ShapeValue> createShapeValue(PassRefPtr<BasicShape> shape, CSSBoxType cssBox)
     {
-        return adoptRef(new ShapeValue(shape, layoutBox));
+        return adoptRef(new ShapeValue(shape, cssBox));
     }
 
-    static PassRefPtr<ShapeValue> createLayoutBoxValue(LayoutBox layoutBox)
+    static PassRefPtr<ShapeValue> createBoxShapeValue(CSSBoxType boxShape)
     {
-        return adoptRef(new ShapeValue(layoutBox));
+        return adoptRef(new ShapeValue(boxShape));
     }
 
     static PassRefPtr<ShapeValue> createOutsideValue()
@@ -70,7 +70,7 @@ public:
 
     ShapeValueType type() const { return m_type; }
     BasicShape* shape() const { return m_shape.get(); }
-    LayoutBox layoutBox() const { return m_layoutBox; }
+    CSSBoxType cssBox() const { return m_cssBox; }
 
     StyleImage* image() const { return m_image.get(); }
     bool isImageValid() const { return image() && image()->cachedImage() && image()->cachedImage()->hasImage(); }
@@ -84,33 +84,33 @@ public:
     bool operator==(const ShapeValue& other) const { return type() == other.type(); }
 
 private:
-    ShapeValue(PassRefPtr<BasicShape> shape, LayoutBox layoutBox)
+    ShapeValue(PassRefPtr<BasicShape> shape, CSSBoxType cssBox)
         : m_type(Shape)
         , m_shape(shape)
-        , m_layoutBox(layoutBox)
+        , m_cssBox(cssBox)
     {
     }
     ShapeValue(ShapeValueType type)
         : m_type(type)
-        , m_layoutBox(BoxMissing)
+        , m_cssBox(BoxMissing)
     {
     }
     ShapeValue(PassRefPtr<StyleImage> image)
         : m_type(Image)
         , m_image(image)
-        , m_layoutBox(BoxMissing)
+        , m_cssBox(BoxMissing)
     {
     }
-    ShapeValue(LayoutBox layoutBox)
+    ShapeValue(CSSBoxType cssBox)
         : m_type(Box)
-        , m_layoutBox(layoutBox)
+        , m_cssBox(cssBox)
     {
     }
 
     ShapeValueType m_type;
     RefPtr<BasicShape> m_shape;
     RefPtr<StyleImage> m_image;
-    LayoutBox m_layoutBox;
+    CSSBoxType m_cssBox;
 };
 
 }