haikuwebkit/Source/WebCore/layout/LayoutContext.cpp

150 lines
6.8 KiB
C++
Raw Permalink Normal View History

[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
/*
* Copyright (C) 2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "LayoutContext.h"
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
#include "BlockFormattingContext.h"
#include "BlockFormattingState.h"
#include "FlexFormattingContext.h"
#include "FlexFormattingState.h"
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
#include "InlineFormattingContext.h"
#include "InlineFormattingState.h"
[LFC][Invalidation] Introduce InvalidationState and Context https://bugs.webkit.org/show_bug.cgi?id=204140 <rdar://problem/57142106> Reviewed by Antti Koivisto. InvalidationContext take style/content changes and turn them into "dirty layout boxes" (stored in InvalidationState). InvalidationState is the input to the (partial)subsequent layout. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/Invalidation.h: Removed. * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): (WebCore::Layout::LayoutContext::runLayout): (WebCore::Layout::LayoutContext::styleChanged): Deleted. (WebCore::Layout::LayoutContext::markNeedsUpdate): Deleted. * layout/LayoutContext.h: (WebCore::Layout::LayoutContext::updateAll): Deleted. * layout/blockformatting/BlockInvalidation.cpp: Removed. * layout/blockformatting/BlockInvalidation.h: Removed. * layout/invalidation/InvalidationContext.cpp: Renamed from Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp. (WebCore::Layout::InvalidationContext::InvalidationContext): (WebCore::Layout::InvalidationContext::styleChanged): (WebCore::Layout::InvalidationContext::contentChanged): (WebCore::Layout::InvalidationContext::subtreeChanged): * layout/invalidation/InvalidationContext.h: Renamed from Source/WebCore/layout/inlineformatting/InlineInvalidation.h. * layout/invalidation/InvalidationState.cpp: Renamed from Source/WebCore/layout/tableformatting/TableInvalidation.cpp. (WebCore::Layout::InvalidationState::InvalidationState): (WebCore::Layout::InvalidationState::markNeedsUpdate): * layout/invalidation/InvalidationState.h: Renamed from Source/WebCore/layout/tableformatting/TableInvalidation.h. (WebCore::Layout::InvalidationState::formattingContextRoots const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): Canonical link: https://commits.webkit.org/217458@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-11-13 18:39:44 +00:00
#include "InvalidationContext.h"
#include "InvalidationState.h"
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
#include "LayoutBox.h"
[LFC] Layout::BoxGeometry rename, part II. https://bugs.webkit.org/show_bug.cgi?id=216523 Reviewed by Simon Fraser. Rename Layout::Geometry to Layout::BoxGeometry (so that later we can introduce Layout::LineGeometry and Layout::RunGeometry) and make sure we don't use displayBox as a variable name in Layout namespace. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::computeBorderAndPadding): (WebCore::Layout::FormattingContext::geometryForBox const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const): (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const): * layout/FormattingContextQuirks.cpp: * layout/FormattingState.cpp: (WebCore::Layout::FormattingState::boxGeometry): (WebCore::Layout::FormattingState::displayBox): Deleted. * layout/FormattingState.h: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::geometryForRootBox): (WebCore::Layout::LayoutState::ensureGeometryForBoxSlow): (WebCore::Layout::LayoutState::geometryForRootLayoutBox): Deleted. (WebCore::Layout::LayoutState::ensureDisplayBoxForLayoutBoxSlow): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasBoxGeometry const): (WebCore::Layout::LayoutState::ensureGeometryForBox): (WebCore::Layout::LayoutState::geometryForBox const): (WebCore::Layout::Box::cachedGeometryForLayoutState const): (WebCore::Layout::LayoutState::hasDisplayBox const): Deleted. (WebCore::Layout::LayoutState::ensureGeometryForLayoutBox): Deleted. (WebCore::Layout::LayoutState::geometryForLayoutBox const): Deleted. (WebCore::Layout::Box::cachedDisplayBoxForLayoutState const): Deleted. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren): (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition): (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear): (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/display/DisplayLayerController.cpp: (WebCore::Display::LayerController::prepareForDisplay): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintBoxDecoration): (WebCore::Display::Painter::absoluteBoxGeometry): (WebCore::Display::paintSubtree): (WebCore::Display::collectPaintRootsAndContentRect): (WebCore::Display::Painter::absoluteDisplayBox): Deleted. * layout/displaytree/DisplayPainter.h: * layout/floats/FloatAvoider.h: * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): (WebCore::Layout::FloatingContext::append): (WebCore::Layout::FloatingContext::absoluteBoxGeometryCoordinates const): (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const): Deleted. * layout/floats/FloatingContext.h: * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::FloatItem::FloatItem): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const): (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const): (WebCore::Layout::FloatingState::FloatItem::bottom const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints): (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin): (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin): (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): (WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent): Deleted. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineLineBox.h: * layout/inlineformatting/InlineLineBuilder.cpp: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::prepareFloatingState): * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::setcachedGeometryForLayoutState const): (WebCore::Layout::Box::setCachedDisplayBoxForLayoutState const): Deleted. * layout/layouttree/LayoutBox.h: * layout/layouttree/LayoutBoxGeometry.cpp: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.cpp. (WebCore::Layout::BoxGeometry::BoxGeometry): (WebCore::Layout::BoxGeometry::~BoxGeometry): (WebCore::Layout::BoxGeometry::marginBox const): (WebCore::Layout::BoxGeometry::borderBox const): (WebCore::Layout::BoxGeometry::paddingBox const): (WebCore::Layout::BoxGeometry::contentBox const): * layout/layouttree/LayoutBoxGeometry.h: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.h. (WebCore::Layout::Rect::expandHorizontally): (WebCore::Layout::Rect::expandVertically): (WebCore::Layout::Rect::intersects const): (WebCore::Layout::Rect::invalidateTop): (WebCore::Layout::Rect::invalidateLeft): (WebCore::Layout::Rect::invalidateWidth): (WebCore::Layout::Rect::invalidateHeight): (WebCore::Layout::Rect::hasValidPosition const): (WebCore::Layout::Rect::hasValidSize const): (WebCore::Layout::Rect::hasValidGeometry const): (WebCore::Layout::Rect::Rect): (WebCore::Layout::Rect::invalidatePosition): (WebCore::Layout::Rect::setHasValidPosition): (WebCore::Layout::Rect::setHasValidSize): (WebCore::Layout::Rect::top const): (WebCore::Layout::Rect::left const): (WebCore::Layout::Rect::bottom const): (WebCore::Layout::Rect::right const): (WebCore::Layout::Rect::topLeft const): (WebCore::Layout::Rect::bottomRight const): (WebCore::Layout::Rect::size const): (WebCore::Layout::Rect::width const): (WebCore::Layout::Rect::height const): (WebCore::Layout::Rect::setTopLeft): (WebCore::Layout::Rect::setTop): (WebCore::Layout::Rect::setLeft): (WebCore::Layout::Rect::setWidth): (WebCore::Layout::Rect::setHeight): (WebCore::Layout::Rect::setSize): (WebCore::Layout::Rect::shiftLeftTo): (WebCore::Layout::Rect::shiftRightTo): (WebCore::Layout::Rect::shiftTopTo): (WebCore::Layout::Rect::shiftBottomTo): (WebCore::Layout::Rect::moveHorizontally): (WebCore::Layout::Rect::moveVertically): (WebCore::Layout::Rect::expand): (WebCore::Layout::Rect::clone const): (WebCore::Layout::Rect::operator LayoutRect const): (WebCore::Layout::BoxGeometry::bottom const): (WebCore::Layout::BoxGeometry::right const): (WebCore::Layout::BoxGeometry::bottomRight const): (WebCore::Layout::BoxGeometry::size const): (WebCore::Layout::BoxGeometry::width const): (WebCore::Layout::BoxGeometry::height const): (WebCore::Layout::BoxGeometry::isEmpty const): (WebCore::Layout::BoxGeometry::rect const): (WebCore::Layout::BoxGeometry::rectWithMargin const): (WebCore::Layout::BoxGeometry::hasClearance const): (WebCore::Layout::BoxGeometry::verticalBorder const): (WebCore::Layout::BoxGeometry::horizontalBorder const): (WebCore::Layout::BoxGeometry::contentBoxTop const): (WebCore::Layout::BoxGeometry::contentBoxLeft const): (WebCore::Layout::BoxGeometry::contentBoxBottom const): (WebCore::Layout::BoxGeometry::contentBoxRight const): (WebCore::Layout::BoxGeometry::paddingBoxTop const): (WebCore::Layout::BoxGeometry::paddingBoxLeft const): (WebCore::Layout::BoxGeometry::paddingBoxBottom const): (WebCore::Layout::BoxGeometry::paddingBoxRight const): (WebCore::Layout::BoxGeometry::paddingBoxHeight const): (WebCore::Layout::BoxGeometry::paddingBoxWidth const): (WebCore::Layout::BoxGeometry::borderBoxHeight const): (WebCore::Layout::BoxGeometry::borderBoxWidth const): (WebCore::Layout::BoxGeometry::marginBoxHeight const): (WebCore::Layout::BoxGeometry::marginBoxWidth const): (WebCore::Layout::BoxGeometry::verticalMarginBorderAndPadding const): (WebCore::Layout::BoxGeometry::horizontalMarginBorderAndPadding const): (WebCore::Layout::BoxGeometry::setHasPrecomputedMarginBefore): (WebCore::Layout::BoxGeometry::moveHorizontally): (WebCore::Layout::BoxGeometry::moveVertically): (WebCore::Layout::BoxGeometry::move): (WebCore::Layout::BoxGeometry::moveBy): (WebCore::Layout::BoxGeometry::setHasClearance): (WebCore::Layout::BoxGeometry::invalidateBorder): (WebCore::Layout::BoxGeometry::invalidatePadding): (WebCore::Layout::BoxGeometry::invalidatePrecomputedMarginBefore): (WebCore::Layout::BoxGeometry::setHasValidTop): (WebCore::Layout::BoxGeometry::setHasValidLeft): (WebCore::Layout::BoxGeometry::setHasValidVerticalMargin): (WebCore::Layout::BoxGeometry::setHasValidHorizontalMargin): (WebCore::Layout::BoxGeometry::setHasValidBorder): (WebCore::Layout::BoxGeometry::setHasValidPadding): (WebCore::Layout::BoxGeometry::setHasValidContentHeight): (WebCore::Layout::BoxGeometry::setHasValidContentWidth): (WebCore::Layout::BoxGeometry::invalidateMargin): (WebCore::Layout::BoxGeometry::top const): (WebCore::Layout::BoxGeometry::left const): (WebCore::Layout::BoxGeometry::topLeft const): (WebCore::Layout::BoxGeometry::setTopLeft): (WebCore::Layout::BoxGeometry::setTop): (WebCore::Layout::BoxGeometry::setLeft): (WebCore::Layout::BoxGeometry::setContentBoxHeight): (WebCore::Layout::BoxGeometry::setContentBoxWidth): (WebCore::Layout::BoxGeometry::contentBoxHeight const): (WebCore::Layout::BoxGeometry::contentBoxWidth const): (WebCore::Layout::BoxGeometry::setHorizontalMargin): (WebCore::Layout::BoxGeometry::setVerticalMargin): (WebCore::Layout::BoxGeometry::setBorder): (WebCore::Layout::BoxGeometry::setPadding): (WebCore::Layout::BoxGeometry::setVerticalPadding): (WebCore::Layout::BoxGeometry::verticalMargin const): (WebCore::Layout::BoxGeometry::horizontalMargin const): (WebCore::Layout::BoxGeometry::marginBefore const): (WebCore::Layout::BoxGeometry::marginStart const): (WebCore::Layout::BoxGeometry::marginAfter const): (WebCore::Layout::BoxGeometry::marginEnd const): (WebCore::Layout::BoxGeometry::paddingTop const): (WebCore::Layout::BoxGeometry::paddingLeft const): (WebCore::Layout::BoxGeometry::paddingBottom const): (WebCore::Layout::BoxGeometry::paddingRight const): (WebCore::Layout::BoxGeometry::verticalPadding const): (WebCore::Layout::BoxGeometry::horizontalPadding const): (WebCore::Layout::BoxGeometry::borderTop const): (WebCore::Layout::BoxGeometry::borderLeft const): (WebCore::Layout::BoxGeometry::borderBottom const): (WebCore::Layout::BoxGeometry::borderRight const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutBox): (WebCore::Layout::outputLayoutTree): (WebCore::Layout::showLayoutTree): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): (WebCore::Layout::TableFormattingContext::layoutCell): * layout/tableformatting/TableFormattingContextGeometry.cpp: * layout/tableformatting/TableLayout.cpp: * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/229358@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267076 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-15 05:52:14 +00:00
#include "LayoutBoxGeometry.h"
[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: Canonical link: https://commits.webkit.org/220576@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-02-12 01:08:08 +00:00
#include "LayoutContainerBox.h"
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
#include "LayoutPhase.h"
#include "LayoutTreeBuilder.h"
[LFC][Invalidation] Introduce InvalidationState and Context https://bugs.webkit.org/show_bug.cgi?id=204140 <rdar://problem/57142106> Reviewed by Antti Koivisto. InvalidationContext take style/content changes and turn them into "dirty layout boxes" (stored in InvalidationState). InvalidationState is the input to the (partial)subsequent layout. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/Invalidation.h: Removed. * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): (WebCore::Layout::LayoutContext::runLayout): (WebCore::Layout::LayoutContext::styleChanged): Deleted. (WebCore::Layout::LayoutContext::markNeedsUpdate): Deleted. * layout/LayoutContext.h: (WebCore::Layout::LayoutContext::updateAll): Deleted. * layout/blockformatting/BlockInvalidation.cpp: Removed. * layout/blockformatting/BlockInvalidation.h: Removed. * layout/invalidation/InvalidationContext.cpp: Renamed from Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp. (WebCore::Layout::InvalidationContext::InvalidationContext): (WebCore::Layout::InvalidationContext::styleChanged): (WebCore::Layout::InvalidationContext::contentChanged): (WebCore::Layout::InvalidationContext::subtreeChanged): * layout/invalidation/InvalidationContext.h: Renamed from Source/WebCore/layout/inlineformatting/InlineInvalidation.h. * layout/invalidation/InvalidationState.cpp: Renamed from Source/WebCore/layout/tableformatting/TableInvalidation.cpp. (WebCore::Layout::InvalidationState::InvalidationState): (WebCore::Layout::InvalidationState::markNeedsUpdate): * layout/invalidation/InvalidationState.h: Renamed from Source/WebCore/layout/tableformatting/TableInvalidation.h. (WebCore::Layout::InvalidationState::formattingContextRoots const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): Canonical link: https://commits.webkit.org/217458@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-11-13 18:39:44 +00:00
#include "RenderStyleConstants.h"
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
#include "RenderView.h"
[LFC] FormattingContext::layoutOutOfFlowContent should take horizontal and vertical constraints. https://bugs.webkit.org/show_bug.cgi?id=205892 <rdar://problem/58389802> Reviewed by Antti Koivisto. The caller should provide the horizontal/vertical constraints for the the out-of-flow boxes. It helps to make sure that we don't access geometry information in the parent formatting context. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::horizontalConstraintsForOutOfFlow): (WebCore::Layout::FormattingContext::Geometry::verticalConstraintsForOutOfFlow): (WebCore::Layout::FormattingContext::Geometry::horizontalConstraintsForInFlow): (WebCore::Layout::FormattingContext::Geometry::verticalConstraintsForInFlow): (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalConstraints): Deleted. (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalConstraints): Deleted. (WebCore::Layout::FormattingContext::Geometry::inFlowHorizontalConstraints): Deleted. (WebCore::Layout::FormattingContext::Geometry::inFlowVerticalConstraints): Deleted. * layout/FormattingContextQuirks.cpp: (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren): (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): Canonical link: https://commits.webkit.org/219119@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-09 17:36:59 +00:00
#include "RuntimeEnabledFeatures.h"
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
#include "TableFormattingContext.h"
#include "TableFormattingState.h"
[LFC][BFC] Introduce TableWrapperBlockFormattingContext https://bugs.webkit.org/show_bug.cgi?id=211996 Reviewed by Antti Koivisto. Table wrapper box establishes a special BFC with only captions and the actual table box in it. It mostly behaves like a normal BFC but the table box requires some special handing when it comes to padding/border and width/height computation. This patch moves the table box specific code from generic BFC to this new subclass. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.h: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::createFormattingContext): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContext.h: (): Deleted. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: Added. (WebCore::Layout::TableWrapperBlockFormattingContext::TableWrapperBlockFormattingContext): (WebCore::Layout::TableWrapperBlockFormattingContext::layoutInFlowContent): (WebCore::Layout::TableWrapperBlockFormattingContext::layoutTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h: Added. Canonical link: https://commits.webkit.org/224885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-17 16:17:45 +00:00
#include "TableWrapperBlockFormattingContext.h"
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
#include <wtf/IsoMallocInlines.h>
namespace WebCore {
namespace Layout {
WTF_MAKE_ISO_ALLOCATED_IMPL(LayoutContext);
LayoutContext::LayoutContext(LayoutState& layoutState)
: m_layoutState(layoutState)
{
}
void LayoutContext::layout(const LayoutSize& rootContentBoxSize, InvalidationState& invalidationState)
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
{
// Set the geometry on the root.
// Note that we never layout the root box. It has to have an already computed geometry (in case of ICB, it's the view geometry).
// ICB establishes the initial BFC, but it does not live in a formatting context and while a non-ICB root(subtree layout) has to have a formatting context,
// we could not lay it out even if we wanted to since it's outside of this LayoutContext.
[LFC] Layout::BoxGeometry rename, part II. https://bugs.webkit.org/show_bug.cgi?id=216523 Reviewed by Simon Fraser. Rename Layout::Geometry to Layout::BoxGeometry (so that later we can introduce Layout::LineGeometry and Layout::RunGeometry) and make sure we don't use displayBox as a variable name in Layout namespace. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::computeBorderAndPadding): (WebCore::Layout::FormattingContext::geometryForBox const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const): (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const): * layout/FormattingContextQuirks.cpp: * layout/FormattingState.cpp: (WebCore::Layout::FormattingState::boxGeometry): (WebCore::Layout::FormattingState::displayBox): Deleted. * layout/FormattingState.h: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::geometryForRootBox): (WebCore::Layout::LayoutState::ensureGeometryForBoxSlow): (WebCore::Layout::LayoutState::geometryForRootLayoutBox): Deleted. (WebCore::Layout::LayoutState::ensureDisplayBoxForLayoutBoxSlow): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasBoxGeometry const): (WebCore::Layout::LayoutState::ensureGeometryForBox): (WebCore::Layout::LayoutState::geometryForBox const): (WebCore::Layout::Box::cachedGeometryForLayoutState const): (WebCore::Layout::LayoutState::hasDisplayBox const): Deleted. (WebCore::Layout::LayoutState::ensureGeometryForLayoutBox): Deleted. (WebCore::Layout::LayoutState::geometryForLayoutBox const): Deleted. (WebCore::Layout::Box::cachedDisplayBoxForLayoutState const): Deleted. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren): (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition): (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear): (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/display/DisplayLayerController.cpp: (WebCore::Display::LayerController::prepareForDisplay): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintBoxDecoration): (WebCore::Display::Painter::absoluteBoxGeometry): (WebCore::Display::paintSubtree): (WebCore::Display::collectPaintRootsAndContentRect): (WebCore::Display::Painter::absoluteDisplayBox): Deleted. * layout/displaytree/DisplayPainter.h: * layout/floats/FloatAvoider.h: * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): (WebCore::Layout::FloatingContext::append): (WebCore::Layout::FloatingContext::absoluteBoxGeometryCoordinates const): (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const): Deleted. * layout/floats/FloatingContext.h: * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::FloatItem::FloatItem): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const): (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const): (WebCore::Layout::FloatingState::FloatItem::bottom const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints): (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin): (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin): (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): (WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent): Deleted. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineLineBox.h: * layout/inlineformatting/InlineLineBuilder.cpp: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::prepareFloatingState): * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::setcachedGeometryForLayoutState const): (WebCore::Layout::Box::setCachedDisplayBoxForLayoutState const): Deleted. * layout/layouttree/LayoutBox.h: * layout/layouttree/LayoutBoxGeometry.cpp: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.cpp. (WebCore::Layout::BoxGeometry::BoxGeometry): (WebCore::Layout::BoxGeometry::~BoxGeometry): (WebCore::Layout::BoxGeometry::marginBox const): (WebCore::Layout::BoxGeometry::borderBox const): (WebCore::Layout::BoxGeometry::paddingBox const): (WebCore::Layout::BoxGeometry::contentBox const): * layout/layouttree/LayoutBoxGeometry.h: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.h. (WebCore::Layout::Rect::expandHorizontally): (WebCore::Layout::Rect::expandVertically): (WebCore::Layout::Rect::intersects const): (WebCore::Layout::Rect::invalidateTop): (WebCore::Layout::Rect::invalidateLeft): (WebCore::Layout::Rect::invalidateWidth): (WebCore::Layout::Rect::invalidateHeight): (WebCore::Layout::Rect::hasValidPosition const): (WebCore::Layout::Rect::hasValidSize const): (WebCore::Layout::Rect::hasValidGeometry const): (WebCore::Layout::Rect::Rect): (WebCore::Layout::Rect::invalidatePosition): (WebCore::Layout::Rect::setHasValidPosition): (WebCore::Layout::Rect::setHasValidSize): (WebCore::Layout::Rect::top const): (WebCore::Layout::Rect::left const): (WebCore::Layout::Rect::bottom const): (WebCore::Layout::Rect::right const): (WebCore::Layout::Rect::topLeft const): (WebCore::Layout::Rect::bottomRight const): (WebCore::Layout::Rect::size const): (WebCore::Layout::Rect::width const): (WebCore::Layout::Rect::height const): (WebCore::Layout::Rect::setTopLeft): (WebCore::Layout::Rect::setTop): (WebCore::Layout::Rect::setLeft): (WebCore::Layout::Rect::setWidth): (WebCore::Layout::Rect::setHeight): (WebCore::Layout::Rect::setSize): (WebCore::Layout::Rect::shiftLeftTo): (WebCore::Layout::Rect::shiftRightTo): (WebCore::Layout::Rect::shiftTopTo): (WebCore::Layout::Rect::shiftBottomTo): (WebCore::Layout::Rect::moveHorizontally): (WebCore::Layout::Rect::moveVertically): (WebCore::Layout::Rect::expand): (WebCore::Layout::Rect::clone const): (WebCore::Layout::Rect::operator LayoutRect const): (WebCore::Layout::BoxGeometry::bottom const): (WebCore::Layout::BoxGeometry::right const): (WebCore::Layout::BoxGeometry::bottomRight const): (WebCore::Layout::BoxGeometry::size const): (WebCore::Layout::BoxGeometry::width const): (WebCore::Layout::BoxGeometry::height const): (WebCore::Layout::BoxGeometry::isEmpty const): (WebCore::Layout::BoxGeometry::rect const): (WebCore::Layout::BoxGeometry::rectWithMargin const): (WebCore::Layout::BoxGeometry::hasClearance const): (WebCore::Layout::BoxGeometry::verticalBorder const): (WebCore::Layout::BoxGeometry::horizontalBorder const): (WebCore::Layout::BoxGeometry::contentBoxTop const): (WebCore::Layout::BoxGeometry::contentBoxLeft const): (WebCore::Layout::BoxGeometry::contentBoxBottom const): (WebCore::Layout::BoxGeometry::contentBoxRight const): (WebCore::Layout::BoxGeometry::paddingBoxTop const): (WebCore::Layout::BoxGeometry::paddingBoxLeft const): (WebCore::Layout::BoxGeometry::paddingBoxBottom const): (WebCore::Layout::BoxGeometry::paddingBoxRight const): (WebCore::Layout::BoxGeometry::paddingBoxHeight const): (WebCore::Layout::BoxGeometry::paddingBoxWidth const): (WebCore::Layout::BoxGeometry::borderBoxHeight const): (WebCore::Layout::BoxGeometry::borderBoxWidth const): (WebCore::Layout::BoxGeometry::marginBoxHeight const): (WebCore::Layout::BoxGeometry::marginBoxWidth const): (WebCore::Layout::BoxGeometry::verticalMarginBorderAndPadding const): (WebCore::Layout::BoxGeometry::horizontalMarginBorderAndPadding const): (WebCore::Layout::BoxGeometry::setHasPrecomputedMarginBefore): (WebCore::Layout::BoxGeometry::moveHorizontally): (WebCore::Layout::BoxGeometry::moveVertically): (WebCore::Layout::BoxGeometry::move): (WebCore::Layout::BoxGeometry::moveBy): (WebCore::Layout::BoxGeometry::setHasClearance): (WebCore::Layout::BoxGeometry::invalidateBorder): (WebCore::Layout::BoxGeometry::invalidatePadding): (WebCore::Layout::BoxGeometry::invalidatePrecomputedMarginBefore): (WebCore::Layout::BoxGeometry::setHasValidTop): (WebCore::Layout::BoxGeometry::setHasValidLeft): (WebCore::Layout::BoxGeometry::setHasValidVerticalMargin): (WebCore::Layout::BoxGeometry::setHasValidHorizontalMargin): (WebCore::Layout::BoxGeometry::setHasValidBorder): (WebCore::Layout::BoxGeometry::setHasValidPadding): (WebCore::Layout::BoxGeometry::setHasValidContentHeight): (WebCore::Layout::BoxGeometry::setHasValidContentWidth): (WebCore::Layout::BoxGeometry::invalidateMargin): (WebCore::Layout::BoxGeometry::top const): (WebCore::Layout::BoxGeometry::left const): (WebCore::Layout::BoxGeometry::topLeft const): (WebCore::Layout::BoxGeometry::setTopLeft): (WebCore::Layout::BoxGeometry::setTop): (WebCore::Layout::BoxGeometry::setLeft): (WebCore::Layout::BoxGeometry::setContentBoxHeight): (WebCore::Layout::BoxGeometry::setContentBoxWidth): (WebCore::Layout::BoxGeometry::contentBoxHeight const): (WebCore::Layout::BoxGeometry::contentBoxWidth const): (WebCore::Layout::BoxGeometry::setHorizontalMargin): (WebCore::Layout::BoxGeometry::setVerticalMargin): (WebCore::Layout::BoxGeometry::setBorder): (WebCore::Layout::BoxGeometry::setPadding): (WebCore::Layout::BoxGeometry::setVerticalPadding): (WebCore::Layout::BoxGeometry::verticalMargin const): (WebCore::Layout::BoxGeometry::horizontalMargin const): (WebCore::Layout::BoxGeometry::marginBefore const): (WebCore::Layout::BoxGeometry::marginStart const): (WebCore::Layout::BoxGeometry::marginAfter const): (WebCore::Layout::BoxGeometry::marginEnd const): (WebCore::Layout::BoxGeometry::paddingTop const): (WebCore::Layout::BoxGeometry::paddingLeft const): (WebCore::Layout::BoxGeometry::paddingBottom const): (WebCore::Layout::BoxGeometry::paddingRight const): (WebCore::Layout::BoxGeometry::verticalPadding const): (WebCore::Layout::BoxGeometry::horizontalPadding const): (WebCore::Layout::BoxGeometry::borderTop const): (WebCore::Layout::BoxGeometry::borderLeft const): (WebCore::Layout::BoxGeometry::borderBottom const): (WebCore::Layout::BoxGeometry::borderRight const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutBox): (WebCore::Layout::outputLayoutTree): (WebCore::Layout::showLayoutTree): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): (WebCore::Layout::TableFormattingContext::layoutCell): * layout/tableformatting/TableFormattingContextGeometry.cpp: * layout/tableformatting/TableLayout.cpp: * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/229358@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267076 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-15 05:52:14 +00:00
auto& boxGeometry = layoutState().geometryForRootBox();
boxGeometry.setHorizontalMargin({ });
boxGeometry.setVerticalMargin({ });
boxGeometry.setBorder({ });
boxGeometry.setPadding({ });
[LFC] Box geometry is all logical https://bugs.webkit.org/show_bug.cgi?id=216614 Reviewed by Simon Fraser. Rename top/left/bottom/right/width/height to logical*. These coordinates are in the Layout namespace, therefore they are all logical. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout 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::inlineReplacedHeightAndMargin const): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider): (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition): (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition const): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/display/DisplayLayerController.cpp: (WebCore::Display::LayerController::prepareForDisplay): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintBoxDecoration): (WebCore::Display::Painter::absoluteBoxGeometry): (WebCore::Display::paintSubtree): (WebCore::Display::collectPaintRootsAndContentRect): * layout/flexformatting/FlexFormattingContext.cpp: (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): (WebCore::Layout::FloatingContext::append): (WebCore::Layout::FloatingContext::mapTopLeftToFloatingStateRoot const): (WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const): (WebCore::Layout::FloatingState::FloatItem::bottom const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::inlineItemWidth const): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::prepareFloatingState): * layout/layouttree/LayoutBoxGeometry.cpp: (WebCore::Layout::BoxGeometry::borderBox const): * layout/layouttree/LayoutBoxGeometry.h: (WebCore::Layout::BoxGeometry::logicalBottom const): (WebCore::Layout::BoxGeometry::logicalRight const): (WebCore::Layout::BoxGeometry::logicalBottomRight const): (WebCore::Layout::BoxGeometry::logicalSize const): (WebCore::Layout::BoxGeometry::logicalWidth const): (WebCore::Layout::BoxGeometry::logicalHeight const): (WebCore::Layout::BoxGeometry::isEmpty const): (WebCore::Layout::BoxGeometry::logicalRect const): (WebCore::Layout::BoxGeometry::logicalRectWithMargin const): (WebCore::Layout::BoxGeometry::logicalTop const): (WebCore::Layout::BoxGeometry::logicalLeft const): (WebCore::Layout::BoxGeometry::logicalTopLeft const): (WebCore::Layout::BoxGeometry::setLogicalTopLeft): (WebCore::Layout::BoxGeometry::setLogicalTop): (WebCore::Layout::BoxGeometry::setLogicalLeft): (WebCore::Layout::BoxGeometry::bottom const): Deleted. (WebCore::Layout::BoxGeometry::right const): Deleted. (WebCore::Layout::BoxGeometry::bottomRight const): Deleted. (WebCore::Layout::BoxGeometry::size const): Deleted. (WebCore::Layout::BoxGeometry::width const): Deleted. (WebCore::Layout::BoxGeometry::height const): Deleted. (WebCore::Layout::BoxGeometry::rect const): Deleted. (WebCore::Layout::BoxGeometry::rectWithMargin const): Deleted. (WebCore::Layout::BoxGeometry::top const): Deleted. (WebCore::Layout::BoxGeometry::left const): Deleted. (WebCore::Layout::BoxGeometry::topLeft const): Deleted. (WebCore::Layout::BoxGeometry::setTopLeft): Deleted. (WebCore::Layout::BoxGeometry::setTop): Deleted. (WebCore::Layout::BoxGeometry::setLeft): Deleted. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutBox): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const): * layout/tableformatting/TableLayout.cpp: (WebCore::Layout::TableFormattingContext::TableLayout::distributedVerticalSpace): * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/229434@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-16 20:58:12 +00:00
boxGeometry.setLogicalTopLeft({ });
[LFC] Layout::BoxGeometry rename, part II. https://bugs.webkit.org/show_bug.cgi?id=216523 Reviewed by Simon Fraser. Rename Layout::Geometry to Layout::BoxGeometry (so that later we can introduce Layout::LineGeometry and Layout::RunGeometry) and make sure we don't use displayBox as a variable name in Layout namespace. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::computeBorderAndPadding): (WebCore::Layout::FormattingContext::geometryForBox const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const): (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const): * layout/FormattingContextQuirks.cpp: * layout/FormattingState.cpp: (WebCore::Layout::FormattingState::boxGeometry): (WebCore::Layout::FormattingState::displayBox): Deleted. * layout/FormattingState.h: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::geometryForRootBox): (WebCore::Layout::LayoutState::ensureGeometryForBoxSlow): (WebCore::Layout::LayoutState::geometryForRootLayoutBox): Deleted. (WebCore::Layout::LayoutState::ensureDisplayBoxForLayoutBoxSlow): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasBoxGeometry const): (WebCore::Layout::LayoutState::ensureGeometryForBox): (WebCore::Layout::LayoutState::geometryForBox const): (WebCore::Layout::Box::cachedGeometryForLayoutState const): (WebCore::Layout::LayoutState::hasDisplayBox const): Deleted. (WebCore::Layout::LayoutState::ensureGeometryForLayoutBox): Deleted. (WebCore::Layout::LayoutState::geometryForLayoutBox const): Deleted. (WebCore::Layout::Box::cachedDisplayBoxForLayoutState const): Deleted. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren): (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition): (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear): (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/display/DisplayLayerController.cpp: (WebCore::Display::LayerController::prepareForDisplay): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintBoxDecoration): (WebCore::Display::Painter::absoluteBoxGeometry): (WebCore::Display::paintSubtree): (WebCore::Display::collectPaintRootsAndContentRect): (WebCore::Display::Painter::absoluteDisplayBox): Deleted. * layout/displaytree/DisplayPainter.h: * layout/floats/FloatAvoider.h: * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): (WebCore::Layout::FloatingContext::append): (WebCore::Layout::FloatingContext::absoluteBoxGeometryCoordinates const): (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const): Deleted. * layout/floats/FloatingContext.h: * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::FloatItem::FloatItem): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const): (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const): (WebCore::Layout::FloatingState::FloatItem::bottom const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints): (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin): (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin): (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): (WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent): Deleted. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineLineBox.h: * layout/inlineformatting/InlineLineBuilder.cpp: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::prepareFloatingState): * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::setcachedGeometryForLayoutState const): (WebCore::Layout::Box::setCachedDisplayBoxForLayoutState const): Deleted. * layout/layouttree/LayoutBox.h: * layout/layouttree/LayoutBoxGeometry.cpp: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.cpp. (WebCore::Layout::BoxGeometry::BoxGeometry): (WebCore::Layout::BoxGeometry::~BoxGeometry): (WebCore::Layout::BoxGeometry::marginBox const): (WebCore::Layout::BoxGeometry::borderBox const): (WebCore::Layout::BoxGeometry::paddingBox const): (WebCore::Layout::BoxGeometry::contentBox const): * layout/layouttree/LayoutBoxGeometry.h: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.h. (WebCore::Layout::Rect::expandHorizontally): (WebCore::Layout::Rect::expandVertically): (WebCore::Layout::Rect::intersects const): (WebCore::Layout::Rect::invalidateTop): (WebCore::Layout::Rect::invalidateLeft): (WebCore::Layout::Rect::invalidateWidth): (WebCore::Layout::Rect::invalidateHeight): (WebCore::Layout::Rect::hasValidPosition const): (WebCore::Layout::Rect::hasValidSize const): (WebCore::Layout::Rect::hasValidGeometry const): (WebCore::Layout::Rect::Rect): (WebCore::Layout::Rect::invalidatePosition): (WebCore::Layout::Rect::setHasValidPosition): (WebCore::Layout::Rect::setHasValidSize): (WebCore::Layout::Rect::top const): (WebCore::Layout::Rect::left const): (WebCore::Layout::Rect::bottom const): (WebCore::Layout::Rect::right const): (WebCore::Layout::Rect::topLeft const): (WebCore::Layout::Rect::bottomRight const): (WebCore::Layout::Rect::size const): (WebCore::Layout::Rect::width const): (WebCore::Layout::Rect::height const): (WebCore::Layout::Rect::setTopLeft): (WebCore::Layout::Rect::setTop): (WebCore::Layout::Rect::setLeft): (WebCore::Layout::Rect::setWidth): (WebCore::Layout::Rect::setHeight): (WebCore::Layout::Rect::setSize): (WebCore::Layout::Rect::shiftLeftTo): (WebCore::Layout::Rect::shiftRightTo): (WebCore::Layout::Rect::shiftTopTo): (WebCore::Layout::Rect::shiftBottomTo): (WebCore::Layout::Rect::moveHorizontally): (WebCore::Layout::Rect::moveVertically): (WebCore::Layout::Rect::expand): (WebCore::Layout::Rect::clone const): (WebCore::Layout::Rect::operator LayoutRect const): (WebCore::Layout::BoxGeometry::bottom const): (WebCore::Layout::BoxGeometry::right const): (WebCore::Layout::BoxGeometry::bottomRight const): (WebCore::Layout::BoxGeometry::size const): (WebCore::Layout::BoxGeometry::width const): (WebCore::Layout::BoxGeometry::height const): (WebCore::Layout::BoxGeometry::isEmpty const): (WebCore::Layout::BoxGeometry::rect const): (WebCore::Layout::BoxGeometry::rectWithMargin const): (WebCore::Layout::BoxGeometry::hasClearance const): (WebCore::Layout::BoxGeometry::verticalBorder const): (WebCore::Layout::BoxGeometry::horizontalBorder const): (WebCore::Layout::BoxGeometry::contentBoxTop const): (WebCore::Layout::BoxGeometry::contentBoxLeft const): (WebCore::Layout::BoxGeometry::contentBoxBottom const): (WebCore::Layout::BoxGeometry::contentBoxRight const): (WebCore::Layout::BoxGeometry::paddingBoxTop const): (WebCore::Layout::BoxGeometry::paddingBoxLeft const): (WebCore::Layout::BoxGeometry::paddingBoxBottom const): (WebCore::Layout::BoxGeometry::paddingBoxRight const): (WebCore::Layout::BoxGeometry::paddingBoxHeight const): (WebCore::Layout::BoxGeometry::paddingBoxWidth const): (WebCore::Layout::BoxGeometry::borderBoxHeight const): (WebCore::Layout::BoxGeometry::borderBoxWidth const): (WebCore::Layout::BoxGeometry::marginBoxHeight const): (WebCore::Layout::BoxGeometry::marginBoxWidth const): (WebCore::Layout::BoxGeometry::verticalMarginBorderAndPadding const): (WebCore::Layout::BoxGeometry::horizontalMarginBorderAndPadding const): (WebCore::Layout::BoxGeometry::setHasPrecomputedMarginBefore): (WebCore::Layout::BoxGeometry::moveHorizontally): (WebCore::Layout::BoxGeometry::moveVertically): (WebCore::Layout::BoxGeometry::move): (WebCore::Layout::BoxGeometry::moveBy): (WebCore::Layout::BoxGeometry::setHasClearance): (WebCore::Layout::BoxGeometry::invalidateBorder): (WebCore::Layout::BoxGeometry::invalidatePadding): (WebCore::Layout::BoxGeometry::invalidatePrecomputedMarginBefore): (WebCore::Layout::BoxGeometry::setHasValidTop): (WebCore::Layout::BoxGeometry::setHasValidLeft): (WebCore::Layout::BoxGeometry::setHasValidVerticalMargin): (WebCore::Layout::BoxGeometry::setHasValidHorizontalMargin): (WebCore::Layout::BoxGeometry::setHasValidBorder): (WebCore::Layout::BoxGeometry::setHasValidPadding): (WebCore::Layout::BoxGeometry::setHasValidContentHeight): (WebCore::Layout::BoxGeometry::setHasValidContentWidth): (WebCore::Layout::BoxGeometry::invalidateMargin): (WebCore::Layout::BoxGeometry::top const): (WebCore::Layout::BoxGeometry::left const): (WebCore::Layout::BoxGeometry::topLeft const): (WebCore::Layout::BoxGeometry::setTopLeft): (WebCore::Layout::BoxGeometry::setTop): (WebCore::Layout::BoxGeometry::setLeft): (WebCore::Layout::BoxGeometry::setContentBoxHeight): (WebCore::Layout::BoxGeometry::setContentBoxWidth): (WebCore::Layout::BoxGeometry::contentBoxHeight const): (WebCore::Layout::BoxGeometry::contentBoxWidth const): (WebCore::Layout::BoxGeometry::setHorizontalMargin): (WebCore::Layout::BoxGeometry::setVerticalMargin): (WebCore::Layout::BoxGeometry::setBorder): (WebCore::Layout::BoxGeometry::setPadding): (WebCore::Layout::BoxGeometry::setVerticalPadding): (WebCore::Layout::BoxGeometry::verticalMargin const): (WebCore::Layout::BoxGeometry::horizontalMargin const): (WebCore::Layout::BoxGeometry::marginBefore const): (WebCore::Layout::BoxGeometry::marginStart const): (WebCore::Layout::BoxGeometry::marginAfter const): (WebCore::Layout::BoxGeometry::marginEnd const): (WebCore::Layout::BoxGeometry::paddingTop const): (WebCore::Layout::BoxGeometry::paddingLeft const): (WebCore::Layout::BoxGeometry::paddingBottom const): (WebCore::Layout::BoxGeometry::paddingRight const): (WebCore::Layout::BoxGeometry::verticalPadding const): (WebCore::Layout::BoxGeometry::horizontalPadding const): (WebCore::Layout::BoxGeometry::borderTop const): (WebCore::Layout::BoxGeometry::borderLeft const): (WebCore::Layout::BoxGeometry::borderBottom const): (WebCore::Layout::BoxGeometry::borderRight const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutBox): (WebCore::Layout::outputLayoutTree): (WebCore::Layout::showLayoutTree): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): (WebCore::Layout::TableFormattingContext::layoutCell): * layout/tableformatting/TableFormattingContextGeometry.cpp: * layout/tableformatting/TableLayout.cpp: * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/229358@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267076 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-15 05:52:14 +00:00
boxGeometry.setContentBoxHeight(rootContentBoxSize.height());
boxGeometry.setContentBoxWidth(rootContentBoxSize.width());
[LFC][Integration] Setup root box properties https://bugs.webkit.org/show_bug.cgi?id=204743 Reviewed by Zalan Bujtas. Source/WebCore: Test: fast/layoutformattingcontext/flow-integration-basic.html Line layout needs to know about flow borders and padding so that boxes are offset correctly. * CMakeLists.txt: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutWithPreparedRootGeometry): Split setup and layout into separate functions. * layout/LayoutContext.h: * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::displayBoxForLayoutRoot): * layout/LayoutState.h: * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintInlineContent): (WebCore::Display::Painter::paint): (WebCore::Display::Painter::paintInlineFlow): Avoid accessing tree root box properties when painting (since margins are not set up). * layout/integration/RenderBlockFlowLineLayout.cpp: Renamed from Source/WebCore/layout/RenderBlockFlowLineLayout.cpp. Moved to integration subdirectory. (WebCore::Layout::RenderBlockFlowLineLayout::layout): Drop the content size paramater, the caller is responsible of setting up the root display box. (WebCore::Layout::RenderBlockFlowLineLayout::prepareRootDisplayBoxForLayout): Setup padding and borders. (WebCore::Layout::RenderBlockFlowLineLayout::displayInlineContent const): (WebCore::Layout::RenderBlockFlowLineLayout::rootLayoutBox const): * layout/integration/RenderBlockFlowLineLayout.h: Renamed from Source/WebCore/layout/RenderBlockFlowLineLayout.h. (WebCore::Layout::RenderBlockFlowLineLayout::contentLogicalHeight const): Use a member to pass content height. * layout/layouttree/LayoutTreeBuilder.h: (WebCore::Layout::LayoutTreeContent::layoutBoxForRenderer const): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutLFCLines): LayoutTests: * fast/layoutformattingcontext/flow-integration-basic.html: Added. * platform/mac/fast/layoutformattingcontext/flow-integration-basic-expected.txt: Added. Canonical link: https://commits.webkit.org/217997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-03 10:51:46 +00:00
layoutWithPreparedRootGeometry(invalidationState);
}
void LayoutContext::layoutWithPreparedRootGeometry(InvalidationState& invalidationState)
{
PhaseScope scope(Phase::Type::Layout);
auto& formattingContextRootsForLayout = invalidationState.formattingContextRoots();
// When invalidation is empty, we assume constraint mutation and start running layout on the context root. Layout logic should be able to figure out the damage.
if (formattingContextRootsForLayout.computesEmpty())
return layoutFormattingContextSubtree(m_layoutState.root(), invalidationState);
[LFC][Invalidation] Introduce InvalidationState and Context https://bugs.webkit.org/show_bug.cgi?id=204140 <rdar://problem/57142106> Reviewed by Antti Koivisto. InvalidationContext take style/content changes and turn them into "dirty layout boxes" (stored in InvalidationState). InvalidationState is the input to the (partial)subsequent layout. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/Invalidation.h: Removed. * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): (WebCore::Layout::LayoutContext::runLayout): (WebCore::Layout::LayoutContext::styleChanged): Deleted. (WebCore::Layout::LayoutContext::markNeedsUpdate): Deleted. * layout/LayoutContext.h: (WebCore::Layout::LayoutContext::updateAll): Deleted. * layout/blockformatting/BlockInvalidation.cpp: Removed. * layout/blockformatting/BlockInvalidation.h: Removed. * layout/invalidation/InvalidationContext.cpp: Renamed from Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp. (WebCore::Layout::InvalidationContext::InvalidationContext): (WebCore::Layout::InvalidationContext::styleChanged): (WebCore::Layout::InvalidationContext::contentChanged): (WebCore::Layout::InvalidationContext::subtreeChanged): * layout/invalidation/InvalidationContext.h: Renamed from Source/WebCore/layout/inlineformatting/InlineInvalidation.h. * layout/invalidation/InvalidationState.cpp: Renamed from Source/WebCore/layout/tableformatting/TableInvalidation.cpp. (WebCore::Layout::InvalidationState::InvalidationState): (WebCore::Layout::InvalidationState::markNeedsUpdate): * layout/invalidation/InvalidationState.h: Renamed from Source/WebCore/layout/tableformatting/TableInvalidation.h. (WebCore::Layout::InvalidationState::formattingContextRoots const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): Canonical link: https://commits.webkit.org/217458@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-11-13 18:39:44 +00:00
for (auto& formattingContextRoot : formattingContextRootsForLayout)
[LFC][Invalidation] Use InvalidationState to populate LayoutQueue https://bugs.webkit.org/show_bug.cgi?id=204191 <rdar://problem/57179614> Reviewed by Antti Koivisto. Start using the InvalidationState in BlockFormattingContext::layoutInFlowContent() to filter out non-dirty boxes (currently InvalidationState returns true for every box). * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: InvalidationState should not be const as we keep adding additional dirty boxes during layout. * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/LayoutContext.h: * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContext.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineFormattingContext.h: * layout/invalidation/InvalidationState.cpp: (WebCore::Layout::InvalidationState::needsLayout const): * layout/invalidation/InvalidationState.h: * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutInFlowContent): (WebCore::Layout::TableFormattingContext::layoutTableCellBox): * layout/tableformatting/TableFormattingContext.h: Canonical link: https://commits.webkit.org/217500@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-11-14 19:42:50 +00:00
layoutFormattingContextSubtree(formattingContextRoot, invalidationState);
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
}
[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: Canonical link: https://commits.webkit.org/220576@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-02-12 01:08:08 +00:00
void LayoutContext::layoutFormattingContextSubtree(const ContainerBox& formattingContextRoot, InvalidationState& invalidationState)
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
{
[LFC][Invalidation] Introduce InvalidationState and Context https://bugs.webkit.org/show_bug.cgi?id=204140 <rdar://problem/57142106> Reviewed by Antti Koivisto. InvalidationContext take style/content changes and turn them into "dirty layout boxes" (stored in InvalidationState). InvalidationState is the input to the (partial)subsequent layout. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/Invalidation.h: Removed. * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): (WebCore::Layout::LayoutContext::runLayout): (WebCore::Layout::LayoutContext::styleChanged): Deleted. (WebCore::Layout::LayoutContext::markNeedsUpdate): Deleted. * layout/LayoutContext.h: (WebCore::Layout::LayoutContext::updateAll): Deleted. * layout/blockformatting/BlockInvalidation.cpp: Removed. * layout/blockformatting/BlockInvalidation.h: Removed. * layout/invalidation/InvalidationContext.cpp: Renamed from Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp. (WebCore::Layout::InvalidationContext::InvalidationContext): (WebCore::Layout::InvalidationContext::styleChanged): (WebCore::Layout::InvalidationContext::contentChanged): (WebCore::Layout::InvalidationContext::subtreeChanged): * layout/invalidation/InvalidationContext.h: Renamed from Source/WebCore/layout/inlineformatting/InlineInvalidation.h. * layout/invalidation/InvalidationState.cpp: Renamed from Source/WebCore/layout/tableformatting/TableInvalidation.cpp. (WebCore::Layout::InvalidationState::InvalidationState): (WebCore::Layout::InvalidationState::markNeedsUpdate): * layout/invalidation/InvalidationState.h: Renamed from Source/WebCore/layout/tableformatting/TableInvalidation.h. (WebCore::Layout::InvalidationState::formattingContextRoots const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): Canonical link: https://commits.webkit.org/217458@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-11-13 18:39:44 +00:00
RELEASE_ASSERT(formattingContextRoot.establishesFormattingContext());
if (!formattingContextRoot.hasChild())
return;
[LFC][Invalidation] Introduce InvalidationState and Context https://bugs.webkit.org/show_bug.cgi?id=204140 <rdar://problem/57142106> Reviewed by Antti Koivisto. InvalidationContext take style/content changes and turn them into "dirty layout boxes" (stored in InvalidationState). InvalidationState is the input to the (partial)subsequent layout. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/Invalidation.h: Removed. * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): (WebCore::Layout::LayoutContext::runLayout): (WebCore::Layout::LayoutContext::styleChanged): Deleted. (WebCore::Layout::LayoutContext::markNeedsUpdate): Deleted. * layout/LayoutContext.h: (WebCore::Layout::LayoutContext::updateAll): Deleted. * layout/blockformatting/BlockInvalidation.cpp: Removed. * layout/blockformatting/BlockInvalidation.h: Removed. * layout/invalidation/InvalidationContext.cpp: Renamed from Source/WebCore/layout/inlineformatting/InlineInvalidation.cpp. (WebCore::Layout::InvalidationContext::InvalidationContext): (WebCore::Layout::InvalidationContext::styleChanged): (WebCore::Layout::InvalidationContext::contentChanged): (WebCore::Layout::InvalidationContext::subtreeChanged): * layout/invalidation/InvalidationContext.h: Renamed from Source/WebCore/layout/inlineformatting/InlineInvalidation.h. * layout/invalidation/InvalidationState.cpp: Renamed from Source/WebCore/layout/tableformatting/TableInvalidation.cpp. (WebCore::Layout::InvalidationState::InvalidationState): (WebCore::Layout::InvalidationState::markNeedsUpdate): * layout/invalidation/InvalidationState.h: Renamed from Source/WebCore/layout/tableformatting/TableInvalidation.h. (WebCore::Layout::InvalidationState::formattingContextRoots const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): Canonical link: https://commits.webkit.org/217458@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-11-13 18:39:44 +00:00
auto formattingContext = createFormattingContext(formattingContextRoot, layoutState());
[LFC] Layout::BoxGeometry rename, part II. https://bugs.webkit.org/show_bug.cgi?id=216523 Reviewed by Simon Fraser. Rename Layout::Geometry to Layout::BoxGeometry (so that later we can introduce Layout::LineGeometry and Layout::RunGeometry) and make sure we don't use displayBox as a variable name in Layout namespace. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::computeBorderAndPadding): (WebCore::Layout::FormattingContext::geometryForBox const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const): (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const): * layout/FormattingContextQuirks.cpp: * layout/FormattingState.cpp: (WebCore::Layout::FormattingState::boxGeometry): (WebCore::Layout::FormattingState::displayBox): Deleted. * layout/FormattingState.h: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::geometryForRootBox): (WebCore::Layout::LayoutState::ensureGeometryForBoxSlow): (WebCore::Layout::LayoutState::geometryForRootLayoutBox): Deleted. (WebCore::Layout::LayoutState::ensureDisplayBoxForLayoutBoxSlow): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasBoxGeometry const): (WebCore::Layout::LayoutState::ensureGeometryForBox): (WebCore::Layout::LayoutState::geometryForBox const): (WebCore::Layout::Box::cachedGeometryForLayoutState const): (WebCore::Layout::LayoutState::hasDisplayBox const): Deleted. (WebCore::Layout::LayoutState::ensureGeometryForLayoutBox): Deleted. (WebCore::Layout::LayoutState::geometryForLayoutBox const): Deleted. (WebCore::Layout::Box::cachedDisplayBoxForLayoutState const): Deleted. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren): (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition): (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear): (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/display/DisplayLayerController.cpp: (WebCore::Display::LayerController::prepareForDisplay): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintBoxDecoration): (WebCore::Display::Painter::absoluteBoxGeometry): (WebCore::Display::paintSubtree): (WebCore::Display::collectPaintRootsAndContentRect): (WebCore::Display::Painter::absoluteDisplayBox): Deleted. * layout/displaytree/DisplayPainter.h: * layout/floats/FloatAvoider.h: * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): (WebCore::Layout::FloatingContext::append): (WebCore::Layout::FloatingContext::absoluteBoxGeometryCoordinates const): (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const): Deleted. * layout/floats/FloatingContext.h: * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::FloatItem::FloatItem): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const): (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const): (WebCore::Layout::FloatingState::FloatItem::bottom const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints): (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin): (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin): (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): (WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent): Deleted. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineLineBox.h: * layout/inlineformatting/InlineLineBuilder.cpp: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::prepareFloatingState): * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::setcachedGeometryForLayoutState const): (WebCore::Layout::Box::setCachedDisplayBoxForLayoutState const): Deleted. * layout/layouttree/LayoutBox.h: * layout/layouttree/LayoutBoxGeometry.cpp: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.cpp. (WebCore::Layout::BoxGeometry::BoxGeometry): (WebCore::Layout::BoxGeometry::~BoxGeometry): (WebCore::Layout::BoxGeometry::marginBox const): (WebCore::Layout::BoxGeometry::borderBox const): (WebCore::Layout::BoxGeometry::paddingBox const): (WebCore::Layout::BoxGeometry::contentBox const): * layout/layouttree/LayoutBoxGeometry.h: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.h. (WebCore::Layout::Rect::expandHorizontally): (WebCore::Layout::Rect::expandVertically): (WebCore::Layout::Rect::intersects const): (WebCore::Layout::Rect::invalidateTop): (WebCore::Layout::Rect::invalidateLeft): (WebCore::Layout::Rect::invalidateWidth): (WebCore::Layout::Rect::invalidateHeight): (WebCore::Layout::Rect::hasValidPosition const): (WebCore::Layout::Rect::hasValidSize const): (WebCore::Layout::Rect::hasValidGeometry const): (WebCore::Layout::Rect::Rect): (WebCore::Layout::Rect::invalidatePosition): (WebCore::Layout::Rect::setHasValidPosition): (WebCore::Layout::Rect::setHasValidSize): (WebCore::Layout::Rect::top const): (WebCore::Layout::Rect::left const): (WebCore::Layout::Rect::bottom const): (WebCore::Layout::Rect::right const): (WebCore::Layout::Rect::topLeft const): (WebCore::Layout::Rect::bottomRight const): (WebCore::Layout::Rect::size const): (WebCore::Layout::Rect::width const): (WebCore::Layout::Rect::height const): (WebCore::Layout::Rect::setTopLeft): (WebCore::Layout::Rect::setTop): (WebCore::Layout::Rect::setLeft): (WebCore::Layout::Rect::setWidth): (WebCore::Layout::Rect::setHeight): (WebCore::Layout::Rect::setSize): (WebCore::Layout::Rect::shiftLeftTo): (WebCore::Layout::Rect::shiftRightTo): (WebCore::Layout::Rect::shiftTopTo): (WebCore::Layout::Rect::shiftBottomTo): (WebCore::Layout::Rect::moveHorizontally): (WebCore::Layout::Rect::moveVertically): (WebCore::Layout::Rect::expand): (WebCore::Layout::Rect::clone const): (WebCore::Layout::Rect::operator LayoutRect const): (WebCore::Layout::BoxGeometry::bottom const): (WebCore::Layout::BoxGeometry::right const): (WebCore::Layout::BoxGeometry::bottomRight const): (WebCore::Layout::BoxGeometry::size const): (WebCore::Layout::BoxGeometry::width const): (WebCore::Layout::BoxGeometry::height const): (WebCore::Layout::BoxGeometry::isEmpty const): (WebCore::Layout::BoxGeometry::rect const): (WebCore::Layout::BoxGeometry::rectWithMargin const): (WebCore::Layout::BoxGeometry::hasClearance const): (WebCore::Layout::BoxGeometry::verticalBorder const): (WebCore::Layout::BoxGeometry::horizontalBorder const): (WebCore::Layout::BoxGeometry::contentBoxTop const): (WebCore::Layout::BoxGeometry::contentBoxLeft const): (WebCore::Layout::BoxGeometry::contentBoxBottom const): (WebCore::Layout::BoxGeometry::contentBoxRight const): (WebCore::Layout::BoxGeometry::paddingBoxTop const): (WebCore::Layout::BoxGeometry::paddingBoxLeft const): (WebCore::Layout::BoxGeometry::paddingBoxBottom const): (WebCore::Layout::BoxGeometry::paddingBoxRight const): (WebCore::Layout::BoxGeometry::paddingBoxHeight const): (WebCore::Layout::BoxGeometry::paddingBoxWidth const): (WebCore::Layout::BoxGeometry::borderBoxHeight const): (WebCore::Layout::BoxGeometry::borderBoxWidth const): (WebCore::Layout::BoxGeometry::marginBoxHeight const): (WebCore::Layout::BoxGeometry::marginBoxWidth const): (WebCore::Layout::BoxGeometry::verticalMarginBorderAndPadding const): (WebCore::Layout::BoxGeometry::horizontalMarginBorderAndPadding const): (WebCore::Layout::BoxGeometry::setHasPrecomputedMarginBefore): (WebCore::Layout::BoxGeometry::moveHorizontally): (WebCore::Layout::BoxGeometry::moveVertically): (WebCore::Layout::BoxGeometry::move): (WebCore::Layout::BoxGeometry::moveBy): (WebCore::Layout::BoxGeometry::setHasClearance): (WebCore::Layout::BoxGeometry::invalidateBorder): (WebCore::Layout::BoxGeometry::invalidatePadding): (WebCore::Layout::BoxGeometry::invalidatePrecomputedMarginBefore): (WebCore::Layout::BoxGeometry::setHasValidTop): (WebCore::Layout::BoxGeometry::setHasValidLeft): (WebCore::Layout::BoxGeometry::setHasValidVerticalMargin): (WebCore::Layout::BoxGeometry::setHasValidHorizontalMargin): (WebCore::Layout::BoxGeometry::setHasValidBorder): (WebCore::Layout::BoxGeometry::setHasValidPadding): (WebCore::Layout::BoxGeometry::setHasValidContentHeight): (WebCore::Layout::BoxGeometry::setHasValidContentWidth): (WebCore::Layout::BoxGeometry::invalidateMargin): (WebCore::Layout::BoxGeometry::top const): (WebCore::Layout::BoxGeometry::left const): (WebCore::Layout::BoxGeometry::topLeft const): (WebCore::Layout::BoxGeometry::setTopLeft): (WebCore::Layout::BoxGeometry::setTop): (WebCore::Layout::BoxGeometry::setLeft): (WebCore::Layout::BoxGeometry::setContentBoxHeight): (WebCore::Layout::BoxGeometry::setContentBoxWidth): (WebCore::Layout::BoxGeometry::contentBoxHeight const): (WebCore::Layout::BoxGeometry::contentBoxWidth const): (WebCore::Layout::BoxGeometry::setHorizontalMargin): (WebCore::Layout::BoxGeometry::setVerticalMargin): (WebCore::Layout::BoxGeometry::setBorder): (WebCore::Layout::BoxGeometry::setPadding): (WebCore::Layout::BoxGeometry::setVerticalPadding): (WebCore::Layout::BoxGeometry::verticalMargin const): (WebCore::Layout::BoxGeometry::horizontalMargin const): (WebCore::Layout::BoxGeometry::marginBefore const): (WebCore::Layout::BoxGeometry::marginStart const): (WebCore::Layout::BoxGeometry::marginAfter const): (WebCore::Layout::BoxGeometry::marginEnd const): (WebCore::Layout::BoxGeometry::paddingTop const): (WebCore::Layout::BoxGeometry::paddingLeft const): (WebCore::Layout::BoxGeometry::paddingBottom const): (WebCore::Layout::BoxGeometry::paddingRight const): (WebCore::Layout::BoxGeometry::verticalPadding const): (WebCore::Layout::BoxGeometry::horizontalPadding const): (WebCore::Layout::BoxGeometry::borderTop const): (WebCore::Layout::BoxGeometry::borderLeft const): (WebCore::Layout::BoxGeometry::borderBottom const): (WebCore::Layout::BoxGeometry::borderRight const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutBox): (WebCore::Layout::outputLayoutTree): (WebCore::Layout::showLayoutTree): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): (WebCore::Layout::TableFormattingContext::layoutCell): * layout/tableformatting/TableFormattingContextGeometry.cpp: * layout/tableformatting/TableLayout.cpp: * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/229358@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267076 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-15 05:52:14 +00:00
auto& boxGeometry = layoutState().geometryForBox(formattingContextRoot);
[LFC] FormattingContext::layoutOutOfFlowContent should take horizontal and vertical constraints. https://bugs.webkit.org/show_bug.cgi?id=205892 <rdar://problem/58389802> Reviewed by Antti Koivisto. The caller should provide the horizontal/vertical constraints for the the out-of-flow boxes. It helps to make sure that we don't access geometry information in the parent formatting context. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::horizontalConstraintsForOutOfFlow): (WebCore::Layout::FormattingContext::Geometry::verticalConstraintsForOutOfFlow): (WebCore::Layout::FormattingContext::Geometry::horizontalConstraintsForInFlow): (WebCore::Layout::FormattingContext::Geometry::verticalConstraintsForInFlow): (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalConstraints): Deleted. (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalConstraints): Deleted. (WebCore::Layout::FormattingContext::Geometry::inFlowHorizontalConstraints): Deleted. (WebCore::Layout::FormattingContext::Geometry::inFlowVerticalConstraints): Deleted. * layout/FormattingContextQuirks.cpp: (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren): (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): Canonical link: https://commits.webkit.org/219119@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-09 17:36:59 +00:00
if (formattingContextRoot.hasInFlowOrFloatingChild()) {
[LFC] Tighten the constraint classes (ConstraintsForInFlowContent/ConstraintsForOutOfFlowContent) https://bugs.webkit.org/show_bug.cgi?id=226435 Reviewed by Antti Koivisto. While logical height should always be available for out of flow content by design, the base inflow layout can't necessarily provide it. This height constraint is not even required/used in most of the layout systems, so let's move it to the derived class(es). * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/LayoutUnits.h: * layout/formattingContexts/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): * layout/formattingContexts/FormattingGeometry.cpp: (WebCore::Layout::FormattingGeometry::outOfFlowNonReplacedVerticalGeometry const): (WebCore::Layout::FormattingGeometry::outOfFlowReplacedVerticalGeometry const): (WebCore::Layout::FormattingGeometry::inlineReplacedContentHeightAndMargin const): (WebCore::Layout::FormattingGeometry::inlineReplacedContentWidthAndMargin const): (WebCore::Layout::FormattingGeometry::constraintsForInFlowContent const): * layout/formattingContexts/block/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const): * layout/formattingContexts/block/BlockFormattingContext.h: * layout/formattingContexts/block/BlockFormattingGeometry.cpp: (WebCore::Layout::BlockFormattingGeometry::staticVerticalPosition const): (WebCore::Layout::BlockFormattingGeometry::staticPosition const): Deleted. * layout/formattingContexts/block/BlockFormattingGeometry.h: * layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::layoutTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/formattingContexts/flex/FlexFormattingContext.cpp: (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems): * layout/formattingContexts/inline/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): * layout/formattingContexts/table/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutInFlowContent): (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): (WebCore::Layout::TableFormattingContext::layoutCell): * layout/formattingContexts/table/TableFormattingContext.h: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::layout): Canonical link: https://commits.webkit.org/238329@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-01 02:41:01 +00:00
auto constraintsForInFlowContent = ConstraintsForInFlowContent { { boxGeometry.contentBoxLeft(), boxGeometry.contentBoxWidth() }, boxGeometry.contentBoxTop() };
formattingContext->layoutInFlowContent(invalidationState, constraintsForInFlowContent);
}
[LFC] FormattingContext::layoutOutOfFlowContent should take horizontal and vertical constraints. https://bugs.webkit.org/show_bug.cgi?id=205892 <rdar://problem/58389802> Reviewed by Antti Koivisto. The caller should provide the horizontal/vertical constraints for the the out-of-flow boxes. It helps to make sure that we don't access geometry information in the parent formatting context. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::horizontalConstraintsForOutOfFlow): (WebCore::Layout::FormattingContext::Geometry::verticalConstraintsForOutOfFlow): (WebCore::Layout::FormattingContext::Geometry::horizontalConstraintsForInFlow): (WebCore::Layout::FormattingContext::Geometry::verticalConstraintsForInFlow): (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalConstraints): Deleted. (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalConstraints): Deleted. (WebCore::Layout::FormattingContext::Geometry::inFlowHorizontalConstraints): Deleted. (WebCore::Layout::FormattingContext::Geometry::inFlowVerticalConstraints): Deleted. * layout/FormattingContextQuirks.cpp: (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren): (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): Canonical link: https://commits.webkit.org/219119@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-09 17:36:59 +00:00
// FIXME: layoutFormattingContextSubtree() does not perform layout on the root, rather it lays out the root's content.
// It constructs an FC for descendant boxes and runs layout on them. The formattingContextRoot is laid out in the FC in which it lives (parent formatting context).
// It also means that the formattingContextRoot has to have a valid/clean geometry at this point.
{
[LFC] Cleanup FormattingContext class https://bugs.webkit.org/show_bug.cgi?id=225744 Reviewed by Antti Koivisto. This final patch makes the FormattingContext interface uncluttered. * WebCore.xcodeproj/project.pbxproj: * layout/FormattingState.h: (WebCore::Layout::FormattingState::setIntrinsicWidthConstraints): (WebCore::Layout::FormattingState::intrinsicWidthConstraints const): (WebCore::Layout::FormattingState::setIntrinsicWidthConstraintsForBox): (WebCore::Layout::FormattingState::intrinsicWidthConstraintsForBox const): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/LayoutUnits.h: (WebCore::Layout::IntrinsicWidthConstraints::expand): (WebCore::Layout::IntrinsicWidthConstraints::operator+=): (WebCore::Layout::IntrinsicWidthConstraints::operator-=): * layout/formattingContexts/FormattingContext.cpp: * layout/formattingContexts/FormattingContext.h: (WebCore::Layout::FormattingContext::root const): (WebCore::Layout::FormattingContext::formattingState const): (WebCore::Layout::FormattingContext::isBlockFormattingContext const): (WebCore::Layout::FormattingContext::isInlineFormattingContext const): (WebCore::Layout::FormattingContext::isTableFormattingContext const): (WebCore::Layout::FormattingContext::isTableWrapperBlockFormattingContext const): (WebCore::Layout::FormattingContext::isFlexFormattingContext const): (WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::expand): Deleted. (WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator+=): Deleted. (WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator-=): Deleted. * layout/formattingContexts/FormattingGeometry.cpp: (WebCore::Layout::FormattingGeometry::computedWidthValue): (WebCore::Layout::FormattingGeometry::shrinkToFitWidth): (WebCore::Layout::FormattingGeometry::constrainByMinMaxWidth const): (WebCore::Layout::FormattingGeometry::constraintsForOutOfFlowContent): (WebCore::Layout::FormattingGeometry::constraintsForInFlowContent const): * layout/formattingContexts/FormattingGeometry.h: * layout/formattingContexts/block/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints): * layout/formattingContexts/block/BlockFormattingGeometry.cpp: (WebCore::Layout::BlockFormattingGeometry::intrinsicWidthConstraints): * layout/formattingContexts/block/BlockFormattingGeometry.h: * layout/formattingContexts/block/BlockMarginCollapse.cpp: * layout/formattingContexts/flex/FlexFormattingContext.cpp: (WebCore::Layout::FlexFormattingContext::computedIntrinsicWidthConstraints): * layout/formattingContexts/flex/FlexFormattingGeometry.cpp: (WebCore::Layout::FlexFormattingGeometry::intrinsicWidthConstraints): * layout/formattingContexts/flex/FlexFormattingGeometry.h: * layout/formattingContexts/inline/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints): * layout/formattingContexts/table/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints): (WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns): * layout/formattingContexts/table/TableFormattingGeometry.cpp: (WebCore::Layout::TableFormattingGeometry::intrinsicWidthConstraintsForCell): * layout/formattingContexts/table/TableFormattingGeometry.h: * layout/formattingContexts/table/TableGrid.h: (WebCore::Layout::TableGrid::setWidthConstraints): (WebCore::Layout::TableGrid::widthConstraints const): (WebCore::Layout::TableGrid::Slot::widthConstraints const): (WebCore::Layout::TableGrid::Slot::setWidthConstraints): Canonical link: https://commits.webkit.org/237798@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-16 15:57:35 +00:00
auto constraints = ConstraintsForOutOfFlowContent { { boxGeometry.paddingBoxLeft(), boxGeometry.paddingBoxWidth() },
[LFC] Layout::BoxGeometry rename, part II. https://bugs.webkit.org/show_bug.cgi?id=216523 Reviewed by Simon Fraser. Rename Layout::Geometry to Layout::BoxGeometry (so that later we can introduce Layout::LineGeometry and Layout::RunGeometry) and make sure we don't use displayBox as a variable name in Layout namespace. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::computeBorderAndPadding): (WebCore::Layout::FormattingContext::geometryForBox const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const): (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const): * layout/FormattingContextQuirks.cpp: * layout/FormattingState.cpp: (WebCore::Layout::FormattingState::boxGeometry): (WebCore::Layout::FormattingState::displayBox): Deleted. * layout/FormattingState.h: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::geometryForRootBox): (WebCore::Layout::LayoutState::ensureGeometryForBoxSlow): (WebCore::Layout::LayoutState::geometryForRootLayoutBox): Deleted. (WebCore::Layout::LayoutState::ensureDisplayBoxForLayoutBoxSlow): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasBoxGeometry const): (WebCore::Layout::LayoutState::ensureGeometryForBox): (WebCore::Layout::LayoutState::geometryForBox const): (WebCore::Layout::Box::cachedGeometryForLayoutState const): (WebCore::Layout::LayoutState::hasDisplayBox const): Deleted. (WebCore::Layout::LayoutState::ensureGeometryForLayoutBox): Deleted. (WebCore::Layout::LayoutState::geometryForLayoutBox const): Deleted. (WebCore::Layout::Box::cachedDisplayBoxForLayoutState const): Deleted. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren): (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition): (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear): (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/display/DisplayLayerController.cpp: (WebCore::Display::LayerController::prepareForDisplay): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintBoxDecoration): (WebCore::Display::Painter::absoluteBoxGeometry): (WebCore::Display::paintSubtree): (WebCore::Display::collectPaintRootsAndContentRect): (WebCore::Display::Painter::absoluteDisplayBox): Deleted. * layout/displaytree/DisplayPainter.h: * layout/floats/FloatAvoider.h: * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): (WebCore::Layout::FloatingContext::append): (WebCore::Layout::FloatingContext::absoluteBoxGeometryCoordinates const): (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const): Deleted. * layout/floats/FloatingContext.h: * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::FloatItem::FloatItem): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const): (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const): (WebCore::Layout::FloatingState::FloatItem::bottom const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints): (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin): (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin): (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): (WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent): Deleted. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineLineBox.h: * layout/inlineformatting/InlineLineBuilder.cpp: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::prepareFloatingState): * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::setcachedGeometryForLayoutState const): (WebCore::Layout::Box::setCachedDisplayBoxForLayoutState const): Deleted. * layout/layouttree/LayoutBox.h: * layout/layouttree/LayoutBoxGeometry.cpp: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.cpp. (WebCore::Layout::BoxGeometry::BoxGeometry): (WebCore::Layout::BoxGeometry::~BoxGeometry): (WebCore::Layout::BoxGeometry::marginBox const): (WebCore::Layout::BoxGeometry::borderBox const): (WebCore::Layout::BoxGeometry::paddingBox const): (WebCore::Layout::BoxGeometry::contentBox const): * layout/layouttree/LayoutBoxGeometry.h: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.h. (WebCore::Layout::Rect::expandHorizontally): (WebCore::Layout::Rect::expandVertically): (WebCore::Layout::Rect::intersects const): (WebCore::Layout::Rect::invalidateTop): (WebCore::Layout::Rect::invalidateLeft): (WebCore::Layout::Rect::invalidateWidth): (WebCore::Layout::Rect::invalidateHeight): (WebCore::Layout::Rect::hasValidPosition const): (WebCore::Layout::Rect::hasValidSize const): (WebCore::Layout::Rect::hasValidGeometry const): (WebCore::Layout::Rect::Rect): (WebCore::Layout::Rect::invalidatePosition): (WebCore::Layout::Rect::setHasValidPosition): (WebCore::Layout::Rect::setHasValidSize): (WebCore::Layout::Rect::top const): (WebCore::Layout::Rect::left const): (WebCore::Layout::Rect::bottom const): (WebCore::Layout::Rect::right const): (WebCore::Layout::Rect::topLeft const): (WebCore::Layout::Rect::bottomRight const): (WebCore::Layout::Rect::size const): (WebCore::Layout::Rect::width const): (WebCore::Layout::Rect::height const): (WebCore::Layout::Rect::setTopLeft): (WebCore::Layout::Rect::setTop): (WebCore::Layout::Rect::setLeft): (WebCore::Layout::Rect::setWidth): (WebCore::Layout::Rect::setHeight): (WebCore::Layout::Rect::setSize): (WebCore::Layout::Rect::shiftLeftTo): (WebCore::Layout::Rect::shiftRightTo): (WebCore::Layout::Rect::shiftTopTo): (WebCore::Layout::Rect::shiftBottomTo): (WebCore::Layout::Rect::moveHorizontally): (WebCore::Layout::Rect::moveVertically): (WebCore::Layout::Rect::expand): (WebCore::Layout::Rect::clone const): (WebCore::Layout::Rect::operator LayoutRect const): (WebCore::Layout::BoxGeometry::bottom const): (WebCore::Layout::BoxGeometry::right const): (WebCore::Layout::BoxGeometry::bottomRight const): (WebCore::Layout::BoxGeometry::size const): (WebCore::Layout::BoxGeometry::width const): (WebCore::Layout::BoxGeometry::height const): (WebCore::Layout::BoxGeometry::isEmpty const): (WebCore::Layout::BoxGeometry::rect const): (WebCore::Layout::BoxGeometry::rectWithMargin const): (WebCore::Layout::BoxGeometry::hasClearance const): (WebCore::Layout::BoxGeometry::verticalBorder const): (WebCore::Layout::BoxGeometry::horizontalBorder const): (WebCore::Layout::BoxGeometry::contentBoxTop const): (WebCore::Layout::BoxGeometry::contentBoxLeft const): (WebCore::Layout::BoxGeometry::contentBoxBottom const): (WebCore::Layout::BoxGeometry::contentBoxRight const): (WebCore::Layout::BoxGeometry::paddingBoxTop const): (WebCore::Layout::BoxGeometry::paddingBoxLeft const): (WebCore::Layout::BoxGeometry::paddingBoxBottom const): (WebCore::Layout::BoxGeometry::paddingBoxRight const): (WebCore::Layout::BoxGeometry::paddingBoxHeight const): (WebCore::Layout::BoxGeometry::paddingBoxWidth const): (WebCore::Layout::BoxGeometry::borderBoxHeight const): (WebCore::Layout::BoxGeometry::borderBoxWidth const): (WebCore::Layout::BoxGeometry::marginBoxHeight const): (WebCore::Layout::BoxGeometry::marginBoxWidth const): (WebCore::Layout::BoxGeometry::verticalMarginBorderAndPadding const): (WebCore::Layout::BoxGeometry::horizontalMarginBorderAndPadding const): (WebCore::Layout::BoxGeometry::setHasPrecomputedMarginBefore): (WebCore::Layout::BoxGeometry::moveHorizontally): (WebCore::Layout::BoxGeometry::moveVertically): (WebCore::Layout::BoxGeometry::move): (WebCore::Layout::BoxGeometry::moveBy): (WebCore::Layout::BoxGeometry::setHasClearance): (WebCore::Layout::BoxGeometry::invalidateBorder): (WebCore::Layout::BoxGeometry::invalidatePadding): (WebCore::Layout::BoxGeometry::invalidatePrecomputedMarginBefore): (WebCore::Layout::BoxGeometry::setHasValidTop): (WebCore::Layout::BoxGeometry::setHasValidLeft): (WebCore::Layout::BoxGeometry::setHasValidVerticalMargin): (WebCore::Layout::BoxGeometry::setHasValidHorizontalMargin): (WebCore::Layout::BoxGeometry::setHasValidBorder): (WebCore::Layout::BoxGeometry::setHasValidPadding): (WebCore::Layout::BoxGeometry::setHasValidContentHeight): (WebCore::Layout::BoxGeometry::setHasValidContentWidth): (WebCore::Layout::BoxGeometry::invalidateMargin): (WebCore::Layout::BoxGeometry::top const): (WebCore::Layout::BoxGeometry::left const): (WebCore::Layout::BoxGeometry::topLeft const): (WebCore::Layout::BoxGeometry::setTopLeft): (WebCore::Layout::BoxGeometry::setTop): (WebCore::Layout::BoxGeometry::setLeft): (WebCore::Layout::BoxGeometry::setContentBoxHeight): (WebCore::Layout::BoxGeometry::setContentBoxWidth): (WebCore::Layout::BoxGeometry::contentBoxHeight const): (WebCore::Layout::BoxGeometry::contentBoxWidth const): (WebCore::Layout::BoxGeometry::setHorizontalMargin): (WebCore::Layout::BoxGeometry::setVerticalMargin): (WebCore::Layout::BoxGeometry::setBorder): (WebCore::Layout::BoxGeometry::setPadding): (WebCore::Layout::BoxGeometry::setVerticalPadding): (WebCore::Layout::BoxGeometry::verticalMargin const): (WebCore::Layout::BoxGeometry::horizontalMargin const): (WebCore::Layout::BoxGeometry::marginBefore const): (WebCore::Layout::BoxGeometry::marginStart const): (WebCore::Layout::BoxGeometry::marginAfter const): (WebCore::Layout::BoxGeometry::marginEnd const): (WebCore::Layout::BoxGeometry::paddingTop const): (WebCore::Layout::BoxGeometry::paddingLeft const): (WebCore::Layout::BoxGeometry::paddingBottom const): (WebCore::Layout::BoxGeometry::paddingRight const): (WebCore::Layout::BoxGeometry::verticalPadding const): (WebCore::Layout::BoxGeometry::horizontalPadding const): (WebCore::Layout::BoxGeometry::borderTop const): (WebCore::Layout::BoxGeometry::borderLeft const): (WebCore::Layout::BoxGeometry::borderBottom const): (WebCore::Layout::BoxGeometry::borderRight const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutBox): (WebCore::Layout::outputLayoutTree): (WebCore::Layout::showLayoutTree): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): (WebCore::Layout::TableFormattingContext::layoutCell): * layout/tableformatting/TableFormattingContextGeometry.cpp: * layout/tableformatting/TableLayout.cpp: * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/229358@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267076 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-15 05:52:14 +00:00
{ boxGeometry.paddingBoxTop(), boxGeometry.paddingBoxHeight() }, boxGeometry.contentBoxWidth() };
formattingContext->layoutOutOfFlowContent(invalidationState, constraints);
[LFC] FormattingContext::layoutOutOfFlowContent should take horizontal and vertical constraints. https://bugs.webkit.org/show_bug.cgi?id=205892 <rdar://problem/58389802> Reviewed by Antti Koivisto. The caller should provide the horizontal/vertical constraints for the the out-of-flow boxes. It helps to make sure that we don't access geometry information in the parent formatting context. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::horizontalConstraintsForOutOfFlow): (WebCore::Layout::FormattingContext::Geometry::verticalConstraintsForOutOfFlow): (WebCore::Layout::FormattingContext::Geometry::horizontalConstraintsForInFlow): (WebCore::Layout::FormattingContext::Geometry::verticalConstraintsForInFlow): (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalConstraints): Deleted. (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalConstraints): Deleted. (WebCore::Layout::FormattingContext::Geometry::inFlowHorizontalConstraints): Deleted. (WebCore::Layout::FormattingContext::Geometry::inFlowVerticalConstraints): Deleted. * layout/FormattingContextQuirks.cpp: (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren): (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): Canonical link: https://commits.webkit.org/219119@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-09 17:36:59 +00:00
}
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
}
[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: Canonical link: https://commits.webkit.org/220576@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-02-12 01:08:08 +00:00
std::unique_ptr<FormattingContext> LayoutContext::createFormattingContext(const ContainerBox& formattingContextRoot, LayoutState& layoutState)
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
{
ASSERT(formattingContextRoot.establishesFormattingContext());
if (formattingContextRoot.establishesInlineFormattingContext()) {
[LFC] Typed accessors for formatting states https://bugs.webkit.org/show_bug.cgi?id=206538 Reviewed by Zalan Bujtas. Almost all clients know what sort of formatting state they want and immediately cast it. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::createFormattingContext): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::formattingStateForBox const): (WebCore::Layout::LayoutState::establishedFormattingState const): (WebCore::Layout::LayoutState::establishedInlineFormattingState const): (WebCore::Layout::LayoutState::establishedBlockFormattingState const): (WebCore::Layout::LayoutState::establishedTableFormattingState const): Typed function for getting established states. (WebCore::Layout::LayoutState::ensureFormattingState): (WebCore::Layout::LayoutState::ensureInlineFormattingState): Also add a fast path for integrated layout. (WebCore::Layout::LayoutState::ensureBlockFormattingState): (WebCore::Layout::LayoutState::ensureTableFormattingState): Typed function for creating states. (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasInlineFormattingState const): (WebCore::Layout::LayoutState::hasFormattingState const): Deleted. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintSubtree): (WebCore::Display::Painter::paintInlineFlow): * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::alignContentVertically): (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::LineLayout): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): Canonical link: https://commits.webkit.org/219610@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-21 21:08:55 +00:00
auto& inlineFormattingState = layoutState.ensureInlineFormattingState(formattingContextRoot);
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
return makeUnique<InlineFormattingContext>(formattingContextRoot, inlineFormattingState);
}
if (formattingContextRoot.establishesBlockFormattingContext()) {
ASSERT(!formattingContextRoot.establishesInlineFormattingContext());
[LFC] Typed accessors for formatting states https://bugs.webkit.org/show_bug.cgi?id=206538 Reviewed by Zalan Bujtas. Almost all clients know what sort of formatting state they want and immediately cast it. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::createFormattingContext): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::formattingStateForBox const): (WebCore::Layout::LayoutState::establishedFormattingState const): (WebCore::Layout::LayoutState::establishedInlineFormattingState const): (WebCore::Layout::LayoutState::establishedBlockFormattingState const): (WebCore::Layout::LayoutState::establishedTableFormattingState const): Typed function for getting established states. (WebCore::Layout::LayoutState::ensureFormattingState): (WebCore::Layout::LayoutState::ensureInlineFormattingState): Also add a fast path for integrated layout. (WebCore::Layout::LayoutState::ensureBlockFormattingState): (WebCore::Layout::LayoutState::ensureTableFormattingState): Typed function for creating states. (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasInlineFormattingState const): (WebCore::Layout::LayoutState::hasFormattingState const): Deleted. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintSubtree): (WebCore::Display::Painter::paintInlineFlow): * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::alignContentVertically): (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::LineLayout): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): Canonical link: https://commits.webkit.org/219610@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-21 21:08:55 +00:00
auto& blockFormattingState = layoutState.ensureBlockFormattingState(formattingContextRoot);
[LFC][BFC] Introduce TableWrapperBlockFormattingContext https://bugs.webkit.org/show_bug.cgi?id=211996 Reviewed by Antti Koivisto. Table wrapper box establishes a special BFC with only captions and the actual table box in it. It mostly behaves like a normal BFC but the table box requires some special handing when it comes to padding/border and width/height computation. This patch moves the table box specific code from generic BFC to this new subclass. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.h: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::createFormattingContext): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContext.h: (): Deleted. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: Added. (WebCore::Layout::TableWrapperBlockFormattingContext::TableWrapperBlockFormattingContext): (WebCore::Layout::TableWrapperBlockFormattingContext::layoutInFlowContent): (WebCore::Layout::TableWrapperBlockFormattingContext::layoutTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h: Added. Canonical link: https://commits.webkit.org/224885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-17 16:17:45 +00:00
if (formattingContextRoot.isTableWrapperBox())
return makeUnique<TableWrapperBlockFormattingContext>(formattingContextRoot, blockFormattingState);
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
return makeUnique<BlockFormattingContext>(formattingContextRoot, blockFormattingState);
}
if (formattingContextRoot.establishesFlexFormattingContext()) {
auto& flexFormattingState = layoutState.ensureFlexFormattingState(formattingContextRoot);
return makeUnique<FlexFormattingContext>(formattingContextRoot, flexFormattingState);
}
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
if (formattingContextRoot.establishesTableFormattingContext()) {
[LFC] Typed accessors for formatting states https://bugs.webkit.org/show_bug.cgi?id=206538 Reviewed by Zalan Bujtas. Almost all clients know what sort of formatting state they want and immediately cast it. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::createFormattingContext): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::formattingStateForBox const): (WebCore::Layout::LayoutState::establishedFormattingState const): (WebCore::Layout::LayoutState::establishedInlineFormattingState const): (WebCore::Layout::LayoutState::establishedBlockFormattingState const): (WebCore::Layout::LayoutState::establishedTableFormattingState const): Typed function for getting established states. (WebCore::Layout::LayoutState::ensureFormattingState): (WebCore::Layout::LayoutState::ensureInlineFormattingState): Also add a fast path for integrated layout. (WebCore::Layout::LayoutState::ensureBlockFormattingState): (WebCore::Layout::LayoutState::ensureTableFormattingState): Typed function for creating states. (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasInlineFormattingState const): (WebCore::Layout::LayoutState::hasFormattingState const): Deleted. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintSubtree): (WebCore::Display::Painter::paintInlineFlow): * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::alignContentVertically): (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::LineLayout): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): Canonical link: https://commits.webkit.org/219610@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-21 21:08:55 +00:00
auto& tableFormattingState = layoutState.ensureTableFormattingState(formattingContextRoot);
[LFC] Introduce LayoutContext class https://bugs.webkit.org/show_bug.cgi?id=202026 <rdar://problem/55546622> Reviewed by Antti Koivisto. Move context related functionality from LayoutState to LayoutContext. To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::updateLayout): Deleted. (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted. (WebCore::Layout::LayoutState::styleChanged): Deleted. (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted. (WebCore::Layout::LayoutState::createFormattingContext): Deleted. (WebCore::Layout::LayoutState::run): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasFormattingState const): (WebCore::Layout::LayoutState::setQuirksMode): (WebCore::Layout::LayoutState::inNoQuirksMode const): (WebCore::Layout::LayoutState::updateAll): Deleted. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::printLayoutTreeForLiveDocuments): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutTableCellBox): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableInvalidation.cpp: (WebCore::Layout::TableInvalidation::invalidate): * layout/tableformatting/TableInvalidation.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): Canonical link: https://commits.webkit.org/215641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-20 13:36:00 +00:00
return makeUnique<TableFormattingContext>(formattingContextRoot, tableFormattingState);
}
CRASH();
}
}
}
#endif