Ignore:
Timestamp:
Jul 16, 2012, 3:48:41 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Resolve CSS Exclusions shapeInside, shapeOutside properties to Length based WrapShape classes
https://bugs.webkit.org/show_bug.cgi?id=89670

Patch by Bear Travis <betravis@adobe.com> on 2012-07-16
Reviewed by Dirk Schulze.

Source/WebCore:

Layout of CSS Exclusions requires length based WrapShape classes,
rather than the existing CSSValue based CSSWrapShape classes. This
patch adds length based WrapShape analogs to the CSSWrapShapes, and
modifies RenderStyle to use a WrapShape instead of a CSSWrapShape.
The translation between WrapShape and CSSWrapShape classes
is handled by helper functions in the new WrapShapeFunctions files.
StyleBuilder resolves CSSWrapShapes to WrapShapes for layout use.
CSSComputedStyleDeclaration translates WrapShapes to CSSWrapShapes
for style use.

There are existing tests that cover the style serialization / resolution
in fast/exclusions/parsing-wrap-shape-inside.html and
fast/exclusions/parsing/wrap-shape-outside.html

Test: fast/exclusions/parsing-wrap-shape-lengths.html

  • CMakeLists.txt: Build system changes for adding new files
  • GNUmakefile.list.am: Ditto
  • Target.pri: Ditto
  • WebCore.gypi: Ditto
  • WebCore.vcproj/WebCore.vcproj: Ditto
  • WebCore.xcodeproj/project.pbxproj: Ditto
  • css/CSSComputedStyleDeclaration.cpp: Translate WrapShapes back to CSSWrapShapes

(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

  • css/CSSWrapShapes.h: Mostly changing functions to be const

(WebCore::CSSWrapShapeRectangle::type):
(WebCore::CSSWrapShapeCircle::type):
(WebCore::CSSWrapShapeEllipse::type):
(WebCore::CSSWrapShapePolygon::getXAt):
(WebCore::CSSWrapShapePolygon::getYAt):
(WebCore::CSSWrapShapePolygon::values):
(WebCore::CSSWrapShapePolygon::type):

  • css/StyleBuilder.cpp: Resolve CSSWrapShapes to WrapShapes

(WebCore):
(WebCore::ApplyPropertyWrapShape::setValue):
(WebCore::ApplyPropertyWrapShape::applyValue):
(WebCore::ApplyPropertyWrapShape::createHandler):

  • css/WrapShapeFunctions.cpp: Added.

(WebCore):
(WebCore::valueForWrapShape):
(WebCore::convertToLength):
(WebCore::wrapShapeForValue):

  • css/WrapShapeFunctions.h: Added.

(WebCore):

  • rendering/style/RenderStyle.h:
  • rendering/style/StyleRareNonInheritedData.h:

(StyleRareNonInheritedData):

  • rendering/style/WrapShapes.h: Added.

(WebCore):
(WrapShape):
(WebCore::WrapShape::~WrapShape):
(WebCore::WrapShape::WrapShape):
(WrapShapeRectangle):
(WebCore::WrapShapeRectangle::create):
(WebCore::WrapShapeRectangle::left):
(WebCore::WrapShapeRectangle::top):
(WebCore::WrapShapeRectangle::width):
(WebCore::WrapShapeRectangle::height):
(WebCore::WrapShapeRectangle::cornerRadiusX):
(WebCore::WrapShapeRectangle::cornerRadiusY):
(WebCore::WrapShapeRectangle::setLeft):
(WebCore::WrapShapeRectangle::setTop):
(WebCore::WrapShapeRectangle::setWidth):
(WebCore::WrapShapeRectangle::setHeight):
(WebCore::WrapShapeRectangle::setCornerRadiusX):
(WebCore::WrapShapeRectangle::setCornerRadiusY):
(WebCore::WrapShapeRectangle::type):
(WebCore::WrapShapeRectangle::WrapShapeRectangle):
(WrapShapeCircle):
(WebCore::WrapShapeCircle::create):
(WebCore::WrapShapeCircle::left):
(WebCore::WrapShapeCircle::top):
(WebCore::WrapShapeCircle::radius):
(WebCore::WrapShapeCircle::setLeft):
(WebCore::WrapShapeCircle::setTop):
(WebCore::WrapShapeCircle::setRadius):
(WebCore::WrapShapeCircle::type):
(WebCore::WrapShapeCircle::WrapShapeCircle):
(WrapShapeEllipse):
(WebCore::WrapShapeEllipse::create):
(WebCore::WrapShapeEllipse::top):
(WebCore::WrapShapeEllipse::left):
(WebCore::WrapShapeEllipse::radiusX):
(WebCore::WrapShapeEllipse::radiusY):
(WebCore::WrapShapeEllipse::setTop):
(WebCore::WrapShapeEllipse::setLeft):
(WebCore::WrapShapeEllipse::setRadiusX):
(WebCore::WrapShapeEllipse::setRadiusY):
(WebCore::WrapShapeEllipse::type):
(WebCore::WrapShapeEllipse::WrapShapeEllipse):
(WrapShapePolygon):
(WebCore::WrapShapePolygon::create):
(WebCore::WrapShapePolygon::windRule):
(WebCore::WrapShapePolygon::values):
(WebCore::WrapShapePolygon::getXAt):
(WebCore::WrapShapePolygon::getYAt):
(WebCore::WrapShapePolygon::setWindRule):
(WebCore::WrapShapePolygon::appendPoint):
(WebCore::WrapShapePolygon::type):
(WebCore::WrapShapePolygon::WrapShapePolygon):

LayoutTests:

Test that wrap shapes accept different length types
Wrap shape parsing and serialization is tested by parsing-wrap-shape-inside/outside

  • fast/exclusions/parsing-wrap-shape-lengths-expected.txt: Added.
  • fast/exclusions/parsing-wrap-shape-lengths.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r122747 r122773  
    14281428#endif
    14291429
    1430     void setWrapShapeInside(PassRefPtr<CSSWrapShape> shape)
     1430    void setWrapShapeInside(PassRefPtr<WrapShape> shape)
    14311431    {
    14321432        if (rareNonInheritedData->m_wrapShapeInside != shape)
    14331433            rareNonInheritedData.access()->m_wrapShapeInside = shape;
    14341434    }
    1435     CSSWrapShape* wrapShapeInside() const { return rareNonInheritedData->m_wrapShapeInside.get(); }
    1436 
    1437     void setWrapShapeOutside(PassRefPtr<CSSWrapShape> shape)
     1435    WrapShape* wrapShapeInside() const { return rareNonInheritedData->m_wrapShapeInside.get(); }
     1436
     1437    void setWrapShapeOutside(PassRefPtr<WrapShape> shape)
    14381438    {
    14391439        if (rareNonInheritedData->m_wrapShapeOutside != shape)
    14401440            rareNonInheritedData.access()->m_wrapShapeOutside = shape;
    14411441    }
    1442     CSSWrapShape* wrapShapeOutside() const { return rareNonInheritedData->m_wrapShapeOutside.get(); }
    1443 
    1444     static CSSWrapShape* initialWrapShapeInside() { return 0; }
    1445     static CSSWrapShape* initialWrapShapeOutside() { return 0; }
     1442    WrapShape* wrapShapeOutside() const { return rareNonInheritedData->m_wrapShapeOutside.get(); }
     1443
     1444    static WrapShape* initialWrapShapeInside() { return 0; }
     1445    static WrapShape* initialWrapShapeOutside() { return 0; }
    14461446
    14471447    Length wrapPadding() const { return rareNonInheritedData->m_wrapPadding; }
Note: See TracChangeset for help on using the changeset viewer.