[LFC] Rename FormattingContext::layout to layoutInFlowContent()
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Sep 2019 16:40:40 +0000 (16:40 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Sep 2019 16:40:40 +0000 (16:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201763
<rdar://problem/55340435>

Reviewed by Antti Koivisto.

FormattingContext::layout() only takes care of the inflow content. Out-out-flow boxes are laid out through FormattingContext::layoutOutOfFlowContent.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
* layout/FormattingContext.h:
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::BlockFormattingContext::layout): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::InlineFormattingContext::layout): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::layoutTableCellBox):
(WebCore::Layout::TableFormattingContext::layout): Deleted.
* layout/tableformatting/TableFormattingContext.h:

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

Source/WebCore/ChangeLog
Source/WebCore/layout/FormattingContext.cpp
Source/WebCore/layout/FormattingContext.h
Source/WebCore/layout/LayoutState.cpp
Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp
Source/WebCore/layout/blockformatting/BlockFormattingContext.h
Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp
Source/WebCore/layout/inlineformatting/InlineFormattingContext.h
Source/WebCore/layout/tableformatting/TableFormattingContext.cpp
Source/WebCore/layout/tableformatting/TableFormattingContext.h

index 77eff03..b8b1b0f 100644 (file)
@@ -1,5 +1,36 @@
 2019-09-13  Zalan Bujtas  <zalan@apple.com>
 
+        [LFC] Rename FormattingContext::layout to layoutInFlowContent()
+        https://bugs.webkit.org/show_bug.cgi?id=201763
+        <rdar://problem/55340435>
+
+        Reviewed by Antti Koivisto.
+
+        FormattingContext::layout() only takes care of the inflow content. Out-out-flow boxes are laid out through FormattingContext::layoutOutOfFlowContent.
+
+        * layout/FormattingContext.cpp:
+        (WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
+        * layout/FormattingContext.h:
+        * layout/LayoutState.cpp:
+        (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
+        * layout/blockformatting/BlockFormattingContext.cpp:
+        (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
+        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
+        (WebCore::Layout::BlockFormattingContext::layout): Deleted.
+        * layout/blockformatting/BlockFormattingContext.h:
+        * layout/inlineformatting/InlineFormattingContext.cpp:
+        (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
+        (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
+        (WebCore::Layout::InlineFormattingContext::layout): Deleted.
+        * layout/inlineformatting/InlineFormattingContext.h:
+        * layout/tableformatting/TableFormattingContext.cpp:
+        (WebCore::Layout::TableFormattingContext::layoutInFlowContent):
+        (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
+        (WebCore::Layout::TableFormattingContext::layout): Deleted.
+        * layout/tableformatting/TableFormattingContext.h:
+
+2019-09-13  Zalan Bujtas  <zalan@apple.com>
+
         [LFC] FormattingContext::displayBoxForLayoutBox should be split into 2 functions
         https://bugs.webkit.org/show_bug.cgi?id=201754
         <rdar://problem/55328753>
index d959f35..1fdf180 100644 (file)
@@ -140,8 +140,7 @@ void FormattingContext::layoutOutOfFlowContent()
         computeOutOfFlowHorizontalGeometry(*outOfFlowBox);
 
         auto formattingContext = layoutState().createFormattingContext(*outOfFlowBox);
-        formattingContext->layout();
-
+        formattingContext->layoutInFlowContent();
         computeOutOfFlowVerticalGeometry(*outOfFlowBox);
         formattingContext->layoutOutOfFlowContent();
     }
index ceae1a2..d97a8b8 100644 (file)
@@ -49,7 +49,7 @@ public:
     FormattingContext(const Box& formattingContextRoot, FormattingState&);
     virtual ~FormattingContext();
 
-    virtual void layout() = 0;
+    virtual void layoutInFlowContent() = 0;
     void layoutOutOfFlowContent();
 
     struct IntrinsicWidthConstraints {
index f47db15..c7c35ec 100644 (file)
@@ -64,7 +64,7 @@ void LayoutState::layoutFormattingContextSubtree(const Box& layoutRoot)
 {
     RELEASE_ASSERT(layoutRoot.establishesFormattingContext());
     auto formattingContext = createFormattingContext(layoutRoot);
-    formattingContext->layout();
+    formattingContext->layoutInFlowContent();
     formattingContext->layoutOutOfFlowContent();
 }
 
index dde05aa..6d1419a 100644 (file)
@@ -49,7 +49,7 @@ BlockFormattingContext::BlockFormattingContext(const Box& formattingContextRoot,
 {
 }
 
-void BlockFormattingContext::layout()
+void BlockFormattingContext::layoutInFlowContent()
 {
     // 9.4.1 Block formatting contexts
     // In a block formatting context, boxes are laid out one after the other, vertically, beginning at the top of a containing block.
@@ -169,8 +169,7 @@ void BlockFormattingContext::layoutFormattingContextRoot(FloatingContext& floati
     computeStaticHorizontalPosition(layoutBox);
     // Swich over to the new formatting context (the one that the root creates).
     auto formattingContext = layoutState().createFormattingContext(layoutBox);
-    formattingContext->layout();
-
+    formattingContext->layoutInFlowContent();
     // Come back and finalize the root's geometry.
     LOG_WITH_STREAM(FormattingContextLayout, stream << "[Compute] -> [Height][Margin] -> for layoutBox(" << &layoutBox << ")");
     computeHeightAndMargin(layoutBox);
index ee75797..dd6f549 100644 (file)
@@ -49,7 +49,7 @@ class BlockFormattingContext : public FormattingContext {
 public:
     BlockFormattingContext(const Box& formattingContextRoot, BlockFormattingState&);
 
-    void layout() override;
+    void layoutInFlowContent() override;
 
 private:
     void layoutFormattingContextRoot(FloatingContext&, const Box&);
index 9805689..ba5aec1 100644 (file)
@@ -62,7 +62,7 @@ static inline const Box* nextInPreOrder(const Box& layoutBox, const Container& s
     return nullptr;
 }
 
-void InlineFormattingContext::layout()
+void InlineFormattingContext::layoutInFlowContent()
 {
     if (!is<Container>(root()))
         return;
@@ -241,7 +241,7 @@ void InlineFormattingContext::layoutFormattingContextRoot(const Box& root, UsedH
     formattingState().displayBox(root).setTopLeft({ 0, 0 });
     // Swich over to the new formatting context (the one that the root creates).
     auto formattingContext = layoutState().createFormattingContext(root);
-    formattingContext->layout();
+    formattingContext->layoutInFlowContent();
     // Come back and finalize the root's height and margin.
     computeHeightAndMargin(root);
     // Now that we computed the root's height, we can go back and layout the out-of-flow content.
index 097375e..9779936 100644 (file)
@@ -46,7 +46,7 @@ class InlineFormattingContext : public FormattingContext {
     WTF_MAKE_ISO_ALLOCATED(InlineFormattingContext);
 public:
     InlineFormattingContext(const Box& formattingContextRoot, InlineFormattingState&);
-    void layout() override;
+    void layoutInFlowContent() override;
 
 private:
     IntrinsicWidthConstraints computedIntrinsicWidthConstraints() override;
index 899775e..6b15d9b 100644 (file)
@@ -57,7 +57,7 @@ TableFormattingContext::TableFormattingContext(const Box& formattingContextRoot,
 {
 }
 
-void TableFormattingContext::layout()
+void TableFormattingContext::layoutInFlowContent()
 {
     auto& grid = formattingState().tableGrid();
     auto& cellList = grid.cells();
@@ -96,9 +96,10 @@ void TableFormattingContext::layoutTableCellBox(const Box& cellLayoutBox, const
     cellDisplayBox.setContentBoxWidth(column.logicalWidth() - cellDisplayBox.horizontalMarginBorderAndPadding());
 
     ASSERT(cellLayoutBox.establishesBlockFormattingContext());
-    layoutState().createFormattingContext(cellLayoutBox)->layout();
+    layoutState().createFormattingContext(cellLayoutBox)->layoutInFlowContent();
     cellDisplayBox.setVerticalMargin({ { }, { } });
     cellDisplayBox.setContentBoxHeight(geometry().tableCellHeightAndMargin(cellLayoutBox).height);
+    // FIXME: Check what to do with out-of-flow content.
 }
 
 void TableFormattingContext::positionTableCells()
index 846ae3a..b0ca252 100644 (file)
@@ -40,7 +40,7 @@ class TableFormattingContext : public FormattingContext {
     WTF_MAKE_ISO_ALLOCATED(TableFormattingContext);
 public:
     TableFormattingContext(const Box& formattingContextRoot, TableFormattingState&);
-    void layout() override;
+    void layoutInFlowContent() override;
 
 private:
     class Geometry : public FormattingContext::Geometry {