[CSS Shapes] Stacked floats with shape-outside should allow inline content to interac...
authorbjonesbe@adobe.com <bjonesbe@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jan 2014 21:11:49 +0000 (21:11 +0000)
committerbjonesbe@adobe.com <bjonesbe@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jan 2014 21:11:49 +0000 (21:11 +0000)
commitd4761ec41aaae2558237ca5e6f391ac7a69ac910
tree19262e5f023c00476813ddb0aa03fb33f6b0fe86
parent9c3ec4d7cf87bfad373cb2899779d717295d2157
[CSS Shapes] Stacked floats with shape-outside should allow inline content to interact with the non-outermost float
https://bugs.webkit.org/show_bug.cgi?id=122576

Reviewed by David Hyatt.

Source/WebCore:

Make inline content interact with stacked floats with shape-outside
per the spec. This means that content can interact with floats on the
line that are not the outermost float.

This refactors ComputeFloatOffsetAdapter into a superclass and two
subclasses: one adaptor for determining the offset for float layout,
and one for determining the offset for inline layout.

The logic in LineWidth::shrinkAvailableWidthForNewFloatIfNeeded has
been updated to handle stacked floats with shape-outside properly and
has been considerably simplified in the process. It was previously
doing a whole bunch of unnecessary work.

Tests: fast/shapes/shape-outside-floats/shape-outside-floats-stacked-000.html
       fast/shapes/shape-outside-floats/shape-outside-floats-stacked-001.html
       fast/shapes/shape-outside-floats/shape-outside-floats-stacked-002.html

* rendering/FloatingObjects.cpp:
(WebCore::ComputeFloatOffsetAdapter::~ComputeFloatOffsetAdapter):
(WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter):
(WebCore::ComputeFloatOffsetForFloatLayoutAdapter::~ComputeFloatOffsetForFloatLayoutAdapter):
(WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter):
(WebCore::ComputeFloatOffsetForLineLayoutAdapter::~ComputeFloatOffsetForLineLayoutAdapter):
(WebCore::FloatingObjects::logicalLeftOffsetForPositioningFloat):
(WebCore::FloatingObjects::logicalRightOffsetForPositioningFloat):
(WebCore::FloatingObjects::logicalLeftOffset):
(WebCore::FloatingObjects::logicalRightOffset):
(WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
(WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
(WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatTypeValue>::heightRemaining):
(WebCore::shapeInfoForFloat):
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
* rendering/line/LineWidth.cpp:
(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine):
* rendering/shapes/ShapeOutsideInfo.h:

LayoutTests:

Tests for shape-outside on stacked floats and interaction with inline
content.

* fast/shapes/shape-outside-floats/shape-outside-floats-stacked-000-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-stacked-000.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-stacked-001-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-stacked-001.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-stacked-002-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-stacked-002.html: Added.

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