Skip to content
  • hmuller@adobe.com's avatar
    <https://webkit.org/b/119849> [CSS Shapes] Complete RasterShape::firstIncludedIntervalLogicalTop() · c9a0f733
    hmuller@adobe.com authored
    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: http://svn.webkit.org/repository/webkit/trunk@154349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    c9a0f733