[LFC][BFC] computeStaticPosition should include estimated computation as well.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2019 16:29:53 +0000 (16:29 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2019 16:29:53 +0000 (16:29 +0000)
commit0df29d4b5b416fcdc793697d3169c691254bc461
treea896de46450a3e3c9a54c0faffcf8cccf6051049
parenta8c790b157d034ae9c3230579ba4b8095abf684c
[LFC][BFC] computeStaticPosition should include estimated computation as well.
https://bugs.webkit.org/show_bug.cgi?id=193719

Reviewed by Antti Koivisto.

Consolidate all static position (non-estimated, estimated) computation in BlockFormattingContext::computeStaticPosition.
It requires to compute width/horizontal margin first, since vertical top estimation needs valid horizontal widths (margin-top: 5% is computed using
the containing block's width).
This is also in preparation for moving 'clear' positioning to computeStaticPosition.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const): Deleted.
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp
Source/WebCore/layout/blockformatting/BlockFormattingContext.h
Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp
Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp