[LFC] Rename formattingContext() to createFormattingContext()
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2018 19:25:44 +0000 (19:25 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2018 19:25:44 +0000 (19:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192500

Reviewed by Zalan Bujtas.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingState.h:
* layout/LayoutFormattingState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::createFormattingContext):
(WebCore::Layout::BlockFormattingState::formattingContext): Deleted.
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
* layout/inlineformatting/InlineFormattingState.h:

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

Source/WebCore/ChangeLog
Source/WebCore/layout/FormattingContext.cpp
Source/WebCore/layout/FormattingContextGeometry.cpp
Source/WebCore/layout/FormattingState.h
Source/WebCore/layout/LayoutFormattingState.cpp
Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp
Source/WebCore/layout/blockformatting/BlockFormattingState.cpp
Source/WebCore/layout/blockformatting/BlockFormattingState.h
Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp
Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp
Source/WebCore/layout/inlineformatting/InlineFormattingState.h

index 0dc35c0..6b00a71 100644 (file)
@@ -1,3 +1,23 @@
+2018-12-07  Antti Koivisto  <antti@apple.com>
+
+        [LFC] Rename formattingContext() to createFormattingContext()
+        https://bugs.webkit.org/show_bug.cgi?id=192500
+
+        Reviewed by Zalan Bujtas.
+
+        * layout/FormattingContext.cpp:
+        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
+        * layout/FormattingState.h:
+        * layout/LayoutFormattingState.cpp:
+        (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
+        * layout/blockformatting/BlockFormattingState.cpp:
+        (WebCore::Layout::BlockFormattingState::createFormattingContext):
+        (WebCore::Layout::BlockFormattingState::formattingContext): Deleted.
+        * layout/blockformatting/BlockFormattingState.h:
+        * layout/inlineformatting/InlineFormattingContext.cpp:
+        (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
+        * layout/inlineformatting/InlineFormattingState.h:
+
 2018-12-07  Truitt Savell  <tsavell@apple.com>
 
         Unreviewed, rolling out r238947.
index ff41200..5b9f225 100644 (file)
@@ -156,7 +156,7 @@ void FormattingContext::layoutOutOfFlowDescendants(const Box& layoutBox) const
         computeBorderAndPadding(layoutBox);
         computeOutOfFlowHorizontalGeometry(layoutBox);
 
-        layoutState.createFormattingStateForFormattingRootIfNeeded(layoutBox).formattingContext(layoutBox)->layout();
+        layoutState.createFormattingStateForFormattingRootIfNeeded(layoutBox).createFormattingContext(layoutBox)->layout();
 
         computeOutOfFlowVerticalGeometry(layoutBox);
         layoutOutOfFlowDescendants(layoutBox);
index 0a3a883..c99071e 100644 (file)
@@ -239,7 +239,7 @@ LayoutUnit FormattingContext::Geometry::shrinkToFitWidth(LayoutState& layoutStat
     // Then the shrink-to-fit width is: min(max(preferred minimum width, available width), preferred width).
     auto availableWidth = layoutState.displayBoxForLayoutBox(*formattingRoot.containingBlock()).width();
     auto& formattingState = layoutState.createFormattingStateForFormattingRootIfNeeded(formattingRoot);
-    auto instrinsicWidthConstraints = formattingState.formattingContext(formattingRoot)->instrinsicWidthConstraints();
+    auto instrinsicWidthConstraints = formattingState.createFormattingContext(formattingRoot)->instrinsicWidthConstraints();
     return std::min(std::max(instrinsicWidthConstraints.minimum, availableWidth), instrinsicWidthConstraints.maximum);
 }
 
index 90283e0..cf8cb0e 100644 (file)
@@ -46,7 +46,7 @@ class FormattingState {
 public:
     virtual ~FormattingState();
 
-    virtual std::unique_ptr<FormattingContext>formattingContext(const Box& formattingContextRoot) = 0;
+    virtual std::unique_ptr<FormattingContext> createFormattingContext(const Box& formattingContextRoot) = 0;
 
     FloatingState& floatingState() const { return m_floatingState; }
 
index b59ae0a..33a675c 100644 (file)
@@ -78,7 +78,7 @@ void LayoutState::layoutFormattingContextSubtree(const Box& layoutRoot)
 {
     RELEASE_ASSERT(layoutRoot.establishesFormattingContext());
     auto& formattingState = createFormattingStateForFormattingRootIfNeeded(layoutRoot);
-    auto formattingContext = formattingState.formattingContext(layoutRoot);
+    auto formattingContext = formattingState.createFormattingContext(layoutRoot);
     formattingContext->layout();
     formattingContext->layoutOutOfFlowDescendants(layoutRoot);
 }
index 26a82b7..5127209 100644 (file)
@@ -134,7 +134,7 @@ void BlockFormattingContext::layoutFormattingContextRoot(FloatingContext& floati
 
     precomputeVerticalPositionForFormattingRootIfNeeded(layoutBox);
     // Swich over to the new formatting context (the one that the root creates).
-    auto formattingContext = layoutState().createFormattingStateForFormattingRootIfNeeded(layoutBox).formattingContext(layoutBox);
+    auto formattingContext = layoutState().createFormattingStateForFormattingRootIfNeeded(layoutBox).createFormattingContext(layoutBox);
     formattingContext->layout();
 
     // Come back and finalize the root's geometry.
@@ -417,7 +417,7 @@ FormattingContext::InstrinsicWidthConstraints BlockFormattingContext::instrinsic
                 if (!Geometry::instrinsicWidthConstraintsNeedChildrenWidth(childBox))
                     instrinsicWidthConstraints = Geometry::instrinsicWidthConstraints(layoutState, childBox);
                 else if (childBox.establishesFormattingContext())
-                    instrinsicWidthConstraints = layoutState.createFormattingStateForFormattingRootIfNeeded(childBox).formattingContext(childBox)->instrinsicWidthConstraints();
+                    instrinsicWidthConstraints = layoutState.createFormattingStateForFormattingRootIfNeeded(childBox).createFormattingContext(childBox)->instrinsicWidthConstraints();
                 formattingState.setInstrinsicWidthConstraints(childBox, instrinsicWidthConstraints);
 
                 queue.removeLast();
index 88cf55c..41ac997 100644 (file)
@@ -46,7 +46,7 @@ BlockFormattingState::~BlockFormattingState()
 {
 }
 
-std::unique_ptr<FormattingContext> BlockFormattingState::formattingContext(const Box& formattingContextRoot)
+std::unique_ptr<FormattingContext> BlockFormattingState::createFormattingContext(const Box& formattingContextRoot)
 {
     ASSERT(formattingContextRoot.establishesBlockFormattingContext());
     return std::make_unique<BlockFormattingContext>(formattingContextRoot, *this);
index 16b8595..bb96693 100644 (file)
@@ -41,7 +41,7 @@ public:
     BlockFormattingState(Ref<FloatingState>&&, LayoutState&);
     virtual ~BlockFormattingState();
 
-    std::unique_ptr<FormattingContext> formattingContext(const Box& formattingContextRoot) override;
+    std::unique_ptr<FormattingContext> createFormattingContext(const Box& formattingContextRoot) override;
 };
 
 }
index b530ad6..ec66e1f 100644 (file)
@@ -373,7 +373,7 @@ void InlineFormattingContext::layoutFormattingContextRoot(const Box& root) const
     computeBorderAndPadding(root);
     computeWidthAndMargin(root);
     // Swich over to the new formatting context (the one that the root creates).
-    auto formattingContext = layoutState().createFormattingStateForFormattingRootIfNeeded(root).formattingContext(root);
+    auto formattingContext = layoutState().createFormattingStateForFormattingRootIfNeeded(root).createFormattingContext(root);
     formattingContext->layout();
     // Come back and finalize the root's height and margin.
     computeHeightAndMargin(root);
index 92d71a4..bae1588 100644 (file)
@@ -44,7 +44,7 @@ InlineFormattingState::~InlineFormattingState()
 {
 }
 
-std::unique_ptr<FormattingContext> InlineFormattingState::formattingContext(const Box& formattingContextRoot)
+std::unique_ptr<FormattingContext> InlineFormattingState::createFormattingContext(const Box& formattingContextRoot)
 {
     ASSERT(formattingContextRoot.establishesInlineFormattingContext());
     return std::make_unique<InlineFormattingContext>(formattingContextRoot, *this);
index 9bb901b..a4872eb 100644 (file)
@@ -43,7 +43,7 @@ public:
     InlineFormattingState(Ref<FloatingState>&&, LayoutState&);
     virtual ~InlineFormattingState();
 
-    std::unique_ptr<FormattingContext> formattingContext(const Box& formattingContextRoot) override;
+    std::unique_ptr<FormattingContext> createFormattingContext(const Box& formattingContextRoot) override;
 
     InlineContent& inlineContent() { return m_inlineContent; }
     InlineItem* lastInlineItem() const { return m_inlineContent.isEmpty() ? nullptr : m_inlineContent.last().get(); }