Changeset 267076 in webkit


Ignore:
Timestamp:
Sep 14, 2020 10:52:14 PM (4 years ago)
Author:
Alan Bujtas
Message:

[LFC] Layout::BoxGeometry rename, part II.
https://bugs.webkit.org/show_bug.cgi?id=216523

Reviewed by Simon Fraser.

Rename Layout::Geometry to Layout::BoxGeometry (so that later we can introduce Layout::LineGeometry and Layout::RunGeometry) and
make sure we don't use displayBox as a variable name in Layout namespace.

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • layout/FormattingContext.cpp:

(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::computeBorderAndPadding):
(WebCore::Layout::FormattingContext::geometryForBox const):

  • layout/FormattingContext.h:
  • layout/FormattingContextGeometry.cpp:

(WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
(WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):

  • layout/FormattingContextQuirks.cpp:
  • layout/FormattingState.cpp:

(WebCore::Layout::FormattingState::boxGeometry):
(WebCore::Layout::FormattingState::displayBox): Deleted.

  • layout/FormattingState.h:
  • layout/LayoutContext.cpp:

(WebCore::Layout::LayoutContext::layout):
(WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):

  • layout/LayoutState.cpp:

(WebCore::Layout::LayoutState::geometryForRootBox):
(WebCore::Layout::LayoutState::ensureGeometryForBoxSlow):
(WebCore::Layout::LayoutState::geometryForRootLayoutBox): Deleted.
(WebCore::Layout::LayoutState::ensureDisplayBoxForLayoutBoxSlow): Deleted.

  • layout/LayoutState.h:

(WebCore::Layout::LayoutState::hasBoxGeometry const):
(WebCore::Layout::LayoutState::ensureGeometryForBox):
(WebCore::Layout::LayoutState::geometryForBox const):
(WebCore::Layout::Box::cachedGeometryForLayoutState const):
(WebCore::Layout::LayoutState::hasDisplayBox const): Deleted.
(WebCore::Layout::LayoutState::ensureGeometryForLayoutBox): Deleted.
(WebCore::Layout::LayoutState::geometryForLayoutBox const): Deleted.
(WebCore::Layout::Box::cachedDisplayBoxForLayoutState const): Deleted.

  • layout/Verification.cpp:

(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):

  • layout/blockformatting/BlockFormattingContext.cpp:

(WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
(WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
(WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):

  • layout/blockformatting/BlockFormattingContextGeometry.cpp:

(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):

  • layout/blockformatting/BlockFormattingContextQuirks.cpp:
  • layout/blockformatting/BlockMarginCollapse.cpp:

(WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const):

  • layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:

(WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
(WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
(WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox):

  • layout/display/DisplayLayerController.cpp:

(WebCore::Display::LayerController::prepareForDisplay):

  • layout/displaytree/DisplayPainter.cpp:

(WebCore::Display::paintBoxDecoration):
(WebCore::Display::Painter::absoluteBoxGeometry):
(WebCore::Display::paintSubtree):
(WebCore::Display::collectPaintRootsAndContentRect):
(WebCore::Display::Painter::absoluteDisplayBox): Deleted.

  • layout/displaytree/DisplayPainter.h:
  • layout/floats/FloatAvoider.h:
  • layout/floats/FloatingContext.cpp:

(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const):
(WebCore::Layout::FloatingContext::append):
(WebCore::Layout::FloatingContext::absoluteBoxGeometryCoordinates const):
(WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const): Deleted.

  • layout/floats/FloatingContext.h:
  • layout/floats/FloatingState.cpp:

(WebCore::Layout::FloatingState::FloatItem::FloatItem):

  • layout/floats/FloatingState.h:

(WebCore::Layout::FloatingState::FloatItem::rectWithMargin const):
(WebCore::Layout::FloatingState::FloatItem::horizontalMargin const):
(WebCore::Layout::FloatingState::FloatItem::bottom const):

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::lineLayout):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
(WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent): Deleted.

  • layout/inlineformatting/InlineFormattingContext.h:
  • layout/inlineformatting/InlineLineBox.h:
  • layout/inlineformatting/InlineLineBuilder.cpp:
  • layout/integration/LayoutIntegrationLineLayout.cpp:

(WebCore::LayoutIntegration::LineLayout::prepareFloatingState):

  • layout/layouttree/LayoutBox.cpp:

(WebCore::Layout::Box::setcachedGeometryForLayoutState const):
(WebCore::Layout::Box::setCachedDisplayBoxForLayoutState const): Deleted.

  • layout/layouttree/LayoutBox.h:
  • layout/layouttree/LayoutBoxGeometry.cpp: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.cpp.

(WebCore::Layout::BoxGeometry::BoxGeometry):
(WebCore::Layout::BoxGeometry::~BoxGeometry):
(WebCore::Layout::BoxGeometry::marginBox const):
(WebCore::Layout::BoxGeometry::borderBox const):
(WebCore::Layout::BoxGeometry::paddingBox const):
(WebCore::Layout::BoxGeometry::contentBox const):

  • layout/layouttree/LayoutBoxGeometry.h: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.h.

(WebCore::Layout::Rect::expandHorizontally):
(WebCore::Layout::Rect::expandVertically):
(WebCore::Layout::Rect::intersects const):
(WebCore::Layout::Rect::invalidateTop):
(WebCore::Layout::Rect::invalidateLeft):
(WebCore::Layout::Rect::invalidateWidth):
(WebCore::Layout::Rect::invalidateHeight):
(WebCore::Layout::Rect::hasValidPosition const):
(WebCore::Layout::Rect::hasValidSize const):
(WebCore::Layout::Rect::hasValidGeometry const):
(WebCore::Layout::Rect::Rect):
(WebCore::Layout::Rect::invalidatePosition):
(WebCore::Layout::Rect::setHasValidPosition):
(WebCore::Layout::Rect::setHasValidSize):
(WebCore::Layout::Rect::top const):
(WebCore::Layout::Rect::left const):
(WebCore::Layout::Rect::bottom const):
(WebCore::Layout::Rect::right const):
(WebCore::Layout::Rect::topLeft const):
(WebCore::Layout::Rect::bottomRight const):
(WebCore::Layout::Rect::size const):
(WebCore::Layout::Rect::width const):
(WebCore::Layout::Rect::height const):
(WebCore::Layout::Rect::setTopLeft):
(WebCore::Layout::Rect::setTop):
(WebCore::Layout::Rect::setLeft):
(WebCore::Layout::Rect::setWidth):
(WebCore::Layout::Rect::setHeight):
(WebCore::Layout::Rect::setSize):
(WebCore::Layout::Rect::shiftLeftTo):
(WebCore::Layout::Rect::shiftRightTo):
(WebCore::Layout::Rect::shiftTopTo):
(WebCore::Layout::Rect::shiftBottomTo):
(WebCore::Layout::Rect::moveHorizontally):
(WebCore::Layout::Rect::moveVertically):
(WebCore::Layout::Rect::expand):
(WebCore::Layout::Rect::clone const):
(WebCore::Layout::Rect::operator LayoutRect const):
(WebCore::Layout::BoxGeometry::bottom const):
(WebCore::Layout::BoxGeometry::right const):
(WebCore::Layout::BoxGeometry::bottomRight const):
(WebCore::Layout::BoxGeometry::size const):
(WebCore::Layout::BoxGeometry::width const):
(WebCore::Layout::BoxGeometry::height const):
(WebCore::Layout::BoxGeometry::isEmpty const):
(WebCore::Layout::BoxGeometry::rect const):
(WebCore::Layout::BoxGeometry::rectWithMargin const):
(WebCore::Layout::BoxGeometry::hasClearance const):
(WebCore::Layout::BoxGeometry::verticalBorder const):
(WebCore::Layout::BoxGeometry::horizontalBorder const):
(WebCore::Layout::BoxGeometry::contentBoxTop const):
(WebCore::Layout::BoxGeometry::contentBoxLeft const):
(WebCore::Layout::BoxGeometry::contentBoxBottom const):
(WebCore::Layout::BoxGeometry::contentBoxRight const):
(WebCore::Layout::BoxGeometry::paddingBoxTop const):
(WebCore::Layout::BoxGeometry::paddingBoxLeft const):
(WebCore::Layout::BoxGeometry::paddingBoxBottom const):
(WebCore::Layout::BoxGeometry::paddingBoxRight const):
(WebCore::Layout::BoxGeometry::paddingBoxHeight const):
(WebCore::Layout::BoxGeometry::paddingBoxWidth const):
(WebCore::Layout::BoxGeometry::borderBoxHeight const):
(WebCore::Layout::BoxGeometry::borderBoxWidth const):
(WebCore::Layout::BoxGeometry::marginBoxHeight const):
(WebCore::Layout::BoxGeometry::marginBoxWidth const):
(WebCore::Layout::BoxGeometry::verticalMarginBorderAndPadding const):
(WebCore::Layout::BoxGeometry::horizontalMarginBorderAndPadding const):
(WebCore::Layout::BoxGeometry::setHasPrecomputedMarginBefore):
(WebCore::Layout::BoxGeometry::moveHorizontally):
(WebCore::Layout::BoxGeometry::moveVertically):
(WebCore::Layout::BoxGeometry::move):
(WebCore::Layout::BoxGeometry::moveBy):
(WebCore::Layout::BoxGeometry::setHasClearance):
(WebCore::Layout::BoxGeometry::invalidateBorder):
(WebCore::Layout::BoxGeometry::invalidatePadding):
(WebCore::Layout::BoxGeometry::invalidatePrecomputedMarginBefore):
(WebCore::Layout::BoxGeometry::setHasValidTop):
(WebCore::Layout::BoxGeometry::setHasValidLeft):
(WebCore::Layout::BoxGeometry::setHasValidVerticalMargin):
(WebCore::Layout::BoxGeometry::setHasValidHorizontalMargin):
(WebCore::Layout::BoxGeometry::setHasValidBorder):
(WebCore::Layout::BoxGeometry::setHasValidPadding):
(WebCore::Layout::BoxGeometry::setHasValidContentHeight):
(WebCore::Layout::BoxGeometry::setHasValidContentWidth):
(WebCore::Layout::BoxGeometry::invalidateMargin):
(WebCore::Layout::BoxGeometry::top const):
(WebCore::Layout::BoxGeometry::left const):
(WebCore::Layout::BoxGeometry::topLeft const):
(WebCore::Layout::BoxGeometry::setTopLeft):
(WebCore::Layout::BoxGeometry::setTop):
(WebCore::Layout::BoxGeometry::setLeft):
(WebCore::Layout::BoxGeometry::setContentBoxHeight):
(WebCore::Layout::BoxGeometry::setContentBoxWidth):
(WebCore::Layout::BoxGeometry::contentBoxHeight const):
(WebCore::Layout::BoxGeometry::contentBoxWidth const):
(WebCore::Layout::BoxGeometry::setHorizontalMargin):
(WebCore::Layout::BoxGeometry::setVerticalMargin):
(WebCore::Layout::BoxGeometry::setBorder):
(WebCore::Layout::BoxGeometry::setPadding):
(WebCore::Layout::BoxGeometry::setVerticalPadding):
(WebCore::Layout::BoxGeometry::verticalMargin const):
(WebCore::Layout::BoxGeometry::horizontalMargin const):
(WebCore::Layout::BoxGeometry::marginBefore const):
(WebCore::Layout::BoxGeometry::marginStart const):
(WebCore::Layout::BoxGeometry::marginAfter const):
(WebCore::Layout::BoxGeometry::marginEnd const):
(WebCore::Layout::BoxGeometry::paddingTop const):
(WebCore::Layout::BoxGeometry::paddingLeft const):
(WebCore::Layout::BoxGeometry::paddingBottom const):
(WebCore::Layout::BoxGeometry::paddingRight const):
(WebCore::Layout::BoxGeometry::verticalPadding const):
(WebCore::Layout::BoxGeometry::horizontalPadding const):
(WebCore::Layout::BoxGeometry::borderTop const):
(WebCore::Layout::BoxGeometry::borderLeft const):
(WebCore::Layout::BoxGeometry::borderBottom const):
(WebCore::Layout::BoxGeometry::borderRight const):

  • layout/layouttree/LayoutTreeBuilder.cpp:

(WebCore::Layout::outputLayoutBox):
(WebCore::Layout::outputLayoutTree):
(WebCore::Layout::showLayoutTree):

  • layout/tableformatting/TableFormattingContext.cpp:

(WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
(WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
(WebCore::Layout::TableFormattingContext::setUsedGeometryForSections):
(WebCore::Layout::TableFormattingContext::layoutCell):

  • layout/tableformatting/TableFormattingContextGeometry.cpp:
  • layout/tableformatting/TableLayout.cpp:
  • page/FrameViewLayoutContext.cpp:

(WebCore::FrameViewLayoutContext::layoutUsingFormattingContext):

Location:
trunk/Source/WebCore
Files:
38 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r267074 r267076  
     12020-09-14  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Layout::BoxGeometry rename, part II.
     4        https://bugs.webkit.org/show_bug.cgi?id=216523
     5
     6        Reviewed by Simon Fraser.
     7
     8        Rename Layout::Geometry to Layout::BoxGeometry (so that later we can introduce Layout::LineGeometry and Layout::RunGeometry) and
     9        make sure we don't use displayBox as a variable name in Layout namespace.
     10
     11        * Sources.txt:
     12        * WebCore.xcodeproj/project.pbxproj:
     13        * layout/FormattingContext.cpp:
     14        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
     15        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
     16        (WebCore::Layout::FormattingContext::computeBorderAndPadding):
     17        (WebCore::Layout::FormattingContext::geometryForBox const):
     18        * layout/FormattingContext.h:
     19        * layout/FormattingContextGeometry.cpp:
     20        (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
     21        (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
     22        * layout/FormattingContextQuirks.cpp:
     23        * layout/FormattingState.cpp:
     24        (WebCore::Layout::FormattingState::boxGeometry):
     25        (WebCore::Layout::FormattingState::displayBox): Deleted.
     26        * layout/FormattingState.h:
     27        * layout/LayoutContext.cpp:
     28        (WebCore::Layout::LayoutContext::layout):
     29        (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
     30        * layout/LayoutState.cpp:
     31        (WebCore::Layout::LayoutState::geometryForRootBox):
     32        (WebCore::Layout::LayoutState::ensureGeometryForBoxSlow):
     33        (WebCore::Layout::LayoutState::geometryForRootLayoutBox): Deleted.
     34        (WebCore::Layout::LayoutState::ensureDisplayBoxForLayoutBoxSlow): Deleted.
     35        * layout/LayoutState.h:
     36        (WebCore::Layout::LayoutState::hasBoxGeometry const):
     37        (WebCore::Layout::LayoutState::ensureGeometryForBox):
     38        (WebCore::Layout::LayoutState::geometryForBox const):
     39        (WebCore::Layout::Box::cachedGeometryForLayoutState const):
     40        (WebCore::Layout::LayoutState::hasDisplayBox const): Deleted.
     41        (WebCore::Layout::LayoutState::ensureGeometryForLayoutBox): Deleted.
     42        (WebCore::Layout::LayoutState::geometryForLayoutBox const): Deleted.
     43        (WebCore::Layout::Box::cachedDisplayBoxForLayoutState const): Deleted.
     44        * layout/Verification.cpp:
     45        (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
     46        * layout/blockformatting/BlockFormattingContext.cpp:
     47        (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
     48        (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
     49        (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
     50        (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors):
     51        (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
     52        (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear):
     53        (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
     54        (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
     55        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
     56        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
     57        * layout/blockformatting/BlockFormattingContextQuirks.cpp:
     58        * layout/blockformatting/BlockMarginCollapse.cpp:
     59        (WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const):
     60        * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
     61        (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
     62        (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
     63        (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox):
     64        * layout/display/DisplayLayerController.cpp:
     65        (WebCore::Display::LayerController::prepareForDisplay):
     66        * layout/displaytree/DisplayPainter.cpp:
     67        (WebCore::Display::paintBoxDecoration):
     68        (WebCore::Display::Painter::absoluteBoxGeometry):
     69        (WebCore::Display::paintSubtree):
     70        (WebCore::Display::collectPaintRootsAndContentRect):
     71        (WebCore::Display::Painter::absoluteDisplayBox): Deleted.
     72        * layout/displaytree/DisplayPainter.h:
     73        * layout/floats/FloatAvoider.h:
     74        * layout/floats/FloatingContext.cpp:
     75        (WebCore::Layout::FloatingContext::positionForFloat const):
     76        (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const):
     77        (WebCore::Layout::FloatingContext::append):
     78        (WebCore::Layout::FloatingContext::absoluteBoxGeometryCoordinates const):
     79        (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const): Deleted.
     80        * layout/floats/FloatingContext.h:
     81        * layout/floats/FloatingState.cpp:
     82        (WebCore::Layout::FloatingState::FloatItem::FloatItem):
     83        * layout/floats/FloatingState.h:
     84        (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const):
     85        (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const):
     86        (WebCore::Layout::FloatingState::FloatItem::bottom const):
     87        * layout/inlineformatting/InlineFormattingContext.cpp:
     88        (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
     89        (WebCore::Layout::InlineFormattingContext::lineLayout):
     90        (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
     91        (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
     92        (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
     93        (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
     94        (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
     95        (WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent): Deleted.
     96        * layout/inlineformatting/InlineFormattingContext.h:
     97        * layout/inlineformatting/InlineLineBox.h:
     98        * layout/inlineformatting/InlineLineBuilder.cpp:
     99        * layout/integration/LayoutIntegrationLineLayout.cpp:
     100        (WebCore::LayoutIntegration::LineLayout::prepareFloatingState):
     101        * layout/layouttree/LayoutBox.cpp:
     102        (WebCore::Layout::Box::setcachedGeometryForLayoutState const):
     103        (WebCore::Layout::Box::setCachedDisplayBoxForLayoutState const): Deleted.
     104        * layout/layouttree/LayoutBox.h:
     105        * layout/layouttree/LayoutBoxGeometry.cpp: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.cpp.
     106        (WebCore::Layout::BoxGeometry::BoxGeometry):
     107        (WebCore::Layout::BoxGeometry::~BoxGeometry):
     108        (WebCore::Layout::BoxGeometry::marginBox const):
     109        (WebCore::Layout::BoxGeometry::borderBox const):
     110        (WebCore::Layout::BoxGeometry::paddingBox const):
     111        (WebCore::Layout::BoxGeometry::contentBox const):
     112        * layout/layouttree/LayoutBoxGeometry.h: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.h.
     113        (WebCore::Layout::Rect::expandHorizontally):
     114        (WebCore::Layout::Rect::expandVertically):
     115        (WebCore::Layout::Rect::intersects const):
     116        (WebCore::Layout::Rect::invalidateTop):
     117        (WebCore::Layout::Rect::invalidateLeft):
     118        (WebCore::Layout::Rect::invalidateWidth):
     119        (WebCore::Layout::Rect::invalidateHeight):
     120        (WebCore::Layout::Rect::hasValidPosition const):
     121        (WebCore::Layout::Rect::hasValidSize const):
     122        (WebCore::Layout::Rect::hasValidGeometry const):
     123        (WebCore::Layout::Rect::Rect):
     124        (WebCore::Layout::Rect::invalidatePosition):
     125        (WebCore::Layout::Rect::setHasValidPosition):
     126        (WebCore::Layout::Rect::setHasValidSize):
     127        (WebCore::Layout::Rect::top const):
     128        (WebCore::Layout::Rect::left const):
     129        (WebCore::Layout::Rect::bottom const):
     130        (WebCore::Layout::Rect::right const):
     131        (WebCore::Layout::Rect::topLeft const):
     132        (WebCore::Layout::Rect::bottomRight const):
     133        (WebCore::Layout::Rect::size const):
     134        (WebCore::Layout::Rect::width const):
     135        (WebCore::Layout::Rect::height const):
     136        (WebCore::Layout::Rect::setTopLeft):
     137        (WebCore::Layout::Rect::setTop):
     138        (WebCore::Layout::Rect::setLeft):
     139        (WebCore::Layout::Rect::setWidth):
     140        (WebCore::Layout::Rect::setHeight):
     141        (WebCore::Layout::Rect::setSize):
     142        (WebCore::Layout::Rect::shiftLeftTo):
     143        (WebCore::Layout::Rect::shiftRightTo):
     144        (WebCore::Layout::Rect::shiftTopTo):
     145        (WebCore::Layout::Rect::shiftBottomTo):
     146        (WebCore::Layout::Rect::moveHorizontally):
     147        (WebCore::Layout::Rect::moveVertically):
     148        (WebCore::Layout::Rect::expand):
     149        (WebCore::Layout::Rect::clone const):
     150        (WebCore::Layout::Rect::operator LayoutRect const):
     151        (WebCore::Layout::BoxGeometry::bottom const):
     152        (WebCore::Layout::BoxGeometry::right const):
     153        (WebCore::Layout::BoxGeometry::bottomRight const):
     154        (WebCore::Layout::BoxGeometry::size const):
     155        (WebCore::Layout::BoxGeometry::width const):
     156        (WebCore::Layout::BoxGeometry::height const):
     157        (WebCore::Layout::BoxGeometry::isEmpty const):
     158        (WebCore::Layout::BoxGeometry::rect const):
     159        (WebCore::Layout::BoxGeometry::rectWithMargin const):
     160        (WebCore::Layout::BoxGeometry::hasClearance const):
     161        (WebCore::Layout::BoxGeometry::verticalBorder const):
     162        (WebCore::Layout::BoxGeometry::horizontalBorder const):
     163        (WebCore::Layout::BoxGeometry::contentBoxTop const):
     164        (WebCore::Layout::BoxGeometry::contentBoxLeft const):
     165        (WebCore::Layout::BoxGeometry::contentBoxBottom const):
     166        (WebCore::Layout::BoxGeometry::contentBoxRight const):
     167        (WebCore::Layout::BoxGeometry::paddingBoxTop const):
     168        (WebCore::Layout::BoxGeometry::paddingBoxLeft const):
     169        (WebCore::Layout::BoxGeometry::paddingBoxBottom const):
     170        (WebCore::Layout::BoxGeometry::paddingBoxRight const):
     171        (WebCore::Layout::BoxGeometry::paddingBoxHeight const):
     172        (WebCore::Layout::BoxGeometry::paddingBoxWidth const):
     173        (WebCore::Layout::BoxGeometry::borderBoxHeight const):
     174        (WebCore::Layout::BoxGeometry::borderBoxWidth const):
     175        (WebCore::Layout::BoxGeometry::marginBoxHeight const):
     176        (WebCore::Layout::BoxGeometry::marginBoxWidth const):
     177        (WebCore::Layout::BoxGeometry::verticalMarginBorderAndPadding const):
     178        (WebCore::Layout::BoxGeometry::horizontalMarginBorderAndPadding const):
     179        (WebCore::Layout::BoxGeometry::setHasPrecomputedMarginBefore):
     180        (WebCore::Layout::BoxGeometry::moveHorizontally):
     181        (WebCore::Layout::BoxGeometry::moveVertically):
     182        (WebCore::Layout::BoxGeometry::move):
     183        (WebCore::Layout::BoxGeometry::moveBy):
     184        (WebCore::Layout::BoxGeometry::setHasClearance):
     185        (WebCore::Layout::BoxGeometry::invalidateBorder):
     186        (WebCore::Layout::BoxGeometry::invalidatePadding):
     187        (WebCore::Layout::BoxGeometry::invalidatePrecomputedMarginBefore):
     188        (WebCore::Layout::BoxGeometry::setHasValidTop):
     189        (WebCore::Layout::BoxGeometry::setHasValidLeft):
     190        (WebCore::Layout::BoxGeometry::setHasValidVerticalMargin):
     191        (WebCore::Layout::BoxGeometry::setHasValidHorizontalMargin):
     192        (WebCore::Layout::BoxGeometry::setHasValidBorder):
     193        (WebCore::Layout::BoxGeometry::setHasValidPadding):
     194        (WebCore::Layout::BoxGeometry::setHasValidContentHeight):
     195        (WebCore::Layout::BoxGeometry::setHasValidContentWidth):
     196        (WebCore::Layout::BoxGeometry::invalidateMargin):
     197        (WebCore::Layout::BoxGeometry::top const):
     198        (WebCore::Layout::BoxGeometry::left const):
     199        (WebCore::Layout::BoxGeometry::topLeft const):
     200        (WebCore::Layout::BoxGeometry::setTopLeft):
     201        (WebCore::Layout::BoxGeometry::setTop):
     202        (WebCore::Layout::BoxGeometry::setLeft):
     203        (WebCore::Layout::BoxGeometry::setContentBoxHeight):
     204        (WebCore::Layout::BoxGeometry::setContentBoxWidth):
     205        (WebCore::Layout::BoxGeometry::contentBoxHeight const):
     206        (WebCore::Layout::BoxGeometry::contentBoxWidth const):
     207        (WebCore::Layout::BoxGeometry::setHorizontalMargin):
     208        (WebCore::Layout::BoxGeometry::setVerticalMargin):
     209        (WebCore::Layout::BoxGeometry::setBorder):
     210        (WebCore::Layout::BoxGeometry::setPadding):
     211        (WebCore::Layout::BoxGeometry::setVerticalPadding):
     212        (WebCore::Layout::BoxGeometry::verticalMargin const):
     213        (WebCore::Layout::BoxGeometry::horizontalMargin const):
     214        (WebCore::Layout::BoxGeometry::marginBefore const):
     215        (WebCore::Layout::BoxGeometry::marginStart const):
     216        (WebCore::Layout::BoxGeometry::marginAfter const):
     217        (WebCore::Layout::BoxGeometry::marginEnd const):
     218        (WebCore::Layout::BoxGeometry::paddingTop const):
     219        (WebCore::Layout::BoxGeometry::paddingLeft const):
     220        (WebCore::Layout::BoxGeometry::paddingBottom const):
     221        (WebCore::Layout::BoxGeometry::paddingRight const):
     222        (WebCore::Layout::BoxGeometry::verticalPadding const):
     223        (WebCore::Layout::BoxGeometry::horizontalPadding const):
     224        (WebCore::Layout::BoxGeometry::borderTop const):
     225        (WebCore::Layout::BoxGeometry::borderLeft const):
     226        (WebCore::Layout::BoxGeometry::borderBottom const):
     227        (WebCore::Layout::BoxGeometry::borderRight const):
     228        * layout/layouttree/LayoutTreeBuilder.cpp:
     229        (WebCore::Layout::outputLayoutBox):
     230        (WebCore::Layout::outputLayoutTree):
     231        (WebCore::Layout::showLayoutTree):
     232        * layout/tableformatting/TableFormattingContext.cpp:
     233        (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
     234        (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
     235        (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections):
     236        (WebCore::Layout::TableFormattingContext::layoutCell):
     237        * layout/tableformatting/TableFormattingContextGeometry.cpp:
     238        * layout/tableformatting/TableLayout.cpp:
     239        * page/FrameViewLayoutContext.cpp:
     240        (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext):
     241
    12422020-09-14  Ryosuke Niwa  <rniwa@webkit.org>
    2243
  • trunk/Source/WebCore/Sources.txt

    r267054 r267076  
    14601460layout/layouttree/LayoutBox.cpp
    14611461layout/layouttree/LayoutContainerBox.cpp
    1462 layout/layouttree/LayoutGeometry.cpp
     1462layout/layouttree/LayoutBoxGeometry.cpp
    14631463layout/layouttree/LayoutInitialContainingBlock.cpp
    14641464layout/layouttree/LayoutInlineTextBox.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r267054 r267076  
    60626062                0FEF20CD1BD4A24100128E5D /* LengthSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthSize.cpp; sourceTree = "<group>"; };
    60636063                0FEF20CF1BD4A64F00128E5D /* RenderStyleConstants.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderStyleConstants.cpp; sourceTree = "<group>"; };
    6064                 0FF29A5325101A61003C34E2 /* LayoutGeometry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutGeometry.h; sourceTree = "<group>"; };
    6065                 0FF29A5525101A61003C34E2 /* LayoutGeometry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutGeometry.cpp; sourceTree = "<group>"; };
     6064                0FF29A5325101A61003C34E2 /* LayoutBoxGeometry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutBoxGeometry.h; sourceTree = "<group>"; };
     6065                0FF29A5525101A61003C34E2 /* LayoutBoxGeometry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutBoxGeometry.cpp; sourceTree = "<group>"; };
    60666066                0FF2E80C1EE0D430009EABD4 /* PerformanceLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceLoggingClient.cpp; sourceTree = "<group>"; };
    60676067                0FF3B9241EE3B6DE00B84144 /* JSDOMQuad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMQuad.cpp; sourceTree = "<group>"; };
     
    1748017480                                115CFA96208B952B001E6991 /* LayoutBox.cpp */,
    1748117481                                115CFA95208B952B001E6991 /* LayoutBox.h */,
     17482                                0FF29A5525101A61003C34E2 /* LayoutBoxGeometry.cpp */,
     17483                                0FF29A5325101A61003C34E2 /* LayoutBoxGeometry.h */,
    1748217484                                11100FC920927CBC0081AA6C /* LayoutChildIterator.h */,
    1748317485                                1199FA45208E35A3002358CC /* LayoutContainerBox.cpp */,
    1748417486                                1199FA44208E35A3002358CC /* LayoutContainerBox.h */,
    1748517487                                11B042FB20B0E21400828A6B /* LayoutDescendantIterator.h */,
    17486                                 0FF29A5525101A61003C34E2 /* LayoutGeometry.cpp */,
    17487                                 0FF29A5325101A61003C34E2 /* LayoutGeometry.h */,
    1748817488                                6FB0ED112427B6C6002737E6 /* LayoutInitialContainingBlock.cpp */,
    1748917489                                6F6383F42427AF4900DABA53 /* LayoutInitialContainingBlock.h */,
  • trunk/Source/WebCore/layout/FormattingContext.cpp

    r267054 r267076  
    3232#include "InvalidationState.h"
    3333#include "LayoutBox.h"
     34#include "LayoutBoxGeometry.h"
    3435#include "LayoutContainerBox.h"
    3536#include "LayoutContext.h"
    3637#include "LayoutDescendantIterator.h"
    37 #include "LayoutGeometry.h"
    3838#include "LayoutInitialContainingBlock.h"
    3939#include "LayoutReplacedBox.h"
     
    9191    }
    9292
    93     auto& displayBox = formattingState().displayBox(layoutBox);
    94     displayBox.setLeft(horizontalGeometry.left + horizontalGeometry.contentWidthAndMargin.usedMargin.start);
    95     displayBox.setContentBoxWidth(horizontalGeometry.contentWidthAndMargin.contentWidth);
     93    auto& boxGeometry = formattingState().boxGeometry(layoutBox);
     94    boxGeometry.setLeft(horizontalGeometry.left + horizontalGeometry.contentWidthAndMargin.usedMargin.start);
     95    boxGeometry.setContentBoxWidth(horizontalGeometry.contentWidthAndMargin.contentWidth);
    9696    auto& usedHorizontalMargin = horizontalGeometry.contentWidthAndMargin.usedMargin;
    97     displayBox.setHorizontalMargin({ usedHorizontalMargin.start, usedHorizontalMargin.end });
     97    boxGeometry.setHorizontalMargin({ usedHorizontalMargin.start, usedHorizontalMargin.end });
    9898}
    9999
     
    119119    }
    120120
    121     auto& displayBox = formattingState().displayBox(layoutBox);
     121    auto& boxGeometry = formattingState().boxGeometry(layoutBox);
    122122    auto nonCollapsedVerticalMargin = verticalGeometry.contentHeightAndMargin.nonCollapsedMargin;
    123     displayBox.setTop(verticalGeometry.top + nonCollapsedVerticalMargin.before);
    124     displayBox.setContentBoxHeight(verticalGeometry.contentHeightAndMargin.contentHeight);
     123    boxGeometry.setTop(verticalGeometry.top + nonCollapsedVerticalMargin.before);
     124    boxGeometry.setContentBoxHeight(verticalGeometry.contentHeightAndMargin.contentHeight);
    125125    // Margins of absolutely positioned boxes do not collapse.
    126     displayBox.setVerticalMargin({ nonCollapsedVerticalMargin.before, nonCollapsedVerticalMargin.after });
     126    boxGeometry.setVerticalMargin({ nonCollapsedVerticalMargin.before, nonCollapsedVerticalMargin.after });
    127127}
    128128
    129129void FormattingContext::computeBorderAndPadding(const Box& layoutBox, const HorizontalConstraints& horizontalConstraint)
    130130{
    131     auto& displayBox = formattingState().displayBox(layoutBox);
    132     displayBox.setBorder(geometry().computedBorder(layoutBox));
    133     displayBox.setPadding(geometry().computedPadding(layoutBox, horizontalConstraint.logicalWidth));
     131    auto& boxGeometry = formattingState().boxGeometry(layoutBox);
     132    boxGeometry.setBorder(geometry().computedBorder(layoutBox));
     133    boxGeometry.setPadding(geometry().computedPadding(layoutBox, horizontalConstraint.logicalWidth));
    134134}
    135135
     
    169169}
    170170
    171 const Layout::Geometry& FormattingContext::geometryForBox(const Box& layoutBox, Optional<EscapeReason> escapeReason) const
     171const BoxGeometry& FormattingContext::geometryForBox(const Box& layoutBox, Optional<EscapeReason> escapeReason) const
    172172{
    173173    UNUSED_PARAM(escapeReason);
    174174#if ASSERT_ENABLED
    175     auto isOkToAccessDisplayBox = [&] {
     175    auto isOkToAccessBoxGeometry = [&] {
    176176        if (!is<InitialContainingBlock>(layoutBox) && &layoutBox.formattingContextRoot() == &root()) {
    177177            // This is the non-escape case of accessing a box's geometry information within the same formatting context.
     
    250250    };
    251251#endif
    252     ASSERT(isOkToAccessDisplayBox());
    253     ASSERT(layoutState().hasDisplayBox(layoutBox));
    254     return layoutState().geometryForLayoutBox(layoutBox);
     252    ASSERT(isOkToAccessBoxGeometry());
     253    ASSERT(layoutState().hasBoxGeometry(layoutBox));
     254    return layoutState().geometryForBox(layoutBox);
    255255}
    256256
  • trunk/Source/WebCore/layout/FormattingContext.h

    r267054 r267076  
    4242
    4343class Box;
     44class BoxGeometry;
    4445class ReplacedBox;
    4546struct ComputedHorizontalMargin;
     
    5051struct Edges;
    5152class FormattingState;
    52 class Geometry;
    5353struct HorizontalGeometry;
    5454class InvalidationState;
     
    106106        TableNeedsAccessToTableWrapper
    107107    };
    108     const Layout::Geometry& geometryForBox(const Box&, Optional<EscapeReason> = WTF::nullopt) const;
     108    const BoxGeometry& geometryForBox(const Box&, Optional<EscapeReason> = WTF::nullopt) const;
    109109    const ContainerBox& root() const { return *m_root; }
    110110
  • trunk/Source/WebCore/layout/FormattingContextGeometry.cpp

    r267054 r267076  
    298298    for (auto* ancestor = &layoutBox.parent(); ancestor != &containingBlock; ancestor = &ancestor->containingBlock()) {
    299299        auto& boxGeometry = formattingContext.geometryForBox(*ancestor, EscapeReason::OutOfFlowBoxNeedsInFlowGeometry);
    300         // Layout::Geometry::top is the border box top position in its containing block's coordinate system.
     300        // BoxGeometry::top is the border box top position in its containing block's coordinate system.
    301301        top += boxGeometry.top();
    302302        ASSERT(!ancestor->isPositioned() || layoutBox.isFixedPositioned());
     
    320320    for (auto* ancestor = &layoutBox.parent(); ancestor != &containingBlock; ancestor = &ancestor->containingBlock()) {
    321321        auto& boxGeometry = formattingContext.geometryForBox(*ancestor, EscapeReason::OutOfFlowBoxNeedsInFlowGeometry);
    322         // Layout::Geometry::left is the border box left position in its containing block's coordinate system.
     322        // BoxGeometry::left is the border box left position in its containing block's coordinate system.
    323323        left += boxGeometry.left();
    324324        ASSERT(!ancestor->isPositioned() || layoutBox.isFixedPositioned());
  • trunk/Source/WebCore/layout/FormattingContextQuirks.cpp

    r267054 r267076  
    3030
    3131#include "LayoutBox.h"
    32 #include "LayoutGeometry.h"
     32#include "LayoutBoxGeometry.h"
    3333#include "LayoutInitialContainingBlock.h"
    3434
  • trunk/Source/WebCore/layout/FormattingState.cpp

    r267054 r267076  
    3030
    3131#include "FloatingState.h"
    32 #include "LayoutGeometry.h"
     32#include "LayoutBoxGeometry.h"
    3333#include <wtf/IsoMallocInlines.h>
    3434
     
    4949}
    5050
    51 Layout::Geometry& FormattingState::displayBox(const Box& layoutBox)
     51BoxGeometry& FormattingState::boxGeometry(const Box& layoutBox)
    5252{
    5353    // Should never need to mutate a display box outside of the formatting context.
     
    5555    // Anonymous text wrappers/line break boxes should not need display boxes.
    5656    ASSERT(!layoutBox.isInlineTextBox() && (!layoutBox.isLineBreakBox() || layoutBox.isOutOfFlowPositioned()));
    57     return layoutState().ensureGeometryForLayoutBox(layoutBox);
     57    return layoutState().ensureGeometryForBox(layoutBox);
    5858}
    5959
  • trunk/Source/WebCore/layout/FormattingState.h

    r267054 r267076  
    6262    LayoutState& layoutState() const { return m_layoutState; }
    6363
    64     Layout::Geometry& displayBox(const Box& layoutBox);
     64    // FIXME: We need to find a way to limit access to mutatable geometry.
     65    BoxGeometry& boxGeometry(const Box& layoutBox);
    6566    // Since we layout the out-of-flow boxes at the end of the formatting context layout, it's okay to store them in the formatting state -as opposed to the containing block level.
    6667    using OutOfFlowBoxList = Vector<WeakPtr<const Box>>;
  • trunk/Source/WebCore/layout/LayoutContext.cpp

    r267054 r267076  
    3737#include "InvalidationState.h"
    3838#include "LayoutBox.h"
     39#include "LayoutBoxGeometry.h"
    3940#include "LayoutContainerBox.h"
    40 #include "LayoutGeometry.h"
    4141#include "LayoutPhase.h"
    4242#include "LayoutTreeBuilder.h"
     
    6565    // ICB establishes the initial BFC, but it does not live in a formatting context and while a non-ICB root(subtree layout) has to have a formatting context,
    6666    // we could not lay it out even if we wanted to since it's outside of this LayoutContext.
    67     auto& displayBox = layoutState().geometryForRootLayoutBox();
    68     displayBox.setHorizontalMargin({ });
    69     displayBox.setVerticalMargin({ });
    70     displayBox.setBorder({ });
    71     displayBox.setPadding({ });
    72     displayBox.setTopLeft({ });
    73     displayBox.setContentBoxHeight(rootContentBoxSize.height());
    74     displayBox.setContentBoxWidth(rootContentBoxSize.width());
     67    auto& boxGeometry = layoutState().geometryForRootBox();
     68    boxGeometry.setHorizontalMargin({ });
     69    boxGeometry.setVerticalMargin({ });
     70    boxGeometry.setBorder({ });
     71    boxGeometry.setPadding({ });
     72    boxGeometry.setTopLeft({ });
     73    boxGeometry.setContentBoxHeight(rootContentBoxSize.height());
     74    boxGeometry.setContentBoxWidth(rootContentBoxSize.width());
    7575
    7676    layoutWithPreparedRootGeometry(invalidationState);
     
    9797
    9898    auto formattingContext = createFormattingContext(formattingContextRoot, layoutState());
    99     auto& displayBox = layoutState().geometryForLayoutBox(formattingContextRoot);
     99    auto& boxGeometry = layoutState().geometryForBox(formattingContextRoot);
    100100
    101101    if (formattingContextRoot.hasInFlowOrFloatingChild()) {
    102         auto constraintsForInFlowContent = FormattingContext::ConstraintsForInFlowContent { { displayBox.contentBoxLeft(), displayBox.contentBoxWidth() }, { displayBox.contentBoxTop(), { } } };
     102        auto constraintsForInFlowContent = FormattingContext::ConstraintsForInFlowContent { { boxGeometry.contentBoxLeft(), boxGeometry.contentBoxWidth() }, { boxGeometry.contentBoxTop(), { } } };
    103103        formattingContext->layoutInFlowContent(invalidationState, constraintsForInFlowContent);
    104104    }
     
    108108    // It also means that the formattingContextRoot has to have a valid/clean geometry at this point.
    109109    {
    110         auto constraints = FormattingContext::ConstraintsForOutOfFlowContent { { displayBox.paddingBoxLeft(), displayBox.paddingBoxWidth() },
    111             { displayBox.paddingBoxTop(), displayBox.paddingBoxHeight() }, displayBox.contentBoxWidth() };
     110        auto constraints = FormattingContext::ConstraintsForOutOfFlowContent { { boxGeometry.paddingBoxLeft(), boxGeometry.paddingBoxWidth() },
     111            { boxGeometry.paddingBoxTop(), boxGeometry.paddingBoxHeight() }, boxGeometry.contentBoxWidth() };
    112112        formattingContext->layoutOutOfFlowContent(invalidationState, constraints);
    113113    }
  • trunk/Source/WebCore/layout/LayoutState.cpp

    r267054 r267076  
    3434#include "InlineFormattingState.h"
    3535#include "LayoutBox.h"
     36#include "LayoutBoxGeometry.h"
    3637#include "LayoutContainerBox.h"
    37 #include "LayoutGeometry.h"
    3838#include "RenderBox.h"
    3939#include "RuntimeEnabledFeatures.h"
     
    6464LayoutState::~LayoutState() = default;
    6565
    66 Layout::Geometry& LayoutState::geometryForRootLayoutBox()
    67 {
    68     return ensureGeometryForLayoutBox(root());
    69 }
    70 
    71 Layout::Geometry& LayoutState::ensureDisplayBoxForLayoutBoxSlow(const Box& layoutBox)
     66BoxGeometry& LayoutState::geometryForRootBox()
     67{
     68    return ensureGeometryForBox(root());
     69}
     70
     71BoxGeometry& LayoutState::ensureGeometryForBoxSlow(const Box& layoutBox)
    7272{
    7373    if (layoutBox.canCacheForLayoutState(*this)) {
    74         ASSERT(!layoutBox.cachedDisplayBoxForLayoutState(*this));
    75         auto newBox = makeUnique<Layout::Geometry>();
     74        ASSERT(!layoutBox.cachedGeometryForLayoutState(*this));
     75        auto newBox = makeUnique<BoxGeometry>();
    7676        auto& newBoxPtr = *newBox;
    77         layoutBox.setCachedDisplayBoxForLayoutState(*this, WTFMove(newBox));
     77        layoutBox.setCachedGeometryForLayoutState(*this, WTFMove(newBox));
    7878        return newBoxPtr;
    7979    }
    8080
    81     return *m_layoutToDisplayBox.ensure(&layoutBox, [] {
    82         return makeUnique<Layout::Geometry>();
     81    return *m_layoutBoxToBoxGeometry.ensure(&layoutBox, [] {
     82        return makeUnique<BoxGeometry>();
    8383    }).iterator->value;
    8484}
  • trunk/Source/WebCore/layout/LayoutState.h

    r267054 r267076  
    4242class FormattingContext;
    4343class FormattingState;
    44 class Geometry;
     44class BoxGeometry;
    4545class InlineFormattingState;
    4646class TableFormattingState;
     
    7272#endif
    7373
    74     Layout::Geometry& geometryForRootLayoutBox();
    75     Layout::Geometry& ensureGeometryForLayoutBox(const Box&);
    76     const Layout::Geometry& geometryForLayoutBox(const Box&) const;
     74    BoxGeometry& geometryForRootBox();
     75    BoxGeometry& ensureGeometryForBox(const Box&);
     76    const BoxGeometry& geometryForBox(const Box&) const;
    7777
    78     bool hasDisplayBox(const Box&) const;
     78    bool hasBoxGeometry(const Box&) const;
    7979
    8080    enum class QuirksMode { No, Limited, Yes };
     
    9494private:
    9595    void setQuirksMode(QuirksMode quirksMode) { m_quirksMode = quirksMode; }
    96     Layout::Geometry& ensureDisplayBoxForLayoutBoxSlow(const Box&);
     96    BoxGeometry& ensureGeometryForBoxSlow(const Box&);
    9797
    9898    HashMap<const ContainerBox*, std::unique_ptr<InlineFormattingState>> m_inlineFormattingStates;
     
    106106    HashSet<const FormattingContext*> m_formattingContextList;
    107107#endif
    108     HashMap<const Box*, std::unique_ptr<Layout::Geometry>> m_layoutToDisplayBox;
     108    HashMap<const Box*, std::unique_ptr<BoxGeometry>> m_layoutBoxToBoxGeometry;
    109109    QuirksMode m_quirksMode { QuirksMode::No };
    110110
     
    116116};
    117117
    118 inline bool LayoutState::hasDisplayBox(const Box& layoutBox) const
     118inline bool LayoutState::hasBoxGeometry(const Box& layoutBox) const
    119119{
    120     if (layoutBox.cachedDisplayBoxForLayoutState(*this))
     120    if (layoutBox.cachedGeometryForLayoutState(*this))
    121121        return true;
    122     return m_layoutToDisplayBox.contains(&layoutBox);
     122    return m_layoutBoxToBoxGeometry.contains(&layoutBox);
    123123}
    124124
    125 inline Layout::Geometry& LayoutState::ensureGeometryForLayoutBox(const Box& layoutBox)
     125inline BoxGeometry& LayoutState::ensureGeometryForBox(const Box& layoutBox)
    126126{
    127     if (auto* displayBox = layoutBox.cachedDisplayBoxForLayoutState(*this))
    128         return *displayBox;
    129     return ensureDisplayBoxForLayoutBoxSlow(layoutBox);
     127    if (auto* boxGeometry = layoutBox.cachedGeometryForLayoutState(*this))
     128        return *boxGeometry;
     129    return ensureGeometryForBoxSlow(layoutBox);
    130130}
    131131
    132 inline const Layout::Geometry& LayoutState::geometryForLayoutBox(const Box& layoutBox) const
     132inline const BoxGeometry& LayoutState::geometryForBox(const Box& layoutBox) const
    133133{
    134     if (auto* displayBox = layoutBox.cachedDisplayBoxForLayoutState(*this))
    135         return *displayBox;
    136     ASSERT(m_layoutToDisplayBox.contains(&layoutBox));
    137     return *m_layoutToDisplayBox.get(&layoutBox);
     134    if (auto* boxGeometry = layoutBox.cachedGeometryForLayoutState(*this))
     135        return *boxGeometry;
     136    ASSERT(m_layoutBoxToBoxGeometry.contains(&layoutBox));
     137    return *m_layoutBoxToBoxGeometry.get(&layoutBox);
    138138}
    139139
     
    153153}
    154154
    155 inline Layout::Geometry* Box::cachedDisplayBoxForLayoutState(const LayoutState& layoutState) const
     155inline BoxGeometry* Box::cachedGeometryForLayoutState(const LayoutState& layoutState) const
    156156{
    157157    if (m_cachedLayoutState.get() != &layoutState)
    158158        return nullptr;
    159     return m_cachedDisplayBoxForLayoutState.get();
     159    return m_cachedGeometryForLayoutState.get();
    160160}
    161161
  • trunk/Source/WebCore/layout/Verification.cpp

    r267054 r267076  
    3434#include "InlineTextBox.h"
    3535#include "LayoutBox.h"
     36#include "LayoutBoxGeometry.h"
    3637#include "LayoutContainerBox.h"
    3738#include "LayoutContext.h"
    38 #include "LayoutGeometry.h"
    3939#include "LayoutTreeBuilder.h"
    4040#include "RenderBox.h"
     
    234234    };
    235235
    236     auto renderBoxLikeMarginBox = [&] (const auto& displayBox) {
     236    auto renderBoxLikeMarginBox = [&] (const auto& boxGeometry) {
    237237        if (layoutBox.isInitialContainingBlock())
    238             return displayBox.rect();
     238            return boxGeometry.rect();
    239239
    240240        // Produce a RenderBox matching margin box.
    241         auto containingBlockWidth = layoutState.geometryForLayoutBox(layoutBox.containingBlock()).contentBoxWidth();
     241        auto containingBlockWidth = layoutState.geometryForBox(layoutBox.containingBlock()).contentBoxWidth();
    242242        auto marginStart = LayoutUnit { };
    243243        auto& marginStartStyle = layoutBox.style().marginStart();
     
    250250            marginEnd = valueForLength(marginEndStyle, containingBlockWidth);
    251251
    252         auto marginBefore = displayBox.marginBefore();
    253         auto marginAfter = displayBox.marginAfter();
     252        auto marginBefore = boxGeometry.marginBefore();
     253        auto marginAfter = boxGeometry.marginAfter();
    254254        if (layoutBox.isBlockLevelBox()) {
    255255            auto& formattingState = downcast<BlockFormattingState>(layoutState.formattingStateForBox(layoutBox));
     
    258258            marginAfter = verticalMargin.nonCollapsedValues.after;
    259259        }
    260         auto borderBox = displayBox.borderBox();
     260        auto borderBox = boxGeometry.borderBox();
    261261        return Rect {
    262262            borderBox.top() - marginBefore,
     
    272272        frameRect.move(renderer.offsetForInFlowPosition());
    273273
    274     auto displayBox = Geometry { layoutState.geometryForLayoutBox(layoutBox) };
     274    auto boxGeometry = BoxGeometry { layoutState.geometryForBox(layoutBox) };
    275275    if (layoutBox.isTableBox()) {
    276276        // When the <table> is out-of-flow positioned, the wrapper table box has the offset
    277277        // while the actual table box is static, inflow.
    278         auto& tableWrapperDisplayBox = layoutState.geometryForLayoutBox(layoutBox.containingBlock());
    279         displayBox.moveBy(tableWrapperDisplayBox.topLeft());
     278        auto& tableWrapperBoxGeometry = layoutState.geometryForBox(layoutBox.containingBlock());
     279        boxGeometry.moveBy(tableWrapperBoxGeometry.topLeft());
    280280        // Table wrapper box has the margin values for the table.
    281         displayBox.setHorizontalMargin(tableWrapperDisplayBox.horizontalMargin());
    282         displayBox.setVerticalMargin(tableWrapperDisplayBox.verticalMargin());
     281        boxGeometry.setHorizontalMargin(tableWrapperBoxGeometry.horizontalMargin());
     282        boxGeometry.setVerticalMargin(tableWrapperBoxGeometry.verticalMargin());
    283283    }
    284284
     
    291291            return false;
    292292    }
    293     if (!areEssentiallyEqual(frameRect, displayBox.rect())) {
    294         outputRect("frameBox", renderer.frameRect(), displayBox.rect());
    295         return true;
    296     }
    297 
    298     if (!areEssentiallyEqual(renderer.borderBoxRect(), displayBox.borderBox())) {
    299         outputRect("borderBox", renderer.borderBoxRect(), displayBox.borderBox());
     293    if (!areEssentiallyEqual(frameRect, boxGeometry.rect())) {
     294        outputRect("frameBox", renderer.frameRect(), boxGeometry.rect());
     295        return true;
     296    }
     297
     298    if (!areEssentiallyEqual(renderer.borderBoxRect(), boxGeometry.borderBox())) {
     299        outputRect("borderBox", renderer.borderBoxRect(), boxGeometry.borderBox());
    300300        return true;
    301301    }
     
    303303    // When the table row border overflows the row, padding box becomes negative and content box is incorrect.
    304304    auto shouldCheckPaddingAndContentBox = !is<RenderTableRow>(renderer) || renderer.paddingBoxRect().width() >= 0;
    305     if (shouldCheckPaddingAndContentBox && !areEssentiallyEqual(renderer.paddingBoxRect(), displayBox.paddingBox())) {
    306         outputRect("paddingBox", renderer.paddingBoxRect(), displayBox.paddingBox());
     305    if (shouldCheckPaddingAndContentBox && !areEssentiallyEqual(renderer.paddingBoxRect(), boxGeometry.paddingBox())) {
     306        outputRect("paddingBox", renderer.paddingBoxRect(), boxGeometry.paddingBox());
    307307        return true;
    308308    }
     
    317317        return !is<RenderTable>(renderer) || !downcast<RenderTable>(renderer).collapseBorders();
    318318    }();
    319     if (shouldCheckContentBox && !areEssentiallyEqual(renderer.contentBoxRect(), displayBox.contentBox())) {
    320         outputRect("contentBox", renderer.contentBoxRect(), displayBox.contentBox());
    321         return true;
    322     }
    323 
    324     if (!areEssentiallyEqual(renderer.marginBoxRect(), renderBoxLikeMarginBox(displayBox))) {
     319    if (shouldCheckContentBox && !areEssentiallyEqual(renderer.contentBoxRect(), boxGeometry.contentBox())) {
     320        outputRect("contentBox", renderer.contentBoxRect(), boxGeometry.contentBox());
     321        return true;
     322    }
     323
     324    if (!areEssentiallyEqual(renderer.marginBoxRect(), renderBoxLikeMarginBox(boxGeometry))) {
    325325        // In certain cases, like out-of-flow boxes with margin auto, marginBoxRect() returns 0. It's clearly incorrect,
    326326        // so let's check the individual margin values instead (and at this point we know that all other boxes match).
    327         auto marginsMatch = displayBox.marginBefore() == renderer.marginBefore()
    328             && displayBox.marginAfter() == renderer.marginAfter()
    329             && displayBox.marginStart() == renderer.marginStart()
    330             && displayBox.marginEnd() == renderer.marginEnd();
     327        auto marginsMatch = boxGeometry.marginBefore() == renderer.marginBefore()
     328            && boxGeometry.marginAfter() == renderer.marginAfter()
     329            && boxGeometry.marginStart() == renderer.marginStart()
     330            && boxGeometry.marginEnd() == renderer.marginEnd();
    331331
    332332        if (!marginsMatch) {
    333             outputRect("marginBox", renderer.marginBoxRect(), renderBoxLikeMarginBox(displayBox));
     333            outputRect("marginBox", renderer.marginBoxRect(), renderBoxLikeMarginBox(boxGeometry));
    334334            return true;
    335335        }
  • trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp

    r264281 r267076  
    223223            continue;
    224224        auto positionOffset = geometry().inFlowPositionedPositionOffset(childBox, horizontalConstraints);
    225         formattingState().displayBox(childBox).move(positionOffset);
     225        formattingState().boxGeometry(childBox).move(positionOffset);
    226226    }
    227227    LOG_WITH_STREAM(FormattingContextLayout, stream << "End: move in-flow positioned children -> parent: " << &containerBox);
     
    230230void BlockFormattingContext::computeStaticVerticalPosition(const Box& layoutBox, const VerticalConstraints& verticalConstraints)
    231231{
    232     formattingState().displayBox(layoutBox).setTop(geometry().staticVerticalPosition(layoutBox, verticalConstraints));
     232    formattingState().boxGeometry(layoutBox).setTop(geometry().staticVerticalPosition(layoutBox, verticalConstraints));
    233233}
    234234
    235235void BlockFormattingContext::computeStaticHorizontalPosition(const Box& layoutBox, const HorizontalConstraints& horizontalConstraints)
    236236{
    237     formattingState().displayBox(layoutBox).setLeft(geometry().staticHorizontalPosition(layoutBox, horizontalConstraints));
     237    formattingState().boxGeometry(layoutBox).setLeft(geometry().staticHorizontalPosition(layoutBox, horizontalConstraints));
    238238}
    239239
     
    260260        auto precomputedMarginBefore = marginCollapse().precomputedMarginBefore(*ancestor, usedNonCollapsedMargin);
    261261
    262         auto& displayBox = formattingState().displayBox(*ancestor);
     262        auto& boxGeometry = formattingState().boxGeometry(*ancestor);
    263263        auto nonCollapsedValues = UsedVerticalMargin::NonCollapsedValues { precomputedMarginBefore.nonCollapsedValue, { } };
    264264        auto collapsedValues = UsedVerticalMargin::CollapsedValues { precomputedMarginBefore.collapsedValue, { }, false };
     
    266266
    267267        formattingState().setUsedVerticalMargin(*ancestor, verticalMargin);
    268         displayBox.setVerticalMargin({ marginBefore(verticalMargin), marginAfter(verticalMargin) });
    269         displayBox.setTop(verticalPositionWithMargin(*ancestor, verticalMargin, constraintsForAncestor.vertical));
     268        boxGeometry.setVerticalMargin({ marginBefore(verticalMargin), marginAfter(verticalMargin) });
     269        boxGeometry.setTop(verticalPositionWithMargin(*ancestor, verticalMargin, constraintsForAncestor.vertical));
    270270#if ASSERT_ENABLED
    271271        setPrecomputedMarginBefore(*ancestor, precomputedMarginBefore);
    272         displayBox.setHasPrecomputedMarginBefore();
     272        boxGeometry.setHasPrecomputedMarginBefore();
    273273#endif
    274274    }
     
    285285    if (layoutBox.isFloatingPositioned()) {
    286286        precomputeVerticalPositionForBoxAndAncestors(layoutBox, constraintsPair);
    287         formattingState().displayBox(layoutBox).setTopLeft(floatingContext.positionForFloat(layoutBox, constraintsPair.containingBlock.horizontal));
     287        formattingState().boxGeometry(layoutBox).setTopLeft(floatingContext.positionForFloat(layoutBox, constraintsPair.containingBlock.horizontal));
    288288        return;
    289289    }
     
    296296
    297297    ASSERT(layoutBox.establishesFormattingContext());
    298     formattingState().displayBox(layoutBox).setTopLeft(floatingContext.positionForNonFloatingFloatAvoider(layoutBox, constraintsPair.containingBlock.horizontal));
     298    formattingState().boxGeometry(layoutBox).setTopLeft(floatingContext.positionForNonFloatingFloatAvoider(layoutBox, constraintsPair.containingBlock.horizontal));
    299299}
    300300
     
    310310    }
    311311
    312     auto& displayBox = formattingState().displayBox(layoutBox);
    313     ASSERT(*verticalPositionAndClearance.position >= displayBox.top());
    314     displayBox.setTop(*verticalPositionAndClearance.position);
     312    auto& boxGeometry = formattingState().boxGeometry(layoutBox);
     313    ASSERT(*verticalPositionAndClearance.position >= boxGeometry.top());
     314    boxGeometry.setTop(*verticalPositionAndClearance.position);
    315315    if (verticalPositionAndClearance.clearance)
    316         displayBox.setHasClearance();
     316        boxGeometry.setHasClearance();
    317317    // FIXME: Reset the margin values on the ancestors/previous siblings now that the float avoider with clearance does not margin collapse anymore.
    318318}
     
    326326    }
    327327    auto contentWidthAndMargin = geometry().computedWidthAndMargin(layoutBox, constraintsPair.containingBlock.horizontal, availableWidthFloatAvoider);
    328     auto& displayBox = formattingState().displayBox(layoutBox);
    329     displayBox.setContentBoxWidth(contentWidthAndMargin.contentWidth);
    330     displayBox.setHorizontalMargin({ contentWidthAndMargin.usedMargin.start, contentWidthAndMargin.usedMargin.end });
     328    auto& boxGeometry = formattingState().boxGeometry(layoutBox);
     329    boxGeometry.setContentBoxWidth(contentWidthAndMargin.contentWidth);
     330    boxGeometry.setHorizontalMargin({ contentWidthAndMargin.usedMargin.start, contentWidthAndMargin.usedMargin.end });
    331331}
    332332
     
    384384    }
    385385#endif
    386     auto& displayBox = formattingState().displayBox(layoutBox);
     386    auto& boxGeometry = formattingState().boxGeometry(layoutBox);
    387387    if (!layoutBox.isFloatAvoider()) {
    388388        // Float avoiders have pre-computed vertical margins.
    389         displayBox.setTop(verticalPositionWithMargin(layoutBox, verticalMargin, constraints.vertical));
    390     }
    391     displayBox.setContentBoxHeight(contentHeightAndMargin.contentHeight);
    392     displayBox.setVerticalMargin({ marginBefore(verticalMargin), marginAfter(verticalMargin) });
     389        boxGeometry.setTop(verticalPositionWithMargin(layoutBox, verticalMargin, constraints.vertical));
     390    }
     391    boxGeometry.setContentBoxHeight(contentHeightAndMargin.contentHeight);
     392    boxGeometry.setVerticalMargin({ marginBefore(verticalMargin), marginAfter(verticalMargin) });
    393393    // Adjust the previous sibling's margin bottom now that this box's vertical margin is computed.
    394394    MarginCollapse::updateMarginAfterForPreviousSibling(*this, marginCollapse, layoutBox);
  • trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp

    r267054 r267076  
    3232#include "FormattingContext.h"
    3333#include "InlineFormattingState.h"
     34#include "LayoutBoxGeometry.h"
    3435#include "LayoutChildIterator.h"
    3536#include "LayoutContext.h"
    36 #include "LayoutGeometry.h"
    3737#include "LayoutInitialContainingBlock.h"
    3838#include "LayoutReplacedBox.h"
     
    9797            inFlowChild = inFlowChild->previousInFlowSibling();
    9898        if (inFlowChild) {
    99             auto& inFlowDisplayBoxGeometry = formattingContext().geometryForBox(*inFlowChild);
    100             return { inFlowDisplayBoxGeometry.top() + inFlowDisplayBoxGeometry.borderBox().height() - borderAndPaddingTop, nonCollapsedMargin };
     99            auto& inFlowBoxGeometry = formattingContext().geometryForBox(*inFlowChild);
     100            return { inFlowBoxGeometry.top() + inFlowBoxGeometry.borderBox().height() - borderAndPaddingTop, nonCollapsedMargin };
    101101        }
    102102
  • trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp

    r267054 r267076  
    3131#include "BlockFormattingState.h"
    3232#include "LayoutBox.h"
     33#include "LayoutBoxGeometry.h"
    3334#include "LayoutContainerBox.h"
    34 #include "LayoutGeometry.h"
    3535#include "LayoutInitialContainingBlock.h"
    3636#include "LayoutState.h"
  • trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp

    r266685 r267076  
    8888    // FIXME: precomputedVerticalPositionForFormattingRoot logic ends up calling into this function when the layoutBox (first inflow child) has
    8989    // not been laid out.
    90     if (!layoutState().hasDisplayBox(layoutBox))
     90    if (!layoutState().hasBoxGeometry(layoutBox))
    9191        return false;
    9292    return formattingContext().geometryForBox(layoutBox).hasClearance();
  • trunk/Source/WebCore/layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp

    r267054 r267076  
    3131#include "BlockFormattingState.h"
    3232#include "InvalidationState.h"
     33#include "LayoutBoxGeometry.h"
    3334#include "LayoutChildIterator.h"
    3435#include "LayoutContext.h"
    35 #include "LayoutGeometry.h"
    3636#include "LayoutInitialContainingBlock.h"
    3737#include "TableFormattingContext.h"
     
    137137    grid.setCollapsedBorder(collapsedBorder);
    138138
    139     auto& displayBox = formattingState().displayBox(tableBox);
    140     displayBox.setBorder(collapsedBorder / 2);
    141     displayBox.setPadding(geometry().computedPadding(tableBox, horizontalConstraints.logicalWidth));
     139    auto& boxGeometry = formattingState().boxGeometry(tableBox);
     140    boxGeometry.setBorder(collapsedBorder / 2);
     141    boxGeometry.setPadding(geometry().computedPadding(tableBox, horizontalConstraints.logicalWidth));
    142142}
    143143
     
    208208    auto contentWidthAndMargin = geometry.inFlowWidthAndMargin(tableBox, horizontalConstraints, OverrideHorizontalValues { usedWidth, { } });
    209209
    210     auto& displayBox = formattingState().displayBox(tableBox);
    211     displayBox.setContentBoxWidth(contentWidthAndMargin.contentWidth);
    212     displayBox.setHorizontalMargin({ contentWidthAndMargin.usedMargin.start, contentWidthAndMargin.usedMargin.end });
     210    auto& boxGeometry = formattingState().boxGeometry(tableBox);
     211    boxGeometry.setContentBoxWidth(contentWidthAndMargin.contentWidth);
     212    boxGeometry.setHorizontalMargin({ contentWidthAndMargin.usedMargin.start, contentWidthAndMargin.usedMargin.end });
    213213}
    214214
     
    225225    formattingState().setUsedVerticalMargin(tableBox, verticalMargin);
    226226
    227     auto& displayBox = formattingState().displayBox(tableBox);
    228     displayBox.setTop(verticalPositionWithMargin(tableBox, verticalMargin, constraints.vertical));
    229     displayBox.setContentBoxHeight(heightAndMargin.contentHeight);
    230     displayBox.setVerticalMargin({ marginBefore(verticalMargin), marginAfter(verticalMargin) });
     227    auto& boxGeometry = formattingState().boxGeometry(tableBox);
     228    boxGeometry.setTop(verticalPositionWithMargin(tableBox, verticalMargin, constraints.vertical));
     229    boxGeometry.setContentBoxHeight(heightAndMargin.contentHeight);
     230    boxGeometry.setVerticalMargin({ marginBefore(verticalMargin), marginAfter(verticalMargin) });
    231231    // Adjust the previous sibling's margin bottom now that this box's vertical margin is computed.
    232232    MarginCollapse::updateMarginAfterForPreviousSibling(*this, marginCollapse, tableBox);
  • trunk/Source/WebCore/layout/display/DisplayLayerController.cpp

    r267054 r267076  
    3535#include "Frame.h"
    3636#include "FrameView.h"
     37#include "LayoutBoxGeometry.h"
    3738#include "LayoutContext.h"
    38 #include "LayoutGeometry.h"
    3939#include "Logging.h"
    4040#include "Page.h"
     
    8484        return;
    8585
    86     ASSERT(layoutState.hasDisplayBox(rootLayoutBox));
    87 
    88     auto viewSize = layoutState.geometryForLayoutBox(rootLayoutBox).size();
    89     auto contentSize = layoutState.geometryForLayoutBox(*rootLayoutBox.firstChild()).size();
     86    ASSERT(layoutState.hasBoxGeometry(rootLayoutBox));
     87
     88    auto viewSize = layoutState.geometryForBox(rootLayoutBox).size();
     89    auto contentSize = layoutState.geometryForBox(*rootLayoutBox.firstChild()).size();
    9090   
    9191    // FIXME: Using the firstChild() size won't be correct until we compute overflow correctly,
  • trunk/Source/WebCore/layout/displaytree/DisplayPainter.cpp

    r267054 r267076  
    3535#include "InlineTextItem.h"
    3636#include "IntRect.h"
     37#include "LayoutBoxGeometry.h"
    3738#include "LayoutContainerBox.h"
    38 #include "LayoutGeometry.h"
    3939#include "LayoutInitialContainingBlock.h"
    4040#include "LayoutState.h"
     
    4646
    4747// FIXME: Move to display box.
    48 static void paintBoxDecoration(GraphicsContext& context, const Layout::Geometry& absoluteDisplayBox, const RenderStyle& style, bool needsMarginPainting)
    49 {
    50     auto decorationBoxTopLeft = needsMarginPainting ? absoluteDisplayBox.rectWithMargin().topLeft() : absoluteDisplayBox.topLeft();
    51     auto decorationBoxSize = needsMarginPainting ? absoluteDisplayBox.rectWithMargin().size() : LayoutSize(absoluteDisplayBox.borderBoxWidth(), absoluteDisplayBox.borderBoxHeight());
     48static void paintBoxDecoration(GraphicsContext& context, const Layout::BoxGeometry& absoluteBoxGeometry, const RenderStyle& style, bool needsMarginPainting)
     49{
     50    auto decorationBoxTopLeft = needsMarginPainting ? absoluteBoxGeometry.rectWithMargin().topLeft() : absoluteBoxGeometry.topLeft();
     51    auto decorationBoxSize = needsMarginPainting ? absoluteBoxGeometry.rectWithMargin().size() : LayoutSize(absoluteBoxGeometry.borderBoxWidth(), absoluteBoxGeometry.borderBoxHeight());
    5252    // Background color
    5353    if (style.hasBackground()) {
     
    143143}
    144144
    145 Layout::Geometry Painter::absoluteDisplayBox(const Layout::LayoutState& layoutState, const Layout::Box& layoutBoxToPaint)
     145Layout::BoxGeometry Painter::absoluteBoxGeometry(const Layout::LayoutState& layoutState, const Layout::Box& layoutBoxToPaint)
    146146{
    147147    // Should never really happen but table code is way too incomplete.
    148     if (!layoutState.hasDisplayBox(layoutBoxToPaint))
     148    if (!layoutState.hasBoxGeometry(layoutBoxToPaint))
    149149        return { };
    150150    if (is<Layout::InitialContainingBlock>(layoutBoxToPaint))
    151         return layoutState.geometryForLayoutBox(layoutBoxToPaint);
     151        return layoutState.geometryForBox(layoutBoxToPaint);
    152152
    153153    auto paintContainer = [&] (const auto& layoutBox) {
     
    159159        return &layoutBox.containingBlock();
    160160    };
    161     auto absoluteBox = Layout::Geometry { layoutState.geometryForLayoutBox(layoutBoxToPaint) };
     161    auto absoluteBox = Layout::BoxGeometry { layoutState.geometryForBox(layoutBoxToPaint) };
    162162    for (auto* container = paintContainer(layoutBoxToPaint); !is<Layout::InitialContainingBlock>(container); container = paintContainer(*container))
    163         absoluteBox.moveBy(layoutState.geometryForLayoutBox(*container).topLeft());
     163        absoluteBox.moveBy(layoutState.geometryForBox(*container).topLeft());
    164164    return absoluteBox;
    165165}
     
    178178        if (layoutBox.style().visibility() != Visibility::Visible)
    179179            return;
    180         if (!layoutState.hasDisplayBox(layoutBox))
    181             return;
    182         auto absoluteDisplayBox = Painter::absoluteDisplayBox(layoutState, layoutBox);
    183         if (!dirtyRect.intersects(snappedIntRect(absoluteDisplayBox.rect())))
     180        if (!layoutState.hasBoxGeometry(layoutBox))
     181            return;
     182        auto absoluteBoxGeometry = Painter::absoluteBoxGeometry(layoutState, layoutBox);
     183        if (!dirtyRect.intersects(snappedIntRect(absoluteBoxGeometry.rect())))
    184184            return;
    185185
     
    187187            if (layoutBox.isAnonymous())
    188188                return;
    189             paintBoxDecoration(context, absoluteDisplayBox, layoutBox.style(), layoutBox.isBodyBox());
     189            paintBoxDecoration(context, absoluteBoxGeometry, layoutBox.style(), layoutBox.isBodyBox());
    190190            return;
    191191        }
     
    193193        if (layoutBox.establishesInlineFormattingContext()) {
    194194            auto& containerBox = downcast<Layout::ContainerBox>(layoutBox);
    195             paintInlineContent(context, absoluteDisplayBox.topLeft(), layoutState.establishedInlineFormattingState(containerBox));
     195            paintInlineContent(context, absoluteBoxGeometry.topLeft(), layoutState.establishedInlineFormattingState(containerBox));
    196196        }
    197197    };
     
    236236    };
    237237
    238     auto contentRect = LayoutRect { layoutState.geometryForLayoutBox(rootLayoutBox).rect() };
     238    auto contentRect = LayoutRect { layoutState.geometryForBox(rootLayoutBox).rect() };
    239239
    240240    // Initial BFC is always a paint root.
     
    249249            if (isPaintRootCandidate(layoutBox))
    250250                appendPaintRoot(layoutBox);
    251             if (layoutState.hasDisplayBox(layoutBox))
    252                 contentRect.uniteIfNonZero(Painter::absoluteDisplayBox(layoutState, layoutBox).rect());
     251            if (layoutState.hasBoxGeometry(layoutBox))
     252                contentRect.uniteIfNonZero(Painter::absoluteBoxGeometry(layoutState, layoutBox).rect());
    253253            if (!is<Layout::ContainerBox>(layoutBox) || !downcast<Layout::ContainerBox>(layoutBox).hasChild())
    254254                break;
  • trunk/Source/WebCore/layout/displaytree/DisplayPainter.h

    r267054 r267076  
    3434
    3535namespace Layout {
    36 class Geometry;
     36class BoxGeometry;
    3737class LayoutState;
    3838}
     
    4646
    4747    // FIXME: Move to display box.
    48     static Layout::Geometry absoluteDisplayBox(const Layout::LayoutState&, const Layout::Box&);
     48    static Layout::BoxGeometry absoluteBoxGeometry(const Layout::LayoutState&, const Layout::Box&);
    4949};
    5050
  • trunk/Source/WebCore/layout/floats/FloatAvoider.h

    r267054 r267076  
    2929
    3030#include "LayoutBox.h"
    31 #include "LayoutGeometry.h"
     31#include "LayoutBoxGeometry.h"
    3232#include "LayoutPoint.h"
    3333#include "LayoutUnits.h"
  • trunk/Source/WebCore/layout/floats/FloatingContext.cpp

    r267054 r267076  
    3333#include "FormattingContext.h"
    3434#include "LayoutBox.h"
     35#include "LayoutBoxGeometry.h"
    3536#include "LayoutContainerBox.h"
    36 #include "LayoutGeometry.h"
    3737#include <wtf/IsoMallocInlines.h>
    3838
     
    244244    ASSERT(!isEmpty());
    245245    auto previousFloatAbsoluteTop = floatingState().floats().last().rectWithMargin().top();
    246     auto absoluteDisplayBoxCoordinates = this->absoluteDisplayBoxCoordinates(layoutBox);
    247     auto absoluteTopLeft = absoluteDisplayBoxCoordinates.topLeft;
     246    auto absoluteBoxGeometryCoordinates = this->absoluteBoxGeometryCoordinates(layoutBox);
     247    auto absoluteTopLeft = absoluteBoxGeometryCoordinates.topLeft;
    248248    // Incoming float cannot be placed higher than existing floats (margin box of the last float).
    249249    // Take the static position (where the box would go if it wasn't floating) and adjust it with the last float.
    250     auto& displayBox = formattingContext().geometryForBox(layoutBox);
    251     if (absoluteTopLeft.y() - displayBox.marginBefore() < previousFloatAbsoluteTop)
    252         absoluteTopLeft.setY(previousFloatAbsoluteTop + displayBox.marginBefore());
     250    auto& boxGeometry = formattingContext().geometryForBox(layoutBox);
     251    if (absoluteTopLeft.y() - boxGeometry.marginBefore() < previousFloatAbsoluteTop)
     252        absoluteTopLeft.setY(previousFloatAbsoluteTop + boxGeometry.marginBefore());
    253253    auto horizontalMargin = computedHorizontalMargin(layoutBox, horizontalConstraints.logicalWidth);
    254     auto margins = Edges { { *horizontalMargin.start, *horizontalMargin.end }, { displayBox.marginBefore(), displayBox.marginAfter() } };
    255     auto floatBox = FloatAvoider { layoutBox, absoluteTopLeft, displayBox.width(), margins, absoluteDisplayBoxCoordinates.containingBlockContentBox };
     254    auto margins = Edges { { *horizontalMargin.start, *horizontalMargin.end }, { boxGeometry.marginBefore(), boxGeometry.marginAfter() } };
     255    auto floatBox = FloatAvoider { layoutBox, absoluteTopLeft, boxGeometry.width(), margins, absoluteBoxGeometryCoordinates.containingBlockContentBox };
    256256    findAvailablePosition(floatBox, m_floatingState.floats());
    257257    // From formatting root coordinate system back to containing block's.
    258     auto containingBlockTopLeft = absoluteDisplayBoxCoordinates.containingBlockTopLeft;
     258    auto containingBlockTopLeft = absoluteBoxGeometryCoordinates.containingBlockTopLeft;
    259259    return { floatBox.left() + margins.horizontal.left - containingBlockTopLeft.x(), floatBox.top() + margins.vertical.top - containingBlockTopLeft.y() };
    260260}
     
    270270        return formattingContext().geometryForBox(layoutBox).topLeft();
    271271
    272     auto absoluteDisplayBoxCoordinates = this->absoluteDisplayBoxCoordinates(layoutBox);
    273     auto& displayBox = formattingContext().geometryForBox(layoutBox);
     272    auto absoluteBoxGeometryCoordinates = this->absoluteBoxGeometryCoordinates(layoutBox);
     273    auto& boxGeometry = formattingContext().geometryForBox(layoutBox);
    274274    auto horizontalMargin = computedHorizontalMargin(layoutBox, horizontalConstraints.logicalWidth);
    275     auto margins = Edges { { *horizontalMargin.start, *horizontalMargin.end }, { displayBox.marginBefore(), displayBox.marginAfter() } };
    276     auto floatAvoider = FloatAvoider { layoutBox, absoluteDisplayBoxCoordinates.topLeft, displayBox.width(), margins, absoluteDisplayBoxCoordinates.containingBlockContentBox };
     275    auto margins = Edges { { *horizontalMargin.start, *horizontalMargin.end }, { boxGeometry.marginBefore(), boxGeometry.marginAfter() } };
     276    auto floatAvoider = FloatAvoider { layoutBox, absoluteBoxGeometryCoordinates.topLeft, boxGeometry.width(), margins, absoluteBoxGeometryCoordinates.containingBlockContentBox };
    277277    findPositionForFormattingContextRoot(floatAvoider);
    278     auto containingBlockTopLeft = absoluteDisplayBoxCoordinates.containingBlockTopLeft;
     278    auto containingBlockTopLeft = absoluteBoxGeometryCoordinates.containingBlockTopLeft;
    279279    return { floatAvoider.left() - containingBlockTopLeft.x(), floatAvoider.top() - containingBlockTopLeft.y() };
    280280}
     
    405405void FloatingContext::append(const Box& floatBox)
    406406{
    407     auto absoluteDisplayBox = Geometry(formattingContext().geometryForBox(floatBox));
    408     absoluteDisplayBox.setTopLeft(mapTopLeftToFloatingStateRoot(floatBox));
    409     floatingState().append(FloatingState::FloatItem { floatBox, absoluteDisplayBox });
     407    auto absoluteBoxGeometry = BoxGeometry(formattingContext().geometryForBox(floatBox));
     408    absoluteBoxGeometry.setTopLeft(mapTopLeftToFloatingStateRoot(floatBox));
     409    floatingState().append(FloatingState::FloatItem { floatBox, absoluteBoxGeometry });
    410410}
    411411
     
    456456}
    457457
    458 FloatingContext::AbsoluteCoordinateValuesForFloatAvoider FloatingContext::absoluteDisplayBoxCoordinates(const Box& floatAvoider) const
     458FloatingContext::AbsoluteCoordinateValuesForFloatAvoider FloatingContext::absoluteBoxGeometryCoordinates(const Box& floatAvoider) const
    459459{
    460460    auto& containingBlock = floatAvoider.containingBlock();
  • trunk/Source/WebCore/layout/floats/FloatingContext.h

    r263938 r267076  
    7575
    7676    struct AbsoluteCoordinateValuesForFloatAvoider;
    77     AbsoluteCoordinateValuesForFloatAvoider absoluteDisplayBoxCoordinates(const Box&) const;
     77    AbsoluteCoordinateValuesForFloatAvoider absoluteBoxGeometryCoordinates(const Box&) const;
    7878    LayoutPoint mapTopLeftToFloatingStateRoot(const Box&) const;
    7979    Point mapPointFromFormattingContextRootToFloatingStateRoot(Point) const;
  • trunk/Source/WebCore/layout/floats/FloatingState.cpp

    r267054 r267076  
    4141WTF_MAKE_ISO_ALLOCATED_IMPL(FloatingState);
    4242
    43 FloatingState::FloatItem::FloatItem(const Box& layoutBox, Geometry absoluteDisplayBox)
     43FloatingState::FloatItem::FloatItem(const Box& layoutBox, BoxGeometry absoluteBoxGeometry)
    4444    : m_layoutBox(makeWeakPtr(layoutBox))
    4545    , m_position(layoutBox.isLeftFloatingPositioned() ? Position::Left : Position::Right)
    46     , m_absoluteDisplayBox(absoluteDisplayBox)
     46    , m_absoluteBoxGeometry(absoluteBoxGeometry)
    4747{
    4848}
    4949
    50 FloatingState::FloatItem::FloatItem(Position position, Geometry absoluteDisplayBox)
     50FloatingState::FloatItem::FloatItem(Position position, BoxGeometry absoluteBoxGeometry)
    5151    : m_position(position)
    52     , m_absoluteDisplayBox(absoluteDisplayBox)
     52    , m_absoluteBoxGeometry(absoluteBoxGeometry)
    5353{
    5454}
  • trunk/Source/WebCore/layout/floats/FloatingState.h

    r267054 r267076  
    2828#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    2929
     30#include "LayoutBoxGeometry.h"
    3031#include "LayoutContainerBox.h"
    31 #include "LayoutGeometry.h"
    3232#include <wtf/IsoMalloc.h>
    3333#include <wtf/Ref.h>
     
    3939
    4040class Box;
     41class BoxGeometry;
    4142class FloatingContext;
    42 class Geometry;
    4343class LayoutState;
    4444class Rect;
     
    5959    class FloatItem {
    6060    public:
    61         FloatItem(const Box&, Geometry absoluteDisplayBox);
     61        FloatItem(const Box&, BoxGeometry absoluteBoxGeometry);
    6262
    6363        // FIXME: This c'tor is only used by the render tree integation codepath.
    6464        enum class Position { Left, Right };
    65         FloatItem(Position, Geometry absoluteDisplayBox);
     65        FloatItem(Position, BoxGeometry absoluteBoxGeometry);
    6666
    6767        bool isLeftPositioned() const { return m_position == Position::Left; }
    6868        bool isInFormattingContextOf(const ContainerBox& formattingContextRoot) const { return m_layoutBox->isInFormattingContextOf(formattingContextRoot); }
    6969
    70         Rect rectWithMargin() const { return m_absoluteDisplayBox.rectWithMargin(); }
    71         Geometry::HorizontalMargin horizontalMargin() const { return m_absoluteDisplayBox.horizontalMargin(); }
    72         PositionInContextRoot bottom() const { return { m_absoluteDisplayBox.bottom() }; }
     70        Rect rectWithMargin() const { return m_absoluteBoxGeometry.rectWithMargin(); }
     71        BoxGeometry::HorizontalMargin horizontalMargin() const { return m_absoluteBoxGeometry.horizontalMargin(); }
     72        PositionInContextRoot bottom() const { return { m_absoluteBoxGeometry.bottom() }; }
    7373
    7474#if ASSERT_ENABLED
     
    7878        WeakPtr<const Box> m_layoutBox;
    7979        Position m_position;
    80         Geometry m_absoluteDisplayBox;
     80        BoxGeometry m_absoluteBoxGeometry;
    8181    };
    8282    using FloatList = Vector<FloatItem>;
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r266979 r267076  
    118118                computeBorderAndPadding(*layoutBox, constraints.horizontal);
    119119                computeHorizontalMargin(*layoutBox, constraints.horizontal);
    120                 formattingState().displayBox(*layoutBox).setVerticalMargin({ });
     120                formattingState().boxGeometry(*layoutBox).setVerticalMargin({ });
    121121            }
    122122        } else
     
    151151        auto initialLineConstraints = ConstraintsForInFlowContent { constraints.horizontal, { lineLogicalTop, makeOptional(toLayoutUnit(quirks().initialLineHeight())) } };
    152152        auto lineContent = lineBuilder.layoutInlineContent(needsLayoutRange, partialLeadingContentLength, initialLineConstraints, isFirstLine);
    153         auto lineLogicalRect = createDisplayBoxesForLineContent(lineContent, constraints.horizontal);
     153        auto lineLogicalRect = computeGeometryForLineContent(lineContent, constraints.horizontal);
    154154
    155155        auto lineContentRange = lineContent.inlineItemRange;
     
    233233        for (auto* formattingRoot : formattingContextRootList) {
    234234            auto intrinsicWidths = layoutState.formattingStateForBox(*formattingRoot).intrinsicWidthConstraintsForBox(*formattingRoot);
    235             auto& displayBox = formattingState().displayBox(*formattingRoot);
    236             auto contentWidth = (availableWidth ? intrinsicWidths->maximum : intrinsicWidths->minimum) - displayBox.horizontalMarginBorderAndPadding();
    237             displayBox.setContentBoxWidth(contentWidth);
     235            auto& boxGeometry = formattingState().boxGeometry(*formattingRoot);
     236            auto contentWidth = (availableWidth ? intrinsicWidths->maximum : intrinsicWidths->minimum) - boxGeometry.horizontalMarginBorderAndPadding();
     237            boxGeometry.setContentBoxWidth(contentWidth);
    238238        }
    239239        return computedIntrinsicWidthForConstraint(availableWidth);
     
    279279{
    280280    auto computedHorizontalMargin = geometry().computedHorizontalMargin(layoutBox, horizontalConstraints);
    281     formattingState().displayBox(layoutBox).setHorizontalMargin({ computedHorizontalMargin.start.valueOr(0), computedHorizontalMargin.end.valueOr(0) });
     281    formattingState().boxGeometry(layoutBox).setHorizontalMargin({ computedHorizontalMargin.start.valueOr(0), computedHorizontalMargin.end.valueOr(0) });
    282282}
    283283
     
    309309        contentWidthAndMargin = minWidthAndMargin;
    310310
    311     auto& displayBox = formattingState().displayBox(layoutBox);
    312     displayBox.setContentBoxWidth(contentWidthAndMargin.contentWidth);
    313     displayBox.setHorizontalMargin({ contentWidthAndMargin.usedMargin.start, contentWidthAndMargin.usedMargin.end });
     311    auto& boxGeometry = formattingState().boxGeometry(layoutBox);
     312    boxGeometry.setContentBoxWidth(contentWidthAndMargin.contentWidth);
     313    boxGeometry.setHorizontalMargin({ contentWidthAndMargin.usedMargin.start, contentWidthAndMargin.usedMargin.end });
    314314}
    315315
     
    339339            contentHeightAndMargin = minHeightAndMargin;
    340340    }
    341     auto& displayBox = formattingState().displayBox(layoutBox);
    342     displayBox.setContentBoxHeight(contentHeightAndMargin.contentHeight);
    343     displayBox.setVerticalMargin({ contentHeightAndMargin.nonCollapsedMargin.before, contentHeightAndMargin.nonCollapsedMargin.after });
     341    auto& boxGeometry = formattingState().boxGeometry(layoutBox);
     342    boxGeometry.setContentBoxHeight(contentHeightAndMargin.contentHeight);
     343    boxGeometry.setVerticalMargin({ contentHeightAndMargin.nonCollapsedMargin.before, contentHeightAndMargin.nonCollapsedMargin.after });
    344344}
    345345
     
    441441}
    442442
    443 Display::InlineRect InlineFormattingContext::createDisplayBoxesForLineContent(const LineBuilder::LineContent& lineContent, const HorizontalConstraints& horizontalConstraints)
     443Display::InlineRect InlineFormattingContext::computeGeometryForLineContent(const LineBuilder::LineContent& lineContent, const HorizontalConstraints& horizontalConstraints)
    444444{
    445445    auto& formattingState = this->formattingState();
     
    455455        for (const auto& floatCandidate : lineContent.floats) {
    456456            auto& floatBox = floatCandidate.item->layoutBox();
    457             auto& displayBox = formattingState.displayBox(floatBox);
     457            auto& boxGeometry = formattingState.boxGeometry(floatBox);
    458458            // Set static position first.
    459459            auto verticalStaticPosition = floatCandidate.isIntrusive ? lineLogicalRect.top() : lineLogicalRect.bottom();
    460             displayBox.setTopLeft({ lineLogicalRect.left(), verticalStaticPosition });
     460            boxGeometry.setTopLeft({ lineLogicalRect.left(), verticalStaticPosition });
    461461            // Float it.
    462             displayBox.setTopLeft(floatingContext.positionForFloat(floatBox, horizontalConstraints));
     462            boxGeometry.setTopLeft(floatingContext.positionForFloat(floatBox, horizontalConstraints));
    463463            floatingContext.append(floatBox);
    464464        }
     
    507507        // Create display boxes.
    508508        // FIXME: Since <br> and <wbr> runs have associated DOM elements, we might need to construct a display box here.
    509         auto initiatesDisplayBox = lineRun.isBox() || lineRun.isContainerStart();
    510         if (initiatesDisplayBox) {
    511             auto& displayBox = formattingState.displayBox(layoutBox);
     509        auto needsBoxGeometry = lineRun.isBox() || lineRun.isContainerStart();
     510        if (needsBoxGeometry) {
     511            auto& boxGeometry = formattingState.boxGeometry(layoutBox);
    512512            auto& inlineBox = lineBox.inlineBoxForLayoutBox(layoutBox);
    513513            auto topLeft = inlineBox.logicalRect().topLeft();
     
    515515            if (layoutBox.isInFlowPositioned())
    516516                topLeft += geometry().inFlowPositionedPositionOffset(layoutBox, horizontalConstraints);
    517             displayBox.setTopLeft(toLayoutPoint(topLeft));
     517            boxGeometry.setTopLeft(toLayoutPoint(topLeft));
    518518            if (lineRun.isContainerStart()) {
    519519                auto marginBoxWidth = inlineBox.logicalWidth();
    520                 auto contentBoxWidth = marginBoxWidth - (displayBox.marginStart() + displayBox.borderLeft() + displayBox.paddingLeft().valueOr(0));
     520                auto contentBoxWidth = marginBoxWidth - (boxGeometry.marginStart() + boxGeometry.borderLeft() + boxGeometry.paddingLeft().valueOr(0));
    521521                // FIXME: Fix it for multiline.
    522                 displayBox.setContentBoxWidth(toLayoutUnit(contentBoxWidth));
    523                 displayBox.setContentBoxHeight(toLayoutUnit(inlineBox.logicalHeight()));
     522                boxGeometry.setContentBoxWidth(toLayoutUnit(contentBoxWidth));
     523                boxGeometry.setContentBoxHeight(toLayoutUnit(inlineBox.logicalHeight()));
    524524            }
    525525        }
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h

    r266722 r267076  
    8787
    8888    void collectInlineContentIfNeeded();
    89     Display::InlineRect createDisplayBoxesForLineContent(const LineBuilder::LineContent&, const HorizontalConstraints&);
     89    Display::InlineRect computeGeometryForLineContent(const LineBuilder::LineContent&, const HorizontalConstraints&);
    9090    struct LineRectAndLineBoxOffset {
    9191        InlineLayoutUnit lineBoxVerticalOffset;
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h

    r267054 r267076  
    3030#include "DisplayInlineRect.h"
    3131#include "InlineLine.h"
    32 #include "LayoutGeometry.h"
     32#include "LayoutBoxGeometry.h"
    3333#include <wtf/IsoMallocInlines.h>
    3434#include <wtf/WeakPtr.h>
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp

    r267054 r267076  
    3232#include "InlineFormattingContext.h"
    3333#include "LayoutBox.h"
    34 #include "LayoutGeometry.h"
     34#include "LayoutBoxGeometry.h"
    3535#include "RuntimeEnabledFeatures.h"
    3636#include "TextUtil.h"
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp

    r267054 r267076  
    3737#include "InlineFormattingState.h"
    3838#include "InvalidationState.h"
    39 #include "LayoutGeometry.h"
     39#include "LayoutBoxGeometry.h"
    4040#include "LayoutTreeBuilder.h"
    4141#include "PaintInfo.h"
     
    139139            ? Layout::FloatingState::FloatItem::Position::Right
    140140            : Layout::FloatingState::FloatItem::Position::Left;
    141         auto box = Layout::Geometry { };
     141        auto boxGeometry = Layout::BoxGeometry { };
    142142        // FIXME: We are flooring here for legacy compatibility.
    143143        //        See FloatingObjects::intervalForFloatingObject.
    144144        auto y = rect.y().floor();
    145145        auto maxY = rect.maxY().floor();
    146         box.setTopLeft({ rect.x(), y });
    147         box.setContentBoxWidth(rect.width());
    148         box.setContentBoxHeight(maxY - y);
    149         box.setBorder({ });
    150         box.setPadding({ });
    151         box.setHorizontalMargin({ });
    152         box.setVerticalMargin({ });
    153         floatingState.append({ position, box });
     146        boxGeometry.setTopLeft({ rect.x(), y });
     147        boxGeometry.setContentBoxWidth(rect.width());
     148        boxGeometry.setContentBoxHeight(maxY - y);
     149        boxGeometry.setBorder({ });
     150        boxGeometry.setPadding({ });
     151        boxGeometry.setHorizontalMargin({ });
     152        boxGeometry.setVerticalMargin({ });
     153        floatingState.append({ position, boxGeometry });
    154154    }
    155155}
  • trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp

    r267059 r267076  
    2929#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    3030
     31#include "LayoutBoxGeometry.h"
    3132#include "LayoutContainerBox.h"
    32 #include "LayoutGeometry.h"
    3333#include "LayoutInitialContainingBlock.h"
    3434#include "LayoutPhase.h"
     
    455455}
    456456
    457 void Box::setCachedDisplayBoxForLayoutState(LayoutState& layoutState, std::unique_ptr<Geometry> box) const
     457void Box::setCachedGeometryForLayoutState(LayoutState& layoutState, std::unique_ptr<BoxGeometry> geometry) const
    458458{
    459459    ASSERT(!m_cachedLayoutState);
    460460    m_cachedLayoutState = makeWeakPtr(layoutState);
    461     m_cachedDisplayBoxForLayoutState = WTFMove(box);
     461    m_cachedGeometryForLayoutState = WTFMove(geometry);
    462462}
    463463
  • trunk/Source/WebCore/layout/layouttree/LayoutBox.h

    r267059 r267076  
    3838
    3939class ContainerBox;
    40 class Geometry;
     40class BoxGeometry;
    4141class InitialContainingBlock;
    4242class LayoutState;
     
    171171
    172172    bool canCacheForLayoutState(const LayoutState&) const;
    173     Geometry* cachedDisplayBoxForLayoutState(const LayoutState&) const;
    174     void setCachedDisplayBoxForLayoutState(LayoutState&, std::unique_ptr<Geometry>) const;
     173    BoxGeometry* cachedGeometryForLayoutState(const LayoutState&) const;
     174    void setCachedGeometryForLayoutState(LayoutState&, std::unique_ptr<BoxGeometry>) const;
    175175
    176176protected:
     
    208208    // First LayoutState gets a direct cache.
    209209    mutable WeakPtr<LayoutState> m_cachedLayoutState;
    210     mutable std::unique_ptr<Geometry> m_cachedDisplayBoxForLayoutState;
     210    mutable std::unique_ptr<BoxGeometry> m_cachedGeometryForLayoutState;
    211211
    212212    unsigned m_baseTypeFlags : 6; // OptionSet<BaseTypeFlag>
  • trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.cpp

    r267075 r267076  
    2525
    2626#include "config.h"
    27 #include "LayoutGeometry.h"
     27#include "LayoutBoxGeometry.h"
    2828
    2929#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     
    3434namespace Layout {
    3535
    36 WTF_MAKE_ISO_ALLOCATED_IMPL(Geometry);
     36WTF_MAKE_ISO_ALLOCATED_IMPL(BoxGeometry);
    3737
    38 Geometry::Geometry(const Geometry& other)
     38BoxGeometry::BoxGeometry(const BoxGeometry& other)
    3939    : m_topLeft(other.m_topLeft)
    4040    , m_contentWidth(other.m_contentWidth)
     
    5959}
    6060
    61 Geometry::~Geometry()
     61BoxGeometry::~BoxGeometry()
    6262{
    6363}
    6464
    65 Rect Geometry::marginBox() const
     65Rect BoxGeometry::marginBox() const
    6666{
    6767    auto borderBox = this->borderBox();
     
    7575}
    7676
    77 Rect Geometry::borderBox() const
     77Rect BoxGeometry::borderBox() const
    7878{
    7979    Rect borderBox;
     
    8383}
    8484
    85 Rect Geometry::paddingBox() const
     85Rect BoxGeometry::paddingBox() const
    8686{
    8787    auto borderBox = this->borderBox();
     
    9595}
    9696
    97 Rect Geometry::contentBox() const
     97Rect BoxGeometry::contentBox() const
    9898{
    9999    Rect contentBox;
  • trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.h

    r267075 r267076  
    306306
    307307
    308 class Geometry {
    309     WTF_MAKE_ISO_ALLOCATED(Geometry);
     308class BoxGeometry {
     309    WTF_MAKE_ISO_ALLOCATED(BoxGeometry);
    310310public:
    311     Geometry(const Geometry&);
    312     Geometry() = default;
    313     ~Geometry();
     311    BoxGeometry(const BoxGeometry&);
     312    BoxGeometry() = default;
     313    ~BoxGeometry();
    314314
    315315    LayoutUnit top() const;
     
    454454
    455455#if ASSERT_ENABLED
    456 inline void Geometry::invalidateMargin()
     456inline void BoxGeometry::invalidateMargin()
    457457{
    458458    m_hasValidHorizontalMargin = false;
     
    461461#endif
    462462
    463 inline LayoutUnit Geometry::top() const
     463inline LayoutUnit BoxGeometry::top() const
    464464{
    465465    ASSERT(m_hasValidTop && (m_hasPrecomputedMarginBefore || m_hasValidVerticalMargin));
     
    467467}
    468468
    469 inline LayoutUnit Geometry::left() const
     469inline LayoutUnit BoxGeometry::left() const
    470470{
    471471    ASSERT(m_hasValidLeft && m_hasValidHorizontalMargin);
     
    473473}
    474474
    475 inline LayoutPoint Geometry::topLeft() const
     475inline LayoutPoint BoxGeometry::topLeft() const
    476476{
    477477    ASSERT(m_hasValidTop && (m_hasPrecomputedMarginBefore || m_hasValidVerticalMargin));
     
    480480}
    481481
    482 inline void Geometry::setTopLeft(const LayoutPoint& topLeft)
     482inline void BoxGeometry::setTopLeft(const LayoutPoint& topLeft)
    483483{
    484484#if ASSERT_ENABLED
     
    489489}
    490490
    491 inline void Geometry::setTop(LayoutUnit top)
     491inline void BoxGeometry::setTop(LayoutUnit top)
    492492{
    493493#if ASSERT_ENABLED
     
    497497}
    498498
    499 inline void Geometry::setLeft(LayoutUnit left)
     499inline void BoxGeometry::setLeft(LayoutUnit left)
    500500{
    501501#if ASSERT_ENABLED
     
    505505}
    506506
    507 inline void Geometry::setContentBoxHeight(LayoutUnit height)
     507inline void BoxGeometry::setContentBoxHeight(LayoutUnit height)
    508508{
    509509#if ASSERT_ENABLED
     
    513513}
    514514
    515 inline void Geometry::setContentBoxWidth(LayoutUnit width)
     515inline void BoxGeometry::setContentBoxWidth(LayoutUnit width)
    516516{
    517517#if ASSERT_ENABLED
     
    521521}
    522522
    523 inline LayoutUnit Geometry::contentBoxHeight() const
     523inline LayoutUnit BoxGeometry::contentBoxHeight() const
    524524{
    525525    ASSERT(m_hasValidContentHeight);
     
    527527}
    528528
    529 inline LayoutUnit Geometry::contentBoxWidth() const
     529inline LayoutUnit BoxGeometry::contentBoxWidth() const
    530530{
    531531    ASSERT(m_hasValidContentWidth);
     
    533533}
    534534
    535 inline void Geometry::setHorizontalMargin(HorizontalMargin margin)
     535inline void BoxGeometry::setHorizontalMargin(HorizontalMargin margin)
    536536{
    537537#if ASSERT_ENABLED
     
    541541}
    542542
    543 inline void Geometry::setVerticalMargin(VerticalMargin margin)
     543inline void BoxGeometry::setVerticalMargin(VerticalMargin margin)
    544544{
    545545#if ASSERT_ENABLED
     
    550550}
    551551
    552 inline void Geometry::setBorder(Layout::Edges border)
     552inline void BoxGeometry::setBorder(Layout::Edges border)
    553553{
    554554#if ASSERT_ENABLED
     
    558558}
    559559
    560 inline void Geometry::setPadding(Optional<Layout::Edges> padding)
     560inline void BoxGeometry::setPadding(Optional<Layout::Edges> padding)
    561561{
    562562#if ASSERT_ENABLED
     
    566566}
    567567
    568 inline void Geometry::setVerticalPadding(Layout::VerticalEdges verticalPadding)
     568inline void BoxGeometry::setVerticalPadding(Layout::VerticalEdges verticalPadding)
    569569{
    570570#if ASSERT_ENABLED
     
    574574}
    575575
    576 inline Geometry::VerticalMargin Geometry::verticalMargin() const
     576inline BoxGeometry::VerticalMargin BoxGeometry::verticalMargin() const
    577577{
    578578    ASSERT(m_hasValidVerticalMargin);
     
    580580}
    581581
    582 inline Geometry::HorizontalMargin Geometry::horizontalMargin() const
     582inline BoxGeometry::HorizontalMargin BoxGeometry::horizontalMargin() const
    583583{
    584584    ASSERT(m_hasValidHorizontalMargin);
     
    586586}
    587587
    588 inline LayoutUnit Geometry::marginBefore() const
     588inline LayoutUnit BoxGeometry::marginBefore() const
    589589{
    590590    ASSERT(m_hasValidVerticalMargin);
     
    592592}
    593593
    594 inline LayoutUnit Geometry::marginStart() const
     594inline LayoutUnit BoxGeometry::marginStart() const
    595595{
    596596    ASSERT(m_hasValidHorizontalMargin);
     
    598598}
    599599
    600 inline LayoutUnit Geometry::marginAfter() const
     600inline LayoutUnit BoxGeometry::marginAfter() const
    601601{
    602602    ASSERT(m_hasValidVerticalMargin);
     
    604604}
    605605
    606 inline LayoutUnit Geometry::marginEnd() const
     606inline LayoutUnit BoxGeometry::marginEnd() const
    607607{
    608608    ASSERT(m_hasValidHorizontalMargin);
     
    610610}
    611611
    612 inline Optional<LayoutUnit> Geometry::paddingTop() const
     612inline Optional<LayoutUnit> BoxGeometry::paddingTop() const
    613613{
    614614    ASSERT(m_hasValidPadding);
     
    618618}
    619619
    620 inline Optional<LayoutUnit> Geometry::paddingLeft() const
     620inline Optional<LayoutUnit> BoxGeometry::paddingLeft() const
    621621{
    622622    ASSERT(m_hasValidPadding);
     
    626626}
    627627
    628 inline Optional<LayoutUnit> Geometry::paddingBottom() const
     628inline Optional<LayoutUnit> BoxGeometry::paddingBottom() const
    629629{
    630630    ASSERT(m_hasValidPadding);
     
    634634}
    635635
    636 inline Optional<LayoutUnit> Geometry::paddingRight() const
     636inline Optional<LayoutUnit> BoxGeometry::paddingRight() const
    637637{
    638638    ASSERT(m_hasValidPadding);
     
    642642}
    643643
    644 inline Optional<LayoutUnit> Geometry::verticalPadding() const
     644inline Optional<LayoutUnit> BoxGeometry::verticalPadding() const
    645645{
    646646    auto paddingTop = this->paddingTop();
     
    651651}
    652652
    653 inline Optional<LayoutUnit> Geometry::horizontalPadding() const
     653inline Optional<LayoutUnit> BoxGeometry::horizontalPadding() const
    654654{
    655655    auto paddingLeft = this->paddingLeft();
     
    660660}
    661661
    662 inline LayoutUnit Geometry::borderTop() const
     662inline LayoutUnit BoxGeometry::borderTop() const
    663663{
    664664    ASSERT(m_hasValidBorder);
     
    666666}
    667667
    668 inline LayoutUnit Geometry::borderLeft() const
     668inline LayoutUnit BoxGeometry::borderLeft() const
    669669{
    670670    ASSERT(m_hasValidBorder);
     
    672672}
    673673
    674 inline LayoutUnit Geometry::borderBottom() const
     674inline LayoutUnit BoxGeometry::borderBottom() const
    675675{
    676676    ASSERT(m_hasValidBorder);
     
    678678}
    679679
    680 inline LayoutUnit Geometry::borderRight() const
     680inline LayoutUnit BoxGeometry::borderRight() const
    681681{
    682682    ASSERT(m_hasValidBorder);
  • trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp

    r267054 r267076  
    3939#include "InvalidationState.h"
    4040#include "LayoutBox.h"
     41#include "LayoutBoxGeometry.h"
    4142#include "LayoutChildIterator.h"
    4243#include "LayoutContainerBox.h"
    4344#include "LayoutContext.h"
    44 #include "LayoutGeometry.h"
    4545#include "LayoutInitialContainingBlock.h"
    4646#include "LayoutInlineTextBox.h"
     
    427427}
    428428
    429 static void outputLayoutBox(TextStream& stream, const Box& layoutBox, const Geometry* displayBox, unsigned depth)
     429static void outputLayoutBox(TextStream& stream, const Box& layoutBox, const BoxGeometry* boxGeometry, unsigned depth)
    430430{
    431431    unsigned printedCharacters = 0;
     
    482482        stream << "unknown box";
    483483
    484     if (displayBox)
    485         stream << " at (" << displayBox->left() << "," << displayBox->top() << ") size " << displayBox->width() << "x" << displayBox->height();
     484    if (boxGeometry)
     485        stream << " at (" << boxGeometry->left() << "," << boxGeometry->top() << ") size " << boxGeometry->width() << "x" << boxGeometry->height();
    486486    stream << " (" << &layoutBox << ")";
    487487    if (is<InlineTextBox>(layoutBox)) {
     
    507507        if (layoutState) {
    508508            // Not all boxes generate display boxes.
    509             if (layoutState->hasDisplayBox(child))
    510                 outputLayoutBox(stream, child, &layoutState->geometryForLayoutBox(child), depth);
     509            if (layoutState->hasBoxGeometry(child))
     510                outputLayoutBox(stream, child, &layoutState->geometryForBox(child), depth);
    511511            else
    512512                outputLayoutBox(stream, child, nullptr, depth);
     
    526526
    527527    auto& initialContainingBlock = layoutBox.initialContainingBlock();
    528     outputLayoutBox(stream, initialContainingBlock, layoutState ? &layoutState->geometryForLayoutBox(initialContainingBlock) : nullptr, 0);
     528    outputLayoutBox(stream, initialContainingBlock, layoutState ? &layoutState->geometryForBox(initialContainingBlock) : nullptr, 0);
    529529    outputLayoutTree(layoutState, stream, initialContainingBlock, 1);
    530530    WTFLogAlways("%s", stream.release().utf8().data());
  • trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp

    r267054 r267076  
    3434#include "InvalidationState.h"
    3535#include "LayoutBox.h"
     36#include "LayoutBoxGeometry.h"
    3637#include "LayoutChildIterator.h"
    3738#include "LayoutContext.h"
    38 #include "LayoutGeometry.h"
    3939#include "LayoutInitialContainingBlock.h"
    4040#include "TableFormattingState.h"
     
    7676    for (auto& cell : grid.cells()) {
    7777        auto& cellBox = cell->box();
    78         auto& cellDisplayBox = formattingState().displayBox(cellBox);
     78        auto& cellBoxGeometry = formattingState().boxGeometry(cellBox);
    7979        auto& section = rowList[cell->startRow()].box().parent();
    8080        if (&section != currentSection) {
     
    8383            sectionOffset = rowList[cell->startRow()].logicalTop();
    8484        }
    85         cellDisplayBox.setTop(rowList[cell->startRow()].logicalTop() - sectionOffset);
    86         cellDisplayBox.setLeft(columnList[cell->startColumn()].logicalLeft());
     85        cellBoxGeometry.setTop(rowList[cell->startRow()].logicalTop() - sectionOffset);
     86        cellBoxGeometry.setLeft(columnList[cell->startColumn()].logicalLeft());
    8787        auto availableVerticalSpace = rowList[cell->startRow()].logicalHeight();
    8888        for (size_t rowIndex = cell->startRow() + 1; rowIndex < cell->endRow(); ++rowIndex)
     
    9292        // FIXME: Find out if it is ok to use the regular padding here to align the content box inside a tall cell or we need to
    9393        // use some kind of intrinsic padding similar to RenderTableCell.
    94         auto paddingTop = cellDisplayBox.paddingTop().valueOr(LayoutUnit { });
    95         auto paddingBottom = cellDisplayBox.paddingBottom().valueOr(LayoutUnit { });
     94        auto paddingTop = cellBoxGeometry.paddingTop().valueOr(LayoutUnit { });
     95        auto paddingBottom = cellBoxGeometry.paddingBottom().valueOr(LayoutUnit { });
    9696        auto intrinsicPaddingTop = LayoutUnit { };
    9797        auto intrinsicPaddingBottom = LayoutUnit { };
     
    9999        switch (cellBox.style().verticalAlign()) {
    100100        case VerticalAlign::Middle: {
    101             auto intrinsicVerticalPadding = std::max(0_lu, availableVerticalSpace - cellDisplayBox.verticalMarginBorderAndPadding() - cellDisplayBox.contentBoxHeight());
     101            auto intrinsicVerticalPadding = std::max(0_lu, availableVerticalSpace - cellBoxGeometry.verticalMarginBorderAndPadding() - cellBoxGeometry.contentBoxHeight());
    102102            intrinsicPaddingTop = intrinsicVerticalPadding / 2;
    103103            intrinsicPaddingBottom = intrinsicVerticalPadding / 2;
     
    107107            auto rowBaseline = LayoutUnit { rowList[cell->startRow()].baseline() };
    108108            auto cellBaseline = LayoutUnit { cell->baseline() };
    109             intrinsicPaddingTop = std::max(0_lu, rowBaseline - cellBaseline - cellDisplayBox.borderTop());
    110             intrinsicPaddingBottom = std::max(0_lu, availableVerticalSpace - cellDisplayBox.verticalMarginBorderAndPadding() - intrinsicPaddingTop - cellDisplayBox.contentBoxHeight());
     109            intrinsicPaddingTop = std::max(0_lu, rowBaseline - cellBaseline - cellBoxGeometry.borderTop());
     110            intrinsicPaddingBottom = std::max(0_lu, availableVerticalSpace - cellBoxGeometry.verticalMarginBorderAndPadding() - intrinsicPaddingTop - cellBoxGeometry.contentBoxHeight());
    111111            break;
    112112        }
     
    127127                    if (child->isAnonymous() || child->isLineBreakBox())
    128128                        continue;
    129                     formattingState.displayBox(*child).moveVertically(intrinsicPaddingTop);
     129                    formattingState.boxGeometry(*child).moveVertically(intrinsicPaddingTop);
    130130                }
    131131                if (cellBox.establishesInlineFormattingContext()) {
     
    139139            adjustCellContentWithInstrinsicPaddingBefore();
    140140        }
    141         cellDisplayBox.setVerticalPadding({ paddingTop + intrinsicPaddingTop, paddingBottom + intrinsicPaddingBottom });
     141        cellBoxGeometry.setVerticalPadding({ paddingTop + intrinsicPaddingTop, paddingBottom + intrinsicPaddingBottom });
    142142    }
    143143}
     
    153153        auto& row = rows[rowIndex];
    154154        auto& rowBox = row.box();
    155         auto& rowDisplayBox = formattingState().displayBox(rowBox);
    156 
    157         rowDisplayBox.setPadding(geometry().computedPadding(rowBox, availableHorizontalSpace));
     155        auto& rowBoxGeometry = formattingState().boxGeometry(rowBox);
     156
     157        rowBoxGeometry.setPadding(geometry().computedPadding(rowBox, availableHorizontalSpace));
    158158        // Internal table elements do not have margins.
    159         rowDisplayBox.setHorizontalMargin({ });
    160         rowDisplayBox.setVerticalMargin({ });
     159        rowBoxGeometry.setHorizontalMargin({ });
     160        rowBoxGeometry.setVerticalMargin({ });
    161161
    162162        auto computedRowBorder = [&] {
     
    182182            computedRowBorder.vertical.bottom = { };
    183183        }
    184         rowDisplayBox.setContentBoxHeight(row.logicalHeight() - computedRowBorder.height());
     184        rowBoxGeometry.setContentBoxHeight(row.logicalHeight() - computedRowBorder.height());
    185185
    186186        auto rowLogicalWidth = grid.columns().logicalWidth() + 2 * grid.horizontalSpacing();
     
    190190            computedRowBorder.horizontal.right = { };
    191191        }
    192         rowDisplayBox.setContentBoxWidth(rowLogicalWidth - computedRowBorder.width());
    193         rowDisplayBox.setBorder(computedRowBorder);
     192        rowBoxGeometry.setContentBoxWidth(rowLogicalWidth - computedRowBorder.width());
     193        rowBoxGeometry.setBorder(computedRowBorder);
    194194
    195195        if (previousRow && &previousRow->parent() != &rowBox.parent()) {
     
    197197            rowLogicalTop = { };
    198198        }
    199         rowDisplayBox.setTop(rowLogicalTop);
    200         rowDisplayBox.setLeft({ });
     199        rowBoxGeometry.setTop(rowLogicalTop);
     200        rowBoxGeometry.setLeft({ });
    201201
    202202        rowLogicalTop += row.logicalHeight() + grid.verticalSpacing();
     
    232232    auto paddingAfter = verticalSpacing;
    233233    for (auto& sectionBox : childrenOfType<ContainerBox>(tableBox)) {
    234         auto& sectionDisplayBox = formattingState().displayBox(sectionBox);
     234        auto& sectionBoxGeometry = formattingState().boxGeometry(sectionBox);
    235235        // Section borders are either collapsed or ignored.
    236         sectionDisplayBox.setBorder({ });
     236        sectionBoxGeometry.setBorder({ });
    237237        // Use fake vertical padding to space out the sections.
    238         sectionDisplayBox.setPadding(Edges { { }, { paddingBefore.valueOr(0_lu), paddingAfter } });
     238        sectionBoxGeometry.setPadding(Edges { { }, { paddingBefore.valueOr(0_lu), paddingAfter } });
    239239        paddingBefore = WTF::nullopt;
    240240        // Internal table elements do not have margins.
    241         sectionDisplayBox.setHorizontalMargin({ });
    242         sectionDisplayBox.setVerticalMargin({ });
    243 
    244         sectionDisplayBox.setContentBoxWidth(sectionWidth);
     241        sectionBoxGeometry.setHorizontalMargin({ });
     242        sectionBoxGeometry.setVerticalMargin({ });
     243
     244        sectionBoxGeometry.setContentBoxWidth(sectionWidth);
    245245        auto sectionContentHeight = LayoutUnit { };
    246246        size_t rowCount = 0;
     
    250250        }
    251251        sectionContentHeight += verticalSpacing * (rowCount - 1);
    252         sectionDisplayBox.setContentBoxHeight(sectionContentHeight);
    253         sectionDisplayBox.setLeft(constraints.horizontal.logicalLeft);
    254         sectionDisplayBox.setTop(logicalTop);
    255 
    256         logicalTop += sectionDisplayBox.height();
     252        sectionBoxGeometry.setContentBoxHeight(sectionContentHeight);
     253        sectionBoxGeometry.setLeft(constraints.horizontal.logicalLeft);
     254        sectionBoxGeometry.setTop(logicalTop);
     255
     256        logicalTop += sectionBoxGeometry.height();
    257257    }
    258258}
     
    264264    auto& grid = formattingState().tableGrid();
    265265    auto& cellBox = cell.box();
    266     auto& cellDisplayBox = formattingState().displayBox(cellBox);
    267 
    268     cellDisplayBox.setBorder(geometry().computedCellBorder(cell));
    269     cellDisplayBox.setPadding(geometry().computedPadding(cellBox, availableHorizontalSpace));
     266    auto& cellBoxGeometry = formattingState().boxGeometry(cellBox);
     267
     268    cellBoxGeometry.setBorder(geometry().computedCellBorder(cell));
     269    cellBoxGeometry.setPadding(geometry().computedPadding(cellBox, availableHorizontalSpace));
    270270    // Internal table elements do not have margins.
    271     cellDisplayBox.setHorizontalMargin({ });
    272     cellDisplayBox.setVerticalMargin({ });
     271    cellBoxGeometry.setHorizontalMargin({ });
     272    cellBoxGeometry.setVerticalMargin({ });
    273273
    274274    auto availableSpaceForContent = [&] {
     
    279279        // No column spacing when spanning.
    280280        logicalWidth += (cell.columnSpan() - 1) * grid.horizontalSpacing();
    281         return logicalWidth - cellDisplayBox.horizontalMarginBorderAndPadding();
     281        return logicalWidth - cellBoxGeometry.horizontalMarginBorderAndPadding();
    282282    }();
    283     cellDisplayBox.setContentBoxWidth(availableSpaceForContent);
     283    cellBoxGeometry.setContentBoxWidth(availableSpaceForContent);
    284284
    285285    if (cellBox.hasInFlowOrFloatingChild()) {
     
    293293        LayoutContext::createFormattingContext(cellBox, layoutState())->layoutInFlowContent(invalidationState, constraintsForCellContent);
    294294    }
    295     cellDisplayBox.setContentBoxHeight(geometry().cellHeigh(cellBox));
     295    cellBoxGeometry.setContentBoxHeight(geometry().cellHeigh(cellBox));
    296296}
    297297
  • trunk/Source/WebCore/layout/tableformatting/TableFormattingContextGeometry.cpp

    r267054 r267076  
    3030
    3131#include "InlineFormattingState.h"
     32#include "LayoutBoxGeometry.h"
    3233#include "LayoutContext.h"
    3334#include "LayoutDescendantIterator.h"
    34 #include "LayoutGeometry.h"
    3535#include "LayoutInitialContainingBlock.h"
    3636#include "TableFormattingState.h"
  • trunk/Source/WebCore/layout/tableformatting/TableLayout.cpp

    r267054 r267076  
    3030
    3131#include "LayoutBox.h"
    32 #include "LayoutGeometry.h"
     32#include "LayoutBoxGeometry.h"
    3333
    3434namespace WebCore {
  • trunk/Source/WebCore/page/FrameViewLayoutContext.cpp

    r267054 r267076  
    4343#include "InvalidationContext.h"
    4444#include "InvalidationState.h"
     45#include "LayoutBoxGeometry.h"
    4546#include "LayoutContext.h"
    46 #include "LayoutGeometry.h"
    4747#include "LayoutState.h"
    4848#include "LayoutTreeBuilder.h"
     
    8282    // Clean up the render tree state when we don't run RenderView::layout.
    8383    if (renderView.needsLayout()) {
    84         auto contentSize = m_layoutState->geometryForLayoutBox(*m_layoutState->root().firstChild()).size();
     84        auto contentSize = m_layoutState->geometryForBox(*m_layoutState->root().firstChild()).size();
    8585        renderView.setSize(contentSize);
    8686        renderView.repaintViewRectangle({ 0, 0, contentSize.width(), contentSize.height() });
Note: See TracChangeset for help on using the changeset viewer.