Title: [282350] trunk/Source/WebCore
Revision
282350
Author
[email protected]
Date
2021-09-13 12:50:02 -0700 (Mon, 13 Sep 2021)

Log Message

[LFC] Rename LayoutState::established*FormattingState to formattingStateFor*FormattingContext
https://bugs.webkit.org/show_bug.cgi?id=229263
<rdar://problem/82365067>

Reviewed by Antti Koivisto.

Stop using "established" when asking for the state object associated with a formatting context.
The spec term, "established", is used to indicate that a particular node in the layout tree forces a set of formatting rules on its descendants.
This terms works well in the context of forming formatting contexts. However the corresponding (persistent)formatting states are not "established" in the same sense.

* display/DisplayTreeBuilder.cpp:
(WebCore::Display::TreeBuilder::buildInlineDisplayTree):
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::boxGeometry):
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::formattingStateForBox const):
(WebCore::Layout::LayoutState::formattingStateForFormattingContext const):
(WebCore::Layout::LayoutState::formattingStateForInlineFormattingContext const):
(WebCore::Layout::LayoutState::formattingStateForBlockFormattingContext const):
(WebCore::Layout::LayoutState::formattingStateForTableFormattingContext const):
(WebCore::Layout::LayoutState::formattingStateForFlexFormattingContext const):
(WebCore::Layout::LayoutState::ensureInlineFormattingState):
(WebCore::Layout::LayoutState::establishedFormattingState const): Deleted.
(WebCore::Layout::LayoutState::establishedInlineFormattingState const): Deleted.
(WebCore::Layout::LayoutState::establishedBlockFormattingState const): Deleted.
(WebCore::Layout::LayoutState::establishedTableFormattingState const): Deleted.
(WebCore::Layout::LayoutState::establishedFlexFormattingState const): Deleted.
* layout/LayoutState.h:
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/formattingContexts/FormattingGeometry.cpp:
(WebCore::Layout::FormattingGeometry::computedWidthValue const):
(WebCore::Layout::FormattingGeometry::shrinkToFitWidth const):
(WebCore::Layout::FormattingGeometry::complicatedCases const):
* layout/formattingContexts/block/BlockFormattingGeometry.cpp:
(WebCore::Layout::BlockFormattingGeometry::inFlowNonReplacedContentHeightAndMargin const):
* layout/formattingContexts/block/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockMarginCollapse::marginsCollapseThrough const):
* layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp:
(WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
(WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
* layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::constructAndAlignInlineLevelBoxes):
* layout/formattingContexts/table/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
* layout/formattingContexts/table/TableFormattingGeometry.cpp:
(WebCore::Layout::TableFormattingGeometry::usedBaselineForCell const):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::showInlineTreeAndRuns):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (282349 => 282350)


--- trunk/Source/WebCore/ChangeLog	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/ChangeLog	2021-09-13 19:50:02 UTC (rev 282350)
@@ -1,5 +1,57 @@
 2021-09-13  Alan Bujtas  <[email protected]>
 
+        [LFC] Rename LayoutState::established*FormattingState to formattingStateFor*FormattingContext
+        https://bugs.webkit.org/show_bug.cgi?id=229263
+        <rdar://problem/82365067>
+
+        Reviewed by Antti Koivisto.
+
+        Stop using "established" when asking for the state object associated with a formatting context. 
+        The spec term, "established", is used to indicate that a particular node in the layout tree forces a set of formatting rules on its descendants.
+        This terms works well in the context of forming formatting contexts. However the corresponding (persistent)formatting states are not "established" in the same sense.
+
+        * display/DisplayTreeBuilder.cpp:
+        (WebCore::Display::TreeBuilder::buildInlineDisplayTree):
+        * layout/FormattingState.cpp:
+        (WebCore::Layout::FormattingState::boxGeometry):
+        * layout/LayoutState.cpp:
+        (WebCore::Layout::LayoutState::formattingStateForBox const):
+        (WebCore::Layout::LayoutState::formattingStateForFormattingContext const):
+        (WebCore::Layout::LayoutState::formattingStateForInlineFormattingContext const):
+        (WebCore::Layout::LayoutState::formattingStateForBlockFormattingContext const):
+        (WebCore::Layout::LayoutState::formattingStateForTableFormattingContext const):
+        (WebCore::Layout::LayoutState::formattingStateForFlexFormattingContext const):
+        (WebCore::Layout::LayoutState::ensureInlineFormattingState):
+        (WebCore::Layout::LayoutState::establishedFormattingState const): Deleted.
+        (WebCore::Layout::LayoutState::establishedInlineFormattingState const): Deleted.
+        (WebCore::Layout::LayoutState::establishedBlockFormattingState const): Deleted.
+        (WebCore::Layout::LayoutState::establishedTableFormattingState const): Deleted.
+        (WebCore::Layout::LayoutState::establishedFlexFormattingState const): Deleted.
+        * layout/LayoutState.h:
+        * layout/Verification.cpp:
+        (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
+        * layout/formattingContexts/FormattingGeometry.cpp:
+        (WebCore::Layout::FormattingGeometry::computedWidthValue const):
+        (WebCore::Layout::FormattingGeometry::shrinkToFitWidth const):
+        (WebCore::Layout::FormattingGeometry::complicatedCases const):
+        * layout/formattingContexts/block/BlockFormattingGeometry.cpp:
+        (WebCore::Layout::BlockFormattingGeometry::inFlowNonReplacedContentHeightAndMargin const):
+        * layout/formattingContexts/block/BlockMarginCollapse.cpp:
+        (WebCore::Layout::BlockMarginCollapse::marginsCollapseThrough const):
+        * layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp:
+        (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
+        (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
+        * layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
+        (WebCore::Layout::LineBoxBuilder::constructAndAlignInlineLevelBoxes):
+        * layout/formattingContexts/table/TableFormattingContext.cpp:
+        (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
+        * layout/formattingContexts/table/TableFormattingGeometry.cpp:
+        (WebCore::Layout::TableFormattingGeometry::usedBaselineForCell const):
+        * layout/layouttree/LayoutTreeBuilder.cpp:
+        (WebCore::Layout::showInlineTreeAndRuns):
+
+2021-09-13  Alan Bujtas  <[email protected]>
+
         [LFC][IFC] Do not pass in the InvalidationState to the layout functions
         https://bugs.webkit.org/show_bug.cgi?id=229221
         <rdar://problem/82321574>

Modified: trunk/Source/WebCore/display/DisplayTreeBuilder.cpp (282349 => 282350)


--- trunk/Source/WebCore/display/DisplayTreeBuilder.cpp	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/display/DisplayTreeBuilder.cpp	2021-09-13 19:50:02 UTC (rev 282350)
@@ -303,7 +303,7 @@
 
 void TreeBuilder::buildInlineDisplayTree(const Layout::LayoutState& layoutState, const Layout::ContainerBox& inlineFormattingRoot, InsertionPosition& insertionPosition)
 {
-    auto& inlineFormattingState = layoutState.establishedInlineFormattingState(inlineFormattingRoot);
+    auto& inlineFormattingState = layoutState.formattingStateForInlineFormattingContext(inlineFormattingRoot);
 
     for (auto& run : inlineFormattingState.runs()) {
         if (run.isRootInlineBox()) {

Modified: trunk/Source/WebCore/layout/FormattingState.cpp (282349 => 282350)


--- trunk/Source/WebCore/layout/FormattingState.cpp	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/FormattingState.cpp	2021-09-13 19:50:02 UTC (rev 282350)
@@ -51,7 +51,7 @@
 BoxGeometry& FormattingState::boxGeometry(const Box& layoutBox)
 {
     // Should never need to mutate a display box outside of the formatting context.
-    ASSERT(&layoutState().establishedFormattingState(layoutBox.formattingContextRoot()) == this);
+    ASSERT(&layoutState().formattingStateForFormattingContext(layoutBox.formattingContextRoot()) == this);
     // Anonymous text wrappers do not need to compute box geometry. They initiate inline runs.
     ASSERT(!layoutBox.isInlineTextBox());
     return layoutState().ensureGeometryForBox(layoutBox);

Modified: trunk/Source/WebCore/layout/LayoutState.cpp (282349 => 282350)


--- trunk/Source/WebCore/layout/LayoutState.cpp	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/LayoutState.cpp	2021-09-13 19:50:02 UTC (rev 282350)
@@ -85,7 +85,7 @@
 
 FormattingState& LayoutState::formattingStateForBox(const Box& layoutBox) const
 {
-    return establishedFormattingState(layoutBox.formattingContextRoot());
+    return formattingStateForFormattingContext(layoutBox.formattingContextRoot());
 }
 
 bool LayoutState::hasFormattingState(const ContainerBox& formattingContextRoot) const
@@ -97,56 +97,57 @@
         || m_flexFormattingStates.contains(&formattingContextRoot);
 }
 
-FormattingState& LayoutState::establishedFormattingState(const ContainerBox& formattingContextRoot) const
+FormattingState& LayoutState::formattingStateForFormattingContext(const ContainerBox& formattingContextRoot) const
 {
+    ASSERT(formattingContextRoot.establishesFormattingContext());
     if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()) {
         ASSERT(&formattingContextRoot == m_rootContainer.get());
         return *m_rootInlineFormattingStateForIntegration;
     }
 
-    if (auto* formattingState = m_inlineFormattingStates.get(&formattingContextRoot))
-        return *formattingState;
+    if (formattingContextRoot.establishesInlineFormattingContext())
+        return formattingStateForInlineFormattingContext(formattingContextRoot);
 
-    if (auto* formattingState = m_blockFormattingStates.get(&formattingContextRoot))
-        return *formattingState;
+    if (formattingContextRoot.establishesBlockFormattingContext())
+        return formattingStateForBlockFormattingContext(formattingContextRoot);
 
-    if (auto* formattingState = m_tableFormattingStates.get(&formattingContextRoot))
-        return *formattingState;
+    if (formattingContextRoot.establishesTableFormattingContext())
+        return formattingStateForTableFormattingContext(formattingContextRoot);
 
-    if (auto* formattingState = m_flexFormattingStates.get(&formattingContextRoot))
-        return *formattingState;
+    if (formattingContextRoot.establishesFlexFormattingContext())
+        return formattingStateForFlexFormattingContext(formattingContextRoot);
 
     CRASH();
 }
 
-InlineFormattingState& LayoutState::establishedInlineFormattingState(const ContainerBox& formattingContextRoot) const
+InlineFormattingState& LayoutState::formattingStateForInlineFormattingContext(const ContainerBox& inlineFormattingContextRoot) const
 {
-    ASSERT(formattingContextRoot.establishesInlineFormattingContext());
+    ASSERT(inlineFormattingContextRoot.establishesInlineFormattingContext());
 
     if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()) {
-        ASSERT(&formattingContextRoot == m_rootContainer.get());
+        ASSERT(&inlineFormattingContextRoot == m_rootContainer.get());
         return *m_rootInlineFormattingStateForIntegration;
     }
 
-    return *m_inlineFormattingStates.get(&formattingContextRoot);
+    return *m_inlineFormattingStates.get(&inlineFormattingContextRoot);
 }
 
-BlockFormattingState& LayoutState::establishedBlockFormattingState(const ContainerBox& formattingContextRoot) const
+BlockFormattingState& LayoutState::formattingStateForBlockFormattingContext(const ContainerBox& blockFormattingContextRoot) const
 {
-    ASSERT(formattingContextRoot.establishesBlockFormattingContext());
-    return *m_blockFormattingStates.get(&formattingContextRoot);
+    ASSERT(blockFormattingContextRoot.establishesBlockFormattingContext());
+    return *m_blockFormattingStates.get(&blockFormattingContextRoot);
 }
 
-TableFormattingState& LayoutState::establishedTableFormattingState(const ContainerBox& formattingContextRoot) const
+TableFormattingState& LayoutState::formattingStateForTableFormattingContext(const ContainerBox& tableFormattingContextRoot) const
 {
-    ASSERT(formattingContextRoot.establishesTableFormattingContext());
-    return *m_tableFormattingStates.get(&formattingContextRoot);
+    ASSERT(tableFormattingContextRoot.establishesTableFormattingContext());
+    return *m_tableFormattingStates.get(&tableFormattingContextRoot);
 }
 
-FlexFormattingState& LayoutState::establishedFlexFormattingState(const ContainerBox& formattingContextRoot) const
+FlexFormattingState& LayoutState::formattingStateForFlexFormattingContext(const ContainerBox& flexFormattingContextRoot) const
 {
-    ASSERT(formattingContextRoot.establishesFlexFormattingContext());
-    return *m_flexFormattingStates.get(&formattingContextRoot);
+    ASSERT(flexFormattingContextRoot.establishesFlexFormattingContext());
+    return *m_flexFormattingStates.get(&flexFormattingContextRoot);
 }
 
 InlineFormattingState& LayoutState::ensureInlineFormattingState(const ContainerBox& formattingContextRoot)
@@ -162,7 +163,8 @@
 
         // Otherwise, the formatting context inherits the floats from the parent formatting context.
         // Find the formatting state in which this formatting root lives, not the one it creates and use its floating state.
-        auto& parentFormattingState = establishedBlockFormattingState(formattingContextRoot.formattingContextRoot());
+        ASSERT(formattingContextRoot.formattingContextRoot().establishesBlockFormattingContext());
+        auto& parentFormattingState = formattingStateForBlockFormattingContext(formattingContextRoot.formattingContextRoot());
         auto& parentFloatingState = parentFormattingState.floatingState();
         return makeUnique<InlineFormattingState>(parentFloatingState, *this);
     };

Modified: trunk/Source/WebCore/layout/LayoutState.h (282349 => 282350)


--- trunk/Source/WebCore/layout/LayoutState.h	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/LayoutState.h	2021-09-13 19:50:02 UTC (rev 282350)
@@ -57,12 +57,12 @@
     TableFormattingState& ensureTableFormattingState(const ContainerBox& formattingContextRoot);
     FlexFormattingState& ensureFlexFormattingState(const ContainerBox& formattingContextRoot);
 
-    FormattingState& establishedFormattingState(const ContainerBox& formattingRoot) const;
-    InlineFormattingState& establishedInlineFormattingState(const ContainerBox& formattingContextRoot) const;
-    BlockFormattingState& establishedBlockFormattingState(const ContainerBox& formattingContextRoot) const;
-    TableFormattingState& establishedTableFormattingState(const ContainerBox& formattingContextRoot) const;
-    FlexFormattingState& establishedFlexFormattingState(const ContainerBox& formattingContextRoot) const;
+    InlineFormattingState& formattingStateForInlineFormattingContext(const ContainerBox& inlineFormattingContextRoot) const;
+    BlockFormattingState& formattingStateForBlockFormattingContext(const ContainerBox& blockFormattingContextRoot) const;
+    TableFormattingState& formattingStateForTableFormattingContext(const ContainerBox& tableFormattingContextRoot) const;
+    FlexFormattingState& formattingStateForFlexFormattingContext(const ContainerBox& flexFormattingContextRoot) const;
 
+    FormattingState& formattingStateForFormattingContext(const ContainerBox& formattingRoot) const;
     FormattingState& formattingStateForBox(const Box&) const;
 
     bool hasFormattingState(const ContainerBox& formattingRoot) const;

Modified: trunk/Source/WebCore/layout/Verification.cpp (282349 => 282350)


--- trunk/Source/WebCore/layout/Verification.cpp	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/Verification.cpp	2021-09-13 19:50:02 UTC (rev 282350)
@@ -117,7 +117,7 @@
 
 static bool outputMismatchingComplexLineInformationIfNeeded(TextStream& stream, const LayoutState& layoutState, const RenderBlockFlow& blockFlow, const ContainerBox& inlineFormattingRoot)
 {
-    auto& inlineFormattingState = layoutState.establishedFormattingState(inlineFormattingRoot);
+    auto& inlineFormattingState = layoutState.formattingStateForFormattingContext(inlineFormattingRoot);
     auto& runs = downcast<InlineFormattingState>(inlineFormattingState).runs();
     // Collect inlineboxes.
     Vector<WebCore::LegacyInlineBox*> inlineBoxes;

Modified: trunk/Source/WebCore/layout/formattingContexts/FormattingGeometry.cpp (282349 => 282350)


--- trunk/Source/WebCore/layout/formattingContexts/FormattingGeometry.cpp	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/FormattingGeometry.cpp	2021-09-13 19:50:02 UTC (rev 282350)
@@ -149,7 +149,7 @@
             ASSERT(containerBox.establishesFormattingContext());
             auto& layoutState = this->layoutState();
             if (layoutState.hasFormattingState(containerBox)) {
-                if (auto intrinsicWidthConstraints = layoutState.establishedFormattingState(containerBox).intrinsicWidthConstraints())
+                if (auto intrinsicWidthConstraints = layoutState.formattingStateForFormattingContext(containerBox).intrinsicWidthConstraints())
                     return *intrinsicWidthConstraints;
             }
             return LayoutContext::createFormattingContext(containerBox, const_cast<LayoutState&>(layoutState))->computedIntrinsicWidthConstraints();
@@ -313,7 +313,7 @@
         auto& layoutState = this->layoutState();
         auto& root = downcast<ContainerBox>(formattingContextRoot);
         if (layoutState.hasFormattingState(root)) {
-            if (auto intrinsicWidthConstraints = layoutState.establishedFormattingState(root).intrinsicWidthConstraints())
+            if (auto intrinsicWidthConstraints = layoutState.formattingStateForFormattingContext(root).intrinsicWidthConstraints())
                 return *intrinsicWidthConstraints;
         }
         return LayoutContext::createFormattingContext(root, const_cast<LayoutState&>(layoutState))->computedIntrinsicWidthConstraints();
@@ -798,7 +798,7 @@
             // This is a special (quirk?) behavior since the document box is not a formatting context root and
             // all the float boxes end up at the ICB level.
             auto& initialContainingBlock = documentBox.formattingContextRoot();
-            auto floatingContext = FloatingContext { formattingContext(), layoutState().establishedFormattingState(initialContainingBlock).floatingState() };
+            auto floatingContext = FloatingContext { formattingContext(), layoutState().formattingStateForFormattingContext(initialContainingBlock).floatingState() };
             if (auto floatBottom = floatingContext.bottom()) {
                 bottom = std::max<LayoutUnit>(*floatBottom, bottom);
                 auto floatTop = floatingContext.top();

Modified: trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp (282349 => 282350)


--- trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp	2021-09-13 19:50:02 UTC (rev 282350)
@@ -83,7 +83,7 @@
         // 1. the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines
         auto& layoutContainer = downcast<ContainerBox>(layoutBox);
         if (layoutContainer.establishesInlineFormattingContext()) {
-            auto& inlineFormattingState = layoutState().establishedInlineFormattingState(layoutContainer);
+            auto& inlineFormattingState = layoutState().formattingStateForInlineFormattingContext(layoutContainer);
             auto& lines = inlineFormattingState.lines();
             // Even empty containers generate one line. 
             ASSERT(!lines.isEmpty());

Modified: trunk/Source/WebCore/layout/formattingContexts/block/BlockMarginCollapse.cpp (282349 => 282350)


--- trunk/Source/WebCore/layout/formattingContexts/block/BlockMarginCollapse.cpp	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/block/BlockMarginCollapse.cpp	2021-09-13 19:50:02 UTC (rev 282350)
@@ -413,7 +413,7 @@
                 return false;
 
             auto isConsideredEmpty = [&] {
-                auto& inlineFormattingState = layoutState.establishedInlineFormattingState(containerBox);
+                auto& inlineFormattingState = layoutState.formattingStateForInlineFormattingContext(containerBox);
                 if (!inlineFormattingState.lines().isEmpty())
                     return false;
                 // Any float box in this formatting context prevents collapsing through.

Modified: trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp (282349 => 282350)


--- trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp	2021-09-13 19:50:02 UTC (rev 282350)
@@ -101,7 +101,7 @@
     // borders with the top border of the table. The top border width of the table is equal to half of the
     // maximum collapsed top border. The bottom border width is computed by examining all cells whose bottom borders collapse
     // with the bottom of the table. The bottom border width is equal to half of the maximum collapsed bottom border.
-    auto& grid = layoutState().establishedTableFormattingState(tableBox).tableGrid();
+    auto& grid = layoutState().formattingStateForTableFormattingContext(tableBox).tableGrid();
     auto tableBorder = formattingGeometry().computedBorder(tableBox);
 
     auto& firstColumnFirstRowBox = grid.slot({ 0 , 0 })->cell().box();
@@ -151,7 +151,7 @@
     ASSERT(tableBox.isTableBox());
     // This is a special table "fit-content size" behavior handling. Not in the spec though.
     // Table returns its final width as min/max. Use this final width value to computed horizontal margins etc.
-    auto& formattingStateForTableBox = layoutState().establishedTableFormattingState(tableBox);
+    auto& formattingStateForTableBox = layoutState().formattingStateForTableFormattingContext(tableBox);
     auto intrinsicWidthConstraints = IntrinsicWidthConstraints { };
     if (auto precomputedIntrinsicWidthConstraints = formattingStateForTableBox.intrinsicWidthConstraints())
         intrinsicWidthConstraints = *precomputedIntrinsicWidthConstraints;

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp (282349 => 282350)


--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp	2021-09-13 19:50:02 UTC (rev 282350)
@@ -278,7 +278,7 @@
                 if (synthesizeBaseline)
                     ascent = marginBoxHeight;
                 else {
-                    auto& formattingState = layoutState().establishedInlineFormattingState(downcast<ContainerBox>(layoutBox));
+                    auto& formattingState = layoutState().formattingStateForInlineFormattingContext(downcast<ContainerBox>(layoutBox));
                     auto& lastLine = formattingState.lines().last();
                     auto inlineBlockBaseline = lastLine.lineBoxLogicalRect().top() + lastLine.baseline();
                     ascent = inlineLevelBoxGeometry.marginBefore() + inlineLevelBoxGeometry.borderTop() + inlineLevelBoxGeometry.paddingTop().value_or(0) + inlineBlockBaseline;

Modified: trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.cpp (282349 => 282350)


--- trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.cpp	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.cpp	2021-09-13 19:50:02 UTC (rev 282350)
@@ -154,7 +154,7 @@
                     // Normally by the time we start positioning the child content, we already have computed borders and padding for the containing block.
                     // This is different with table cells where the final padding offset depends on the content height as we use
                     // the padding box to vertically align the table cell content.
-                    auto& formattingState = layoutState().establishedFormattingState(cellBox);
+                    auto& formattingState = layoutState().formattingStateForFormattingContext(cellBox);
                     for (auto* child = cellBox.firstInFlowOrFloatingChild(); child; child = child->nextInFlowOrFloatingSibling()) {
                         if (child->isInlineTextBox())
                             continue;
@@ -161,7 +161,7 @@
                         formattingState.boxGeometry(*child).moveVertically(intrinsicPaddingTop);
                     }
                     if (cellBox.establishesInlineFormattingContext()) {
-                        auto& inlineFormattingStatee = layoutState().establishedInlineFormattingState(cellBox);
+                        auto& inlineFormattingStatee = layoutState().formattingStateForInlineFormattingContext(cellBox);
                         for (auto& run : inlineFormattingStatee.runs())
                             run.moveVertically(intrinsicPaddingTop);
                         for (auto& line : inlineFormattingStatee.lines())

Modified: trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingGeometry.cpp (282349 => 282350)


--- trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingGeometry.cpp	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingGeometry.cpp	2021-09-13 19:50:02 UTC (rev 282350)
@@ -133,15 +133,15 @@
     // or the first in-flow table-row in the cell, whichever comes first.
     // If there is no such line box, the baseline is the bottom of content edge of the cell box.
     if (cellBox.establishesInlineFormattingContext())
-        return layoutState().establishedInlineFormattingState(cellBox).lines()[0].baseline();
+        return layoutState().formattingStateForInlineFormattingContext(cellBox).lines()[0].baseline();
     for (auto& cellDescendant : descendantsOfType<ContainerBox>(cellBox)) {
         if (cellDescendant.establishesInlineFormattingContext()) {
-            auto& inlineFormattingStateForCell = layoutState().establishedInlineFormattingState(cellDescendant);
+            auto& inlineFormattingStateForCell = layoutState().formattingStateForInlineFormattingContext(cellDescendant);
             if (!inlineFormattingStateForCell.lines().isEmpty())
                 return inlineFormattingStateForCell.lines()[0].baseline();
         }
         if (cellDescendant.establishesTableFormattingContext())
-            return layoutState().establishedTableFormattingState(cellDescendant).tableGrid().rows().list()[0].baseline();
+            return layoutState().formattingStateForTableFormattingContext(cellDescendant).tableGrid().rows().list()[0].baseline();
     }
     return formattingContext().geometryForBox(cellBox).contentBoxBottom();
 }

Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (282349 => 282350)


--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2021-09-13 19:41:12 UTC (rev 282349)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2021-09-13 19:50:02 UTC (rev 282350)
@@ -383,7 +383,7 @@
 #if ENABLE(TREE_DEBUGGING)
 void showInlineTreeAndRuns(TextStream& stream, const LayoutState& layoutState, const ContainerBox& inlineFormattingRoot, size_t depth)
 {
-    auto& inlineFormattingState = layoutState.establishedInlineFormattingState(inlineFormattingRoot);
+    auto& inlineFormattingState = layoutState.formattingStateForInlineFormattingContext(inlineFormattingRoot);
     auto& lines = inlineFormattingState.lines();
     auto& runs = inlineFormattingState.runs();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to