[LFC] The static position for an out-of-flow box should include the previous sibling...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2018 07:55:53 +0000 (07:55 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2018 07:55:53 +0000 (07:55 +0000)
commitcab84f8c0a81c3cba31a51ebe7713c0294167eb9
tree71ae505e8e9f247b07a3a0527f4d861b465722fb
parent2a0bc74857dfc38eb0f704ba77671081d71c91de
[LFC] The static position for an out-of-flow box should include the previous sibling's collapsed margin
https://bugs.webkit.org/show_bug.cgi?id=187169

Reviewed by Antti Koivisto.

When computing the static position of an absolutely positioned box, we need to look at the previous sibling's bottom margin.
If the previous sibling happens to collapse its bottom margin with the parent's bottom margin, we still need to account for it
and compute the static vertical position as if the bottom margin was not collapsed.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::initializeRoot):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::nonCollapsedMarginBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHasValidVerticalNonCollapsedMargin):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::setVerticalNonCollapsedMargin):
(WebCore::Display::Box::nonCollapsedMarginTop const):
(WebCore::Display::Box::nonCollapsedMarginBottom const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/layout/FormattingContext.cpp
Source/WebCore/layout/FormattingContextGeometry.cpp
Source/WebCore/layout/LayoutContext.cpp
Source/WebCore/layout/Verification.cpp
Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp
Source/WebCore/layout/displaytree/DisplayBox.cpp
Source/WebCore/layout/displaytree/DisplayBox.h