Ignore:
Timestamp:
Jan 9, 2014, 12:16:23 PM (11 years ago)
Author:
[email protected]
Message:

[CSS Shapes] Factor the ReferenceBox type out of BasicShapes
https://bugs.webkit.org/show_bug.cgi?id=126648

Reviewed by Dirk Schulze.

Moving ReferenceBox out of BasicShapes and into RenderStyleConstants
as the LayoutBox enum. Most of the changes are removing the BasicShape
namespace.

Refactoring, no new tests.

  • css/BasicShapeFunctions.cpp:

(WebCore::valueForBox):
(WebCore::boxForValue):
(WebCore::valueForBasicShape):
(WebCore::basicShapeForValue):

  • css/BasicShapeFunctions.h:
  • css/CSSBasicShapes.cpp:

(WebCore::CSSBasicShapeRectangle::cssText):
(WebCore::CSSBasicShapeRectangle::equals):
(WebCore::CSSBasicShapeCircle::cssText):
(WebCore::CSSBasicShapeCircle::equals):
(WebCore::CSSDeprecatedBasicShapeCircle::cssText):
(WebCore::CSSDeprecatedBasicShapeCircle::equals):
(WebCore::CSSBasicShapeEllipse::cssText):
(WebCore::CSSBasicShapeEllipse::equals):
(WebCore::CSSDeprecatedBasicShapeEllipse::cssText):
(WebCore::CSSDeprecatedBasicShapeEllipse::equals):
(WebCore::CSSBasicShapePolygon::cssText):
(WebCore::CSSBasicShapePolygon::equals):
(WebCore::CSSBasicShapeInsetRectangle::cssText):
(WebCore::CSSBasicShapeInsetRectangle::equals):
(WebCore::CSSBasicShapeInset::cssText):

  • css/CSSBasicShapes.h:

(WebCore::CSSBasicShape::layoutBox):
(WebCore::CSSBasicShape::setLayoutBox):

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::propertyValue):

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseShapeProperty):

  • css/DeprecatedStyleBuilder.cpp:

(WebCore::ApplyPropertyClipPath::applyValue):
(WebCore::ApplyPropertyShape::applyValue):

  • rendering/ClipPathOperation.h:

(WebCore::ShapeClipPathOperation::setReferenceBox):
(WebCore::ShapeClipPathOperation::referenceBox):
(WebCore::ShapeClipPathOperation::ShapeClipPathOperation):
(WebCore::BoxClipPathOperation::create):
(WebCore::BoxClipPathOperation::referenceBox):
(WebCore::BoxClipPathOperation::BoxClipPathOperation):

  • rendering/shapes/Shape.cpp:

(WebCore::Shape::createLayoutBoxShape):

  • rendering/shapes/Shape.h:
  • rendering/shapes/ShapeInfo.cpp:

(WebCore::ShapeInfo<RenderType>::computedShape):

  • rendering/shapes/ShapeInfo.h:

(WebCore::ShapeInfo::setShapeSize):
(WebCore::ShapeInfo::logicalTopOffset):
(WebCore::ShapeInfo::logicalLeftOffset):

  • rendering/shapes/ShapeInsideInfo.h:
  • rendering/shapes/ShapeOutsideInfo.h:
  • rendering/style/BasicShapes.cpp:

(WebCore::BasicShape::canBlend):
(WebCore::BasicShape::referenceBoxSize):

  • rendering/style/BasicShapes.h:

(WebCore::BasicShape::layoutBox):
(WebCore::BasicShape::setLayoutBox):
(WebCore::BasicShape::BasicShape):

  • rendering/style/RenderStyleConstants.h:
  • rendering/style/ShapeValue.h:

(WebCore::ShapeValue::createLayoutBoxValue):
(WebCore::ShapeValue::layoutBox):
(WebCore::ShapeValue::ShapeValue):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSBasicShapes.cpp

    r160023 r161569  
    7979        m_radiusX.get() ? m_radiusX->cssText() : String(),
    8080        m_radiusY.get() ? m_radiusY->cssText() : String(),
    81         m_box ? m_box->cssText() : String());
     81        m_layoutBox ? m_layoutBox->cssText() : String());
    8282}
    8383
     
    9494        && compareCSSValuePtr(m_radiusX, other.m_radiusX)
    9595        && compareCSSValuePtr(m_radiusY, other.m_radiusY)
    96         && compareCSSValuePtr(m_box, other.m_box);
     96        && compareCSSValuePtr(m_layoutBox, other.m_layoutBox);
    9797}
    9898
     
    129129        m_centerX ? m_centerX->cssText() : String(),
    130130        m_centerY ? m_centerY->cssText() : String(),
    131         m_box ? m_box->cssText() : String());
     131        m_layoutBox ? m_layoutBox->cssText() : String());
    132132}
    133133
     
    141141        && compareCSSValuePtr(m_centerY, other.m_centerY)
    142142        && compareCSSValuePtr(m_radius, other.m_radius)
    143         && compareCSSValuePtr(m_box, other.m_box);
     143        && compareCSSValuePtr(m_layoutBox, other.m_layoutBox);
    144144}
    145145
     
    165165String CSSDeprecatedBasicShapeCircle::cssText() const
    166166{
    167     return buildDeprecatedCircleString(m_centerX->cssText(), m_centerY->cssText(), m_radius->cssText(), m_box ? m_box->cssText() : String());
     167    return buildDeprecatedCircleString(m_centerX->cssText(), m_centerY->cssText(), m_radius->cssText(), m_layoutBox ? m_layoutBox->cssText() : String());
    168168}
    169169
     
    177177        && compareCSSValuePtr(m_centerY, other.m_centerY)
    178178        && compareCSSValuePtr(m_radius, other.m_radius)
    179         && compareCSSValuePtr(m_box, other.m_box);
     179        && compareCSSValuePtr(m_layoutBox, other.m_layoutBox);
    180180}
    181181
     
    222222        m_centerX ? m_centerX->cssText() : String(),
    223223        m_centerY ? m_centerY->cssText() : String(),
    224         m_box ? m_box->cssText() : String());
     224        m_layoutBox ? m_layoutBox->cssText() : String());
    225225}
    226226
     
    235235        && compareCSSValuePtr(m_radiusX, other.m_radiusX)
    236236        && compareCSSValuePtr(m_radiusY, other.m_radiusY)
    237         && compareCSSValuePtr(m_box, other.m_box);
     237        && compareCSSValuePtr(m_layoutBox, other.m_layoutBox);
    238238}
    239239
     
    261261String CSSDeprecatedBasicShapeEllipse::cssText() const
    262262{
    263     return buildDeprecatedEllipseString(m_centerX->cssText(), m_centerY->cssText(), m_radiusX->cssText(), m_radiusY->cssText(), m_box ? m_box->cssText() : String());
     263    return buildDeprecatedEllipseString(m_centerX->cssText(), m_centerY->cssText(), m_radiusX->cssText(), m_radiusY->cssText(), m_layoutBox ? m_layoutBox->cssText() : String());
    264264}
    265265
     
    274274        && compareCSSValuePtr(m_radiusX, other.m_radiusX)
    275275        && compareCSSValuePtr(m_radiusY, other.m_radiusY)
    276         && compareCSSValuePtr(m_box, other.m_box);
     276        && compareCSSValuePtr(m_layoutBox, other.m_layoutBox);
    277277}
    278278
     
    332332        points.append(m_values.at(i)->cssText());
    333333
    334     return buildPolygonString(m_windRule, points, m_box ? m_box->cssText() : String());
     334    return buildPolygonString(m_windRule, points, m_layoutBox ? m_layoutBox->cssText() : String());
    335335}
    336336
     
    341341
    342342    const CSSBasicShapePolygon& rhs = static_cast<const CSSBasicShapePolygon&>(shape);
    343     return compareCSSValuePtr(m_box, rhs.m_box)
     343    return compareCSSValuePtr(m_layoutBox, rhs.m_layoutBox)
    344344        && compareCSSValueVector<CSSPrimitiveValue>(m_values, rhs.m_values);
    345345}
     
    384384        m_radiusX.get() ? m_radiusX->cssText() : String(),
    385385        m_radiusY.get() ? m_radiusY->cssText() : String(),
    386         m_box ? m_box->cssText() : String());
     386        m_layoutBox ? m_layoutBox->cssText() : String());
    387387}
    388388
     
    399399        && compareCSSValuePtr(m_radiusX, other.m_radiusX)
    400400        && compareCSSValuePtr(m_radiusY, other.m_radiusY)
    401         && compareCSSValuePtr(m_box, other.m_box);
     401        && compareCSSValuePtr(m_layoutBox, other.m_layoutBox);
    402402}
    403403
     
    515515        bottomLeftRadiusWidth,
    516516        bottomLeftRadiusHeight,
    517         m_box ? m_box->cssText() : String());
     517        m_layoutBox ? m_layoutBox->cssText() : String());
    518518}
    519519
Note: See TracChangeset for help on using the changeset viewer.