Fix handling of top margin on float with shape-outside
authorbjonesbe@adobe.com <bjonesbe@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Sep 2013 18:18:39 +0000 (18:18 +0000)
committerbjonesbe@adobe.com <bjonesbe@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Sep 2013 18:18:39 +0000 (18:18 +0000)
commit4577d2e65bff640ffa05c5865c97f8205624d0f1
tree98aa12c17b1eb1b05c106f21bbc1ad42a500d645
parent28e0d603f17a7037099fe1469b5011c75176a64d
Fix handling of top margin on float with shape-outside
https://bugs.webkit.org/show_bug.cgi?id=121614

Reviewed by Alexandru Chiculita.

Source/WebCore:

When a float has shape outside, the top margin should be treated as if
there is no shape there, so inline content should be allowed to flow
into that space. This patch fixes two issues:

1) If the top margin is the same as the line height, a line should be
able to fit into the margin. Before this patch, that line was being
treated as if it intersected with the shape.

2) The shape should be positioned (x, y) relative to the box sizing
box of the float. While the x coordinate was being treated properly,
the y coordinate was relative to the top of the margin box. This patch
fixes this behavior.

This patch also includes a simple test for right and left margins, as
I wrote that test and then discovered the problems listed above.

This patch also removes an unused override of the
lineOverlapsShapeBounds method.

Tests: csswg/submitted/shapes/shape-outside/shape-outside-floats-margin-000.html
       csswg/submitted/shapes/shape-outside/shape-outside-floats-margin-001.html

* rendering/FloatingObjects.cpp:
(WebCore::FloatingObjects::logicalLeftOffset):
(WebCore::FloatingObjects::logicalRightOffset):
* rendering/LineWidth.cpp:
(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
* rendering/shapes/ShapeInfo.h:
* rendering/shapes/ShapeInsideInfo.h:
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::computeSegmentsForContainingBlockLine):
* rendering/shapes/ShapeOutsideInfo.h:

LayoutTests:

* csswg/submitted/shapes/shape-outside/shape-outside-floats-margin-000-expected.html: Added.
* csswg/submitted/shapes/shape-outside/shape-outside-floats-margin-000.html: Added.
    Test for a positive left/right margin.

* csswg/submitted/shapes/shape-outside/shape-outside-floats-margin-001-expected.html: Added.
* csswg/submitted/shapes/shape-outside/shape-outside-floats-margin-001.html: Added.
    Test for a positive top margin.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156106 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/csswg/submitted/shapes/shape-outside/shape-outside-floats-margin-000-expected.html [new file with mode: 0644]
LayoutTests/csswg/submitted/shapes/shape-outside/shape-outside-floats-margin-000.html [new file with mode: 0644]
LayoutTests/csswg/submitted/shapes/shape-outside/shape-outside-floats-margin-001-expected.html [new file with mode: 0644]
LayoutTests/csswg/submitted/shapes/shape-outside/shape-outside-floats-margin-001.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/FloatingObjects.cpp
Source/WebCore/rendering/LineWidth.cpp
Source/WebCore/rendering/shapes/ShapeInfo.h
Source/WebCore/rendering/shapes/ShapeInsideInfo.h
Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp
Source/WebCore/rendering/shapes/ShapeOutsideInfo.h