[CSS Shapes] Support block content with inline content around floats in shape-inside
authorzoltan@webkit.org <zoltan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Oct 2013 18:24:59 +0000 (18:24 +0000)
committerzoltan@webkit.org <zoltan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Oct 2013 18:24:59 +0000 (18:24 +0000)
commite74963b37a4d3ce6ee78588116a63c8d1bf8c175
treee2f6099fe4b171d83e47ab28f92bcc004421a8ae
parentd22ff49d1c266fb3731bd4610325fd001b5d58a0
[CSS Shapes] Support block content with inline content around floats in shape-inside
https://bugs.webkit.org/show_bug.cgi?id=121616

Reviewed by David Hyatt.

In r156022 and r156364, I added support for floats inside shape-inside with inline content. This change extends
the existing implementation to support block content with inline content (paragraphs). I added an extra text for
positioning a float inside shape-inside without text content around it.

Source/WebCore:

Tests: fast/shapes/shape-inside/shape-inside-left-float-in-lower-left-triangle-block-content.html
       fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-block-content.html
       fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle.html
       fast/shapes/shape-inside/shape-inside-left-float-in-upper-left-triangle-block-content.html
       fast/shapes/shape-inside/shape-inside-left-float-in-upper-right-triangle-block-content.html

* rendering/FloatingObjects.h:
(WebCore::FloatingObject::logicalSize): Add new function to return the FloatingObject logical size.
* rendering/LineWidth.cpp:
(WebCore::LineWidth::fitBelowFloats): When the lineBreaker code pushes down the content below the floating object,
we need to update the segments if we are in a shape-inside.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeLogicalLocationForFloat): Do the positioning based on the float actual size, and use the
recent shapeInsideInfo. (Calling layoutShapeInsideInfo which deals with the layoutStates also instead of shapeInsideInfo.)
* rendering/RenderBlock.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::adjustLogicalLineTopAndLogicalHeightIfNeeded): If we don't have inline content we still need to positionize
our float content in a shape-inside.
(WebCore::updateSegmentsForShapes): Use the right coordinates for block content with inline content.

LayoutTests:

* fast/shapes/shape-inside/shape-inside-left-float-in-lower-left-triangle-block-content-expected.html: Added.
* fast/shapes/shape-inside/shape-inside-left-float-in-lower-left-triangle-block-content.html: Added.
* fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-block-content-expected.html: Added.
* fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-block-content.html: Added.
* fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-expected.html: Added.
* fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle.html: Added.
* fast/shapes/shape-inside/shape-inside-left-float-in-upper-left-triangle-block-content-expected.html: Added.
* fast/shapes/shape-inside/shape-inside-left-float-in-upper-left-triangle-block-content.html: Added.
* fast/shapes/shape-inside/shape-inside-left-float-in-upper-right-triangle-block-content-expected.html: Added.
* fast/shapes/shape-inside/shape-inside-left-float-in-upper-right-triangle-block-content.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156846 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-lower-left-triangle-block-content-expected.html [new file with mode: 0644]
LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-lower-left-triangle-block-content.html [new file with mode: 0644]
LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-block-content-expected.html [new file with mode: 0644]
LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-block-content.html [new file with mode: 0644]
LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-expected.html [new file with mode: 0644]
LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle.html [new file with mode: 0644]
LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-upper-left-triangle-block-content-expected.html [new file with mode: 0644]
LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-upper-left-triangle-block-content.html [new file with mode: 0644]
LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-upper-right-triangle-block-content-expected.html [new file with mode: 0644]
LayoutTests/fast/shapes/shape-inside/shape-inside-left-float-in-upper-right-triangle-block-content.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/FloatingObjects.h
Source/WebCore/rendering/LineWidth.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBlockLineLayout.cpp