[CSS Shapes] Image valued shape-outside that extends vertically into the margin-box...
authorhmuller@adobe.com <hmuller@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Nov 2013 23:46:57 +0000 (23:46 +0000)
committerhmuller@adobe.com <hmuller@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Nov 2013 23:46:57 +0000 (23:46 +0000)
commit1a6de67a0c6aafc67513cc617cec3525548bc894
tree7b5e42808043fae26d8c621ac07d20d0c4403181
parent4a4a63ba92406d228717796422b91fbadffb502e
[CSS Shapes] Image valued shape-outside that extends vertically into the margin-box is top-clipped
https://bugs.webkit.org/show_bug.cgi?id=123769

Reviewed by Dirk Schulze.

Source/WebCore:

Remove the assumption that Y coordinates are >= 0 from the RasterShapeIntervals class
and correct its computeShapeMarginIntervals() method. The computeShapeMarginIntervals()
method now generates intervals with Y coordinates that begin at the image shape's
bounds.y - shape-margin, which may be less than 0.

The RasterShapeIntervals::intervalsAt() method now offsets its Y coordinate parameter
by the shape-margin. A non-const overload of the method was added to centralize all
access to m_intervalLists.

Test: fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-004.html
      fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-005.html

* rendering/shapes/RasterShape.cpp:
(WebCore::MarginIntervalGenerator::intervalAt): Don't clip X coordinates to 0 since they can extend into the margin-box.
(WebCore::RasterShapeIntervals::appendInterval): Use the non-const intervalsAt() method.
(WebCore::RasterShapeIntervals::uniteMarginInterval): Ditto.
(WebCore::RasterShapeIntervals::computeShapeMarginIntervals): See above.
* rendering/shapes/RasterShape.h:
(WebCore::RasterShapeIntervals::RasterShapeIntervals): Added a field for the margin.
(WebCore::RasterShapeIntervals::intervalsAt): Offset y coordinates by the margin; added a non-const overload.

LayoutTests:

Verify that lines overlap a shape-outside that extends into the top of the margin-box
do wrap around the top of the shape as well its side and bottom.

* fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-004-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-004.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-005-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-005.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-004-expected.html [new file with mode: 0644]
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-004.html [new file with mode: 0644]
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-005-expected.html [new file with mode: 0644]
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-005.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/shapes/RasterShape.cpp
Source/WebCore/rendering/shapes/RasterShape.h