[New Block-Inside-Inline Model] Floats need to be allowed to intrude into anonymous...
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Apr 2015 18:10:32 +0000 (18:10 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Apr 2015 18:10:32 +0000 (18:10 +0000)
commit5f572e1960054fdad91a14392af2dedf18152498
tree0edec57133d10f2293e0f63cdeb2f6eb6b0361f2
parent3a34160aa4c39595b476018b302e736dae2b3d16
[New Block-Inside-Inline Model] Floats need to be allowed to intrude into anonymous inline-blocks.
https://bugs.webkit.org/show_bug.cgi?id=143307

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/block/inside-inlines/basic-float-intrusion.html

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
Make sure to exclude the margins of an anonymous inline-block when considering the height of the line.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::lineHeight):
(WebCore::RenderBlock::baselinePosition):
Anonymous inline-block lines ignore line-height and just return the height of the block. For baseline position, the baseline
is considered to be at the bottom border edge of the anonymous inline-block.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
(WebCore::RenderBlockFlow::addIntrudingFloats):
* rendering/RenderBlockFlow.h:
Patch float intrusion to handle the case of anonymous inline-blocks. Instead of collecting the floats from our parent(), we
collect them from the containingBlock() in the anonymous inline-block case. Patch addIntrudingFloats to pass in the container
that acts as the "parent", since it is not the parent() in the anonymous inline-block case.

* rendering/RenderBlockLineLayout.cpp:
(WebCore::updateLogicalInlinePositions):
Make sure to use the full available width for content always in the anonymous inline-block case, since we don't avoid the
floats, but instead let them intrude into the inline-block.

(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
Patch callers of updateLogicalInlinePositions to pass in the root line box that we're checking for.

(WebCore::RenderBlockFlow::layoutLineBoxes):
Defer the layout of anonymous inline-blocks, since they need to only lay out once the vertical position to lay them out
at is known.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::createsNewFormattingContext):
(WebCore::RenderBox::avoidsFloats):
Anonymous inline-blocks do not establish a new block formatting context, nor do they avoid floats.

* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleReplaced):
Add code to do a just-in-time layout of the anonymous inline-block at the time it is being examined (after the break before
it was handled).

LayoutTests:

* fast/block/inside-inlines/basic-float-intrusion-expected.html: Added.
* fast/block/inside-inlines/basic-float-intrusion.html: Added.
* fast/block/inside-inlines/new-model/basic-float-intrusion-expected.html: Added.
* fast/block/inside-inlines/new-model/basic-float-intrusion.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182241 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/block/inside-inlines/basic-float-intrusion-expected.html [new file with mode: 0644]
LayoutTests/fast/block/inside-inlines/basic-float-intrusion.html [new file with mode: 0644]
LayoutTests/fast/block/inside-inlines/new-model/basic-float-intrusion-expected.html [new file with mode: 0644]
LayoutTests/fast/block/inside-inlines/new-model/basic-float-intrusion.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockFlow.h
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/line/BreakingContext.h