[LFC] When the formatting root is also a containing block for out-of-flow elements.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2018 15:20:47 +0000 (15:20 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2018 15:20:47 +0000 (15:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187179

Reviewed by Antti Koivisto.

Out-of-flow descendants' layout requires their containing block height to be computed. This patch takes care of the case
when the containing block is also a formatting context root (e.g. relative positioned with overflow other than visible).

* layout/Verification.cpp:
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233357 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp

index 1c8d9cf..4d8f413 100644 (file)
@@ -1,5 +1,20 @@
 2018-06-29  Zalan Bujtas  <zalan@apple.com>
 
 2018-06-29  Zalan Bujtas  <zalan@apple.com>
 
+        [LFC] When the formatting root is also a containing block for out-of-flow elements.
+        https://bugs.webkit.org/show_bug.cgi?id=187179
+
+        Reviewed by Antti Koivisto.
+
+        Out-of-flow descendants' layout requires their containing block height to be computed. This patch takes care of the case
+        when the containing block is also a formatting context root (e.g. relative positioned with overflow other than visible).
+
+        * layout/Verification.cpp:
+        (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
+        * layout/blockformatting/BlockFormattingContext.cpp:
+        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
+
+2018-06-29  Zalan Bujtas  <zalan@apple.com>
+
         [LFC] Do not skip the next inflow sibling after finishing a formatting context root layout.
         https://bugs.webkit.org/show_bug.cgi?id=187178
 
         [LFC] Do not skip the next inflow sibling after finishing a formatting context root layout.
         https://bugs.webkit.org/show_bug.cgi?id=187178
 
index b4692ae..fb7454d 100644 (file)
@@ -148,6 +148,8 @@ void BlockFormattingContext::layoutFormattingContextRoot(LayoutContext& layoutCo
     FloatingContext(formattingState.floatingState()).computePosition(layoutBox, displayBox);
     LOG_WITH_STREAM(FormattingContextLayout, stream << "[Compute] -> [Height][Margin] -> for layoutBox(" << &layoutBox << ")");
     computeHeightAndMargin(layoutContext, layoutBox, displayBox);
     FloatingContext(formattingState.floatingState()).computePosition(layoutBox, displayBox);
     LOG_WITH_STREAM(FormattingContextLayout, stream << "[Compute] -> [Height][Margin] -> for layoutBox(" << &layoutBox << ")");
     computeHeightAndMargin(layoutContext, layoutBox, displayBox);
+    // Now that we computed the root's height, we can go back and layout the out-of-flow descedants (if any).
+    formattingContext->layoutOutOfFlowDescendants(layoutContext, layoutBox);
 }
 
 std::unique_ptr<FormattingState> BlockFormattingContext::createFormattingState(Ref<FloatingState>&& floatingState) const
 }
 
 std::unique_ptr<FormattingState> BlockFormattingContext::createFormattingState(Ref<FloatingState>&& floatingState) const