Skip to content
  • hmuller@adobe.com's avatar
    [CSS Exclusions] polygon shape-inside layout fails · 242d1366
    hmuller@adobe.com authored
    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: http://svn.webkit.org/repository/webkit/trunk@148582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    242d1366