[LFC][Floating] Add basic clearance support
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Aug 2018 14:48:10 +0000 (14:48 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Aug 2018 14:48:10 +0000 (14:48 +0000)
commit91136cb0222b69ee8314945657dd860f966eac4c
tree05a49383bb3eb11d6afec87b21e441f5fb96fe58
parent42304c6ba4cc4c8aaace93a49ed4af06f00bdf31
[LFC][Floating] Add basic clearance support
https://bugs.webkit.org/show_bug.cgi?id=188492

Reviewed by Antti Koivisto.

Source/WebCore:

Adjust final position of a block level box with clearance when float is present.

Test: fast/block/block-only/floating-left-and-right-with-clearance.html

* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
(WebCore::Layout::FloatingContext::alignWithContainingBlock const):
(WebCore::Layout::FloatingContext::toContainingBlock const):
(WebCore::Layout::FloatingContext::computePosition const): Deleted.
* layout/FloatingContext.h:
* layout/FloatingState.cpp:
(WebCore::Layout::FloatingState::bottom const):
* layout/FloatingState.h:
(WebCore::Layout::FloatingState::leftBottom const):
(WebCore::Layout::FloatingState::rightBottom const):
(WebCore::Layout::FloatingState::bottom const):
* layout/Verification.cpp:
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionWithClearance const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::hasClearance const):
* layout/layouttree/LayoutBox.h:

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/block/block-only/floating-left-and-right-with-clearance-expected.txt: Added.
* fast/block/block-only/floating-left-and-right-with-clearance.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/block/block-only/floating-left-and-right-with-clearance-expected.txt [new file with mode: 0644]
LayoutTests/fast/block/block-only/floating-left-and-right-with-clearance.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/layout/FloatingContext.cpp
Source/WebCore/layout/FloatingContext.h
Source/WebCore/layout/FloatingState.cpp
Source/WebCore/layout/FloatingState.h
Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp
Source/WebCore/layout/blockformatting/BlockFormattingContext.h
Source/WebCore/layout/layouttree/LayoutBox.cpp
Source/WebCore/layout/layouttree/LayoutBox.h
Tools/ChangeLog
Tools/LayoutReloaded/misc/LFC-passing-tests.txt