<https://webkit.org/b/119849> [CSS Shapes] Complete RasterShape::firstIncludedInterva...
authorhmuller@adobe.com <hmuller@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Aug 2013 19:21:36 +0000 (19:21 +0000)
committerhmuller@adobe.com <hmuller@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Aug 2013 19:21:36 +0000 (19:21 +0000)
commit12c92bef7f7fc331a7a63faff38e22bcd879b1ef
tree4836e8792b28d5a92a8331e35963c35120b724b6
parent36ac86231f0d2e731f7191441e0dce6f4ac50bb0
<https://webkit.org/b/119849> [CSS Shapes] Complete RasterShape::firstIncludedIntervalLogicalTop()

Reviewed by Alexandru Chiculita.

Source/WebCore:

Completed the implementation of RasterShape::firstIncludedIntervalLogicalTop(). The
method now computes first logical top location where a line segment can be laid
out within a RasterShape, i.e. a shape derived from an image valued URL resource.

A detailed description of the algorithm can be found in
http://hansmuller-webkit.blogspot.com/2013/08/first-fit-location-for-image-shapes.html.

The new tests exposed a bug in the existing getIncludedIntervals() method. A shape
with a vertical gap that spans the entire line now causes the method to short circuit
and return an empty interval list.

Tests: fast/shapes/shape-inside/shape-inside-image-003.html
       fast/shapes/shape-inside/shape-inside-image-004.html
       fast/shapes/shape-inside/shape-inside-image-005.html

* rendering/shapes/RasterShape.cpp:
(WebCore::RasterShapeIntervals::firstIncludedIntervalY):
(WebCore::RasterShapeIntervals::getIncludedIntervals):
(WebCore::RasterShape::firstIncludedIntervalLogicalTop):
* rendering/shapes/RasterShape.h:

LayoutTests:

Verify that the first fit algorithm works correctly for complex image shapes.
For this set of tests the image is specified with an SVG file.

* fast/shapes/resources/svg-shape-001.svg: Added.
* fast/shapes/shape-inside/shape-inside-image-003-expected.html: Added.
* fast/shapes/shape-inside/shape-inside-image-003.html: Added.
* fast/shapes/shape-inside/shape-inside-image-004-expected.html: Added.
* fast/shapes/shape-inside/shape-inside-image-004.html: Added.
* fast/shapes/shape-inside/shape-inside-image-005-expected.html: Added.
* fast/shapes/shape-inside/shape-inside-image-005.html: Added.

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