[CSS Exclusions] polygon shape-inside layout fails
authorhmuller@adobe.com <hmuller@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Apr 2013 00:09:49 +0000 (00:09 +0000)
committerhmuller@adobe.com <hmuller@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Apr 2013 00:09:49 +0000 (00:09 +0000)
commitfdba9f0c532ea2f24849dc17142be037581995f9
treee271b03cb208def12fa67515f381e68900765b02
parentf8e1b7d3aeb34f4e525eed2e31a8ca70b251e14a
[CSS Exclusions] polygon shape-inside layout fails
https://bugs.webkit.org/show_bug.cgi?id=114402

Source/WebCore:

Reviewed by Dirk Schulze.

The firstIncludedIntervalLogicalTop() method's implementation relied on optimistic
assumptions about floating point accuracy which, in rare cases, caused it to discard
first-fit locations based on the intersection of the minLogicalIntervalTop offset edge
and a polygon offset edge. Now: we do not verify that first-fit locations based on the
intersection of an offset edge and the minLogicalIntervalTop offset edge are below
the horizontal minLogicalIntervalTop line. They're essentially below the line "by definition".

Test: fast/exclusions/shape-inside/shape-inside-polygon-layout.html

* rendering/ExclusionPolygon.cpp:
(WebCore::ExclusionPolygon::firstIncludedIntervalLogicalTop): Avoid floating point problems
    when checking intersections with the offset edge based on minLogicalIntervalTop.
* rendering/ExclusionPolygon.h:
(WebCore::OffsetPolygonEdge::OffsetPolygonEdge): Initialize the basis field.
(WebCore::OffsetPolygonEdge::basis): Report what the offset edge is "based on": a polygon
    edge, the top of the line, or a (reflex) vertex.
(OffsetPolygonEdge): Added the Basis enum to enable tracking what the geometry of
    an offset edge is based on.

LayoutTests:

Verify that subsequent polygon shape-inside lines are vertically adjacent.

Reviewed by Dirk Schulze.

* fast/exclusions/shape-inside/shape-inside-polygon-layout-expected.txt: Added.
* fast/exclusions/shape-inside/shape-inside-polygon-layout.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-layout-expected.txt [new file with mode: 0644]
LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-layout.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/ExclusionPolygon.cpp
Source/WebCore/rendering/ExclusionPolygon.h