Resolve CSS Exclusions shapeInside, shapeOutside properties to Length based WrapShape...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2012 22:48:41 +0000 (22:48 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2012 22:48:41 +0000 (22:48 +0000)
commitff49d4ba228a84bb294a8ec00aaa6cae3e2e640b
tree5a6162525b7b3edee623777380ecebe6237aa3f8
parent5f3ac99feca2a9b19148798235db1b323ad8dab0
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/exclusions/parsing-wrap-shape-lengths-expected.txt [new file with mode: 0644]
LayoutTests/fast/exclusions/parsing-wrap-shape-lengths.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSWrapShapes.h
Source/WebCore/css/StyleBuilder.cpp
Source/WebCore/css/WrapShapeFunctions.cpp [new file with mode: 0644]
Source/WebCore/css/WrapShapeFunctions.h [new file with mode: 0644]
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.h
Source/WebCore/rendering/style/WrapShapes.h [new file with mode: 0644]