Changeset 256417 in webkit


Ignore:
Timestamp:
Feb 11, 2020 5:08:08 PM (4 years ago)
Author:
Alan Bujtas
Message:

[LFC] Rename Layout::Container to Layout::ContainerBox
https://bugs.webkit.org/show_bug.cgi?id=207585
<rdar://problem/59363845>

Reviewed by Antti Koivisto.

ContainerBox name is more inline with the rest of the box classes.

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

(WebCore::Layout::FormattingContext::FormattingContext):
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
(WebCore::Layout::mapHorizontalPositionToAncestor):
(WebCore::Layout::FormattingContext::mapTopToFormattingContextRoot const):

  • layout/FormattingContext.h:

(WebCore::Layout::FormattingContext::root const):

  • layout/FormattingContextGeometry.cpp:

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

  • layout/LayoutContext.cpp:

(WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
(WebCore::Layout::LayoutContext::createFormattingContext):

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

(WebCore::Layout::LayoutState::LayoutState):
(WebCore::Layout::LayoutState::establishedFormattingState const):
(WebCore::Layout::LayoutState::establishedInlineFormattingState const):
(WebCore::Layout::LayoutState::establishedBlockFormattingState const):
(WebCore::Layout::LayoutState::establishedTableFormattingState const):
(WebCore::Layout::LayoutState::ensureFormattingState):
(WebCore::Layout::LayoutState::ensureInlineFormattingState):
(WebCore::Layout::LayoutState::ensureBlockFormattingState):
(WebCore::Layout::LayoutState::ensureTableFormattingState):

  • layout/LayoutState.h:

(WebCore::Layout::LayoutState::hasInlineFormattingState const):
(WebCore::Layout::LayoutState::root const):

  • layout/Verification.cpp:

(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
(WebCore::Layout::verifyAndOutputSubtree):

  • layout/blockformatting/BlockFormattingContext.cpp:

(WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
(WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
(WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints):

  • layout/blockformatting/BlockFormattingContext.h:
  • layout/blockformatting/BlockFormattingContextGeometry.cpp:

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

  • layout/blockformatting/BlockFormattingContextQuirks.cpp:

(WebCore::Layout::initialContainingBlock):

  • layout/blockformatting/BlockMarginCollapse.cpp:

(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter const):

  • layout/displaytree/DisplayPainter.cpp:

(WebCore::Display::absoluteDisplayBox):
(WebCore::Display::paintSubtree):
(WebCore::Display::collectPaintRootsAndContentRect):

  • layout/floats/FloatAvoider.cpp:
  • layout/floats/FloatingContext.cpp:

(WebCore::Layout::FloatingContext::FloatingContext):
(WebCore::Layout::FloatingContext::mapTopToFloatingStateRoot const):
(WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const):

  • layout/floats/FloatingContext.h:

(WebCore::Layout::FloatingContext::root const):

  • layout/floats/FloatingState.cpp:

(WebCore::Layout::FloatingState::FloatingState):
(WebCore::Layout::FloatingState::append):
(WebCore::Layout::FloatingState::bottom const):
(WebCore::Layout::FloatingState::top const):

  • layout/floats/FloatingState.h:

(WebCore::Layout::FloatingState::create):
(WebCore::Layout::FloatingState::root const):
(WebCore::Layout::FloatingState::leftBottom const):
(WebCore::Layout::FloatingState::rightBottom const):
(WebCore::Layout::FloatingState::bottom const):
(WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
(WebCore::Layout::nextInlineLevelBoxToLayout):
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
(WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded):

  • layout/inlineformatting/InlineFormattingContext.h:
  • layout/inlineformatting/InlineFormattingContextGeometry.cpp:

(WebCore::Layout::InlineFormattingContext::Geometry::computedTextIndent const):

  • layout/inlineformatting/InlineFormattingContextQuirks.cpp:

(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
(WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):

  • layout/inlineformatting/InlineLineBuilder.cpp:

(WebCore::Layout::LineBuilder::alignContentVertically):
(WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight):

  • layout/inlineformatting/LineLayoutContext.cpp:

(WebCore::Layout::LineLayoutContext::LineLayoutContext):

  • layout/inlineformatting/LineLayoutContext.h:

(WebCore::Layout::LineLayoutContext::root const):

  • layout/integration/LayoutIntegrationBoxTree.h:

(WebCore::LayoutIntegration::BoxTree::rootLayoutBox const):
(WebCore::LayoutIntegration::BoxTree::rootLayoutBox):

  • layout/integration/LayoutIntegrationLineLayout.cpp:

(WebCore::LayoutIntegration::LineLayout::rootLayoutBox const):
(WebCore::LayoutIntegration::LineLayout::rootLayoutBox):

  • layout/integration/LayoutIntegrationLineLayout.h:
  • layout/invalidation/InvalidationState.h:
  • layout/layouttree/LayoutBox.cpp:

(WebCore::Layout::Box::establishesInlineFormattingContext const):
(WebCore::Layout::Box::containingBlock const):
(WebCore::Layout::Box::formattingContextRoot const):
(WebCore::Layout::Box::initialContainingBlock const):
(WebCore::Layout::Box::isDescendantOf const):
(WebCore::Layout::Box::isContainingBlockDescendantOf const):
(WebCore::Layout::Box::isOverflowVisible const):

  • layout/layouttree/LayoutBox.h:

(WebCore::Layout::Box::parent const):
(WebCore::Layout::Box::isContainerBox const):
(WebCore::Layout::Box::setParent):
(WebCore::Layout::Box::isContainer const): Deleted.

  • layout/layouttree/LayoutChildIterator.h:

(WebCore::Layout::LayoutChildIterator<T>::LayoutChildIterator):
(WebCore::Layout::LayoutChildIteratorAdapter<T>::LayoutChildIteratorAdapter):
(WebCore::Layout::childrenOfType):

  • layout/layouttree/LayoutContainerBox.cpp: Renamed from Source/WebCore/layout/layouttree/LayoutContainer.cpp.

(WebCore::Layout::ContainerBox::ContainerBox):
(WebCore::Layout::ContainerBox::firstInFlowChild const):
(WebCore::Layout::ContainerBox::firstInFlowOrFloatingChild const):
(WebCore::Layout::ContainerBox::lastInFlowChild const):
(WebCore::Layout::ContainerBox::lastInFlowOrFloatingChild const):
(WebCore::Layout::ContainerBox::setFirstChild):
(WebCore::Layout::ContainerBox::setLastChild):
(WebCore::Layout::ContainerBox::appendChild):

  • layout/layouttree/LayoutContainerBox.h: Renamed from Source/WebCore/layout/layouttree/LayoutContainer.h.
  • layout/layouttree/LayoutDescendantIterator.h:

(WebCore::Layout::LayoutDescendantIterator<T>::LayoutDescendantIterator):
(WebCore::Layout::LayoutDescendantIteratorAdapter<T>::LayoutDescendantIteratorAdapter):
(WebCore::Layout::descendantsOfType):

  • layout/layouttree/LayoutIterator.h:

(WebCore::Layout::LayoutBoxTraversal::firstChild):
(WebCore::Layout::LayoutBoxTraversal::nextAncestorSibling):
(WebCore::Layout::LayoutBoxTraversal::next):
(WebCore::Layout::LayoutBoxTraversal::nextSkippingChildren):
(WebCore::Layout::Traversal::next):
(WebCore::Layout::LayoutIterator<T>::LayoutIterator):

  • layout/layouttree/LayoutTreeBuilder.cpp:

(WebCore::Layout::LayoutTreeContent::LayoutTreeContent):
(WebCore::Layout::appendChild):
(WebCore::Layout::TreeBuilder::buildLayoutTree):
(WebCore::Layout::TreeBuilder::createContainer):
(WebCore::Layout::TreeBuilder::createLayoutBox):
(WebCore::Layout::TreeBuilder::buildTableStructure):
(WebCore::Layout::TreeBuilder::buildSubTree):
(WebCore::Layout::outputInlineRuns):
(WebCore::Layout::outputLayoutTree):

  • layout/layouttree/LayoutTreeBuilder.h:

(WebCore::Layout::LayoutTreeContent::rootLayoutBox const):
(WebCore::Layout::LayoutTreeContent::rootLayoutBox):
(WebCore::Layout::LayoutTreeContent::addBox):
(WebCore::Layout::LayoutTreeContent::addContainer):

  • layout/tableformatting/TableFormattingContext.cpp:

(WebCore::Layout::TableFormattingContext::TableFormattingContext):
(WebCore::Layout::TableFormattingContext::layoutTableCellBox):
(WebCore::Layout::TableFormattingContext::ensureTableGrid):
(WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):

  • layout/tableformatting/TableFormattingContext.h:
Location:
trunk/Source/WebCore
Files:
42 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r256414 r256417  
     12020-02-11  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Rename Layout::Container to Layout::ContainerBox
     4        https://bugs.webkit.org/show_bug.cgi?id=207585
     5        <rdar://problem/59363845>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        ContainerBox name is more inline with the rest of the box classes.
     10
     11        * Sources.txt:
     12        * WebCore.xcodeproj/project.pbxproj:
     13        * layout/FormattingContext.cpp:
     14        (WebCore::Layout::FormattingContext::FormattingContext):
     15        (WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
     16        (WebCore::Layout::mapHorizontalPositionToAncestor):
     17        (WebCore::Layout::FormattingContext::mapTopToFormattingContextRoot const):
     18        * layout/FormattingContext.h:
     19        (WebCore::Layout::FormattingContext::root const):
     20        * layout/FormattingContextGeometry.cpp:
     21        (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
     22        (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
     23        (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
     24        (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
     25        * layout/LayoutContext.cpp:
     26        (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
     27        (WebCore::Layout::LayoutContext::createFormattingContext):
     28        * layout/LayoutContext.h:
     29        * layout/LayoutState.cpp:
     30        (WebCore::Layout::LayoutState::LayoutState):
     31        (WebCore::Layout::LayoutState::establishedFormattingState const):
     32        (WebCore::Layout::LayoutState::establishedInlineFormattingState const):
     33        (WebCore::Layout::LayoutState::establishedBlockFormattingState const):
     34        (WebCore::Layout::LayoutState::establishedTableFormattingState const):
     35        (WebCore::Layout::LayoutState::ensureFormattingState):
     36        (WebCore::Layout::LayoutState::ensureInlineFormattingState):
     37        (WebCore::Layout::LayoutState::ensureBlockFormattingState):
     38        (WebCore::Layout::LayoutState::ensureTableFormattingState):
     39        * layout/LayoutState.h:
     40        (WebCore::Layout::LayoutState::hasInlineFormattingState const):
     41        (WebCore::Layout::LayoutState::root const):
     42        * layout/Verification.cpp:
     43        (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
     44        (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
     45        (WebCore::Layout::verifyAndOutputSubtree):
     46        * layout/blockformatting/BlockFormattingContext.cpp:
     47        (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
     48        (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
     49        (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
     50        (WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints):
     51        * layout/blockformatting/BlockFormattingContext.h:
     52        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
     53        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
     54        (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
     55        * layout/blockformatting/BlockFormattingContextQuirks.cpp:
     56        (WebCore::Layout::initialContainingBlock):
     57        * layout/blockformatting/BlockMarginCollapse.cpp:
     58        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore const):
     59        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter const):
     60        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
     61        (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore const):
     62        (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter const):
     63        * layout/displaytree/DisplayPainter.cpp:
     64        (WebCore::Display::absoluteDisplayBox):
     65        (WebCore::Display::paintSubtree):
     66        (WebCore::Display::collectPaintRootsAndContentRect):
     67        * layout/floats/FloatAvoider.cpp:
     68        * layout/floats/FloatingContext.cpp:
     69        (WebCore::Layout::FloatingContext::FloatingContext):
     70        (WebCore::Layout::FloatingContext::mapTopToFloatingStateRoot const):
     71        (WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const):
     72        * layout/floats/FloatingContext.h:
     73        (WebCore::Layout::FloatingContext::root const):
     74        * layout/floats/FloatingState.cpp:
     75        (WebCore::Layout::FloatingState::FloatingState):
     76        (WebCore::Layout::FloatingState::append):
     77        (WebCore::Layout::FloatingState::bottom const):
     78        (WebCore::Layout::FloatingState::top const):
     79        * layout/floats/FloatingState.h:
     80        (WebCore::Layout::FloatingState::create):
     81        (WebCore::Layout::FloatingState::root const):
     82        (WebCore::Layout::FloatingState::leftBottom const):
     83        (WebCore::Layout::FloatingState::rightBottom const):
     84        (WebCore::Layout::FloatingState::bottom const):
     85        (WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
     86        * layout/inlineformatting/InlineFormattingContext.cpp:
     87        (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
     88        (WebCore::Layout::nextInlineLevelBoxToLayout):
     89        (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
     90        (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
     91        (WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded):
     92        * layout/inlineformatting/InlineFormattingContext.h:
     93        * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
     94        (WebCore::Layout::InlineFormattingContext::Geometry::computedTextIndent const):
     95        * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
     96        (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
     97        (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):
     98        * layout/inlineformatting/InlineLineBuilder.cpp:
     99        (WebCore::Layout::LineBuilder::alignContentVertically):
     100        (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight):
     101        * layout/inlineformatting/LineLayoutContext.cpp:
     102        (WebCore::Layout::LineLayoutContext::LineLayoutContext):
     103        * layout/inlineformatting/LineLayoutContext.h:
     104        (WebCore::Layout::LineLayoutContext::root const):
     105        * layout/integration/LayoutIntegrationBoxTree.h:
     106        (WebCore::LayoutIntegration::BoxTree::rootLayoutBox const):
     107        (WebCore::LayoutIntegration::BoxTree::rootLayoutBox):
     108        * layout/integration/LayoutIntegrationLineLayout.cpp:
     109        (WebCore::LayoutIntegration::LineLayout::rootLayoutBox const):
     110        (WebCore::LayoutIntegration::LineLayout::rootLayoutBox):
     111        * layout/integration/LayoutIntegrationLineLayout.h:
     112        * layout/invalidation/InvalidationState.h:
     113        * layout/layouttree/LayoutBox.cpp:
     114        (WebCore::Layout::Box::establishesInlineFormattingContext const):
     115        (WebCore::Layout::Box::containingBlock const):
     116        (WebCore::Layout::Box::formattingContextRoot const):
     117        (WebCore::Layout::Box::initialContainingBlock const):
     118        (WebCore::Layout::Box::isDescendantOf const):
     119        (WebCore::Layout::Box::isContainingBlockDescendantOf const):
     120        (WebCore::Layout::Box::isOverflowVisible const):
     121        * layout/layouttree/LayoutBox.h:
     122        (WebCore::Layout::Box::parent const):
     123        (WebCore::Layout::Box::isContainerBox const):
     124        (WebCore::Layout::Box::setParent):
     125        (WebCore::Layout::Box::isContainer const): Deleted.
     126        * layout/layouttree/LayoutChildIterator.h:
     127        (WebCore::Layout::LayoutChildIterator<T>::LayoutChildIterator):
     128        (WebCore::Layout::LayoutChildIteratorAdapter<T>::LayoutChildIteratorAdapter):
     129        (WebCore::Layout::childrenOfType):
     130        * layout/layouttree/LayoutContainerBox.cpp: Renamed from Source/WebCore/layout/layouttree/LayoutContainer.cpp.
     131        (WebCore::Layout::ContainerBox::ContainerBox):
     132        (WebCore::Layout::ContainerBox::firstInFlowChild const):
     133        (WebCore::Layout::ContainerBox::firstInFlowOrFloatingChild const):
     134        (WebCore::Layout::ContainerBox::lastInFlowChild const):
     135        (WebCore::Layout::ContainerBox::lastInFlowOrFloatingChild const):
     136        (WebCore::Layout::ContainerBox::setFirstChild):
     137        (WebCore::Layout::ContainerBox::setLastChild):
     138        (WebCore::Layout::ContainerBox::appendChild):
     139        * layout/layouttree/LayoutContainerBox.h: Renamed from Source/WebCore/layout/layouttree/LayoutContainer.h.
     140        * layout/layouttree/LayoutDescendantIterator.h:
     141        (WebCore::Layout::LayoutDescendantIterator<T>::LayoutDescendantIterator):
     142        (WebCore::Layout::LayoutDescendantIteratorAdapter<T>::LayoutDescendantIteratorAdapter):
     143        (WebCore::Layout::descendantsOfType):
     144        * layout/layouttree/LayoutIterator.h:
     145        (WebCore::Layout::LayoutBoxTraversal::firstChild):
     146        (WebCore::Layout::LayoutBoxTraversal::nextAncestorSibling):
     147        (WebCore::Layout::LayoutBoxTraversal::next):
     148        (WebCore::Layout::LayoutBoxTraversal::nextSkippingChildren):
     149        (WebCore::Layout::Traversal::next):
     150        (WebCore::Layout::LayoutIterator<T>::LayoutIterator):
     151        * layout/layouttree/LayoutTreeBuilder.cpp:
     152        (WebCore::Layout::LayoutTreeContent::LayoutTreeContent):
     153        (WebCore::Layout::appendChild):
     154        (WebCore::Layout::TreeBuilder::buildLayoutTree):
     155        (WebCore::Layout::TreeBuilder::createContainer):
     156        (WebCore::Layout::TreeBuilder::createLayoutBox):
     157        (WebCore::Layout::TreeBuilder::buildTableStructure):
     158        (WebCore::Layout::TreeBuilder::buildSubTree):
     159        (WebCore::Layout::outputInlineRuns):
     160        (WebCore::Layout::outputLayoutTree):
     161        * layout/layouttree/LayoutTreeBuilder.h:
     162        (WebCore::Layout::LayoutTreeContent::rootLayoutBox const):
     163        (WebCore::Layout::LayoutTreeContent::rootLayoutBox):
     164        (WebCore::Layout::LayoutTreeContent::addBox):
     165        (WebCore::Layout::LayoutTreeContent::addContainer):
     166        * layout/tableformatting/TableFormattingContext.cpp:
     167        (WebCore::Layout::TableFormattingContext::TableFormattingContext):
     168        (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
     169        (WebCore::Layout::TableFormattingContext::ensureTableGrid):
     170        (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
     171        * layout/tableformatting/TableFormattingContext.h:
     172
    11732020-02-11  Sihui Liu  <sihui_liu@apple.com>
    2174
  • trunk/Source/WebCore/Sources.txt

    r256380 r256417  
    14511451layout/invalidation/InvalidationState.cpp
    14521452layout/layouttree/LayoutBox.cpp
    1453 layout/layouttree/LayoutContainer.cpp
     1453layout/layouttree/LayoutContainerBox.cpp
    14541454layout/layouttree/LayoutInlineTextBox.cpp
    14551455layout/layouttree/LayoutLineBreakBox.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r256380 r256417  
    394394                119340971FED715500935F1E /* RenderTreeBuilderFormControls.h in Headers */ = {isa = PBXBuildFile; fileRef = 119340951FED715500935F1E /* RenderTreeBuilderFormControls.h */; };
    395395                119340A31FEE024000935F1E /* RenderTreeBuilderBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 119340A11FEE024000935F1E /* RenderTreeBuilderBlock.h */; };
    396                 1199FA46208E35A3002358CC /* LayoutContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1199FA44208E35A3002358CC /* LayoutContainer.h */; settings = {ATTRIBUTES = (Private, ); }; };
     396                1199FA46208E35A3002358CC /* LayoutContainerBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 1199FA44208E35A3002358CC /* LayoutContainerBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
    397397                1199FA5B208E3C7F002358CC /* DisplayBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 1199FA59208E3C7F002358CC /* DisplayBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
    398398                11CB2789203BA570004A1DC9 /* RenderTreeBuilderFullScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 11CB2787203BA570004A1DC9 /* RenderTreeBuilderFullScreen.h */; };
     
    59325932                119340A01FEE024000935F1E /* RenderTreeBuilderBlock.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderBlock.cpp; sourceTree = "<group>"; };
    59335933                119340A11FEE024000935F1E /* RenderTreeBuilderBlock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilderBlock.h; sourceTree = "<group>"; };
    5934                 1199FA44208E35A3002358CC /* LayoutContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutContainer.h; sourceTree = "<group>"; };
    5935                 1199FA45208E35A3002358CC /* LayoutContainer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutContainer.cpp; sourceTree = "<group>"; };
     5934                1199FA44208E35A3002358CC /* LayoutContainerBox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutContainerBox.h; sourceTree = "<group>"; };
     5935                1199FA45208E35A3002358CC /* LayoutContainerBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutContainerBox.cpp; sourceTree = "<group>"; };
    59365936                1199FA59208E3C7F002358CC /* DisplayBox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DisplayBox.h; sourceTree = "<group>"; };
    59375937                1199FA5A208E3C7F002358CC /* DisplayBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DisplayBox.cpp; sourceTree = "<group>"; };
     
    1673016730                                115CFA95208B952B001E6991 /* LayoutBox.h */,
    1673116731                                11100FC920927CBC0081AA6C /* LayoutChildIterator.h */,
    16732                                 1199FA45208E35A3002358CC /* LayoutContainer.cpp */,
    16733                                 1199FA44208E35A3002358CC /* LayoutContainer.h */,
     16732                                1199FA45208E35A3002358CC /* LayoutContainerBox.cpp */,
     16733                                1199FA44208E35A3002358CC /* LayoutContainerBox.h */,
    1673416734                                11B042FB20B0E21400828A6B /* LayoutDescendantIterator.h */,
    1673516735                                6F0B98B623F2690600EEC2F2 /* LayoutInlineTextBox.cpp */,
     
    3127931279                                115CFA97208B952B001E6991 /* LayoutBox.h in Headers */,
    3128031280                                11310CF620BA4A560065A8D0 /* LayoutChildIterator.h in Headers */,
    31281                                 1199FA46208E35A3002358CC /* LayoutContainer.h in Headers */,
     31281                                1199FA46208E35A3002358CC /* LayoutContainerBox.h in Headers */,
    3128231282                                6F26BB6C23343E6F002F2BEA /* LayoutContext.h in Headers */,
    3128331283                                11310CF520BA4A4C0065A8D0 /* LayoutDescendantIterator.h in Headers */,
  • trunk/Source/WebCore/layout/FormattingContext.cpp

    r256380 r256417  
    3333#include "InvalidationState.h"
    3434#include "LayoutBox.h"
    35 #include "LayoutContainer.h"
     35#include "LayoutContainerBox.h"
    3636#include "LayoutContext.h"
    3737#include "LayoutDescendantIterator.h"
     
    4747WTF_MAKE_ISO_ALLOCATED_IMPL(FormattingContext);
    4848
    49 FormattingContext::FormattingContext(const Container& formattingContextRoot, FormattingState& formattingState)
     49FormattingContext::FormattingContext(const ContainerBox& formattingContextRoot, FormattingState& formattingState)
    5050    : m_root(makeWeakPtr(formattingContextRoot))
    5151    , m_formattingState(formattingState)
     
    166166        computeBorderAndPadding(*outOfFlowBox, Geometry::horizontalConstraintsForInFlow(outOfFlowRootDisplayBox));
    167167        computeOutOfFlowHorizontalGeometry(*outOfFlowBox, horizontalConstraints);
    168         if (!is<Container>(*outOfFlowBox) || !downcast<Container>(*outOfFlowBox).hasChild()) {
     168        if (!is<ContainerBox>(*outOfFlowBox) || !downcast<ContainerBox>(*outOfFlowBox).hasChild()) {
    169169            computeOutOfFlowVerticalGeometry(*outOfFlowBox, horizontalConstraints, verticalConstraints);
    170170            continue;
    171171        }
    172172
    173         auto& outOfFlowRootContainer = downcast<Container>(*outOfFlowBox);
     173        auto& outOfFlowRootContainer = downcast<ContainerBox>(*outOfFlowBox);
    174174        auto formattingContext = LayoutContext::createFormattingContext(outOfFlowRootContainer, layoutState());
    175175        if (outOfFlowRootContainer.hasInFlowOrFloatingChild())
     
    181181}
    182182
    183 static LayoutUnit mapHorizontalPositionToAncestor(const FormattingContext& formattingContext, LayoutUnit horizontalPosition, const Container& containingBlock, const Container& ancestor)
     183static LayoutUnit mapHorizontalPositionToAncestor(const FormattingContext& formattingContext, LayoutUnit horizontalPosition, const ContainerBox& containingBlock, const ContainerBox& ancestor)
    184184{
    185185    // "horizontalPosition" is in the coordinate system of the "containingBlock". -> map from containingBlock to ancestor.
     
    187187        return horizontalPosition;
    188188    ASSERT(containingBlock.isContainingBlockDescendantOf(ancestor));
    189     for (auto* container = &containingBlock; container && container != &ancestor; container = container->containingBlock())
    190         horizontalPosition += formattingContext.geometryForBox(*container).left();
     189    for (auto* containerBox = &containingBlock; containerBox && containerBox != &ancestor; containerBox = containerBox->containingBlock())
     190        horizontalPosition += formattingContext.geometryForBox(*containerBox).left();
    191191    return horizontalPosition;
    192192}
     
    199199    ASSERT(layoutBox.isContainingBlockDescendantOf(formattingContextRoot));
    200200    auto top = geometryForBox(layoutBox).top();
    201     for (auto* container = layoutBox.containingBlock(); container && container != &formattingContextRoot; container = container->containingBlock())
    202         top += geometryForBox(*container).top();
     201    for (auto* containerBox = layoutBox.containingBlock(); containerBox && containerBox != &formattingContextRoot; containerBox = containerBox->containingBlock())
     202        top += geometryForBox(*containerBox).top();
    203203    return top;
    204204}
  • trunk/Source/WebCore/layout/FormattingContext.h

    r256380 r256417  
    2828#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    2929
    30 #include "LayoutContainer.h"
     30#include "LayoutContainerBox.h"
    3131#include "LayoutUnit.h"
    3232#include "LayoutUnits.h"
     
    4848struct ComputedHorizontalMargin;
    4949struct ComputedVerticalMargin;
    50 class Container;
     50class ContainerBox;
    5151struct ContentHeightAndMargin;
    5252struct ContentWidthAndMargin;
     
    6363    WTF_MAKE_ISO_ALLOCATED(FormattingContext);
    6464public:
    65     FormattingContext(const Container& formattingContextRoot, FormattingState&);
     65    FormattingContext(const ContainerBox& formattingContextRoot, FormattingState&);
    6666    virtual ~FormattingContext();
    6767
     
    100100    using LayoutQueue = Vector<const Box*>;
    101101
    102     const Container& root() const { return *m_root; }
     102    const ContainerBox& root() const { return *m_root; }
    103103    LayoutState& layoutState() const;
    104104    const FormattingState& formattingState() const { return m_formattingState; }
     
    205205    void computeOutOfFlowHorizontalGeometry(const Box&, const HorizontalConstraints&);
    206206
    207     WeakPtr<const Container> m_root;
     207    WeakPtr<const ContainerBox> m_root;
    208208    FormattingState& m_formattingState;
    209209};
  • trunk/Source/WebCore/layout/FormattingContextGeometry.cpp

    r256380 r256417  
    123123    // then the height is increased to include those edges. Only floats that participate in this block formatting context are taken
    124124    // into account, e.g., floats inside absolutely positioned descendants or other floats are not.
    125     if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowOrFloatingChild())
     125    if (!is<ContainerBox>(layoutBox) || !downcast<ContainerBox>(layoutBox).hasInFlowOrFloatingChild())
    126126        return { };
    127127
     
    132132    auto top = borderAndPaddingTop;
    133133    auto bottom = borderAndPaddingTop;
    134     auto& formattingRootContainer = downcast<Container>(layoutBox);
     134    auto& formattingRootContainer = downcast<ContainerBox>(layoutBox);
    135135    if (formattingRootContainer.establishesInlineFormattingContext()) {
    136136        auto& lineBoxes = layoutState.establishedInlineFormattingState(formattingRootContainer).displayInlineContent()->lineBoxes;
     
    240240    auto& containingBlock = *layoutBox.containingBlock();
    241241    // Start with the parent since we pretend that this box is normal flow.
    242     for (auto* container = layoutBox.parent(); container != &containingBlock; container = container->containingBlock()) {
    243         auto& boxGeometry = formattingContext.geometryForBox(*container, EscapeReason::OutOfFlowBoxNeedsInFlowGeometry);
     242    for (auto* containerBox = layoutBox.parent(); containerBox != &containingBlock; containerBox = containerBox->containingBlock()) {
     243        auto& boxGeometry = formattingContext.geometryForBox(*containerBox, EscapeReason::OutOfFlowBoxNeedsInFlowGeometry);
    244244        // Display::Box::top is the border box top position in its containing block's coordinate system.
    245245        top += boxGeometry.top();
    246         ASSERT(!container->isPositioned() || layoutBox.isFixedPositioned());
     246        ASSERT(!containerBox->isPositioned() || layoutBox.isFixedPositioned());
    247247    }
    248248    // Move the static position relative to the padding box. This is very specific to abolutely positioned boxes.
     
    263263    auto& containingBlock = *layoutBox.containingBlock();
    264264    // Start with the parent since we pretend that this box is normal flow.
    265     for (auto* container = layoutBox.parent(); container != &containingBlock; container = container->containingBlock()) {
    266         auto& boxGeometry = formattingContext.geometryForBox(*container, EscapeReason::OutOfFlowBoxNeedsInFlowGeometry);
     265    for (auto* containerBox = layoutBox.parent(); containerBox != &containingBlock; containerBox = containerBox->containingBlock()) {
     266        auto& boxGeometry = formattingContext.geometryForBox(*containerBox, EscapeReason::OutOfFlowBoxNeedsInFlowGeometry);
    267267        // Display::Box::left is the border box left position in its containing block's coordinate system.
    268268        left += boxGeometry.left();
    269         ASSERT(!container->isPositioned() || layoutBox.isFixedPositioned());
     269        ASSERT(!containerBox->isPositioned() || layoutBox.isFixedPositioned());
    270270    }
    271271    // Move the static position relative to the padding box. This is very specific to abolutely positioned boxes.
     
    286286    // Then the shrink-to-fit width is: min(max(preferred minimum width, available width), preferred width).
    287287    auto intrinsicWidthConstraints = IntrinsicWidthConstraints { };
    288     if (is<Container>(formattingRoot) && downcast<Container>(formattingRoot).hasInFlowOrFloatingChild()) {
    289         auto& root = downcast<Container>(formattingRoot);
     288    if (is<ContainerBox>(formattingRoot) && downcast<ContainerBox>(formattingRoot).hasInFlowOrFloatingChild()) {
     289        auto& root = downcast<ContainerBox>(formattingRoot);
    290290        auto& formattingStateForRoot = layoutState().ensureFormattingState(root);
    291291        auto precomputedIntrinsicWidthConstraints = formattingStateForRoot.intrinsicWidthConstraints();
  • trunk/Source/WebCore/layout/LayoutContext.cpp

    r256098 r256417  
    3838#include "InvalidationState.h"
    3939#include "LayoutBox.h"
    40 #include "LayoutContainer.h"
     40#include "LayoutContainerBox.h"
    4141#include "LayoutPhase.h"
    4242#include "LayoutTreeBuilder.h"
     
    9090}
    9191
    92 void LayoutContext::layoutFormattingContextSubtree(const Container& formattingContextRoot, InvalidationState& invalidationState)
     92void LayoutContext::layoutFormattingContextSubtree(const ContainerBox& formattingContextRoot, InvalidationState& invalidationState)
    9393{
    9494    RELEASE_ASSERT(formattingContextRoot.establishesFormattingContext());
     
    110110}
    111111
    112 std::unique_ptr<FormattingContext> LayoutContext::createFormattingContext(const Container& formattingContextRoot, LayoutState& layoutState)
     112std::unique_ptr<FormattingContext> LayoutContext::createFormattingContext(const ContainerBox& formattingContextRoot, LayoutState& layoutState)
    113113{
    114114    ASSERT(formattingContextRoot.establishesFormattingContext());
  • trunk/Source/WebCore/layout/LayoutContext.h

    r254797 r256417  
    4040namespace Layout {
    4141
    42 class Container;
     42class ContainerBox;
    4343class InvalidationState;
    4444class LayoutState;
     
    5858    void layoutWithPreparedRootGeometry(InvalidationState&);
    5959
    60     static std::unique_ptr<FormattingContext> createFormattingContext(const Container& formattingContextRoot, LayoutState&);
     60    static std::unique_ptr<FormattingContext> createFormattingContext(const ContainerBox& formattingContextRoot, LayoutState&);
    6161
    6262    // FIXME: This is temporary.
     
    6868
    6969private:
    70     void layoutFormattingContextSubtree(const Container&, InvalidationState&);
     70    void layoutFormattingContextSubtree(const ContainerBox&, InvalidationState&);
    7171    LayoutState& layoutState() { return m_layoutState; }
    7272
  • trunk/Source/WebCore/layout/LayoutState.cpp

    r254875 r256417  
    3434#include "InlineFormattingState.h"
    3535#include "LayoutBox.h"
    36 #include "LayoutContainer.h"
     36#include "LayoutContainerBox.h"
    3737#include "RenderBox.h"
    3838#include "RuntimeEnabledFeatures.h"
     
    4545WTF_MAKE_ISO_ALLOCATED_IMPL(LayoutState);
    4646
    47 LayoutState::LayoutState(const Document& document, const Container& rootContainer)
     47LayoutState::LayoutState(const Document& document, const ContainerBox& rootContainer)
    4848    : m_rootContainer(makeWeakPtr(rootContainer))
    4949{
     
    8888}
    8989
    90 FormattingState& LayoutState::establishedFormattingState(const Container& formattingContextRoot) const
     90FormattingState& LayoutState::establishedFormattingState(const ContainerBox& formattingContextRoot) const
    9191{
    9292    if (RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()) {
     
    105105}
    106106
    107 InlineFormattingState& LayoutState::establishedInlineFormattingState(const Container& formattingContextRoot) const
     107InlineFormattingState& LayoutState::establishedInlineFormattingState(const ContainerBox& formattingContextRoot) const
    108108{
    109109    ASSERT(formattingContextRoot.establishesInlineFormattingContext());
     
    117117}
    118118
    119 BlockFormattingState& LayoutState::establishedBlockFormattingState(const Container& formattingContextRoot) const
     119BlockFormattingState& LayoutState::establishedBlockFormattingState(const ContainerBox& formattingContextRoot) const
    120120{
    121121    ASSERT(formattingContextRoot.establishesBlockFormattingContext());
     
    123123}
    124124
    125 TableFormattingState& LayoutState::establishedTableFormattingState(const Container& formattingContextRoot) const
     125TableFormattingState& LayoutState::establishedTableFormattingState(const ContainerBox& formattingContextRoot) const
    126126{
    127127    ASSERT(formattingContextRoot.establishesTableFormattingContext());
     
    129129}
    130130
    131 FormattingState& LayoutState::ensureFormattingState(const Container& formattingContextRoot)
     131FormattingState& LayoutState::ensureFormattingState(const ContainerBox& formattingContextRoot)
    132132{
    133133    if (formattingContextRoot.establishesInlineFormattingContext())
     
    140140}
    141141
    142 InlineFormattingState& LayoutState::ensureInlineFormattingState(const Container& formattingContextRoot)
     142InlineFormattingState& LayoutState::ensureInlineFormattingState(const ContainerBox& formattingContextRoot)
    143143{
    144144    ASSERT(formattingContextRoot.establishesInlineFormattingContext());
     
    169169}
    170170
    171 BlockFormattingState& LayoutState::ensureBlockFormattingState(const Container& formattingContextRoot)
     171BlockFormattingState& LayoutState::ensureBlockFormattingState(const ContainerBox& formattingContextRoot)
    172172{
    173173    ASSERT(formattingContextRoot.establishesBlockFormattingContext());
     
    180180}
    181181
    182 TableFormattingState& LayoutState::ensureTableFormattingState(const Container& formattingContextRoot)
     182TableFormattingState& LayoutState::ensureTableFormattingState(const ContainerBox& formattingContextRoot)
    183183{
    184184    ASSERT(formattingContextRoot.establishesTableFormattingContext());
  • trunk/Source/WebCore/layout/LayoutState.h

    r254875 r256417  
    2828#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    2929
    30 #include "LayoutContainer.h"
     30#include "LayoutContainerBox.h"
    3131#include <wtf/HashMap.h>
    3232#include <wtf/HashSet.h>
     
    5151    WTF_MAKE_ISO_ALLOCATED(LayoutState);
    5252public:
    53     LayoutState(const Document&, const Container& rootContainer);
     53    LayoutState(const Document&, const ContainerBox& rootContainer);
    5454    ~LayoutState();
    5555
    56     FormattingState& ensureFormattingState(const Container& formattingContextRoot);
    57     InlineFormattingState& ensureInlineFormattingState(const Container& formattingContextRoot);
    58     BlockFormattingState& ensureBlockFormattingState(const Container& formattingContextRoot);
    59     TableFormattingState& ensureTableFormattingState(const Container& formattingContextRoot);
     56    FormattingState& ensureFormattingState(const ContainerBox& formattingContextRoot);
     57    InlineFormattingState& ensureInlineFormattingState(const ContainerBox& formattingContextRoot);
     58    BlockFormattingState& ensureBlockFormattingState(const ContainerBox& formattingContextRoot);
     59    TableFormattingState& ensureTableFormattingState(const ContainerBox& formattingContextRoot);
    6060
    61     FormattingState& establishedFormattingState(const Container& formattingRoot) const;
    62     InlineFormattingState& establishedInlineFormattingState(const Container& formattingContextRoot) const;
    63     BlockFormattingState& establishedBlockFormattingState(const Container& formattingContextRoot) const;
    64     TableFormattingState& establishedTableFormattingState(const Container& formattingContextRoot) const;
     61    FormattingState& establishedFormattingState(const ContainerBox& formattingRoot) const;
     62    InlineFormattingState& establishedInlineFormattingState(const ContainerBox& formattingContextRoot) const;
     63    BlockFormattingState& establishedBlockFormattingState(const ContainerBox& formattingContextRoot) const;
     64    TableFormattingState& establishedTableFormattingState(const ContainerBox& formattingContextRoot) const;
    6565
    6666    FormattingState& formattingStateForBox(const Box&) const;
    67     bool hasInlineFormattingState(const Container& formattingRoot) const { return m_inlineFormattingStates.contains(&formattingRoot); }
     67    bool hasInlineFormattingState(const ContainerBox& formattingRoot) const { return m_inlineFormattingStates.contains(&formattingRoot); }
    6868
    6969#ifndef NDEBUG
     
    8383    bool inNoQuirksMode() const { return m_quirksMode == QuirksMode::No; }
    8484
    85     const Container& root() const { return *m_rootContainer; }
     85    const ContainerBox& root() const { return *m_rootContainer; }
    8686
    8787    // LFC integration only. Full LFC has proper ICB access.
     
    9595    Display::Box& ensureDisplayBoxForLayoutBoxSlow(const Box&);
    9696
    97     HashMap<const Container*, std::unique_ptr<InlineFormattingState>> m_inlineFormattingStates;
    98     HashMap<const Container*, std::unique_ptr<BlockFormattingState>> m_blockFormattingStates;
    99     HashMap<const Container*, std::unique_ptr<TableFormattingState>> m_tableFormattingStates;
     97    HashMap<const ContainerBox*, std::unique_ptr<InlineFormattingState>> m_inlineFormattingStates;
     98    HashMap<const ContainerBox*, std::unique_ptr<BlockFormattingState>> m_blockFormattingStates;
     99    HashMap<const ContainerBox*, std::unique_ptr<TableFormattingState>> m_tableFormattingStates;
    100100
    101101    std::unique_ptr<InlineFormattingState> m_rootInlineFormattingStateForIntegration;
     
    107107    QuirksMode m_quirksMode { QuirksMode::No };
    108108
    109     WeakPtr<const Container> m_rootContainer;
     109    WeakPtr<const ContainerBox> m_rootContainer;
    110110
    111111    // LFC integration only.
  • trunk/Source/WebCore/layout/Verification.cpp

    r256304 r256417  
    3434#include "InlineTextBox.h"
    3535#include "LayoutBox.h"
    36 #include "LayoutContainer.h"
     36#include "LayoutContainerBox.h"
    3737#include "LayoutContext.h"
    3838#include "LayoutTreeBuilder.h"
     
    6868}
    6969
    70 static bool outputMismatchingSimpleLineInformationIfNeeded(TextStream& stream, const LayoutState& layoutState, const RenderBlockFlow& blockFlow, const Container& inlineFormattingRoot)
     70static bool outputMismatchingSimpleLineInformationIfNeeded(TextStream& stream, const LayoutState& layoutState, const RenderBlockFlow& blockFlow, const ContainerBox& inlineFormattingRoot)
    7171{
    7272    auto* lineLayoutData = blockFlow.simpleLineLayout();
     
    160160}
    161161
    162 static bool outputMismatchingComplexLineInformationIfNeeded(TextStream& stream, const LayoutState& layoutState, const RenderBlockFlow& blockFlow, const Container& inlineFormattingRoot)
     162static bool outputMismatchingComplexLineInformationIfNeeded(TextStream& stream, const LayoutState& layoutState, const RenderBlockFlow& blockFlow, const ContainerBox& inlineFormattingRoot)
    163163{
    164164    auto& inlineFormattingState = layoutState.establishedFormattingState(inlineFormattingRoot);
     
    291291    // Rendering code does not have the concept of table wrapper box. Skip it by verifying the first child(table box) instead.
    292292    if (layoutBox.isTableWrapperBox())
    293         return verifyAndOutputSubtree(stream, context, renderer, *downcast<Container>(layoutBox).firstChild());
     293        return verifyAndOutputSubtree(stream, context, renderer, *downcast<ContainerBox>(layoutBox).firstChild());
    294294
    295295    auto mismtachingGeometry = outputMismatchingBlockBoxInformationIfNeeded(stream, context, renderer, layoutBox);
    296296
    297     if (!is<Container>(layoutBox))
     297    if (!is<ContainerBox>(layoutBox))
    298298        return mismtachingGeometry;
    299299
    300     auto& container = downcast<Container>(layoutBox);
    301     auto* childLayoutBox = container.firstChild();
     300    auto& containerBox = downcast<ContainerBox>(layoutBox);
     301    auto* childLayoutBox = containerBox.firstChild();
    302302    auto* childRenderer = renderer.firstChild();
    303303
     
    321321
    322322            auto& blockFlow = downcast<RenderBlockFlow>(*childRenderer);
    323             auto& formattingRoot = downcast<Container>(*childLayoutBox);
     323            auto& formattingRoot = downcast<ContainerBox>(*childLayoutBox);
    324324            mismtachingGeometry |= blockFlow.lineLayoutPath() == RenderBlockFlow::SimpleLinesPath ? outputMismatchingSimpleLineInformationIfNeeded(stream, context, blockFlow, formattingRoot) : outputMismatchingComplexLineInformationIfNeeded(stream, context, blockFlow, formattingRoot);
    325325        } else {
  • trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp

    r256106 r256417  
    3535#include "LayoutBox.h"
    3636#include "LayoutChildIterator.h"
    37 #include "LayoutContainer.h"
     37#include "LayoutContainerBox.h"
    3838#include "LayoutContext.h"
    3939#include "LayoutState.h"
     
    4747WTF_MAKE_ISO_ALLOCATED_IMPL(BlockFormattingContext);
    4848
    49 BlockFormattingContext::BlockFormattingContext(const Container& formattingContextRoot, BlockFormattingState& formattingState)
     49BlockFormattingContext::BlockFormattingContext(const ContainerBox& formattingContextRoot, BlockFormattingState& formattingState)
    5050    : FormattingContext(formattingContextRoot, formattingState)
    5151{
     
    6767    auto appendNextToLayoutQueue = [&] (const auto& layoutBox, auto direction) {
    6868        if (direction == LayoutDirection::Child) {
    69             if (!is<Container>(layoutBox))
     69            if (!is<ContainerBox>(layoutBox))
    7070                return false;
    71             for (auto* child = downcast<Container>(layoutBox).firstInFlowOrFloatingChild(); child; child = child->nextInFlowOrFloatingSibling()) {
     71            for (auto* child = downcast<ContainerBox>(layoutBox).firstInFlowOrFloatingChild(); child; child = child->nextInFlowOrFloatingSibling()) {
    7272                if (!invalidationState.needsLayout(*child))
    7373                    continue;
     
    126126
    127127            if (layoutBox.establishesFormattingContext()) {
    128                 if (is<Container>(layoutBox) && downcast<Container>(layoutBox).hasInFlowOrFloatingChild()) {
     128                if (is<ContainerBox>(layoutBox) && downcast<ContainerBox>(layoutBox).hasInFlowOrFloatingChild()) {
    129129                    // Layout the inflow descendants of this formatting context root.
    130130                    precomputeVerticalPositionForFormattingRoot(floatingContext, layoutBox, horizontalConstraints, verticalConstraints);
     
    132132                    auto horizontalConstraintsForFormattingContext = Geometry::horizontalConstraintsForInFlow(rootDisplayBox);
    133133                    auto verticalConstraintsForFormattingContext = Geometry::verticalConstraintsForInFlow(rootDisplayBox);
    134                     LayoutContext::createFormattingContext(downcast<Container>(layoutBox), layoutState())->layoutInFlowContent(invalidationState, horizontalConstraintsForFormattingContext, verticalConstraintsForFormattingContext);
     134                    LayoutContext::createFormattingContext(downcast<ContainerBox>(layoutBox), layoutState())->layoutInFlowContent(invalidationState, horizontalConstraintsForFormattingContext, verticalConstraintsForFormattingContext);
    135135                }
    136136                break;
     
    151151            if (layoutBox.establishesFormattingContext()) {
    152152                // Now that we computed the root's height, we can layout the out-of-flow descendants.
    153                 if (is<Container>(layoutBox) && downcast<Container>(layoutBox).hasChild()) {
     153                if (is<ContainerBox>(layoutBox) && downcast<ContainerBox>(layoutBox).hasChild()) {
    154154                    auto& rootDisplayBox = geometryForBox(layoutBox);
    155155                    auto horizontalConstraintsForOutOfFlow =  Geometry::horizontalConstraintsForOutOfFlow(rootDisplayBox);
    156156                    auto verticalConstraintsForOutOfFlow = Geometry::verticalConstraintsForOutOfFlow(rootDisplayBox);
    157                     LayoutContext::createFormattingContext(downcast<Container>(layoutBox), layoutState())->layoutOutOfFlowContent(invalidationState, horizontalConstraintsForOutOfFlow, verticalConstraintsForOutOfFlow);
     157                    LayoutContext::createFormattingContext(downcast<ContainerBox>(layoutBox), layoutState())->layoutOutOfFlowContent(invalidationState, horizontalConstraintsForOutOfFlow, verticalConstraintsForOutOfFlow);
    158158                }
    159159            }
     
    213213void BlockFormattingContext::placeInFlowPositionedChildren(const Box& layoutBox, const ConstraintsPair<HorizontalConstraints>& horizontalConstraints)
    214214{
    215     if (!is<Container>(layoutBox))
     215    if (!is<ContainerBox>(layoutBox))
    216216        return;
    217217    LOG_WITH_STREAM(FormattingContextLayout, stream << "Start: move in-flow positioned children -> parent: " << &layoutBox);
    218     auto& container = downcast<Container>(layoutBox);
    219     for (auto& childBox : childrenOfType<Box>(container)) {
     218    auto& containerBox = downcast<ContainerBox>(layoutBox);
     219    for (auto& childBox : childrenOfType<Box>(containerBox)) {
    220220        if (!childBox.isInFlowPositioned())
    221221            continue;
     
    456456        while (true) {
    457457            auto& layoutBox = *queue.last();
    458             auto hasInFlowOrFloatingChild = is<Container>(layoutBox) && downcast<Container>(layoutBox).hasInFlowOrFloatingChild();
     458            auto hasInFlowOrFloatingChild = is<ContainerBox>(layoutBox) && downcast<ContainerBox>(layoutBox).hasInFlowOrFloatingChild();
    459459            auto skipDescendants = formattingState.intrinsicWidthConstraintsForBox(layoutBox) || !hasInFlowOrFloatingChild || layoutBox.establishesFormattingContext() || layoutBox.style().width().isFixed();
    460460            if (skipDescendants)
    461461                break;
    462             queue.append(downcast<Container>(layoutBox).firstInFlowOrFloatingChild());
     462            queue.append(downcast<ContainerBox>(layoutBox).firstInFlowOrFloatingChild());
    463463        }
    464464        // Compute min/max intrinsic width bottom up if needed.
  • trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.h

    r256380 r256417  
    4747    WTF_MAKE_ISO_ALLOCATED(BlockFormattingContext);
    4848public:
    49     BlockFormattingContext(const Container& formattingContextRoot, BlockFormattingState&);
     49    BlockFormattingContext(const ContainerBox& formattingContextRoot, BlockFormattingState&);
    5050
    5151    void layoutInFlowContent(InvalidationState&, const HorizontalConstraints&, const VerticalConstraints&) override;
  • trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp

    r256380 r256417  
    7171            return { *height, nonCollapsedMargin };
    7272
    73         if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowChild())
     73        if (!is<ContainerBox>(layoutBox) || !downcast<ContainerBox>(layoutBox).hasInFlowChild())
    7474            return { 0, nonCollapsedMargin };
    7575
    7676        // 1. the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines
    77         auto& layoutContainer = downcast<Container>(layoutBox);
     77        auto& layoutContainer = downcast<ContainerBox>(layoutBox);
    7878        if (layoutContainer.establishesInlineFormattingContext()) {
    7979            auto& lineBoxes = layoutState().establishedInlineFormattingState(layoutContainer).displayInlineContent()->lineBoxes;
     
    322322        }
    323323
    324         if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowOrFloatingChild())
     324        if (!is<ContainerBox>(layoutBox) || !downcast<ContainerBox>(layoutBox).hasInFlowOrFloatingChild())
    325325            return { };
    326326
    327327        if (layoutBox.establishesFormattingContext())
    328             return LayoutContext::createFormattingContext(downcast<Container>(layoutBox), layoutState())->computedIntrinsicWidthConstraints();
     328            return LayoutContext::createFormattingContext(downcast<ContainerBox>(layoutBox), layoutState())->computedIntrinsicWidthConstraints();
    329329
    330330        auto intrinsicWidthConstraints = IntrinsicWidthConstraints { };
    331331        auto& formattingState = layoutState().formattingStateForBox(layoutBox);
    332         for (auto& child : childrenOfType<Box>(downcast<Container>(layoutBox))) {
     332        for (auto& child : childrenOfType<Box>(downcast<ContainerBox>(layoutBox))) {
    333333            if (child.isOutOfFlowPositioned())
    334334                continue;
  • trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp

    r254666 r256417  
    3232#include "DisplayBox.h"
    3333#include "LayoutBox.h"
    34 #include "LayoutContainer.h"
     34#include "LayoutContainerBox.h"
    3535#include "LayoutState.h"
    3636
     
    3838namespace Layout {
    3939
    40 static const Container& initialContainingBlock(const Box& layoutBox)
     40static const ContainerBox& initialContainingBlock(const Box& layoutBox)
    4141{
    4242    auto* containingBlock = layoutBox.containingBlock();
  • trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp

    r256380 r256417  
    3333#include "InlineFormattingState.h"
    3434#include "LayoutBox.h"
    35 #include "LayoutContainer.h"
     35#include "LayoutContainerBox.h"
    3636#include "LayoutUnit.h"
    3737#include "RenderStyle.h"
     
    196196        return false;
    197197
    198     if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowChild())
    199         return false;
    200 
    201     auto& firstInFlowChild = *downcast<Container>(layoutBox).firstInFlowChild();
     198    if (!is<ContainerBox>(layoutBox) || !downcast<ContainerBox>(layoutBox).hasInFlowChild())
     199        return false;
     200
     201    auto& firstInFlowChild = *downcast<ContainerBox>(layoutBox).firstInFlowChild();
    202202    if (!firstInFlowChild.isBlockLevelBox())
    203203        return false;
     
    305305        return false;
    306306
    307     if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowChild())
    308         return false;
    309 
    310     auto& lastInFlowChild = *downcast<Container>(layoutBox).lastInFlowChild();
     307    if (!is<ContainerBox>(layoutBox) || !downcast<ContainerBox>(layoutBox).hasInFlowChild())
     308        return false;
     309
     310    auto& lastInFlowChild = *downcast<ContainerBox>(layoutBox).lastInFlowChild();
    311311    if (!lastInFlowChild.isBlockLevelBox())
    312312        return false;
     
    381381        return false;
    382382
    383     if (!is<Container>(layoutBox))
     383    if (!is<ContainerBox>(layoutBox))
    384384        return true;
    385385
    386     if (!downcast<Container>(layoutBox).hasInFlowChild())
     386    if (!downcast<ContainerBox>(layoutBox).hasInFlowChild())
    387387        return !establishesBlockFormattingContext(layoutBox);
    388388
     
    392392            // If we get here through margin estimation, we don't necessarily have an actual state for this layout box since
    393393            // we haven't started laying it out yet.
    394             auto& layoutContainer = downcast<Container>(layoutBox);
    395             if (!layoutState.hasInlineFormattingState(layoutContainer))
     394            auto& containerBox = downcast<ContainerBox>(layoutBox);
     395            if (!layoutState.hasInlineFormattingState(containerBox))
    396396                return false;
    397397
    398398            auto isConsideredEmpty = [&] {
    399                 auto& formattingState = layoutState.establishedInlineFormattingState(layoutContainer);
     399                auto& formattingState = layoutState.establishedInlineFormattingState(containerBox);
    400400                if (auto* inlineContent = formattingState.displayInlineContent()) {
    401401                    for (auto& lineBox : inlineContent->lineBoxes) {
     
    407407                auto& floats = formattingState.floatingState().floats();
    408408                for (auto& floatItem : floats) {
    409                     if (floatItem.isDescendantOfFormattingRoot(layoutContainer))
     409                    if (floatItem.isDescendantOfFormattingRoot(containerBox))
    410410                        return false;
    411411                }
     
    419419    }
    420420
    421     for (auto* inflowChild = downcast<Container>(layoutBox).firstInFlowOrFloatingChild(); inflowChild; inflowChild = inflowChild->nextInFlowOrFloatingSibling()) {
     421    for (auto* inflowChild = downcast<ContainerBox>(layoutBox).firstInFlowOrFloatingChild(); inflowChild; inflowChild = inflowChild->nextInFlowOrFloatingSibling()) {
    422422        if (establishesBlockFormattingContext(*inflowChild))
    423423            return false;
     
    528528        if (!marginBeforeCollapsesWithFirstInFlowChildMarginBefore(layoutBox))
    529529            return { };
    530         return positiveNegativeValues(*downcast<Container>(layoutBox).firstInFlowChild(), MarginType::Before);
     530        return positiveNegativeValues(*downcast<ContainerBox>(layoutBox).firstInFlowChild(), MarginType::Before);
    531531    };
    532532
     
    558558        if (!marginAfterCollapsesWithLastInFlowChildMarginAfter(layoutBox))
    559559            return { };
    560         return positiveNegativeValues(*downcast<Container>(layoutBox).lastInFlowChild(), MarginType::After);
     560        return positiveNegativeValues(*downcast<ContainerBox>(layoutBox).lastInFlowChild(), MarginType::After);
    561561    };
    562562
  • trunk/Source/WebCore/layout/displaytree/DisplayPainter.cpp

    r255257 r256417  
    3636#include "InlineTextItem.h"
    3737#include "IntRect.h"
    38 #include "LayoutContainer.h"
     38#include "LayoutContainerBox.h"
    3939#include "LayoutDescendantIterator.h"
    4040#include "LayoutState.h"
     
    153153
    154154    auto absoluteBox = Box { layoutState.displayBoxForLayoutBox(layoutBox) };
    155     for (auto* container = layoutBox.containingBlock(); container != &layoutBox.initialContainingBlock(); container = container->containingBlock())
    156         absoluteBox.moveBy(layoutState.displayBoxForLayoutBox(*container).topLeft());
     155    for (auto* containerBox = layoutBox.containingBlock(); containerBox != &layoutBox.initialContainingBlock(); containerBox = containerBox->containingBlock())
     156        absoluteBox.moveBy(layoutState.displayBoxForLayoutBox(*containerBox).topLeft());
    157157    return absoluteBox;
    158158}
     
    183183        // Only inline content for now.
    184184        if (layoutBox.establishesInlineFormattingContext()) {
    185             auto& container = downcast<Layout::Container>(layoutBox);
    186             paintInlineContent(context, absoluteDisplayBox.topLeft(), layoutState.establishedInlineFormattingState(container));
     185            auto& containerBox = downcast<Layout::ContainerBox>(layoutBox);
     186            paintInlineContent(context, absoluteDisplayBox.topLeft(), layoutState.establishedInlineFormattingState(containerBox));
    187187        }
    188188    };
    189189
    190190    paint(paintRootBox);
    191     if (!is<Layout::Container>(paintRootBox) || !downcast<Layout::Container>(paintRootBox).hasChild())
     191    if (!is<Layout::ContainerBox>(paintRootBox) || !downcast<Layout::ContainerBox>(paintRootBox).hasChild())
    192192        return;
    193193
    194194    LayoutBoxList layoutBoxList;
    195     layoutBoxList.append(downcast<Layout::Container>(paintRootBox).firstChild());
     195    layoutBoxList.append(downcast<Layout::ContainerBox>(paintRootBox).firstChild());
    196196    while (!layoutBoxList.isEmpty()) {
    197197        while (true) {
     
    200200                break;
    201201            paint(layoutBox);
    202             if (!is<Layout::Container>(layoutBox) || !downcast<Layout::Container>(layoutBox).hasChild())
    203                 break;
    204             layoutBoxList.append(downcast<Layout::Container>(layoutBox).firstChild());
     202            if (!is<Layout::ContainerBox>(layoutBox) || !downcast<Layout::ContainerBox>(layoutBox).hasChild())
     203                break;
     204            layoutBoxList.append(downcast<Layout::ContainerBox>(layoutBox).firstChild());
    205205        }
    206206        while (!layoutBoxList.isEmpty()) {
     
    241241                appendPaintRoot(layoutBox);
    242242            contentRect.uniteIfNonZero(Display::absoluteDisplayBox(layoutState, layoutBox).rect());
    243             if (!is<Layout::Container>(layoutBox) || !downcast<Layout::Container>(layoutBox).hasChild())
    244                 break;
    245             layoutBoxList.append(downcast<Layout::Container>(layoutBox).firstChild());
     243            if (!is<Layout::ContainerBox>(layoutBox) || !downcast<Layout::ContainerBox>(layoutBox).hasChild())
     244                break;
     245            layoutBoxList.append(downcast<Layout::ContainerBox>(layoutBox).firstChild());
    246246        }
    247247        while (!layoutBoxList.isEmpty()) {
  • trunk/Source/WebCore/layout/floats/FloatAvoider.cpp

    r250766 r256417  
    3030
    3131#include "LayoutBox.h"
    32 #include "LayoutContainer.h"
     32#include "LayoutContainerBox.h"
    3333#include <wtf/IsoMallocInlines.h>
    3434
  • trunk/Source/WebCore/layout/floats/FloatingContext.cpp

    r256107 r256417  
    3434#include "FormattingContext.h"
    3535#include "LayoutBox.h"
    36 #include "LayoutContainer.h"
     36#include "LayoutContainerBox.h"
    3737#include <wtf/IsoMallocInlines.h>
    3838
     
    156156};
    157157
    158 FloatingContext::FloatingContext(const Container& floatingContextRoot, const FormattingContext& formattingContext, FloatingState& floatingState)
     158FloatingContext::FloatingContext(const ContainerBox& floatingContextRoot, const FormattingContext& formattingContext, FloatingState& floatingState)
    159159    : m_root(makeWeakPtr(floatingContextRoot))
    160160    , m_formattingContext(formattingContext)
     
    447447    auto& floatingStateRoot = floatingState().root();
    448448    auto top = formattingContext().geometryForBox(floatBox, FormattingContext::EscapeReason::FloatBoxNeedsToBeInAbsoluteCoordinates).top();
    449     for (auto* container = floatBox.containingBlock(); container && container != &floatingStateRoot; container = container->containingBlock())
    450         top += formattingContext().geometryForBox(*container, FormattingContext::EscapeReason::FloatBoxNeedsToBeInAbsoluteCoordinates).top();
     449    for (auto* containerBox = floatBox.containingBlock(); containerBox && containerBox != &floatingStateRoot; containerBox = containerBox->containingBlock())
     450        top += formattingContext().geometryForBox(*containerBox, FormattingContext::EscapeReason::FloatBoxNeedsToBeInAbsoluteCoordinates).top();
    451451    return top;
    452452}
     
    459459        return position;
    460460    auto mappedPosition = position;
    461     for (auto* container = &from; container && container != &to; container = container->containingBlock())
    462         mappedPosition.moveBy(formattingContext().geometryForBox(*container, FormattingContext::EscapeReason::FloatBoxNeedsToBeInAbsoluteCoordinates).topLeft());
     461    for (auto* containerBox = &from; containerBox && containerBox != &to; containerBox = containerBox->containingBlock())
     462        mappedPosition.moveBy(formattingContext().geometryForBox(*containerBox, FormattingContext::EscapeReason::FloatBoxNeedsToBeInAbsoluteCoordinates).topLeft());
    463463    return mappedPosition;
    464464}
  • trunk/Source/WebCore/layout/floats/FloatingContext.h

    r256107 r256417  
    2929
    3030#include "FloatingState.h"
    31 #include "LayoutContainer.h"
     31#include "LayoutContainerBox.h"
    3232#include <wtf/IsoMalloc.h>
    3333
     
    4646    WTF_MAKE_ISO_ALLOCATED(FloatingContext);
    4747public:
    48     FloatingContext(const Container& floatingContextRoot, const FormattingContext&, FloatingState&);
     48    FloatingContext(const ContainerBox& floatingContextRoot, const FormattingContext&, FloatingState&);
    4949
    5050    FloatingState& floatingState() const { return m_floatingState; }
     
    7171    LayoutState& layoutState() const { return m_floatingState.layoutState(); }
    7272    const FormattingContext& formattingContext() const { return m_formattingContext; }
    73     const Container& root() const { return *m_root; }
     73    const ContainerBox& root() const { return *m_root; }
    7474
    7575    void findPositionForFloatBox(FloatBox&) const;
     
    8282    Point mapPointFromFormattingContextRootToFloatingStateRoot(Point) const;
    8383
    84     WeakPtr<const Container> m_root;
     84    WeakPtr<const ContainerBox> m_root;
    8585    const FormattingContext& m_formattingContext;
    8686    FloatingState& m_floatingState;
  • trunk/Source/WebCore/layout/floats/FloatingState.cpp

    r256107 r256417  
    3131#include "FormattingContext.h"
    3232#include "LayoutBox.h"
    33 #include "LayoutContainer.h"
     33#include "LayoutContainerBox.h"
    3434#include "LayoutState.h"
    3535#include <wtf/IsoMallocInlines.h>
     
    5353}
    5454
    55 FloatingState::FloatingState(LayoutState& layoutState, const Container& formattingContextRoot)
     55FloatingState::FloatingState(LayoutState& layoutState, const ContainerBox& formattingContextRoot)
    5656    : m_layoutState(layoutState)
    5757    , m_formattingContextRoot(makeWeakPtr(formattingContextRoot))
     
    6161void FloatingState::append(FloatItem floatItem)
    6262{
    63     ASSERT(is<Container>(*m_formattingContextRoot));
     63    ASSERT(is<ContainerBox>(*m_formattingContextRoot));
    6464
    6565    if (m_floats.isEmpty())
     
    8888}
    8989
    90 Optional<PositionInContextRoot> FloatingState::bottom(const Container& formattingContextRoot, Clear type) const
     90Optional<PositionInContextRoot> FloatingState::bottom(const ContainerBox& formattingContextRoot, Clear type) const
    9191{
    9292    if (m_floats.isEmpty())
     
    115115}
    116116
    117 Optional<PositionInContextRoot> FloatingState::top(const Container& formattingContextRoot) const
     117Optional<PositionInContextRoot> FloatingState::top(const ContainerBox& formattingContextRoot) const
    118118{
    119119    if (m_floats.isEmpty())
  • trunk/Source/WebCore/layout/floats/FloatingState.h

    r256107 r256417  
    2929
    3030#include "DisplayBox.h"
    31 #include "LayoutContainer.h"
     31#include "LayoutContainerBox.h"
    3232#include <wtf/IsoMalloc.h>
    3333#include <wtf/Ref.h>
     
    5050    WTF_MAKE_ISO_ALLOCATED(FloatingState);
    5151public:
    52     static Ref<FloatingState> create(LayoutState& layoutState, const Container& formattingContextRoot) { return adoptRef(*new FloatingState(layoutState, formattingContextRoot)); }
     52    static Ref<FloatingState> create(LayoutState& layoutState, const ContainerBox& formattingContextRoot) { return adoptRef(*new FloatingState(layoutState, formattingContextRoot)); }
    5353
    54     const Container& root() const { return *m_formattingContextRoot; }
     54    const ContainerBox& root() const { return *m_formattingContextRoot; }
    5555
    56     Optional<PositionInContextRoot> top(const Container& formattingContextRoot) const;
    57     Optional<PositionInContextRoot> leftBottom(const Container& formattingContextRoot) const;
    58     Optional<PositionInContextRoot> rightBottom(const Container& formattingContextRoot) const;
    59     Optional<PositionInContextRoot> bottom(const Container& formattingContextRoot) const;
     56    Optional<PositionInContextRoot> top(const ContainerBox& formattingContextRoot) const;
     57    Optional<PositionInContextRoot> leftBottom(const ContainerBox& formattingContextRoot) const;
     58    Optional<PositionInContextRoot> rightBottom(const ContainerBox& formattingContextRoot) const;
     59    Optional<PositionInContextRoot> bottom(const ContainerBox& formattingContextRoot) const;
    6060
    6161    class FloatItem {
     
    6767
    6868        bool isLeftPositioned() const { return m_position == Position::Left; }
    69         bool isDescendantOfFormattingRoot(const Container&) const;
     69        bool isDescendantOfFormattingRoot(const ContainerBox&) const;
    7070
    7171        Display::Rect rectWithMargin() const { return m_absoluteDisplayBox.rectWithMargin(); }
     
    8787private:
    8888    friend class FloatingContext;
    89     FloatingState(LayoutState&, const Container& formattingContextRoot);
     89    FloatingState(LayoutState&, const ContainerBox& formattingContextRoot);
    9090
    9191    LayoutState& layoutState() const { return m_layoutState; }
    9292
    93     Optional<PositionInContextRoot> bottom(const Container& formattingContextRoot, Clear) const;
     93    Optional<PositionInContextRoot> bottom(const ContainerBox& formattingContextRoot, Clear) const;
    9494
    9595    LayoutState& m_layoutState;
    96     WeakPtr<const Container> m_formattingContextRoot;
     96    WeakPtr<const ContainerBox> m_formattingContextRoot;
    9797    FloatList m_floats;
    9898};
    9999
    100 inline Optional<PositionInContextRoot> FloatingState::leftBottom(const Container& formattingContextRoot) const
     100inline Optional<PositionInContextRoot> FloatingState::leftBottom(const ContainerBox& formattingContextRoot) const
    101101{
    102102    ASSERT(formattingContextRoot.establishesFormattingContext());
     
    104104}
    105105
    106 inline Optional<PositionInContextRoot> FloatingState::rightBottom(const Container& formattingContextRoot) const
     106inline Optional<PositionInContextRoot> FloatingState::rightBottom(const ContainerBox& formattingContextRoot) const
    107107{
    108108    ASSERT(formattingContextRoot.establishesFormattingContext());
     
    110110}
    111111
    112 inline Optional<PositionInContextRoot> FloatingState::bottom(const Container& formattingContextRoot) const
     112inline Optional<PositionInContextRoot> FloatingState::bottom(const ContainerBox& formattingContextRoot) const
    113113{
    114114    ASSERT(formattingContextRoot.establishesFormattingContext());
     
    116116}
    117117
    118 inline bool FloatingState::FloatItem::isDescendantOfFormattingRoot(const Container& formattingContextRoot) const
     118inline bool FloatingState::FloatItem::isDescendantOfFormattingRoot(const ContainerBox& formattingContextRoot) const
    119119{
    120120    ASSERT(formattingContextRoot.establishesFormattingContext());
    121     return m_layoutBox->isContainingBlockDescendantOf(downcast<Container>(formattingContextRoot));
     121    return m_layoutBox->isContainingBlockDescendantOf(downcast<ContainerBox>(formattingContextRoot));
    122122}
    123123
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r256380 r256417  
    3535#include "InvalidationState.h"
    3636#include "LayoutBox.h"
    37 #include "LayoutContainer.h"
     37#include "LayoutContainerBox.h"
    3838#include "LayoutContext.h"
    3939#include "LayoutInlineTextBox.h"
     
    5151WTF_MAKE_ISO_ALLOCATED_IMPL(InlineFormattingContext);
    5252
    53 InlineFormattingContext::InlineFormattingContext(const Container& formattingContextRoot, InlineFormattingState& formattingState)
     53InlineFormattingContext::InlineFormattingContext(const ContainerBox& formattingContextRoot, InlineFormattingState& formattingState)
    5454    : FormattingContext(formattingContextRoot, formattingState)
    5555{
    5656}
    5757
    58 static inline const Box* nextInlineLevelBoxToLayout(const Box& layoutBox, const Container& stayWithin)
     58static inline const Box* nextInlineLevelBoxToLayout(const Box& layoutBox, const ContainerBox& stayWithin)
    5959{
    6060    // Atomic inline-level boxes and floats are opaque boxes meaning that they are
     
    6262    // Only inline boxes may have relevant descendant content.
    6363    if (layoutBox.isInlineBox()) {
    64         if (is<Container>(layoutBox) && downcast<Container>(layoutBox).hasInFlowOrFloatingChild()) {
     64        if (is<ContainerBox>(layoutBox) && downcast<ContainerBox>(layoutBox).hasInFlowOrFloatingChild()) {
    6565            // Anonymous inline boxes/line breaks can't have descendant content by definition.
    6666            ASSERT(!layoutBox.isAnonymous() && !layoutBox.isLineBreakBox());
    67             return downcast<Container>(layoutBox).firstInFlowOrFloatingChild();
     67            return downcast<ContainerBox>(layoutBox).firstInFlowOrFloatingChild();
    6868        }
    6969    }
     
    9393            computeWidthAndMargin(*layoutBox, horizontalConstraints);
    9494            auto createsFormattingContext = layoutBox->isInlineBlockBox() || layoutBox->isInlineTableBox();
    95             auto hasInFlowOrFloatingChild = is<Container>(*layoutBox) && downcast<Container>(*layoutBox).hasInFlowOrFloatingChild();
     95            auto hasInFlowOrFloatingChild = is<ContainerBox>(*layoutBox) && downcast<ContainerBox>(*layoutBox).hasInFlowOrFloatingChild();
    9696            if (createsFormattingContext && hasInFlowOrFloatingChild) {
    97                 auto formattingContext = LayoutContext::createFormattingContext(downcast<Container>(*layoutBox), layoutState());
     97                auto formattingContext = LayoutContext::createFormattingContext(downcast<ContainerBox>(*layoutBox), layoutState());
    9898                formattingContext->layoutInFlowContent(invalidationState, horizontalConstraints, verticalConstraints);
    9999            }
    100100            computeHeightAndMargin(*layoutBox, horizontalConstraints);
    101             if (createsFormattingContext && is<Container>(*layoutBox) && downcast<Container>(*layoutBox).hasChild()) {
     101            if (createsFormattingContext && is<ContainerBox>(*layoutBox) && downcast<ContainerBox>(*layoutBox).hasChild()) {
    102102                auto& displayBox = geometryForBox(*layoutBox);
    103103                auto horizontalConstraintsForOutOfFlow = Geometry::horizontalConstraintsForOutOfFlow(displayBox);
    104104                auto verticalConstraintsForOutOfFlow = Geometry::verticalConstraintsForOutOfFlow(displayBox);
    105                 auto formattingContext = LayoutContext::createFormattingContext(downcast<Container>(*layoutBox), layoutState());
     105                auto formattingContext = LayoutContext::createFormattingContext(downcast<ContainerBox>(*layoutBox), layoutState());
    106106                formattingContext->layoutOutOfFlowContent(invalidationState, horizontalConstraintsForOutOfFlow, verticalConstraintsForOutOfFlow);
    107107            }
     
    254254    if (auto fixedWidth = geometry().fixedValue(formattingRoot.style().logicalWidth()))
    255255        constraints = { *fixedWidth, *fixedWidth };
    256     else if (is<Container>(formattingRoot) && downcast<Container>(formattingRoot).hasInFlowOrFloatingChild())
    257         constraints = LayoutContext::createFormattingContext(downcast<Container>(formattingRoot), layoutState())->computedIntrinsicWidthConstraints();
     256    else if (is<ContainerBox>(formattingRoot) && downcast<ContainerBox>(formattingRoot).hasInFlowOrFloatingChild())
     257        constraints = LayoutContext::createFormattingContext(downcast<ContainerBox>(formattingRoot), layoutState())->computedIntrinsicWidthConstraints();
    258258    constraints = geometry().constrainByMinMaxWidth(formattingRoot, constraints);
    259259    constraints.expand(geometryForBox(formattingRoot).horizontalMarginBorderAndPadding());
     
    326326            // This is the start of an inline box (e.g. <span>).
    327327            formattingState.addInlineItem({ layoutBox, InlineItem::Type::ContainerStart });
    328             auto& inlineBoxWithInlineContent = downcast<Container>(layoutBox);
     328            auto& inlineBoxWithInlineContent = downcast<ContainerBox>(layoutBox);
    329329            if (!inlineBoxWithInlineContent.hasInFlowOrFloatingChild())
    330330                break;
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h

    r255118 r256417  
    4343    WTF_MAKE_ISO_ALLOCATED(InlineFormattingContext);
    4444public:
    45     InlineFormattingContext(const Container& formattingContextRoot, InlineFormattingState&);
     45    InlineFormattingContext(const ContainerBox& formattingContextRoot, InlineFormattingState&);
    4646    void layoutInFlowContent(InvalidationState&, const HorizontalConstraints&, const VerticalConstraints&) override;
    4747
     
    5252    public:
    5353        bool lineDescentNeedsCollapsing(const LineBuilder::RunList&) const;
    54         LineBuilder::Constraints::HeightAndBaseline lineHeightConstraints(const Container& formattingRoot) const;
     54        LineBuilder::Constraints::HeightAndBaseline lineHeightConstraints(const ContainerBox& formattingRoot) const;
    5555
    5656    private:
     
    6767        ContentHeightAndMargin inlineBlockHeightAndMargin(const Box&, const HorizontalConstraints&, const OverrideVerticalValues&) const;
    6868        ContentWidthAndMargin inlineBlockWidthAndMargin(const Box&, const HorizontalConstraints&, const OverrideHorizontalValues&);
    69         Optional<InlineLayoutUnit> computedTextIndent(const Container& formattingContextRoot, const HorizontalConstraints&) const;
     69        Optional<InlineLayoutUnit> computedTextIndent(const ContainerBox& formattingContextRoot, const HorizontalConstraints&) const;
    7070
    7171    private:
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp

    r256380 r256417  
    3131#include "FormattingContext.h"
    3232#include "LayoutBox.h"
    33 #include "LayoutContainer.h"
     33#include "LayoutContainerBox.h"
    3434#include "LengthFunctions.h"
    3535
     
    7575}
    7676
    77 Optional<InlineLayoutUnit> InlineFormattingContext::Geometry::computedTextIndent(const Container& formattingContextRoot, const HorizontalConstraints& horizontalConstraints) const
     77Optional<InlineLayoutUnit> InlineFormattingContext::Geometry::computedTextIndent(const ContainerBox& formattingContextRoot, const HorizontalConstraints& horizontalConstraints) const
    7878{
    7979    auto textIndent = formattingContextRoot.style().textIndent();
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextQuirks.cpp

    r255257 r256417  
    6060        if (run.isBox()) {
    6161            if (layoutBox.isInlineBlockBox() && layoutBox.establishesInlineFormattingContext()) {
    62                 auto& formattingState = layoutState.establishedInlineFormattingState(downcast<Container>(layoutBox));
     62                auto& formattingState = layoutState.establishedInlineFormattingState(downcast<ContainerBox>(layoutBox));
    6363                auto inlineBlockBaseline = formattingState.displayInlineContent()->lineBoxes.last().baseline();
    6464                if (inlineBlockBaseline.descent())
     
    7272}
    7373
    74 LineBuilder::Constraints::HeightAndBaseline InlineFormattingContext::Quirks::lineHeightConstraints(const Container& formattingRoot) const
     74LineBuilder::Constraints::HeightAndBaseline InlineFormattingContext::Quirks::lineHeightConstraints(const ContainerBox& formattingRoot) const
    7575{
    7676    // computedLineHeight takes font-size into account when line-height is not set.
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp

    r256380 r256417  
    156156                logicalTop = baselineOffset() - ascent - boxGeometry.borderTop() - boxGeometry.paddingTop().valueOr(0);
    157157            } else if (layoutBox.isInlineBlockBox() && layoutBox.establishesInlineFormattingContext()) {
    158                 auto& formattingState = layoutState().establishedInlineFormattingState(downcast<Container>(layoutBox));
     158                auto& formattingState = layoutState().establishedInlineFormattingState(downcast<ContainerBox>(layoutBox));
    159159                // Spec makes us generate at least one line -even if it is empty.
    160160                auto inlineBlockBaselineOffset = formattingState.displayInlineContent()->lineBoxes.last().baselineOffset();
     
    566566            if (layoutBox.isInlineBlockBox() && layoutBox.establishesInlineFormattingContext()) {
    567567                // Inline-blocks with inline content always have baselines.
    568                 auto& formattingState = layoutState().establishedInlineFormattingState(downcast<Container>(layoutBox));
     568                auto& formattingState = layoutState().establishedInlineFormattingState(downcast<ContainerBox>(layoutBox));
    569569                // Spec makes us generate at least one line -even if it is empty.
    570570                auto& lastLineBox = formattingState.displayInlineContent()->lineBoxes.last();
  • trunk/Source/WebCore/layout/inlineformatting/LineLayoutContext.cpp

    r256380 r256417  
    246246}
    247247
    248 LineLayoutContext::LineLayoutContext(const InlineFormattingContext& inlineFormattingContext, const Container& formattingContextRoot, const InlineItems& inlineItems)
     248LineLayoutContext::LineLayoutContext(const InlineFormattingContext& inlineFormattingContext, const ContainerBox& formattingContextRoot, const InlineItems& inlineItems)
    249249    : m_inlineFormattingContext(inlineFormattingContext)
    250250    , m_formattingContextRoot(formattingContextRoot)
  • trunk/Source/WebCore/layout/inlineformatting/LineLayoutContext.h

    r255257 r256417  
    3838class LineLayoutContext {
    3939public:
    40     LineLayoutContext(const InlineFormattingContext&, const Container& formattingContextRoot, const InlineItems&);
     40    LineLayoutContext(const InlineFormattingContext&, const ContainerBox& formattingContextRoot, const InlineItems&);
    4141
    4242    struct LineContent {
     
    7676
    7777    const InlineFormattingContext& formattingContext() const { return m_inlineFormattingContext; }
    78     const Container& root() const { return m_formattingContextRoot; }
     78    const ContainerBox& root() const { return m_formattingContextRoot; }
    7979
    8080    const InlineFormattingContext& m_inlineFormattingContext;
    81     const Container& m_formattingContextRoot;
     81    const ContainerBox& m_formattingContextRoot;
    8282    const InlineItems& m_inlineItems;
    8383    FloatList m_floats;
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.h

    r254806 r256417  
    2828#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    2929
    30 #include "LayoutContainer.h"
     30#include "LayoutContainerBox.h"
    3131#include <wtf/HashMap.h>
    3232#include <wtf/Vector.h>
     
    4242    BoxTree(const RenderBlockFlow&);
    4343
    44     const Layout::Container& rootLayoutBox() const { return m_root; }
    45     Layout::Container& rootLayoutBox() { return m_root; }
     44    const Layout::ContainerBox& rootLayoutBox() const { return m_root; }
     45    Layout::ContainerBox& rootLayoutBox() { return m_root; }
    4646
    4747    const Layout::Box* layoutBoxForRenderer(const RenderObject&) const;
     
    5151    void buildTree(const RenderBlockFlow&);
    5252
    53     Layout::Container m_root;
     53    Layout::ContainerBox m_root;
    5454    struct BoxAndRenderer {
    5555        std::unique_ptr<const Layout::Box> box;
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp

    r256107 r256417  
    243243}
    244244
    245 const Layout::Container& LineLayout::rootLayoutBox() const
     245const Layout::ContainerBox& LineLayout::rootLayoutBox() const
    246246{
    247247    return m_boxTree.rootLayoutBox();
    248248}
    249249
    250 Layout::Container& LineLayout::rootLayoutBox()
     250Layout::ContainerBox& LineLayout::rootLayoutBox()
    251251{
    252252    return m_boxTree.rootLayoutBox();
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h

    r256107 r256417  
    8787    void prepareFloatingState();
    8888
    89     const Layout::Container& rootLayoutBox() const;
    90     Layout::Container& rootLayoutBox();
     89    const Layout::ContainerBox& rootLayoutBox() const;
     90    Layout::ContainerBox& rootLayoutBox();
    9191    ShadowData* debugTextShadow();
    9292    void releaseInlineItemCache();
  • trunk/Source/WebCore/layout/invalidation/InvalidationState.h

    r252460 r256417  
    2929
    3030#include "LayoutBox.h"
    31 #include "LayoutContainer.h"
     31#include "LayoutContainerBox.h"
    3232#include <wtf/IsoMalloc.h>
    3333#include <wtf/WeakHashSet.h>
     
    4444    bool needsLayout(const Box&) const;
    4545
    46     using FormattingContextRoots = WeakHashSet<const Container>;
     46    using FormattingContextRoots = WeakHashSet<const ContainerBox>;
    4747    // FIXME: We currently do full formatting context layouts (no partial layout within a formatting context).
    4848    const FormattingContextRoots& formattingContextRoots() const { return m_formattingContextRoots; }
  • trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp

    r256384 r256417  
    3030
    3131#include "DisplayBox.h"
    32 #include "LayoutContainer.h"
     32#include "LayoutContainerBox.h"
    3333#include "LayoutPhase.h"
    3434#include "LayoutState.h"
     
    100100        return false;
    101101
    102     if (!isContainer())
     102    if (!isContainerBox())
    103103        return false;
    104104
    105105    // FIXME ???
    106     if (!downcast<Container>(*this).firstInFlowChild())
     106    if (!downcast<ContainerBox>(*this).firstInFlowChild())
    107107        return false;
    108108
    109109    // It's enough to check the first in-flow child since we can't have both block and inline level sibling boxes.
    110     return downcast<Container>(*this).firstInFlowChild()->isInlineLevelBox();
     110    return downcast<ContainerBox>(*this).firstInFlowChild()->isInlineLevelBox();
    111111}
    112112
     
    175175}
    176176
    177 const Container* Box::containingBlock() const
     177const ContainerBox* Box::containingBlock() const
    178178{
    179179    // Finding the containing block by traversing the tree during tree construction could provide incorrect result.
     
    214214}
    215215
    216 const Container& Box::formattingContextRoot() const
     216const ContainerBox& Box::formattingContextRoot() const
    217217{
    218218    // Finding the context root by traversing the tree during tree construction could provide incorrect result.
     
    227227    // While the relatively positioned inline container (span) is placed relative to its containing block "outer", it lives in the inline
    228228    // formatting context established by "inner".
    229     const Container* ancestor = nullptr;
     229    const ContainerBox* ancestor = nullptr;
    230230    if (isInlineLevelBox() && isInFlowPositioned())
    231231        ancestor = parent();
     
    238238}
    239239
    240 const Container& Box::initialContainingBlock() const
     240const ContainerBox& Box::initialContainingBlock() const
    241241{
    242242    if (isInitialContainingBlock())
    243         return downcast<Container>(*this);
     243        return downcast<ContainerBox>(*this);
    244244
    245245    auto* parent = this->parent();
     
    249249}
    250250
    251 bool Box::isDescendantOf(const Container& ancestorCandidate) const
     251bool Box::isDescendantOf(const ContainerBox& ancestorCandidate) const
    252252{
    253253    for (auto* ancestor = parent(); ancestor; ancestor = ancestor->parent()) {
     
    258258}
    259259
    260 bool Box::isContainingBlockDescendantOf(const Container& ancestorCandidate) const
     260bool Box::isContainingBlockDescendantOf(const ContainerBox& ancestorCandidate) const
    261261{
    262262    for (auto* ancestor = containingBlock(); ancestor; ancestor = ancestor->containingBlock()) {
     
    366366    }
    367367    if (isInitialContainingBlock()) {
    368         auto* documentBox = downcast<Container>(*this).firstChild();
    369         if (!documentBox || !documentBox->isDocumentBox() || !is<Container>(documentBox))
     368        auto* documentBox = downcast<ContainerBox>(*this).firstChild();
     369        if (!documentBox || !documentBox->isDocumentBox() || !is<ContainerBox>(documentBox))
    370370            return isOverflowVisible;
    371         auto* bodyBox = downcast<Container>(documentBox)->firstChild();
     371        auto* bodyBox = downcast<ContainerBox>(documentBox)->firstChild();
    372372        if (!bodyBox || !bodyBox->isBodyBox())
    373373            return isOverflowVisible;
  • trunk/Source/WebCore/layout/layouttree/LayoutBox.h

    r256384 r256417  
    4040namespace Layout {
    4141
    42 class Container;
     42class ContainerBox;
    4343class LayoutState;
    4444class TreeBuilder;
     
    6666        LineBreakBox           = 1 << 2,
    6767        ReplacedBox            = 1 << 3,
    68         ContainerFlag          = 1 << 4
     68        ContainerBoxFlag       = 1 << 4
    6969    };
    7070    typedef unsigned BaseTypeFlags;
     
    9494    bool isFloatingOrOutOfFlowPositioned() const { return isFloatingPositioned() || isOutOfFlowPositioned(); }
    9595
    96     const Container* containingBlock() const;
    97     const Container& formattingContextRoot() const;
    98     const Container& initialContainingBlock() const;
    99 
    100     bool isDescendantOf(const Container&) const;
    101     bool isContainingBlockDescendantOf(const Container&) const;
     96    const ContainerBox* containingBlock() const;
     97    const ContainerBox& formattingContextRoot() const;
     98    const ContainerBox& initialContainingBlock() const;
     99
     100    bool isDescendantOf(const ContainerBox&) const;
     101    bool isContainingBlockDescendantOf(const ContainerBox&) const;
    102102
    103103    bool isAnonymous() const { return m_isAnonymous; }
     
    127127    bool isImage() const { return m_elementAttributes && m_elementAttributes.value().elementType == ElementType::Image; }
    128128
    129     const Container* parent() const { return m_parent; }
     129    const ContainerBox* parent() const { return m_parent; }
    130130    const Box* nextSibling() const { return m_nextSibling; }
    131131    const Box* nextInFlowSibling() const;
     
    138138    Box* nextSibling() { return m_nextSibling; }
    139139
    140     bool isContainer() const { return m_baseTypeFlags & ContainerFlag; }
     140    bool isContainerBox() const { return m_baseTypeFlags & ContainerBoxFlag; }
    141141    bool isInlineTextBox() const { return m_baseTypeFlags & InlineTextBox; }
    142142    bool isLineBreakBox() const { return m_baseTypeFlags & LineBreakBox; }
     
    159159    Optional<LayoutUnit> columnWidth() const;
    160160
    161     void setParent(Container& parent) { m_parent = &parent; }
     161    void setParent(ContainerBox& parent) { m_parent = &parent; }
    162162    void setNextSibling(Box& nextSibling) { m_nextSibling = &nextSibling; }
    163163    void setPreviousSibling(Box& previousSibling) { m_previousSibling = &previousSibling; }
     
    196196    Optional<ElementAttributes> m_elementAttributes;
    197197
    198     Container* m_parent { nullptr };
     198    ContainerBox* m_parent { nullptr };
    199199    Box* m_previousSibling { nullptr };
    200200    Box* m_nextSibling { nullptr };
  • trunk/Source/WebCore/layout/layouttree/LayoutChildIterator.h

    r250767 r256417  
    3636class LayoutChildIterator : public LayoutIterator<T> {
    3737public:
    38     LayoutChildIterator(const Container& parent);
    39     LayoutChildIterator(const Container& parent, const T* current);
     38    LayoutChildIterator(const ContainerBox& parent);
     39    LayoutChildIterator(const ContainerBox& parent, const T* current);
    4040    LayoutChildIterator& operator++();
    4141};
     
    4444class LayoutChildIteratorAdapter {
    4545public:
    46     LayoutChildIteratorAdapter(const Container& parent);
     46    LayoutChildIteratorAdapter(const ContainerBox& parent);
    4747    LayoutChildIterator<T> begin() const;
    4848    LayoutChildIterator<T> end() const;
     
    5151
    5252private:
    53     const Container& m_parent;
     53    const ContainerBox& m_parent;
    5454};
    5555
    56 template <typename T> LayoutChildIteratorAdapter<T> childrenOfType(const Container&);
     56template <typename T> LayoutChildIteratorAdapter<T> childrenOfType(const ContainerBox&);
    5757
    5858// LayoutChildIterator
    5959
    6060template <typename T>
    61 inline LayoutChildIterator<T>::LayoutChildIterator(const Container& parent)
     61inline LayoutChildIterator<T>::LayoutChildIterator(const ContainerBox& parent)
    6262    : LayoutIterator<T>(&parent)
    6363{
     
    6565
    6666template <typename T>
    67 inline LayoutChildIterator<T>::LayoutChildIterator(const Container& parent, const T* current)
     67inline LayoutChildIterator<T>::LayoutChildIterator(const ContainerBox& parent, const T* current)
    6868    : LayoutIterator<T>(&parent, current)
    6969{
     
    7979
    8080template <typename T>
    81 inline LayoutChildIteratorAdapter<T>::LayoutChildIteratorAdapter(const Container& parent)
     81inline LayoutChildIteratorAdapter<T>::LayoutChildIteratorAdapter(const ContainerBox& parent)
    8282    : m_parent(parent)
    8383{
     
    109109
    110110template <typename T>
    111 inline LayoutChildIteratorAdapter<T> childrenOfType(const Container& parent)
     111inline LayoutChildIteratorAdapter<T> childrenOfType(const ContainerBox& parent)
    112112{
    113113    return LayoutChildIteratorAdapter<T>(parent);
  • trunk/Source/WebCore/layout/layouttree/LayoutContainerBox.cpp

    r256414 r256417  
    2525
    2626#include "config.h"
    27 #include "LayoutContainer.h"
     27#include "LayoutContainerBox.h"
    2828
    2929#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     
    3535namespace Layout {
    3636
    37 WTF_MAKE_ISO_ALLOCATED_IMPL(Container);
     37WTF_MAKE_ISO_ALLOCATED_IMPL(ContainerBox);
    3838
    39 Container::Container(Optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags)
    40     : Box(attributes, WTFMove(style), baseTypeFlags | ContainerFlag)
     39ContainerBox::ContainerBox(Optional<ElementAttributes> attributes, RenderStyle&& style, BaseTypeFlags baseTypeFlags)
     40    : Box(attributes, WTFMove(style), baseTypeFlags | ContainerBoxFlag)
    4141{
    4242}
    4343
    44 const Box* Container::firstInFlowChild() const
     44const Box* ContainerBox::firstInFlowChild() const
    4545{
    4646    if (auto* firstChild = this->firstChild()) {
     
    5252}
    5353
    54 const Box* Container::firstInFlowOrFloatingChild() const
     54const Box* ContainerBox::firstInFlowOrFloatingChild() const
    5555{
    5656    if (auto* firstChild = this->firstChild()) {
     
    6262}
    6363
    64 const Box* Container::lastInFlowChild() const
     64const Box* ContainerBox::lastInFlowChild() const
    6565{
    6666    if (auto* lastChild = this->lastChild()) {
     
    7272}
    7373
    74 const Box* Container::lastInFlowOrFloatingChild() const
     74const Box* ContainerBox::lastInFlowOrFloatingChild() const
    7575{
    7676    if (auto* lastChild = this->lastChild()) {
     
    8282}
    8383
    84 void Container::setFirstChild(Box& childBox)
     84void ContainerBox::setFirstChild(Box& childBox)
    8585{
    8686    m_firstChild = &childBox;
    8787}
    8888
    89 void Container::setLastChild(Box& childBox)
     89void ContainerBox::setLastChild(Box& childBox)
    9090{
    9191    m_lastChild = &childBox;
    9292}
    9393
    94 void Container::appendChild(Box& childBox)
     94void ContainerBox::appendChild(Box& childBox)
    9595{
    9696    childBox.setParent(*this);
  • trunk/Source/WebCore/layout/layouttree/LayoutContainerBox.h

    r256414 r256417  
    3737namespace Layout {
    3838
    39 class Container final : public Box {
    40     WTF_MAKE_ISO_ALLOCATED(Container);
     39class ContainerBox final : public Box {
     40    WTF_MAKE_ISO_ALLOCATED(ContainerBox);
    4141public:
    42     Container(Optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags = ContainerFlag);
     42    ContainerBox(Optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags = Box::ContainerBoxFlag);
    4343
    4444    const Box* firstChild() const { return m_firstChild; }
     
    6868}
    6969
    70 SPECIALIZE_TYPE_TRAITS_LAYOUT_BOX(Container, isContainer())
     70SPECIALIZE_TYPE_TRAITS_LAYOUT_BOX(ContainerBox, isContainerBox())
    7171
    7272#endif
  • trunk/Source/WebCore/layout/layouttree/LayoutDescendantIterator.h

    r232042 r256417  
    3636class LayoutDescendantIterator : public LayoutIterator<T> {
    3737public:
    38     LayoutDescendantIterator(const Container& root);
    39     LayoutDescendantIterator(const Container& root, const T* current);
     38    LayoutDescendantIterator(const ContainerBox& root);
     39    LayoutDescendantIterator(const ContainerBox& root, const T* current);
    4040    LayoutDescendantIterator& operator++();
    4141};
     
    4444class LayoutDescendantIteratorAdapter {
    4545public:
    46     LayoutDescendantIteratorAdapter(const Container& root);
     46    LayoutDescendantIteratorAdapter(const ContainerBox& root);
    4747    LayoutDescendantIterator<T> begin();
    4848    LayoutDescendantIterator<T> end();
     
    5050
    5151private:
    52     const Container& m_root;
     52    const ContainerBox& m_root;
    5353};
    5454
     
    5858
    5959template <typename T>
    60 inline LayoutDescendantIterator<T>::LayoutDescendantIterator(const Container& root)
     60inline LayoutDescendantIterator<T>::LayoutDescendantIterator(const ContainerBox& root)
    6161    : LayoutIterator<T>(&root)
    6262{
     
    6464
    6565template <typename T>
    66 inline LayoutDescendantIterator<T>::LayoutDescendantIterator(const Container& root, const T* current)
     66inline LayoutDescendantIterator<T>::LayoutDescendantIterator(const ContainerBox& root, const T* current)
    6767    : LayoutIterator<T>(&root, current)
    6868{
     
    7878
    7979template <typename T>
    80 inline LayoutDescendantIteratorAdapter<T>::LayoutDescendantIteratorAdapter(const Container& root)
     80inline LayoutDescendantIteratorAdapter<T>::LayoutDescendantIteratorAdapter(const ContainerBox& root)
    8181    : m_root(root)
    8282{
     
    104104
    105105template <typename T>
    106 inline LayoutDescendantIteratorAdapter<T> descendantsOfType(const Container& root)
     106inline LayoutDescendantIteratorAdapter<T> descendantsOfType(const ContainerBox& root)
    107107{
    108108    return LayoutDescendantIteratorAdapter<T>(root);
  • trunk/Source/WebCore/layout/layouttree/LayoutIterator.h

    r248199 r256417  
    3434class LayoutIterator {
    3535public:
    36     LayoutIterator(const Container* root);
    37     LayoutIterator(const Container* root, const T* current);
     36    LayoutIterator(const ContainerBox* root);
     37    LayoutIterator(const ContainerBox* root, const T* current);
    3838
    3939    const T& operator*() const;
     
    4949
    5050private:
    51     const Container* m_root;
     51    const ContainerBox* m_root;
    5252    const T* m_current;
    5353};
     
    6767inline const Box* firstChild(const Box& box)
    6868{
    69     if (is<Container>(box))
    70         return downcast<Container>(box).firstChild();
     69    if (is<ContainerBox>(box))
     70        return downcast<ContainerBox>(box).firstChild();
    7171    return nullptr;
    7272}
    7373
    74 inline const Box* nextAncestorSibling(const Box& current, const Container* stayWithin)
     74inline const Box* nextAncestorSibling(const Box& current, const ContainerBox* stayWithin)
    7575{
    7676    for (auto* ancestor = current.parent(); ancestor; ancestor = ancestor->parent()) {
     
    8484
    8585template <typename U>
    86 inline const Box* next(const U& current, const Container* stayWithin)
     86inline const Box* next(const U& current, const ContainerBox* stayWithin)
    8787{
    8888    if (auto* child = firstChild(current))
     
    9898}
    9999
    100 inline const Box* nextSkippingChildren(Box& current, const Container* stayWithin)
     100inline const Box* nextSkippingChildren(Box& current, const ContainerBox* stayWithin)
    101101{
    102102    if (&current == stayWithin)
     
    169169
    170170template <typename T, typename U>
    171 inline const T* next(const U& current, const Container* stayWithin)
     171inline const T* next(const U& current, const ContainerBox* stayWithin)
    172172{
    173173    auto* descendant = LayoutBoxTraversal::next(current, stayWithin);
     
    182182
    183183template <typename T>
    184 inline LayoutIterator<T>::LayoutIterator(const Container* root)
     184inline LayoutIterator<T>::LayoutIterator(const ContainerBox* root)
    185185    : m_root(root)
    186186    , m_current(nullptr)
     
    189189
    190190template <typename T>
    191 inline LayoutIterator<T>::LayoutIterator(const Container* root, const T* current)
     191inline LayoutIterator<T>::LayoutIterator(const ContainerBox* root, const T* current)
    192192    : m_root(root)
    193193    , m_current(current)
  • trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp

    r256380 r256417  
    4040#include "LayoutBox.h"
    4141#include "LayoutChildIterator.h"
    42 #include "LayoutContainer.h"
     42#include "LayoutContainerBox.h"
    4343#include "LayoutContext.h"
    4444#include "LayoutDescendantIterator.h"
     
    6868
    6969WTF_MAKE_ISO_ALLOCATED_IMPL(LayoutTreeContent);
    70 LayoutTreeContent::LayoutTreeContent(const RenderBox& rootRenderer, std::unique_ptr<Container> rootLayoutBox)
     70LayoutTreeContent::LayoutTreeContent(const RenderBox& rootRenderer, std::unique_ptr<ContainerBox> rootLayoutBox)
    7171    : m_rootRenderer(rootRenderer)
    7272    , m_rootLayoutBox(WTFMove(rootLayoutBox))
     
    8383}
    8484
    85 static void appendChild(Container& parent, Box& newChild)
     85static void appendChild(ContainerBox& parent, Box& newChild)
    8686{
    8787    if (!parent.hasChild()) {
     
    131131    style.setLogicalHeight(Length(renderView.height(), Fixed));
    132132
    133     auto layoutTreeContent = makeUnique<LayoutTreeContent>(renderView, makeUnique<Container>(WTF::nullopt, WTFMove(style)));
     133    auto layoutTreeContent = makeUnique<LayoutTreeContent>(renderView, makeUnique<ContainerBox>(WTF::nullopt, WTFMove(style)));
    134134    TreeBuilder(*layoutTreeContent).buildTree();
    135135    return layoutTreeContent;
     
    170170}
    171171
    172 Container& TreeBuilder::createContainer(Optional<Box::ElementAttributes> elementAttributes, RenderStyle&& style)
    173 {
    174     auto newContainer = makeUnique<Container>(elementAttributes, WTFMove(style));
     172ContainerBox& TreeBuilder::createContainer(Optional<Box::ElementAttributes> elementAttributes, RenderStyle&& style)
     173{
     174    auto newContainer = makeUnique<ContainerBox>(elementAttributes, WTFMove(style));
    175175    auto& container = *newContainer;
    176176    m_layoutTreeContent.addContainer(WTFMove(newContainer));
     
    178178}
    179179
    180 Box* TreeBuilder::createLayoutBox(const Container& parentContainer, const RenderObject& childRenderer)
     180Box* TreeBuilder::createLayoutBox(const ContainerBox& parentContainer, const RenderObject& childRenderer)
    181181{
    182182    auto elementAttributes = [] (const RenderElement& renderer) -> Optional<Box::ElementAttributes> {
     
    279279}
    280280
    281 void TreeBuilder::buildTableStructure(const RenderTable& tableRenderer, Container& tableWrapperBox)
     281void TreeBuilder::buildTableStructure(const RenderTable& tableRenderer, ContainerBox& tableWrapperBox)
    282282{
    283283    // Create caption and table box.
     
    287287        auto* captionBox = createLayoutBox(tableWrapperBox, captionRenderer);
    288288        appendChild(tableWrapperBox, *captionBox);
    289         auto& captionContainer = downcast<Container>(*captionBox);
     289        auto& captionContainer = downcast<ContainerBox>(*captionBox);
    290290        buildSubTree(downcast<RenderElement>(captionRenderer), captionContainer);
    291291        tableChild = tableChild->nextSibling();
     
    298298        auto* sectionBox = createLayoutBox(tableBox, *sectionRenderer);
    299299        appendChild(tableBox, *sectionBox);
    300         auto& sectionContainer = downcast<Container>(*sectionBox);
     300        auto& sectionContainer = downcast<ContainerBox>(*sectionBox);
    301301        buildSubTree(downcast<RenderElement>(*sectionRenderer), sectionContainer);
    302302        sectionRenderer = sectionRenderer->nextSibling();
     
    304304}
    305305
    306 void TreeBuilder::buildSubTree(const RenderElement& parentRenderer, Container& parentContainer)
     306void TreeBuilder::buildSubTree(const RenderElement& parentRenderer, ContainerBox& parentContainer)
    307307{
    308308    for (auto& childRenderer : childrenOfType<RenderObject>(parentRenderer)) {
     
    310310        appendChild(parentContainer, *childLayoutBox);
    311311        if (childLayoutBox->isTableWrapperBox())
    312             buildTableStructure(downcast<RenderTable>(childRenderer), downcast<Container>(*childLayoutBox));
    313         else if (is<Container>(*childLayoutBox))
    314             buildSubTree(downcast<RenderElement>(childRenderer), downcast<Container>(*childLayoutBox));
     312            buildTableStructure(downcast<RenderTable>(childRenderer), downcast<ContainerBox>(*childLayoutBox));
     313        else if (is<ContainerBox>(*childLayoutBox))
     314            buildSubTree(downcast<RenderElement>(childRenderer), downcast<ContainerBox>(*childLayoutBox));
    315315    }
    316316}
    317317
    318318#if ENABLE(TREE_DEBUGGING)
    319 static void outputInlineRuns(TextStream& stream, const LayoutState& layoutState, const Container& inlineFormattingRoot, unsigned depth)
     319static void outputInlineRuns(TextStream& stream, const LayoutState& layoutState, const ContainerBox& inlineFormattingRoot, unsigned depth)
    320320{
    321321    auto& inlineFormattingState = layoutState.establishedInlineFormattingState(inlineFormattingRoot);
     
    416416}
    417417
    418 static void outputLayoutTree(const LayoutState* layoutState, TextStream& stream, const Container& rootContainer, unsigned depth)
     418static void outputLayoutTree(const LayoutState* layoutState, TextStream& stream, const ContainerBox& rootContainer, unsigned depth)
    419419{
    420420    for (auto& child : childrenOfType<Box>(rootContainer)) {
     
    424424                outputLayoutBox(stream, child, &layoutState->displayBoxForLayoutBox(child), depth);
    425425            if (child.establishesInlineFormattingContext())
    426                 outputInlineRuns(stream, *layoutState, downcast<Container>(child), depth + 1);
     426                outputInlineRuns(stream, *layoutState, downcast<ContainerBox>(child), depth + 1);
    427427        } else
    428428            outputLayoutBox(stream, child, nullptr, depth);
    429429
    430         if (is<Container>(child))
    431             outputLayoutTree(layoutState, stream, downcast<Container>(child), depth + 1);
     430        if (is<ContainerBox>(child))
     431            outputLayoutTree(layoutState, stream, downcast<ContainerBox>(child), depth + 1);
    432432    }
    433433}
  • trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.h

    r256380 r256417  
    2828#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    2929
    30 #include "LayoutContainer.h"
     30#include "LayoutContainerBox.h"
    3131#include <wtf/IsoMalloc.h>
    3232#include <wtf/WeakPtr.h>
     
    4848    WTF_MAKE_ISO_ALLOCATED(LayoutTreeContent);
    4949public:
    50     LayoutTreeContent(const RenderBox&, std::unique_ptr<Container>);
     50    LayoutTreeContent(const RenderBox&, std::unique_ptr<ContainerBox>);
    5151    ~LayoutTreeContent();
    5252
    53     const Container& rootLayoutBox() const { return *m_rootLayoutBox; }
    54     Container& rootLayoutBox() { return *m_rootLayoutBox; }
     53    const ContainerBox& rootLayoutBox() const { return *m_rootLayoutBox; }
     54    ContainerBox& rootLayoutBox() { return *m_rootLayoutBox; }
    5555    const RenderBox& rootRenderer() const { return m_rootRenderer; }
    5656
    5757    void addBox(std::unique_ptr<Box> box)
    5858    {
    59         ASSERT(!box->isContainer());
     59        ASSERT(!box->isContainerBox());
    6060        m_boxes.add(WTFMove(box));
    6161    }
    62     void addContainer(std::unique_ptr<Container> container) { m_containers.add(WTFMove(container)); }
     62    void addContainer(std::unique_ptr<ContainerBox> container) { m_containers.add(WTFMove(container)); }
    6363
    6464    Box* layoutBoxForRenderer(const RenderObject& renderer) { return m_renderObjectToLayoutBox.get(&renderer); }
     
    7171private:
    7272    const RenderBox& m_rootRenderer;
    73     std::unique_ptr<Container> m_rootLayoutBox;
     73    std::unique_ptr<ContainerBox> m_rootLayoutBox;
    7474    HashSet<std::unique_ptr<Box>> m_boxes;
    75     HashSet<std::unique_ptr<Container>> m_containers;
     75    HashSet<std::unique_ptr<ContainerBox>> m_containers;
    7676
    7777    HashMap<const RenderObject*, Box*> m_renderObjectToLayoutBox;
     
    8787
    8888    void buildTree();
    89     void buildSubTree(const RenderElement& parentRenderer, Container& parentContainer);
    90     void buildTableStructure(const RenderTable& tableRenderer, Container& tableWrapperBox);
    91     Box* createLayoutBox(const Container& parentContainer, const RenderObject& childRenderer);
     89    void buildSubTree(const RenderElement& parentRenderer, ContainerBox& parentContainer);
     90    void buildTableStructure(const RenderTable& tableRenderer, ContainerBox& tableWrapperBox);
     91    Box* createLayoutBox(const ContainerBox& parentContainer, const RenderObject& childRenderer);
    9292
    9393    Box& createReplacedBox(RenderStyle&&);
    9494    Box& createTextBox(String text, bool canUseSimplifiedTextMeasuring, RenderStyle&&);
    9595    Box& createLineBreakBox(bool isOptional, RenderStyle&&);
    96     Container& createContainer(Optional<Box::ElementAttributes>, RenderStyle&&);
     96    ContainerBox& createContainer(Optional<Box::ElementAttributes>, RenderStyle&&);
    9797
    9898    LayoutTreeContent& m_layoutTreeContent;
  • trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp

    r254927 r256417  
    5656
    5757// https://www.w3.org/TR/css-tables-3/#table-layout-algorithm
    58 TableFormattingContext::TableFormattingContext(const Container& formattingContextRoot, TableFormattingState& formattingState)
     58TableFormattingContext::TableFormattingContext(const ContainerBox& formattingContextRoot, TableFormattingState& formattingState)
    5959    : FormattingContext(formattingContextRoot, formattingState)
    6060{
     
    112112
    113113    ASSERT(cellLayoutBox.establishesBlockFormattingContext());
    114     if (is<Container>(cellLayoutBox) && downcast<Container>(cellLayoutBox).hasInFlowOrFloatingChild())
    115         LayoutContext::createFormattingContext(downcast<Container>(cellLayoutBox), layoutState())->layoutInFlowContent(invalidationState, Geometry::horizontalConstraintsForInFlow(cellDisplayBox), Geometry::verticalConstraintsForInFlow(cellDisplayBox));
     114    if (is<ContainerBox>(cellLayoutBox) && downcast<ContainerBox>(cellLayoutBox).hasInFlowOrFloatingChild())
     115        LayoutContext::createFormattingContext(downcast<ContainerBox>(cellLayoutBox), layoutState())->layoutInFlowContent(invalidationState, Geometry::horizontalConstraintsForInFlow(cellDisplayBox), Geometry::verticalConstraintsForInFlow(cellDisplayBox));
    116116    cellDisplayBox.setVerticalMargin({ { }, { } });
    117117    cellDisplayBox.setContentBoxHeight(geometry().tableCellHeightAndMargin(cellLayoutBox).contentHeight);
     
    197197    if (colgroup) {
    198198        auto& columnsContext = tableGrid.columnsContext();
    199         for (auto* column = downcast<Container>(*colgroup).firstChild(); column; column = column->nextSibling()) {
     199        for (auto* column = downcast<ContainerBox>(*colgroup).firstChild(); column; column = column->nextSibling()) {
    200200            ASSERT(column->isTableColumn());
    201201            auto columnSpanCount = column->columnSpan();
     
    209209    for (auto* section = firstSection; section; section = section->nextSibling()) {
    210210        ASSERT(section->isTableHeader() || section->isTableBody() || section->isTableFooter());
    211         for (auto* row = downcast<Container>(*section).firstChild(); row; row = row->nextSibling()) {
     211        for (auto* row = downcast<ContainerBox>(*section).firstChild(); row; row = row->nextSibling()) {
    212212            ASSERT(row->isTableRow());
    213             for (auto* cell = downcast<Container>(*row).firstChild(); cell; cell = cell->nextSibling()) {
     213            for (auto* cell = downcast<ContainerBox>(*row).firstChild(); cell; cell = cell->nextSibling()) {
    214214                ASSERT(cell->isTableCell());
    215215                tableGrid.appendCell(*cell);
     
    235235        if (!intrinsicWidth) {
    236236            intrinsicWidth = IntrinsicWidthConstraints { };
    237             if (is<Container>(tableCellBox))
    238                 intrinsicWidth = LayoutContext::createFormattingContext(downcast<Container>(tableCellBox), layoutState())->computedIntrinsicWidthConstraints();
     237            if (is<ContainerBox>(tableCellBox))
     238                intrinsicWidth = LayoutContext::createFormattingContext(downcast<ContainerBox>(tableCellBox), layoutState())->computedIntrinsicWidthConstraints();
    239239            intrinsicWidth = geometry().constrainByMinMaxWidth(tableCellBox, *intrinsicWidth);
    240240            auto border = geometry().computedBorder(tableCellBox);
  • trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.h

    r254853 r256417  
    4242    WTF_MAKE_ISO_ALLOCATED(TableFormattingContext);
    4343public:
    44     TableFormattingContext(const Container& formattingContextRoot, TableFormattingState&);
     44    TableFormattingContext(const ContainerBox& formattingContextRoot, TableFormattingState&);
    4545    void layoutInFlowContent(InvalidationState&, const HorizontalConstraints&, const VerticalConstraints&) override;
    4646
Note: See TracChangeset for help on using the changeset viewer.