Title: [277957] trunk/Source/WebCore
Revision
277957
Author
za...@apple.com
Date
2021-05-24 11:08:10 -0700 (Mon, 24 May 2021)

Log Message

[LFC] Rename the geometry() helpers to formattingGeometry()
https://bugs.webkit.org/show_bug.cgi?id=226153

Reviewed by Antti Koivisto.

* layout/formattingContexts/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::computeBorderAndPadding):
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
(WebCore::Layout::FormattingContext::formattingGeometry const):
(WebCore::Layout::FormattingContext::geometry const): Deleted.
* layout/formattingContexts/FormattingContext.h:
* layout/formattingContexts/FormattingQuirks.cpp:
(WebCore::Layout::FormattingQuirks::heightValueOfNearestContainingBlockWithFixedHeight const):
* layout/formattingContexts/block/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
(WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
(WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
(WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::BlockFormattingContext::formattingGeometry const):
(WebCore::Layout::BlockFormattingContext::geometry const): Deleted.
* layout/formattingContexts/block/BlockFormattingContext.h:
* layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp:
(WebCore::Layout::TableWrapperBlockFormattingContext::layoutTableBox):
(WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
(WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
(WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox):
* layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems):
(WebCore::Layout::FlexFormattingContext::computeIntrinsicWidthConstraintsForFlexItems):
(WebCore::Layout::FlexFormattingContext::formattingGeometry const):
(WebCore::Layout::FlexFormattingContext::geometry const): Deleted.
* layout/formattingContexts/flex/FlexFormattingContext.h:
* layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::lineLayout):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
(WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
(WebCore::Layout::InlineFormattingContext::formattingGeometry const):
(WebCore::Layout::InlineFormattingContext::geometry const): Deleted.
* layout/formattingContexts/inline/InlineFormattingContext.h:
* layout/formattingContexts/table/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
(WebCore::Layout::TableFormattingContext::layoutCell):
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraSpace):
(WebCore::Layout::TableFormattingContext::formattingGeometry const):
(WebCore::Layout::TableFormattingContext::geometry const): Deleted.
* layout/formattingContexts/table/TableFormattingContext.h:
* layout/formattingContexts/table/TableLayout.cpp:
(WebCore::Layout::TableFormattingContext::TableLayout::distributedVerticalSpace):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (277956 => 277957)


--- trunk/Source/WebCore/ChangeLog	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/ChangeLog	2021-05-24 18:08:10 UTC (rev 277957)
@@ -1,5 +1,68 @@
 2021-05-24  Alan Bujtas  <za...@apple.com>
 
+        [LFC] Rename the geometry() helpers to formattingGeometry()
+        https://bugs.webkit.org/show_bug.cgi?id=226153
+
+        Reviewed by Antti Koivisto.
+
+        * layout/formattingContexts/FormattingContext.cpp:
+        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
+        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
+        (WebCore::Layout::FormattingContext::computeBorderAndPadding):
+        (WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
+        (WebCore::Layout::FormattingContext::formattingGeometry const):
+        (WebCore::Layout::FormattingContext::geometry const): Deleted.
+        * layout/formattingContexts/FormattingContext.h:
+        * layout/formattingContexts/FormattingQuirks.cpp:
+        (WebCore::Layout::FormattingQuirks::heightValueOfNearestContainingBlockWithFixedHeight const):
+        * layout/formattingContexts/block/BlockFormattingContext.cpp:
+        (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
+        (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
+        (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
+        (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
+        (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors):
+        (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
+        (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
+        (WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints):
+        (WebCore::Layout::BlockFormattingContext::formattingGeometry const):
+        (WebCore::Layout::BlockFormattingContext::geometry const): Deleted.
+        * layout/formattingContexts/block/BlockFormattingContext.h:
+        * layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp:
+        (WebCore::Layout::TableWrapperBlockFormattingContext::layoutTableBox):
+        (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
+        (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
+        (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox):
+        * layout/formattingContexts/flex/FlexFormattingContext.cpp:
+        (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems):
+        (WebCore::Layout::FlexFormattingContext::computeIntrinsicWidthConstraintsForFlexItems):
+        (WebCore::Layout::FlexFormattingContext::formattingGeometry const):
+        (WebCore::Layout::FlexFormattingContext::geometry const): Deleted.
+        * layout/formattingContexts/flex/FlexFormattingContext.h:
+        * layout/formattingContexts/inline/InlineFormattingContext.cpp:
+        (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
+        (WebCore::Layout::InlineFormattingContext::lineLayout):
+        (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
+        (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
+        (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
+        (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
+        (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
+        (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
+        (WebCore::Layout::InlineFormattingContext::formattingGeometry const):
+        (WebCore::Layout::InlineFormattingContext::geometry const): Deleted.
+        * layout/formattingContexts/inline/InlineFormattingContext.h:
+        * layout/formattingContexts/table/TableFormattingContext.cpp:
+        (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
+        (WebCore::Layout::TableFormattingContext::layoutCell):
+        (WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
+        (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraSpace):
+        (WebCore::Layout::TableFormattingContext::formattingGeometry const):
+        (WebCore::Layout::TableFormattingContext::geometry const): Deleted.
+        * layout/formattingContexts/table/TableFormattingContext.h:
+        * layout/formattingContexts/table/TableLayout.cpp:
+        (WebCore::Layout::TableFormattingContext::TableLayout::distributedVerticalSpace):
+
+2021-05-24  Alan Bujtas  <za...@apple.com>
+
         [LFC] FormattingGeometry functions should all be const
         https://bugs.webkit.org/show_bug.cgi?id=226147
 

Modified: trunk/Source/WebCore/layout/formattingContexts/FormattingContext.cpp (277956 => 277957)


--- trunk/Source/WebCore/layout/formattingContexts/FormattingContext.cpp	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/layout/formattingContexts/FormattingContext.cpp	2021-05-24 18:08:10 UTC (rev 277957)
@@ -75,18 +75,18 @@
 {
     ASSERT(layoutBox.isOutOfFlowPositioned());
     auto compute = [&](Optional<LayoutUnit> usedWidth) {
-        return geometry().outOfFlowHorizontalGeometry(layoutBox, constraints.horizontal, constraints.vertical, { usedWidth, { } });
+        return formattingGeometry().outOfFlowHorizontalGeometry(layoutBox, constraints.horizontal, constraints.vertical, { usedWidth, { } });
     };
 
     auto containingBlockWidth = constraints.horizontal.logicalWidth;
     auto horizontalGeometry = compute({ });
-    if (auto maxWidth = geometry().computedMaxWidth(layoutBox, containingBlockWidth)) {
+    if (auto maxWidth = formattingGeometry().computedMaxWidth(layoutBox, containingBlockWidth)) {
         auto maxHorizontalGeometry = compute(maxWidth);
         if (horizontalGeometry.contentWidthAndMargin.contentWidth > maxHorizontalGeometry.contentWidthAndMargin.contentWidth)
             horizontalGeometry = maxHorizontalGeometry;
     }
 
-    if (auto minWidth = geometry().computedMinWidth(layoutBox, containingBlockWidth)) {
+    if (auto minWidth = formattingGeometry().computedMinWidth(layoutBox, containingBlockWidth)) {
         auto minHorizontalGeometry = compute(minWidth);
         if (horizontalGeometry.contentWidthAndMargin.contentWidth < minHorizontalGeometry.contentWidthAndMargin.contentWidth)
             horizontalGeometry = minHorizontalGeometry;
@@ -103,18 +103,18 @@
 {
     ASSERT(layoutBox.isOutOfFlowPositioned());
     auto compute = [&](Optional<LayoutUnit> usedHeight) {
-        return geometry().outOfFlowVerticalGeometry(layoutBox, constraints.horizontal, constraints.vertical, { usedHeight });
+        return formattingGeometry().outOfFlowVerticalGeometry(layoutBox, constraints.horizontal, constraints.vertical, { usedHeight });
     };
 
     auto containingBlockHeight = *constraints.vertical.logicalHeight;
     auto verticalGeometry = compute({ });
-    if (auto maxHeight = geometry().computedMaxHeight(layoutBox, containingBlockHeight)) {
+    if (auto maxHeight = formattingGeometry().computedMaxHeight(layoutBox, containingBlockHeight)) {
         auto maxVerticalGeometry = compute(maxHeight);
         if (verticalGeometry.contentHeightAndMargin.contentHeight > maxVerticalGeometry.contentHeightAndMargin.contentHeight)
             verticalGeometry = maxVerticalGeometry;
     }
 
-    if (auto minHeight = geometry().computedMinHeight(layoutBox, containingBlockHeight)) {
+    if (auto minHeight = formattingGeometry().computedMinHeight(layoutBox, containingBlockHeight)) {
         auto minVerticalGeometry = compute(minHeight);
         if (verticalGeometry.contentHeightAndMargin.contentHeight < minVerticalGeometry.contentHeightAndMargin.contentHeight)
             verticalGeometry = minVerticalGeometry;
@@ -131,8 +131,8 @@
 void FormattingContext::computeBorderAndPadding(const Box& layoutBox, const HorizontalConstraints& horizontalConstraint)
 {
     auto& boxGeometry = formattingState().boxGeometry(layoutBox);
-    boxGeometry.setBorder(geometry().computedBorder(layoutBox));
-    boxGeometry.setPadding(geometry().computedPadding(layoutBox, horizontalConstraint.logicalWidth));
+    boxGeometry.setBorder(formattingGeometry().computedBorder(layoutBox));
+    boxGeometry.setPadding(formattingGeometry().computedPadding(layoutBox, horizontalConstraint.logicalWidth));
 }
 
 void FormattingContext::layoutOutOfFlowContent(InvalidationState& invalidationState, const ConstraintsForOutOfFlowContent& constraints)
@@ -143,7 +143,7 @@
 
     auto constraintsForLayoutBox = [&] (const auto& outOfFlowBox) {
         auto& containingBlock = outOfFlowBox.containingBlock();
-        return &containingBlock == &root() ? constraints : geometry().constraintsForOutOfFlowContent(containingBlock);
+        return &containingBlock == &root() ? constraints : formattingGeometry().constraintsForOutOfFlowContent(containingBlock);
     };
 
     for (auto& outOfFlowBox : formattingState().outOfFlowBoxes()) {
@@ -161,9 +161,9 @@
             auto& containerBox = downcast<ContainerBox>(*outOfFlowBox);
             auto formattingContext = LayoutContext::createFormattingContext(containerBox, layoutState());
             if (containerBox.hasInFlowOrFloatingChild())
-                formattingContext->layoutInFlowContent(invalidationState, geometry().constraintsForInFlowContent(containerBox));
+                formattingContext->layoutInFlowContent(invalidationState, formattingGeometry().constraintsForInFlowContent(containerBox));
             computeOutOfFlowVerticalGeometry(containerBox, containingBlockConstraints);
-            formattingContext->layoutOutOfFlowContent(invalidationState, geometry().constraintsForOutOfFlowContent(containerBox));
+            formattingContext->layoutOutOfFlowContent(invalidationState, formattingGeometry().constraintsForOutOfFlowContent(containerBox));
         } else
             computeOutOfFlowVerticalGeometry(*outOfFlowBox, containingBlockConstraints);
     }
@@ -272,7 +272,7 @@
     }
 }
 
-FormattingGeometry FormattingContext::geometry() const
+FormattingGeometry FormattingContext::formattingGeometry() const
 {
     return FormattingGeometry(*this);
 }

Modified: trunk/Source/WebCore/layout/formattingContexts/FormattingContext.h (277956 => 277957)


--- trunk/Source/WebCore/layout/formattingContexts/FormattingContext.h	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/layout/formattingContexts/FormattingContext.h	2021-05-24 18:08:10 UTC (rev 277957)
@@ -91,7 +91,7 @@
 
     using LayoutQueue = Vector<const Box*>;
 private:
-    FormattingGeometry geometry() const;
+    FormattingGeometry formattingGeometry() const;
     FormattingQuirks quirks() const;
 
     void collectOutOfFlowDescendantsIfNeeded();

Modified: trunk/Source/WebCore/layout/formattingContexts/FormattingQuirks.cpp (277956 => 277957)


--- trunk/Source/WebCore/layout/formattingContexts/FormattingQuirks.cpp	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/layout/formattingContexts/FormattingQuirks.cpp	2021-05-24 18:08:10 UTC (rev 277957)
@@ -57,9 +57,9 @@
         // -and it's totally insane because now we freely travel across formatting context boundaries and computed margins are nonexistent.
         if (containingBlock->isBodyBox() || containingBlock->isDocumentBox()) {
 
-            auto geometry = FormattingGeometry { formattingContext };
-            auto horizontalConstraints = geometry.constraintsForInFlowContent(containingBlock->containingBlock(), FormattingContext::EscapeReason::FindFixedHeightAncestorQuirk).horizontal;
-            auto verticalMargin = geometry.computedVerticalMargin(*containingBlock, horizontalConstraints);
+            auto formattingGeometry = FormattingGeometry { formattingContext };
+            auto horizontalConstraints = formattingGeometry.constraintsForInFlowContent(containingBlock->containingBlock(), FormattingContext::EscapeReason::FindFixedHeightAncestorQuirk).horizontal;
+            auto verticalMargin = formattingGeometry.computedVerticalMargin(*containingBlock, horizontalConstraints);
 
             auto& boxGeometry = formattingContext.geometryForBox(*containingBlock, FormattingContext::EscapeReason::FindFixedHeightAncestorQuirk);
             auto verticalPadding = boxGeometry.paddingTop().valueOr(0) + boxGeometry.paddingBottom().valueOr(0);

Modified: trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingContext.cpp (277956 => 277957)


--- trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingContext.cpp	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingContext.cpp	2021-05-24 18:08:10 UTC (rev 277957)
@@ -97,7 +97,7 @@
 
     auto constraintsForLayoutBox = [&] (const auto& layoutBox) {
         auto& containingBlock = layoutBox.containingBlock();
-        return &containingBlock == &formattingRoot ? constraints : geometry().constraintsForInFlowContent(containingBlock);
+        return &containingBlock == &formattingRoot ? constraints : blockFormattingGeometry().constraintsForInFlowContent(containingBlock);
     };
 
     // This is a post-order tree traversal layout.
@@ -130,7 +130,7 @@
                     auto formattingContext = LayoutContext::createFormattingContext(containerBox, layoutState());
                     if (containerBox.isTableWrapperBox())
                         downcast<TableWrapperBlockFormattingContext>(*formattingContext).setHorizontalConstraintsIgnoringFloats(containingBlockConstraints.horizontal);
-                    formattingContext->layoutInFlowContent(invalidationState, geometry().constraintsForInFlowContent(containerBox));
+                    formattingContext->layoutInFlowContent(invalidationState, blockFormattingGeometry().constraintsForInFlowContent(containerBox));
                 }
                 break;
             }
@@ -161,7 +161,7 @@
                 // Now that we computed the box's height, we can layout the out-of-flow descendants.
                 if (is<ContainerBox>(layoutBox) && downcast<ContainerBox>(layoutBox).hasChild()) {
                     auto& containerBox = downcast<ContainerBox>(layoutBox);
-                    LayoutContext::createFormattingContext(containerBox, layoutState())->layoutOutOfFlowContent(invalidationState, geometry().constraintsForOutOfFlowContent(containerBox));
+                    LayoutContext::createFormattingContext(containerBox, layoutState())->layoutOutOfFlowContent(invalidationState, blockFormattingGeometry().constraintsForOutOfFlowContent(containerBox));
                 }
             }
             if (!establishesFormattingContext && is<ContainerBox>(layoutBox))
@@ -258,7 +258,7 @@
     for (auto& childBox : childrenOfType<Box>(containerBox)) {
         if (!childBox.isInFlowPositioned())
             continue;
-        auto positionOffset = geometry().inFlowPositionedPositionOffset(childBox, horizontalConstraints);
+        auto positionOffset = blockFormattingGeometry().inFlowPositionedPositionOffset(childBox, horizontalConstraints);
         formattingState().boxGeometry(childBox).move(positionOffset);
     }
     LOG_WITH_STREAM(FormattingContextLayout, stream << "End: move in-flow positioned children -> parent: " << &containerBox);
@@ -266,12 +266,12 @@
 
 void BlockFormattingContext::computeStaticVerticalPosition(const Box& layoutBox, const VerticalConstraints& verticalConstraints)
 {
-    formattingState().boxGeometry(layoutBox).setLogicalTop(geometry().staticVerticalPosition(layoutBox, verticalConstraints));
+    formattingState().boxGeometry(layoutBox).setLogicalTop(blockFormattingGeometry().staticVerticalPosition(layoutBox, verticalConstraints));
 }
 
 void BlockFormattingContext::computeStaticHorizontalPosition(const Box& layoutBox, const HorizontalConstraints& horizontalConstraints)
 {
-    formattingState().boxGeometry(layoutBox).setLogicalLeft(geometry().staticHorizontalPosition(layoutBox, horizontalConstraints));
+    formattingState().boxGeometry(layoutBox).setLogicalLeft(blockFormattingGeometry().staticHorizontalPosition(layoutBox, horizontalConstraints));
 }
 
 void BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors(const Box& layoutBox, const ConstraintsPair& constraintsPair)
@@ -286,7 +286,7 @@
     //
     // The idea here is that as long as we don't cross the block formatting context boundary, we should be able to pre-compute the final top position.
     // FIXME: we currently don't account for the "clear" property when computing the final position for an ancestor.
-    auto formattingGeometry = geometry();
+    auto formattingGeometry = blockFormattingGeometry();
     for (auto* ancestor = &layoutBox; ancestor && ancestor != &root(); ancestor = &ancestor->containingBlock()) {
         auto constraintsForAncestor = [&] {
             auto& containingBlock = ancestor->containingBlock();
@@ -360,7 +360,7 @@
         // Float avoiders' available width might be shrunk by existing floats in the context.
         availableWidthFloatAvoider = usedAvailableWidthForFloatAvoider(floatingContext, layoutBox, constraintsPair);
     }
-    auto contentWidthAndMargin = geometry().computedContentWidthAndMargin(layoutBox, constraintsPair.containingBlock.horizontal, availableWidthFloatAvoider);
+    auto contentWidthAndMargin = blockFormattingGeometry().computedContentWidthAndMargin(layoutBox, constraintsPair.containingBlock.horizontal, availableWidthFloatAvoider);
     auto& boxGeometry = formattingState().boxGeometry(layoutBox);
     boxGeometry.setContentBoxWidth(contentWidthAndMargin.contentWidth);
     boxGeometry.setHorizontalMargin({ contentWidthAndMargin.usedMargin.start, contentWidthAndMargin.usedMargin.end });
@@ -370,10 +370,10 @@
 {
     auto compute = [&](Optional<LayoutUnit> usedHeight) -> ContentHeightAndMargin {
         if (layoutBox.isInFlow())
-            return geometry().inFlowContentHeightAndMargin(layoutBox, constraints.horizontal, { usedHeight });
+            return blockFormattingGeometry().inFlowContentHeightAndMargin(layoutBox, constraints.horizontal, { usedHeight });
 
         if (layoutBox.isFloatingPositioned())
-            return geometry().floatingContentHeightAndMargin(layoutBox, constraints.horizontal, { usedHeight });
+            return blockFormattingGeometry().floatingContentHeightAndMargin(layoutBox, constraints.horizontal, { usedHeight });
 
         ASSERT_NOT_REACHED();
         return { };
@@ -380,7 +380,7 @@
     };
 
     auto contentHeightAndMargin = compute({ });
-    if (auto maxHeight = geometry().computedMaxHeight(layoutBox)) {
+    if (auto maxHeight = blockFormattingGeometry().computedMaxHeight(layoutBox)) {
         if (contentHeightAndMargin.contentHeight > *maxHeight) {
             auto maxHeightAndMargin = compute(maxHeight);
             // Used height should remain the same.
@@ -389,7 +389,7 @@
         }
     }
 
-    if (auto minHeight = geometry().computedMinHeight(layoutBox)) {
+    if (auto minHeight = blockFormattingGeometry().computedMinHeight(layoutBox)) {
         if (contentHeightAndMargin.contentHeight < *minHeight) {
             auto minHeightAndMargin = compute(minHeight);
             // Used height should remain the same.
@@ -478,7 +478,7 @@
             auto& layoutBox = *queue.takeLast();
             auto desdendantConstraints = formattingState.intrinsicWidthConstraintsForBox(layoutBox);
             if (!desdendantConstraints) {
-                desdendantConstraints = geometry().intrinsicWidthConstraints(layoutBox);
+                desdendantConstraints = blockFormattingGeometry().intrinsicWidthConstraints(layoutBox);
                 formattingState.setIntrinsicWidthConstraintsForBox(layoutBox, *desdendantConstraints);
             }
             constraints.minimum = std::max(constraints.minimum, desdendantConstraints->minimum);
@@ -602,7 +602,7 @@
     }
 }
 
-BlockFormattingGeometry BlockFormattingContext::geometry() const
+BlockFormattingGeometry BlockFormattingContext::blockFormattingGeometry() const
 {
     return BlockFormattingGeometry { *this };
 }

Modified: trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingContext.h (277956 => 277957)


--- trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingContext.h	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingContext.h	2021-05-24 18:08:10 UTC (rev 277957)
@@ -80,7 +80,7 @@
     void updateMarginAfterForPreviousSibling(const Box&);
 
     BlockFormattingState& formattingState() { return downcast<BlockFormattingState>(FormattingContext::formattingState()); }
-    BlockFormattingGeometry geometry() const;
+    BlockFormattingGeometry blockFormattingGeometry() const;
     BlockMarginCollapse marginCollapse() const;
 
 #if ASSERT_ENABLED

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


--- trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp	2021-05-24 18:08:10 UTC (rev 277957)
@@ -78,7 +78,7 @@
 
     if (tableBox.hasChild()) {
         auto invalidationState = InvalidationState { };
-        LayoutContext::createFormattingContext(tableBox, layoutState())->layoutInFlowContent(invalidationState, geometry().constraintsForInFlowContent(tableBox));
+        LayoutContext::createFormattingContext(tableBox, layoutState())->layoutInFlowContent(invalidationState, blockFormattingGeometry().constraintsForInFlowContent(tableBox));
     }
 
     computeHeightAndMarginForTableBox(tableBox, constraints);
@@ -100,13 +100,13 @@
     // 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 tableBorder = geometry().computedBorder(tableBox);
+    auto tableBorder = blockFormattingGeometry().computedBorder(tableBox);
 
     auto& firstColumnFirstRowBox = grid.slot({ 0 , 0 })->cell().box();
-    auto leftBorder = std::max(tableBorder.horizontal.left, geometry().computedBorder(firstColumnFirstRowBox).horizontal.left);
+    auto leftBorder = std::max(tableBorder.horizontal.left, blockFormattingGeometry().computedBorder(firstColumnFirstRowBox).horizontal.left);
 
     auto& lastColumnFirstRow = grid.slot({ grid.columns().size() - 1, 0 })->cell().box();
-    auto rightBorder = std::max(tableBorder.horizontal.right, geometry().computedBorder(lastColumnFirstRow).horizontal.right);
+    auto rightBorder = std::max(tableBorder.horizontal.right, blockFormattingGeometry().computedBorder(lastColumnFirstRow).horizontal.right);
 
     auto topBorder = tableBorder.vertical.top;
     auto bottomBorder = tableBorder.vertical.bottom;
@@ -115,26 +115,26 @@
         auto& boxInFirstRox = grid.slot({ columnIndex, 0 })->cell().box();
         auto& boxInLastRow = grid.slot({ columnIndex, lastRowIndex })->cell().box();
 
-        topBorder = std::max(topBorder, geometry().computedBorder(boxInFirstRox).vertical.top);
-        bottomBorder = std::max(bottomBorder, geometry().computedBorder(boxInLastRow).vertical.bottom);
+        topBorder = std::max(topBorder, blockFormattingGeometry().computedBorder(boxInFirstRox).vertical.top);
+        bottomBorder = std::max(bottomBorder, blockFormattingGeometry().computedBorder(boxInLastRow).vertical.bottom);
     }
 
-    topBorder = std::max(topBorder, geometry().computedBorder(*tableBox.firstChild()).vertical.top);
+    topBorder = std::max(topBorder, blockFormattingGeometry().computedBorder(*tableBox.firstChild()).vertical.top);
     for (auto& section : childrenOfType<ContainerBox>(tableBox)) {
-        auto horiztonalBorder = geometry().computedBorder(section).horizontal;
+        auto horiztonalBorder = blockFormattingGeometry().computedBorder(section).horizontal;
         leftBorder = std::max(leftBorder, horiztonalBorder.left);
         rightBorder = std::max(rightBorder, horiztonalBorder.right);
     }
-    bottomBorder = std::max(bottomBorder, geometry().computedBorder(*tableBox.lastChild()).vertical.bottom);
+    bottomBorder = std::max(bottomBorder, blockFormattingGeometry().computedBorder(*tableBox.lastChild()).vertical.bottom);
 
     auto& rows = grid.rows().list();
-    topBorder = std::max(topBorder, geometry().computedBorder(rows.first().box()).vertical.top);
+    topBorder = std::max(topBorder, blockFormattingGeometry().computedBorder(rows.first().box()).vertical.top);
     for (auto& row : rows) {
-        auto horiztonalBorder = geometry().computedBorder(row.box()).horizontal;
+        auto horiztonalBorder = blockFormattingGeometry().computedBorder(row.box()).horizontal;
         leftBorder = std::max(leftBorder, horiztonalBorder.left);
         rightBorder = std::max(rightBorder, horiztonalBorder.right);
     }
-    bottomBorder = std::max(bottomBorder, geometry().computedBorder(rows.last().box()).vertical.bottom);
+    bottomBorder = std::max(bottomBorder, blockFormattingGeometry().computedBorder(rows.last().box()).vertical.bottom);
 
     auto collapsedBorder = Edges { { leftBorder, rightBorder }, { topBorder, bottomBorder } };
     grid.setCollapsedBorder(collapsedBorder);
@@ -141,7 +141,7 @@
 
     auto& boxGeometry = formattingState().boxGeometry(tableBox);
     boxGeometry.setBorder(collapsedBorder / 2);
-    boxGeometry.setPadding(geometry().computedPadding(tableBox, horizontalConstraints.logicalWidth));
+    boxGeometry.setPadding(blockFormattingGeometry().computedPadding(tableBox, horizontalConstraints.logicalWidth));
 }
 
 void TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox(const ContainerBox& tableBox, const HorizontalConstraints& horizontalConstraints)
@@ -186,10 +186,10 @@
     // Similar setup with non-table content would resolve the inner block level box's width to 40px;
     // This needs clarification in the spec.
     auto horizontalConstraintForResolvingWidth = m_horizontalConstraintsIgnoringFloats.logicalWidth;
-    auto geometry = this->geometry();
-    auto computedWidth = geometry.computedWidth(tableBox, horizontalConstraintForResolvingWidth);
-    auto computedMaxWidth = geometry.computedMaxWidth(tableBox, horizontalConstraintForResolvingWidth);
-    auto computedMinWidth = geometry.computedMinWidth(tableBox, horizontalConstraintForResolvingWidth);
+    auto formattingGeometry = blockFormattingGeometry();
+    auto computedWidth = formattingGeometry.computedWidth(tableBox, horizontalConstraintForResolvingWidth);
+    auto computedMaxWidth = formattingGeometry.computedMaxWidth(tableBox, horizontalConstraintForResolvingWidth);
+    auto computedMinWidth = formattingGeometry.computedMinWidth(tableBox, horizontalConstraintForResolvingWidth);
     // Use the generic shrink-to-fit-width logic as the initial width for the table.
     auto usedWidth = std::min(std::max(intrinsicWidthConstraints.minimum, availableHorizontalSpace), intrinsicWidthConstraints.maximum);
     if (computedWidth || computedMinWidth || computedMaxWidth) {
@@ -208,7 +208,7 @@
             usedWidth = *computedMinWidth;
     }
 
-    auto contentWidthAndMargin = geometry.inFlowContentWidthAndMargin(tableBox, horizontalConstraints, OverriddenHorizontalValues { usedWidth, { } });
+    auto contentWidthAndMargin = formattingGeometry.inFlowContentWidthAndMargin(tableBox, horizontalConstraints, OverriddenHorizontalValues { usedWidth, { } });
 
     auto& boxGeometry = formattingState().boxGeometry(tableBox);
     boxGeometry.setContentBoxWidth(contentWidthAndMargin.contentWidth);
@@ -224,11 +224,11 @@
         if (layoutState().inQuirksMode())
             return TableWrapperQuirks(*this).overriddenTableHeight(tableBox);
         if (tableBox.hasInFlowOrFloatingChild())
-            return geometry().contentHeightForFormattingContextRoot(tableBox);
+            return blockFormattingGeometry().contentHeightForFormattingContextRoot(tableBox);
         return { };
     }();
 
-    auto heightAndMargin = geometry().inFlowContentHeightAndMargin(tableBox, constraints.horizontal, { overriddenTableHeight });
+    auto heightAndMargin = blockFormattingGeometry().inFlowContentHeightAndMargin(tableBox, constraints.horizontal, { overriddenTableHeight });
     auto verticalMargin = marginCollapse().collapsedVerticalValues(tableBox, heightAndMargin.nonCollapsedMargin);
     // Cache the computed positive and negative margin value pair.
     formattingState().setUsedVerticalMargin(tableBox, verticalMargin);

Modified: trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp (277956 => 277957)


--- trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp	2021-05-24 18:08:10 UTC (rev 277957)
@@ -67,7 +67,7 @@
 void FlexFormattingContext::sizeAndPlaceFlexItems(const ConstraintsForInFlowContent& constraints)
 {
     auto& formattingState = this->formattingState();
-    auto geometry = this->geometry();
+    auto formattingGeometry = flexFormattingGeometry();
     auto flexItemMainAxisStart = constraints.horizontal.logicalLeft;
     auto flexItemMainAxisEnd = flexItemMainAxisStart;
     auto flexItemCrosAxisStart = constraints.vertical.logicalTop;
@@ -87,16 +87,16 @@
 
             flexItemGeometry.setLogicalTopLeft(LayoutPoint { flexItemMainAxisEnd, flexItemCrosAxisStart });
 
-            flexItemGeometry.setBorder(geometry.computedBorder(flexItem));
-            flexItemGeometry.setPadding(geometry.computedPadding(flexItem, constraints.horizontal.logicalWidth));
+            flexItemGeometry.setBorder(formattingGeometry.computedBorder(flexItem));
+            flexItemGeometry.setPadding(formattingGeometry.computedPadding(flexItem, constraints.horizontal.logicalWidth));
 
-            auto computedHorizontalMargin = geometry.computedHorizontalMargin(flexItem, constraints.horizontal);
+            auto computedHorizontalMargin = formattingGeometry.computedHorizontalMargin(flexItem, constraints.horizontal);
             flexItemGeometry.setHorizontalMargin({ computedHorizontalMargin.start.valueOr(0_lu), computedHorizontalMargin.end.valueOr(0_lu) });
 
-            auto computedVerticalMargin = geometry.computedVerticalMargin(flexItem, constraints.horizontal);
+            auto computedVerticalMargin = formattingGeometry.computedVerticalMargin(flexItem, constraints.horizontal);
             flexItemGeometry.setVerticalMargin({ computedVerticalMargin.before.valueOr(0_lu), computedVerticalMargin.after.valueOr(0_lu) });
 
-            flexItemGeometry.setContentBoxHeight(geometry.contentHeightForFormattingContextRoot(flexItem));
+            flexItemGeometry.setContentBoxHeight(formattingGeometry.contentHeightForFormattingContextRoot(flexItem));
             flexItemGeometry.setContentBoxWidth(flexItemLogicalWidth);
             flexItemMainAxisEnd= BoxGeometry::borderBoxRect(flexItemGeometry).right();
             flexItemCrosAxisEnd = std::max(flexItemCrosAxisEnd, BoxGeometry::borderBoxRect(flexItemGeometry).bottom());
@@ -110,15 +110,15 @@
 void FlexFormattingContext::computeIntrinsicWidthConstraintsForFlexItems()
 {
     auto& formattingState = this->formattingState();
-    auto geometry = this->geometry();
+    auto formattingGeometry = flexFormattingGeometry();
     for (auto& flexItem : childrenOfType<ContainerBox>(root())) {
         if (formattingState.intrinsicWidthConstraintsForBox(flexItem))
             continue;
-        formattingState.setIntrinsicWidthConstraintsForBox(flexItem, geometry.intrinsicWidthConstraints(flexItem));
+        formattingState.setIntrinsicWidthConstraintsForBox(flexItem, formattingGeometry.intrinsicWidthConstraints(flexItem));
     }
 }
 
-FlexFormattingGeometry FlexFormattingContext::geometry() const
+FlexFormattingGeometry FlexFormattingContext::flexFormattingGeometry() const
 {
     return FlexFormattingGeometry(*this);
 }

Modified: trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h (277956 => 277957)


--- trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h	2021-05-24 18:08:10 UTC (rev 277957)
@@ -48,7 +48,7 @@
     IntrinsicWidthConstraints computedIntrinsicWidthConstraints() override;
 
 private:
-    FlexFormattingGeometry geometry() const;
+    FlexFormattingGeometry flexFormattingGeometry() const;
 
     void sizeAndPlaceFlexItems(const ConstraintsForInFlowContent&);
     void computeIntrinsicWidthConstraintsForFlexItems();

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp (277956 => 277957)


--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp	2021-05-24 18:08:10 UTC (rev 277957)
@@ -104,9 +104,9 @@
                 if (formattingRoot.hasChild()) {
                     auto formattingContext = LayoutContext::createFormattingContext(formattingRoot, layoutState());
                     if (formattingRoot.hasInFlowOrFloatingChild())
-                        formattingContext->layoutInFlowContent(invalidationState, geometry().constraintsForInFlowContent(formattingRoot));
+                        formattingContext->layoutInFlowContent(invalidationState, inlineFormattingGeometry().constraintsForInFlowContent(formattingRoot));
                     computeHeightAndMargin(formattingRoot, constraints.horizontal);
-                    formattingContext->layoutOutOfFlowContent(invalidationState, geometry().constraintsForOutOfFlowContent(formattingRoot));
+                    formattingContext->layoutOutOfFlowContent(invalidationState, inlineFormattingGeometry().constraintsForOutOfFlowContent(formattingRoot));
                 } else
                     computeHeightAndMargin(formattingRoot, constraints.horizontal);
             } else {
@@ -208,7 +208,7 @@
         if (!lineContentRange.isEmpty()) {
             ASSERT(needsLayoutRange.start < lineContentRange.end);
             isFirstLine = false;
-            lineLogicalTop = geometry().logicalTopForNextLine(lineContent, lineLogicalRect.bottom(), floatingContext);
+            lineLogicalTop = inlineFormattingGeometry().logicalTopForNextLine(lineContent, lineLogicalRect.bottom(), floatingContext);
             if (lineContent.isLastLineWithInlineContent) {
                 // The final content height of this inline formatting context should include the cleared floats as well.
                 formattingState.setClearGapAfterLastLine(lineLogicalTop - lineLogicalRect.bottom());
@@ -249,7 +249,7 @@
     ASSERT(!formattingState().intrinsicWidthConstraints());
 
     if (!root().hasInFlowOrFloatingChild()) {
-        auto constraints = geometry().constrainByMinMaxWidth(root(), { });
+        auto constraints = inlineFormattingGeometry().constrainByMinMaxWidth(root(), { });
         formattingState().setIntrinsicWidthConstraints(constraints);
         return constraints;
     }
@@ -296,7 +296,7 @@
 
     auto minimumContentWidth = ceiledLayoutUnit(maximumLineWidth(0));
     auto maximumContentWidth = ceiledLayoutUnit(maximumLineWidth(maxInlineLayoutUnit()));
-    auto constraints = geometry().constrainByMinMaxWidth(root(), { minimumContentWidth, maximumContentWidth });
+    auto constraints = inlineFormattingGeometry().constrainByMinMaxWidth(root(), { minimumContentWidth, maximumContentWidth });
     formattingState().setIntrinsicWidthConstraints(constraints);
     return constraints;
 }
@@ -323,7 +323,7 @@
 {
     ASSERT(formattingRoot.establishesFormattingContext());
     auto constraints = IntrinsicWidthConstraints { };
-    if (auto fixedWidth = geometry().fixedValue(formattingRoot.style().logicalWidth()))
+    if (auto fixedWidth = inlineFormattingGeometry().fixedValue(formattingRoot.style().logicalWidth()))
         constraints = { *fixedWidth, *fixedWidth };
     else {
         auto hasInflowOrFloatingContent = is<ContainerBox>(formattingRoot) && downcast<ContainerBox>(formattingRoot).hasInFlowOrFloatingChild();
@@ -332,7 +332,7 @@
         if (hasInflowOrFloatingContent && !shouldIgnoreChildContent)
             constraints = LayoutContext::createFormattingContext(downcast<ContainerBox>(formattingRoot), layoutState())->computedIntrinsicWidthConstraints();
     }
-    constraints = geometry().constrainByMinMaxWidth(formattingRoot, constraints);
+    constraints = inlineFormattingGeometry().constrainByMinMaxWidth(formattingRoot, constraints);
     constraints.expand(geometryForBox(formattingRoot).horizontalMarginBorderAndPadding());
     formattingState().setIntrinsicWidthConstraintsForBox(formattingRoot, constraints);
 }
@@ -339,7 +339,7 @@
 
 void InlineFormattingContext::computeHorizontalMargin(const Box& layoutBox, const HorizontalConstraints& horizontalConstraints)
 {
-    auto computedHorizontalMargin = geometry().computedHorizontalMargin(layoutBox, horizontalConstraints);
+    auto computedHorizontalMargin = inlineFormattingGeometry().computedHorizontalMargin(layoutBox, horizontalConstraints);
     formattingState().boxGeometry(layoutBox).setHorizontalMargin({ computedHorizontalMargin.start.valueOr(0), computedHorizontalMargin.end.valueOr(0) });
 }
 
@@ -347,11 +347,11 @@
 {
     auto compute = [&](Optional<LayoutUnit> usedWidth) {
         if (layoutBox.isFloatingPositioned())
-            return geometry().floatingContentWidthAndMargin(layoutBox, horizontalConstraints, { usedWidth, { } });
+            return inlineFormattingGeometry().floatingContentWidthAndMargin(layoutBox, horizontalConstraints, { usedWidth, { } });
         if (layoutBox.isInlineBlockBox())
-            return geometry().inlineBlockContentWidthAndMargin(layoutBox, horizontalConstraints, { usedWidth, { } });
+            return inlineFormattingGeometry().inlineBlockContentWidthAndMargin(layoutBox, horizontalConstraints, { usedWidth, { } });
         if (layoutBox.isReplacedBox())
-            return geometry().inlineReplacedContentWidthAndMargin(downcast<ReplacedBox>(layoutBox), horizontalConstraints, { }, { usedWidth, { } });
+            return inlineFormattingGeometry().inlineReplacedContentWidthAndMargin(downcast<ReplacedBox>(layoutBox), horizontalConstraints, { }, { usedWidth, { } });
         ASSERT_NOT_REACHED();
         return ContentWidthAndMargin { };
     };
@@ -359,13 +359,13 @@
     auto contentWidthAndMargin = compute({ });
 
     auto availableWidth = horizontalConstraints.logicalWidth;
-    if (auto maxWidth = geometry().computedMaxWidth(layoutBox, availableWidth)) {
+    if (auto maxWidth = inlineFormattingGeometry().computedMaxWidth(layoutBox, availableWidth)) {
         auto maxWidthAndMargin = compute(maxWidth);
         if (contentWidthAndMargin.contentWidth > maxWidthAndMargin.contentWidth)
             contentWidthAndMargin = maxWidthAndMargin;
     }
 
-    auto minWidth = geometry().computedMinWidth(layoutBox, availableWidth).valueOr(0);
+    auto minWidth = inlineFormattingGeometry().computedMinWidth(layoutBox, availableWidth).valueOr(0);
     auto minWidthAndMargin = compute(minWidth);
     if (contentWidthAndMargin.contentWidth < minWidthAndMargin.contentWidth)
         contentWidthAndMargin = minWidthAndMargin;
@@ -379,23 +379,23 @@
 {
     auto compute = [&](Optional<LayoutUnit> usedHeight) {
         if (layoutBox.isFloatingPositioned())
-            return geometry().floatingContentHeightAndMargin(layoutBox, horizontalConstraints, { usedHeight });
+            return inlineFormattingGeometry().floatingContentHeightAndMargin(layoutBox, horizontalConstraints, { usedHeight });
         if (layoutBox.isInlineBlockBox())
-            return geometry().inlineBlockContentHeightAndMargin(layoutBox, horizontalConstraints, { usedHeight });
+            return inlineFormattingGeometry().inlineBlockContentHeightAndMargin(layoutBox, horizontalConstraints, { usedHeight });
         if (layoutBox.isReplacedBox())
-            return geometry().inlineReplacedContentHeightAndMargin(downcast<ReplacedBox>(layoutBox), horizontalConstraints, { }, { usedHeight });
+            return inlineFormattingGeometry().inlineReplacedContentHeightAndMargin(downcast<ReplacedBox>(layoutBox), horizontalConstraints, { }, { usedHeight });
         ASSERT_NOT_REACHED();
         return ContentHeightAndMargin { };
     };
 
     auto contentHeightAndMargin = compute({ });
-    if (auto maxHeight = geometry().computedMaxHeight(layoutBox)) {
+    if (auto maxHeight = inlineFormattingGeometry().computedMaxHeight(layoutBox)) {
         auto maxHeightAndMargin = compute(maxHeight);
         if (contentHeightAndMargin.contentHeight > maxHeightAndMargin.contentHeight)
             contentHeightAndMargin = maxHeightAndMargin;
     }
 
-    if (auto minHeight = geometry().computedMinHeight(layoutBox)) {
+    if (auto minHeight = inlineFormattingGeometry().computedMinHeight(layoutBox)) {
         auto minHeightAndMargin = compute(minHeight);
         if (contentHeightAndMargin.contentHeight < minHeightAndMargin.contentHeight)
             contentHeightAndMargin = minHeightAndMargin;
@@ -456,9 +456,9 @@
 InlineRect InlineFormattingContext::computeGeometryForLineContent(const LineBuilder::LineContent& lineContent, const HorizontalConstraints& horizontalConstraints)
 {
     auto& formattingState = this->formattingState();
-    auto geometry = this->geometry();
+    auto formattingGeometry = inlineFormattingGeometry();
 
-    formattingState.addLineBox(geometry.lineBoxForLineContent(lineContent));
+    formattingState.addLineBox(formattingGeometry.lineBoxForLineContent(lineContent));
     const auto& lineBox = formattingState.lineBoxes().last();
     auto lineIndex = formattingState.lines().size();
     auto& lineBoxLogicalRect = lineBox.logicalRect();
@@ -527,7 +527,7 @@
                 // Note that inline boxes are relative to the line and their top position can be negative.
                 borderBoxLogicalTopLeft.moveBy(lineBoxLogicalRect.topLeft());
                 if (layoutBox.isInFlowPositioned())
-                    borderBoxLogicalTopLeft += geometry.inFlowPositionedPositionOffset(layoutBox, horizontalConstraints);
+                    borderBoxLogicalTopLeft += formattingGeometry.inFlowPositionedPositionOffset(layoutBox, horizontalConstraints);
                 // Atomic inline boxes are all set. Their margin/border/content box geometries are already computed. We just have to position them here.
                 boxGeometry.setLogicalTopLeft(toLayoutPoint(borderBoxLogicalTopLeft));
 
@@ -612,7 +612,7 @@
     // FIXME: This is also where we would delete inline items if their content changed.
 }
 
-InlineFormattingGeometry InlineFormattingContext::geometry() const
+InlineFormattingGeometry InlineFormattingContext::inlineFormattingGeometry() const
 {
     return InlineFormattingGeometry(*this);
 }

Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h (277956 => 277957)


--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h	2021-05-24 18:08:10 UTC (rev 277957)
@@ -56,7 +56,7 @@
 private:
     IntrinsicWidthConstraints computedIntrinsicWidthConstraints() override;
 
-    InlineFormattingGeometry geometry() const;
+    InlineFormattingGeometry inlineFormattingGeometry() const;
 
     void lineLayout(InlineItems&, LineBuilder::InlineItemRange, const ConstraintsForInFlowContent&);
 

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


--- trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.cpp	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.cpp	2021-05-24 18:08:10 UTC (rev 277957)
@@ -173,13 +173,13 @@
         auto& rowBox = row.box();
         auto& rowBoxGeometry = formattingState().boxGeometry(rowBox);
 
-        rowBoxGeometry.setPadding(geometry().computedPadding(rowBox, availableHorizontalSpace));
+        rowBoxGeometry.setPadding(tableFormattingGeometry().computedPadding(rowBox, availableHorizontalSpace));
         // Internal table elements do not have margins.
         rowBoxGeometry.setHorizontalMargin({ });
         rowBoxGeometry.setVerticalMargin({ });
 
         auto computedRowBorder = [&] {
-            auto border = geometry().computedBorder(rowBox);
+            auto border = tableFormattingGeometry().computedBorder(rowBox);
             if (!grid.collapsedBorder())
                 return border;
             // Border collapsing delegates borders to table/cells.
@@ -280,13 +280,13 @@
 {
     ASSERT(cell.box().establishesBlockFormattingContext());
 
-    auto geometry = this->geometry();
+    auto formattingGeometry = tableFormattingGeometry();
     auto& grid = formattingState().tableGrid();
     auto& cellBox = cell.box();
     auto& cellBoxGeometry = formattingState().boxGeometry(cellBox);
 
-    cellBoxGeometry.setBorder(geometry.computedCellBorder(cell));
-    cellBoxGeometry.setPadding(geometry.computedPadding(cellBox, availableHorizontalSpace));
+    cellBoxGeometry.setBorder(formattingGeometry.computedCellBorder(cell));
+    cellBoxGeometry.setPadding(formattingGeometry.computedPadding(cellBox, availableHorizontalSpace));
     // Internal table elements do not have margins.
     cellBoxGeometry.setHorizontalMargin({ });
     cellBoxGeometry.setVerticalMargin({ });
@@ -303,7 +303,7 @@
     cellBoxGeometry.setContentBoxWidth(availableSpaceForContent);
 
     if (cellBox.hasInFlowOrFloatingChild()) {
-        auto constraintsForCellContent = geometry.constraintsForInFlowContent(cellBox);
+        auto constraintsForCellContent = formattingGeometry.constraintsForInFlowContent(cellBox);
         constraintsForCellContent.vertical.logicalHeight = availableVerticalSpaceForContent;
         auto invalidationState = InvalidationState { };
         // FIXME: This should probably be part of the invalidation state to indicate when we re-layout the cell
@@ -312,8 +312,8 @@
         floatingStateForCellContent.clear();
         LayoutContext::createFormattingContext(cellBox, layoutState())->layoutInFlowContent(invalidationState, constraintsForCellContent);
     }
-    auto contentBoxHeight = geometry.cellBoxContentHeight(cellBox);
-    if (auto computedHeight = geometry.computedHeight(cellBox)) {
+    auto contentBoxHeight = formattingGeometry.cellBoxContentHeight(cellBox);
+    if (auto computedHeight = formattingGeometry.computedHeight(cellBox)) {
         auto heightUsesBorderBox = layoutState().inQuirksMode() || cellBox.style().boxSizing() == BoxSizing::BorderBox;
         if (heightUsesBorderBox)
             *computedHeight -= cellBoxGeometry.verticalMarginBorderAndPadding();
@@ -407,7 +407,7 @@
 
         auto intrinsicWidth = formattingState.intrinsicWidthConstraintsForBox(cellBox);
         if (!intrinsicWidth) {
-            intrinsicWidth = geometry().intrinsicWidthConstraintsForCell(*cell);
+            intrinsicWidth = tableFormattingGeometry().intrinsicWidthConstraintsForCell(*cell);
             formattingState.setIntrinsicWidthConstraintsForBox(cellBox, *intrinsicWidth);
         }
         // Spanner cells put their intrinsic widths on the initial slots.
@@ -426,7 +426,7 @@
             }
             if (auto width = columnBox->columnWidth())
                 return width;
-            return geometry().computedColumnWidth(*columnBox);
+            return tableFormattingGeometry().computedColumnWidth(*columnBox);
         };
         fixedWidthColumns.append(fixedWidth());
     }
@@ -518,7 +518,7 @@
             // The minimum height of a row (without spanning-related height distribution) is defined as the height of an hypothetical
             // linebox containing the cells originating in the row.
             auto& cell = slot.cell();
-            cell.setBaseline(geometry().usedBaselineForCell(cell.box()));
+            cell.setBaseline(tableFormattingGeometry().usedBaselineForCell(cell.box()));
         }
     }
 
@@ -533,7 +533,7 @@
     }
 }
 
-TableFormattingGeometry TableFormattingContext::geometry() const
+TableFormattingGeometry TableFormattingContext::tableFormattingGeometry() const
 {
     return TableFormattingGeometry(*this, formattingState().tableGrid());
 }

Modified: trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.h (277956 => 277957)


--- trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.h	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.h	2021-05-24 18:08:10 UTC (rev 277957)
@@ -77,7 +77,7 @@
     IntrinsicWidthConstraints computedPreferredWidthForColumns();
     void computeAndDistributeExtraSpace(LayoutUnit availableHorizontalSpace, Optional<LayoutUnit> availableVerticalSpace);
 
-    TableFormattingGeometry geometry() const;
+    TableFormattingGeometry tableFormattingGeometry() const;
     const TableFormattingState& formattingState() const { return downcast<TableFormattingState>(FormattingContext::formattingState()); }
     TableFormattingState& formattingState() { return downcast<TableFormattingState>(FormattingContext::formattingState()); }
 };

Modified: trunk/Source/WebCore/layout/formattingContexts/table/TableLayout.cpp (277956 => 277957)


--- trunk/Source/WebCore/layout/formattingContexts/table/TableLayout.cpp	2021-05-24 17:11:36 UTC (rev 277956)
+++ trunk/Source/WebCore/layout/formattingContexts/table/TableLayout.cpp	2021-05-24 18:08:10 UTC (rev 277957)
@@ -272,7 +272,7 @@
         auto maximumColumnAscent = InlineLayoutUnit { };
         auto maximumColumnDescent = InlineLayoutUnit { };
         // Initial minimum height is the computed height if available <tr style="height: 100px"><td></td></tr>
-        rowHeight[rowIndex] = formattingContext().geometry().computedHeight(rows.list()[rowIndex].box(), availableVerticalSpace).valueOr(0_lu);
+        rowHeight[rowIndex] = formattingContext().tableFormattingGeometry().computedHeight(rows.list()[rowIndex].box(), availableVerticalSpace).valueOr(0_lu);
         for (size_t columnIndex = 0; columnIndex < columns.size(); ++columnIndex) {
             auto& slot = *m_grid.slot({ columnIndex, rowIndex });
             if (slot.isRowSpanned())
@@ -302,7 +302,7 @@
         if (slot.hasRowSpan())
             return GridSpace { formattingContext().geometryForBox(slot.cell().box()).borderBoxHeight(), formattingContext().geometryForBox(slot.cell().box()).borderBoxHeight() };
         auto& rows = m_grid.rows();
-        auto computedRowHeight = formattingContext().geometry().computedHeight(rows.list()[rowIndex].box(), { });
+        auto computedRowHeight = formattingContext().tableFormattingGeometry().computedHeight(rows.list()[rowIndex].box(), { });
         auto height = std::max<float>(rowHeight[rowIndex], computedRowHeight.valueOr(0_lu));
         return GridSpace { height, height };
     });
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to