Properly handle bottom margin on float with shape-outside
authorbjonesbe@adobe.com <bjonesbe@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Sep 2013 19:02:59 +0000 (19:02 +0000)
committerbjonesbe@adobe.com <bjonesbe@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Sep 2013 19:02:59 +0000 (19:02 +0000)
commit4d60e67045276d38f97b7f1228beff6b3b9b0cc0
tree67798ceb2122eed878c80695cd4fb82765ead6cd
parent87e60f3d151273d851442818ea3e3c1978dbefe0
Properly handle bottom margin on float with shape-outside
https://bugs.webkit.org/show_bug.cgi?id=121808

Reviewed by David Hyatt.

Source/WebCore:

When a float has a shape-outside, inline content must conform to the
shape, not to the margin box. Thus, if a float with shape-outside has
a bottom margin and the shape does not intrude into that margin, then
the inline content should ignore the margin. Before this patch, inline
content would drop below the margin box instead of obeying the shape.

Note that content that should clear the float still clears the margin
box, not the shape's contour.

Tests: csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-002.html
       csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-003.html
       csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-004.html

* rendering/LineWidth.cpp:
(WebCore::LineWidth::fitBelowFloats): Compute the logical bottom based
on the shape.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nextFloatLogicalBottomBelow): Add option to
compute the logical bottom based on the shape instead of on the margin
box.
* rendering/RenderBlock.h:

LayoutTests:

Import new tests for floats wish shape-outside and bottom margins.

* csswg/contributors/adobe/submitted/shapes/shape-outside/resources/w3c-import.log:
* csswg/contributors/adobe/submitted/shapes/shape-outside/resources/rounded-rectangle.js: Remove whitespace at ends of lines.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-002.html: Added.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-003-expected.html: Added.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-003.html: Added.
* csswg/contributors/adobe/submitted/shapes/shape-outside/w3c-import.log:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/resources/rounded-rectangle.js
LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/resources/w3c-import.log
LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-002.html [new file with mode: 0644]
LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-003-expected.html [new file with mode: 0644]
LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-003.html [new file with mode: 0644]
LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-004-expected.html [new file with mode: 0644]
LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-004.html [new file with mode: 0644]
LayoutTests/csswg/contributors/adobe/submitted/shapes/shape-outside/w3c-import.log
Source/WebCore/ChangeLog
Source/WebCore/rendering/LineWidth.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h