haikuwebkit/Tools/LayoutReloaded/TreeBuilder.js

106 lines
4.4 KiB
JavaScript
Raw Permalink Normal View History

[LayoutReloaded] Initial commit -block formatting context. https://bugs.webkit.org/show_bug.cgi?id=183462 Reviewed by Antti Koivisto. See README.md * LayoutReloaded/BlockContainer.js: Added. (BlockContainer): (BlockContainer.prototype.establishesInlineFormattingContext): * LayoutReloaded/BlockFormattingContext.js: Added. (BlockFormattingContext): (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype.computeWidth): (BlockFormattingContext.prototype.computeHeight): (BlockFormattingContext.prototype.marginTop): (BlockFormattingContext.prototype.marginBottom): (BlockFormattingContext.prototype._computeStaticPosition): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._placeOutOfFlowDescendants): (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._computeHorizontalConstraint): (BlockFormattingContext.prototype._computeContentHeight): (BlockFormattingContext.prototype._computeInFlowPositionedPosition): (BlockFormattingContext.prototype._computeOutOfFlowPosition): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/BlockMarginCollapse.js: Added. (BlockMarginCollapse.marginTop): (BlockMarginCollapse.marginBottom): (BlockMarginCollapse._isMarginTopCollapsedWithSibling): (BlockMarginCollapse._isMarginBottomCollapsedWithSibling): (BlockMarginCollapse._isMarginTopCollapsedWithParent): (BlockMarginCollapse._isMarginBottomCollapsedWithParent): (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): (BlockMarginCollapse._marginValue): (BlockMarginCollapse._hasAdjoiningMarginTopAndBottom): (BlockMarginCollapse): * LayoutReloaded/Box.js: Added. (Box): (Box.prototype.id): (Box.prototype.setRendererName): (Box.prototype.name): (Box.prototype.node): (Box.prototype.parent): (Box.prototype.nextSibling): (Box.prototype.nextInFlowSibling): (Box.prototype.previousSibling): (Box.prototype.previousInFlowSibling): (Box.prototype.setParent): (Box.prototype.setNextSibling): (Box.prototype.setPreviousSibling): (Box.prototype.rect): (Box.prototype.topLeft): (Box.prototype.bottomRight): (Box.prototype.setTopLeft): (Box.prototype.setSize): (Box.prototype.setWidth): (Box.prototype.setHeight): (Box.prototype.isContainer): (Box.prototype.isBlockLevelBox): (Box.prototype.isBlockContainerBox): (Box.prototype.isInlineLevelBox): (Box.prototype.setIsAnonymous): (Box.prototype.isAnonymous): (Box.prototype.establishesFormattingContext): (Box.prototype.establishedFormattingContext): (Box.prototype.establishesBlockFormattingContext): (Box.prototype.establishesInlineFormattingContext): (Box.prototype.isPositioned): (Box.prototype.isRelativePositioned): (Box.prototype.isAbsolutePositioned): (Box.prototype.isFixedPositioned): (Box.prototype.isInFlow): (Box.prototype.isOutOfFlowPositioned): (Box.prototype.isInFlowPositioned): (Box.prototype.isFloatingPositioned): (Box.prototype.isFloatingOrOutOfFlowPositioned): (Box.prototype.isRootElement): (Box.prototype.containingBlock): (Box.prototype.borderBox): (Box.prototype.paddingBox): (Box.prototype.contentBox): * LayoutReloaded/Container.js: Added. (Container): (Container.prototype.isContainer): (Container.prototype.setFirstChild): (Container.prototype.setLastChild): (Container.prototype.firstChild): (Container.prototype.firstInFlowChild): (Container.prototype.lastChild): (Container.prototype.lastInFlowChild): (Container.prototype.hasChild): (Container.prototype.hasInFlowChild): * LayoutReloaded/FloatingContext.js: Added. (FloatingContext): (FloatingContext.prototype.computePosition): (FloatingContext.prototype.bottom): (FloatingContext.prototype._positionForFloating): (FloatingContext.prototype._positionForClear): (FloatingContext.prototype._computePositionToAvoidIntrudingFloats): (FloatingContext.prototype._addFloating): (FloatingContext.prototype._findInnerMostLeftAndRight): (FloatingContext.prototype._moveToNextVerticalPosition): (FloatingContext.prototype._availableSpace): (FloatingContext.prototype._findFloatingAtVerticalPosition): (FloatingContext.prototype._isEmpty): (FloatingContext.prototype._adjustedFloatingPosition): (FloatingContext.prototype._bottom): (FloatingContext.prototype._formattingContext): * LayoutReloaded/FormattingContext.js: Added. (FormattingContext): (FormattingContext.prototype.rootContainer): (FormattingContext.prototype.floatingContext): (FormattingContext.prototype.layout): (FormattingContext.prototype.computeWidth): (FormattingContext.prototype.computeHeight): (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): (FormattingContext.prototype.absoluteMarginBox): (FormattingContext.prototype.absoluteBorderBox): (FormattingContext.prototype.absolutePaddingBox): (FormattingContext.prototype.absoluteContentBox): * LayoutReloaded/InitialBlockContainer.js: Added. (InitialBlockContainer): (InitialBlockContainer.prototype.establishesBlockFormattingContext): (InitialBlockContainer.prototype.paddingBox): (InitialBlockContainer.prototype.contentBox): * LayoutReloaded/InlineBox.js: Added. (InlineBox): (InlineBox.prototype.setText): (InlineBox.prototype.text): * LayoutReloaded/InlineFormattingContext.js: Added. (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._handleInlineBox): (InlineFormattingContext.prototype._handleText): * LayoutReloaded/Layout.js: Added. (layout): * LayoutReloaded/LayoutContext.js: Added. (LayoutContext): (LayoutContext.prototype.layoutFormattingContext): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: Added. * LayoutReloaded/LayoutReloaded.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: Added. * LayoutReloaded/README.md: Added. * LayoutReloaded/Text.js: Added. (Text): * LayoutReloaded/TreeBuilder.js: Added. (TreeBuilder.prototype.createTree): (TreeBuilder.prototype._createAndAttachBox): (TreeBuilder.prototype._appendChild): (TreeBuilder.prototype._findBox): (TreeBuilder.prototype._findNode): (TreeBuilder): * LayoutReloaded/Utils.js: Added. (LayoutPoint): (LayoutPoint.prototype.setLeft): (LayoutPoint.prototype.setTop): (LayoutPoint.prototype.left): (LayoutPoint.prototype.top): (LayoutPoint.prototype.shiftLeft): (LayoutPoint.prototype.shiftTop): (LayoutPoint.prototype.moveBy): (LayoutPoint.prototype.equal): (LayoutPoint.prototype.clone): (LayoutSize): (LayoutSize.prototype.setWidth): (LayoutSize.prototype.setHeight): (LayoutSize.prototype.width): (LayoutSize.prototype.height): (LayoutSize.prototype.growBy): (LayoutSize.prototype.shrinkBy): (LayoutSize.prototype.isEmpty): (LayoutSize.prototype.equal): (LayoutSize.prototype.clone): (LayoutRect): (LayoutRect.prototype.setTop): (LayoutRect.prototype.setLeft): (LayoutRect.prototype.setBottom): (LayoutRect.prototype.setRight): (LayoutRect.prototype.left): (LayoutRect.prototype.top): (LayoutRect.prototype.bottom): (LayoutRect.prototype.right): (LayoutRect.prototype.setTopLeft): (LayoutRect.prototype.topLeft): (LayoutRect.prototype.topRight): (LayoutRect.prototype.bottomRight): (LayoutRect.prototype.setWidth): (LayoutRect.prototype.setHeight): (LayoutRect.prototype.setSize): (LayoutRect.prototype.size): (LayoutRect.prototype.width): (LayoutRect.prototype.height): (LayoutRect.prototype.growBy): (LayoutRect.prototype.shrinkBy): (LayoutRect.prototype.moveBy): (LayoutRect.prototype.isEmpty): (LayoutRect.prototype.equal): (LayoutRect.prototype.intersects): (LayoutRect.prototype.contains): (LayoutRect.prototype.clone): (ASSERT_NOT_REACHED): (ASSERT): (Utils.computedValue): (Utils.propertyIsAuto): (Utils.isWidthAuto): (Utils.isHeightAuto): (Utils.isTopAuto): (Utils.isLeftAuto): (Utils.isBottomAuto): (Utils.isRightAuto): (Utils.width): (Utils.height): (Utils.top): (Utils.bottom): (Utils.left): (Utils.right): (Utils.hasBorderTop): (Utils.hasBorderBottom): (Utils.hasPaddingTop): (Utils.hasPaddingBottom): (Utils.computedMarginTop): (Utils.computedMarginLeft): (Utils.computedMarginBottom): (Utils.computedMarginRight): (Utils.computedBorderTopLeft): (Utils.computedBorderBottomRight): (Utils.computedPaddingTopLeft): (Utils.computedPaddingBottomRight): (Utils.computedBorderAndPaddingTop): (Utils.computedBorderAndPaddingLeft): (Utils.computedBorderAndPaddingBottom): (Utils.computedBorderAndPaddingRight): (Utils.computedHorizontalBorderAndPadding): (Utils.computedVerticalBorderAndPadding): (Utils.hasClear): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): (Utils.isBlockLevelElement): (Utils.isBlockContainerElement): (Utils.isInlineLevelElement): (Utils.isTableElement): (Utils.isRelativePositioned): (Utils.isAbsolutePositioned): (Utils.isFixedPositioned): (Utils.isOverflowVisible): (Utils.isFloatingPositioned): (Utils.isFloatingLeft): (Utils.mapToContainer): (Utils.mapStaticToAbsolute): (Utils.collectOutOfFlowDescendants): (Utils.nextBreakingOpportunity): (Utils.measureText): (Utils.layoutTreeDump): (Utils._dumpBox): (Utils._dumpTree): (Utils): * LayoutReloaded/misc/LayoutReloadedWebKit.patch: Added. * LayoutReloaded/misc/headers/BlockContainer.h: Added. * LayoutReloaded/misc/headers/BlockFormattingContext.h: Added. * LayoutReloaded/misc/headers/BlockMarginCollapse.h: Added. * LayoutReloaded/misc/headers/Box.h: Added. * LayoutReloaded/misc/headers/Container.h: Added. * LayoutReloaded/misc/headers/FloatingContext.h: Added. * LayoutReloaded/misc/headers/FormattingContext.h: Added. * LayoutReloaded/misc/headers/InitialBlockContainer.h: Added. * LayoutReloaded/misc/headers/InlineBox.h: Added. * LayoutReloaded/misc/headers/LayoutContext.h: Added. * LayoutReloaded/misc/headers/Text.h: Added. * LayoutReloaded/test/TestHarness.js: Added. (verifyLayoutTreeDump): (runLayout): * LayoutReloaded/test/absolute-auto-with-sibling-margin-bottom.html: Added. * LayoutReloaded/test/absolute-bottom.html: Added. * LayoutReloaded/test/absolute-height-stretch.html: Added. * LayoutReloaded/test/absolute-left-auto.html: Added. * LayoutReloaded/test/absolute-left-right-top-bottom-auto.html: Added. * LayoutReloaded/test/absolute-nested.html: Added. * LayoutReloaded/test/absolute-nested2.html: Added. * LayoutReloaded/test/absolute-simple.html: Added. * LayoutReloaded/test/absolute-width-shrink-to-fit.html: Added. * LayoutReloaded/test/absolute-width-stretch.html: Added. * LayoutReloaded/test/absolute-with-inline-preferred-width.html: Added. * LayoutReloaded/test/absolute-with-static-block-position-nested.html: Added. * LayoutReloaded/test/almost-intruding-left-float-simple.html: Added. * LayoutReloaded/test/border-simple.html: Added. * LayoutReloaded/test/fixed-nested.html: Added. * LayoutReloaded/test/float-left-when-container-has-padding-margin.html: Added. * LayoutReloaded/test/floating-box-clear-both-simple.html: Added. * LayoutReloaded/test/floating-box-clear-right-simple.html: Added. * LayoutReloaded/test/floating-box-left-and-right-multiple-with-top-offset.html: Added. * LayoutReloaded/test/floating-box-left-and-right-multiple.html: Added. * LayoutReloaded/test/floating-box-right-simple.html: Added. * LayoutReloaded/test/floating-box-with-clear-siblings.html: Added. * LayoutReloaded/test/floating-box-with-clear-simple.html: Added. * LayoutReloaded/test/floating-box-with-new-formatting-context.html: Added. * LayoutReloaded/test/floating-box-with-relative-positioned-sibling.html: Added. * LayoutReloaded/test/floating-left-right-simple.html: Added. * LayoutReloaded/test/floating-left-right-with-all-margins.html: Added. * LayoutReloaded/test/floating-lefts-and-rights-simple.html: Added. * LayoutReloaded/test/floating-multiple-lefts-in-body.html: Added. * LayoutReloaded/test/floating-multiple-lefts-multiple-lines.html: Added. * LayoutReloaded/test/floating-multiple-lefts.html: Added. * LayoutReloaded/test/floating-sizing.html: Added. * LayoutReloaded/test/floating-sizing2.html: Added. * LayoutReloaded/test/floating-sizing3.html: Added. * LayoutReloaded/test/floating-with-new-block-formatting-context.html: Added. * LayoutReloaded/test/index.html: Added. * LayoutReloaded/test/inline-content-simple.html: Added. * LayoutReloaded/test/intruding-left-float-simple.html: Added. * LayoutReloaded/test/margin-collapse-bottom-bottom.html: Added. * LayoutReloaded/test/margin-collapse-bottom-nested.html: Added. * LayoutReloaded/test/margin-collapse-first-last-are-floating.html: Added. * LayoutReloaded/test/margin-collapse-simple.html: Added. * LayoutReloaded/test/margin-collapse-top-nested.html: Added. * LayoutReloaded/test/margin-collapse-when-child-has-padding-border.html: Added. * LayoutReloaded/test/margin-collapse-with-block-formatting-context.html: Added. * LayoutReloaded/test/margin-collapse-with-block-formatting-context2.html: Added. * LayoutReloaded/test/margin-left-right-sizing-out-of-flow.html: Added. * LayoutReloaded/test/margin-left-right-sizing.html: Added. * LayoutReloaded/test/margin-propagation-simple-content-height.html: Added. * LayoutReloaded/test/margin-sibling-collapse-propagated.html: Added. * LayoutReloaded/test/margin-simple.html: Added. * LayoutReloaded/test/negative-margin-simple.html: Added. * LayoutReloaded/test/padding-nested.html: Added. * LayoutReloaded/test/padding-simple.html: Added. * LayoutReloaded/test/relative-auto-with-parent-offset.html: Added. * LayoutReloaded/test/relative-auto.html: Added. * LayoutReloaded/test/relative-bottom.html: Added. * LayoutReloaded/test/relative-right.html: Added. * LayoutReloaded/test/relative-siblings.html: Added. * LayoutReloaded/test/relative-simple.html: Added. Canonical link: https://commits.webkit.org/199175@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-09 19:10:37 +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. ``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
* 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.
*/
// 1()RenderView|2(1)RenderBlock|3(2)RenderBody|4(3)RenderBlock|5(3)AnonymousRenderBlock|
class TreeBuilder {
createTree(document, renderTreeDump) {
// Root.
let initialBlockContainer = new Layout.BlockContainer(document, parseInt(renderTreeDump.substring(0, renderTreeDump.indexOf("("))));
[LayoutReloaded] Initial commit -block formatting context. https://bugs.webkit.org/show_bug.cgi?id=183462 Reviewed by Antti Koivisto. See README.md * LayoutReloaded/BlockContainer.js: Added. (BlockContainer): (BlockContainer.prototype.establishesInlineFormattingContext): * LayoutReloaded/BlockFormattingContext.js: Added. (BlockFormattingContext): (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype.computeWidth): (BlockFormattingContext.prototype.computeHeight): (BlockFormattingContext.prototype.marginTop): (BlockFormattingContext.prototype.marginBottom): (BlockFormattingContext.prototype._computeStaticPosition): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._placeOutOfFlowDescendants): (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._computeHorizontalConstraint): (BlockFormattingContext.prototype._computeContentHeight): (BlockFormattingContext.prototype._computeInFlowPositionedPosition): (BlockFormattingContext.prototype._computeOutOfFlowPosition): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/BlockMarginCollapse.js: Added. (BlockMarginCollapse.marginTop): (BlockMarginCollapse.marginBottom): (BlockMarginCollapse._isMarginTopCollapsedWithSibling): (BlockMarginCollapse._isMarginBottomCollapsedWithSibling): (BlockMarginCollapse._isMarginTopCollapsedWithParent): (BlockMarginCollapse._isMarginBottomCollapsedWithParent): (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): (BlockMarginCollapse._marginValue): (BlockMarginCollapse._hasAdjoiningMarginTopAndBottom): (BlockMarginCollapse): * LayoutReloaded/Box.js: Added. (Box): (Box.prototype.id): (Box.prototype.setRendererName): (Box.prototype.name): (Box.prototype.node): (Box.prototype.parent): (Box.prototype.nextSibling): (Box.prototype.nextInFlowSibling): (Box.prototype.previousSibling): (Box.prototype.previousInFlowSibling): (Box.prototype.setParent): (Box.prototype.setNextSibling): (Box.prototype.setPreviousSibling): (Box.prototype.rect): (Box.prototype.topLeft): (Box.prototype.bottomRight): (Box.prototype.setTopLeft): (Box.prototype.setSize): (Box.prototype.setWidth): (Box.prototype.setHeight): (Box.prototype.isContainer): (Box.prototype.isBlockLevelBox): (Box.prototype.isBlockContainerBox): (Box.prototype.isInlineLevelBox): (Box.prototype.setIsAnonymous): (Box.prototype.isAnonymous): (Box.prototype.establishesFormattingContext): (Box.prototype.establishedFormattingContext): (Box.prototype.establishesBlockFormattingContext): (Box.prototype.establishesInlineFormattingContext): (Box.prototype.isPositioned): (Box.prototype.isRelativePositioned): (Box.prototype.isAbsolutePositioned): (Box.prototype.isFixedPositioned): (Box.prototype.isInFlow): (Box.prototype.isOutOfFlowPositioned): (Box.prototype.isInFlowPositioned): (Box.prototype.isFloatingPositioned): (Box.prototype.isFloatingOrOutOfFlowPositioned): (Box.prototype.isRootElement): (Box.prototype.containingBlock): (Box.prototype.borderBox): (Box.prototype.paddingBox): (Box.prototype.contentBox): * LayoutReloaded/Container.js: Added. (Container): (Container.prototype.isContainer): (Container.prototype.setFirstChild): (Container.prototype.setLastChild): (Container.prototype.firstChild): (Container.prototype.firstInFlowChild): (Container.prototype.lastChild): (Container.prototype.lastInFlowChild): (Container.prototype.hasChild): (Container.prototype.hasInFlowChild): * LayoutReloaded/FloatingContext.js: Added. (FloatingContext): (FloatingContext.prototype.computePosition): (FloatingContext.prototype.bottom): (FloatingContext.prototype._positionForFloating): (FloatingContext.prototype._positionForClear): (FloatingContext.prototype._computePositionToAvoidIntrudingFloats): (FloatingContext.prototype._addFloating): (FloatingContext.prototype._findInnerMostLeftAndRight): (FloatingContext.prototype._moveToNextVerticalPosition): (FloatingContext.prototype._availableSpace): (FloatingContext.prototype._findFloatingAtVerticalPosition): (FloatingContext.prototype._isEmpty): (FloatingContext.prototype._adjustedFloatingPosition): (FloatingContext.prototype._bottom): (FloatingContext.prototype._formattingContext): * LayoutReloaded/FormattingContext.js: Added. (FormattingContext): (FormattingContext.prototype.rootContainer): (FormattingContext.prototype.floatingContext): (FormattingContext.prototype.layout): (FormattingContext.prototype.computeWidth): (FormattingContext.prototype.computeHeight): (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): (FormattingContext.prototype.absoluteMarginBox): (FormattingContext.prototype.absoluteBorderBox): (FormattingContext.prototype.absolutePaddingBox): (FormattingContext.prototype.absoluteContentBox): * LayoutReloaded/InitialBlockContainer.js: Added. (InitialBlockContainer): (InitialBlockContainer.prototype.establishesBlockFormattingContext): (InitialBlockContainer.prototype.paddingBox): (InitialBlockContainer.prototype.contentBox): * LayoutReloaded/InlineBox.js: Added. (InlineBox): (InlineBox.prototype.setText): (InlineBox.prototype.text): * LayoutReloaded/InlineFormattingContext.js: Added. (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._handleInlineBox): (InlineFormattingContext.prototype._handleText): * LayoutReloaded/Layout.js: Added. (layout): * LayoutReloaded/LayoutContext.js: Added. (LayoutContext): (LayoutContext.prototype.layoutFormattingContext): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: Added. * LayoutReloaded/LayoutReloaded.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: Added. * LayoutReloaded/README.md: Added. * LayoutReloaded/Text.js: Added. (Text): * LayoutReloaded/TreeBuilder.js: Added. (TreeBuilder.prototype.createTree): (TreeBuilder.prototype._createAndAttachBox): (TreeBuilder.prototype._appendChild): (TreeBuilder.prototype._findBox): (TreeBuilder.prototype._findNode): (TreeBuilder): * LayoutReloaded/Utils.js: Added. (LayoutPoint): (LayoutPoint.prototype.setLeft): (LayoutPoint.prototype.setTop): (LayoutPoint.prototype.left): (LayoutPoint.prototype.top): (LayoutPoint.prototype.shiftLeft): (LayoutPoint.prototype.shiftTop): (LayoutPoint.prototype.moveBy): (LayoutPoint.prototype.equal): (LayoutPoint.prototype.clone): (LayoutSize): (LayoutSize.prototype.setWidth): (LayoutSize.prototype.setHeight): (LayoutSize.prototype.width): (LayoutSize.prototype.height): (LayoutSize.prototype.growBy): (LayoutSize.prototype.shrinkBy): (LayoutSize.prototype.isEmpty): (LayoutSize.prototype.equal): (LayoutSize.prototype.clone): (LayoutRect): (LayoutRect.prototype.setTop): (LayoutRect.prototype.setLeft): (LayoutRect.prototype.setBottom): (LayoutRect.prototype.setRight): (LayoutRect.prototype.left): (LayoutRect.prototype.top): (LayoutRect.prototype.bottom): (LayoutRect.prototype.right): (LayoutRect.prototype.setTopLeft): (LayoutRect.prototype.topLeft): (LayoutRect.prototype.topRight): (LayoutRect.prototype.bottomRight): (LayoutRect.prototype.setWidth): (LayoutRect.prototype.setHeight): (LayoutRect.prototype.setSize): (LayoutRect.prototype.size): (LayoutRect.prototype.width): (LayoutRect.prototype.height): (LayoutRect.prototype.growBy): (LayoutRect.prototype.shrinkBy): (LayoutRect.prototype.moveBy): (LayoutRect.prototype.isEmpty): (LayoutRect.prototype.equal): (LayoutRect.prototype.intersects): (LayoutRect.prototype.contains): (LayoutRect.prototype.clone): (ASSERT_NOT_REACHED): (ASSERT): (Utils.computedValue): (Utils.propertyIsAuto): (Utils.isWidthAuto): (Utils.isHeightAuto): (Utils.isTopAuto): (Utils.isLeftAuto): (Utils.isBottomAuto): (Utils.isRightAuto): (Utils.width): (Utils.height): (Utils.top): (Utils.bottom): (Utils.left): (Utils.right): (Utils.hasBorderTop): (Utils.hasBorderBottom): (Utils.hasPaddingTop): (Utils.hasPaddingBottom): (Utils.computedMarginTop): (Utils.computedMarginLeft): (Utils.computedMarginBottom): (Utils.computedMarginRight): (Utils.computedBorderTopLeft): (Utils.computedBorderBottomRight): (Utils.computedPaddingTopLeft): (Utils.computedPaddingBottomRight): (Utils.computedBorderAndPaddingTop): (Utils.computedBorderAndPaddingLeft): (Utils.computedBorderAndPaddingBottom): (Utils.computedBorderAndPaddingRight): (Utils.computedHorizontalBorderAndPadding): (Utils.computedVerticalBorderAndPadding): (Utils.hasClear): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): (Utils.isBlockLevelElement): (Utils.isBlockContainerElement): (Utils.isInlineLevelElement): (Utils.isTableElement): (Utils.isRelativePositioned): (Utils.isAbsolutePositioned): (Utils.isFixedPositioned): (Utils.isOverflowVisible): (Utils.isFloatingPositioned): (Utils.isFloatingLeft): (Utils.mapToContainer): (Utils.mapStaticToAbsolute): (Utils.collectOutOfFlowDescendants): (Utils.nextBreakingOpportunity): (Utils.measureText): (Utils.layoutTreeDump): (Utils._dumpBox): (Utils._dumpTree): (Utils): * LayoutReloaded/misc/LayoutReloadedWebKit.patch: Added. * LayoutReloaded/misc/headers/BlockContainer.h: Added. * LayoutReloaded/misc/headers/BlockFormattingContext.h: Added. * LayoutReloaded/misc/headers/BlockMarginCollapse.h: Added. * LayoutReloaded/misc/headers/Box.h: Added. * LayoutReloaded/misc/headers/Container.h: Added. * LayoutReloaded/misc/headers/FloatingContext.h: Added. * LayoutReloaded/misc/headers/FormattingContext.h: Added. * LayoutReloaded/misc/headers/InitialBlockContainer.h: Added. * LayoutReloaded/misc/headers/InlineBox.h: Added. * LayoutReloaded/misc/headers/LayoutContext.h: Added. * LayoutReloaded/misc/headers/Text.h: Added. * LayoutReloaded/test/TestHarness.js: Added. (verifyLayoutTreeDump): (runLayout): * LayoutReloaded/test/absolute-auto-with-sibling-margin-bottom.html: Added. * LayoutReloaded/test/absolute-bottom.html: Added. * LayoutReloaded/test/absolute-height-stretch.html: Added. * LayoutReloaded/test/absolute-left-auto.html: Added. * LayoutReloaded/test/absolute-left-right-top-bottom-auto.html: Added. * LayoutReloaded/test/absolute-nested.html: Added. * LayoutReloaded/test/absolute-nested2.html: Added. * LayoutReloaded/test/absolute-simple.html: Added. * LayoutReloaded/test/absolute-width-shrink-to-fit.html: Added. * LayoutReloaded/test/absolute-width-stretch.html: Added. * LayoutReloaded/test/absolute-with-inline-preferred-width.html: Added. * LayoutReloaded/test/absolute-with-static-block-position-nested.html: Added. * LayoutReloaded/test/almost-intruding-left-float-simple.html: Added. * LayoutReloaded/test/border-simple.html: Added. * LayoutReloaded/test/fixed-nested.html: Added. * LayoutReloaded/test/float-left-when-container-has-padding-margin.html: Added. * LayoutReloaded/test/floating-box-clear-both-simple.html: Added. * LayoutReloaded/test/floating-box-clear-right-simple.html: Added. * LayoutReloaded/test/floating-box-left-and-right-multiple-with-top-offset.html: Added. * LayoutReloaded/test/floating-box-left-and-right-multiple.html: Added. * LayoutReloaded/test/floating-box-right-simple.html: Added. * LayoutReloaded/test/floating-box-with-clear-siblings.html: Added. * LayoutReloaded/test/floating-box-with-clear-simple.html: Added. * LayoutReloaded/test/floating-box-with-new-formatting-context.html: Added. * LayoutReloaded/test/floating-box-with-relative-positioned-sibling.html: Added. * LayoutReloaded/test/floating-left-right-simple.html: Added. * LayoutReloaded/test/floating-left-right-with-all-margins.html: Added. * LayoutReloaded/test/floating-lefts-and-rights-simple.html: Added. * LayoutReloaded/test/floating-multiple-lefts-in-body.html: Added. * LayoutReloaded/test/floating-multiple-lefts-multiple-lines.html: Added. * LayoutReloaded/test/floating-multiple-lefts.html: Added. * LayoutReloaded/test/floating-sizing.html: Added. * LayoutReloaded/test/floating-sizing2.html: Added. * LayoutReloaded/test/floating-sizing3.html: Added. * LayoutReloaded/test/floating-with-new-block-formatting-context.html: Added. * LayoutReloaded/test/index.html: Added. * LayoutReloaded/test/inline-content-simple.html: Added. * LayoutReloaded/test/intruding-left-float-simple.html: Added. * LayoutReloaded/test/margin-collapse-bottom-bottom.html: Added. * LayoutReloaded/test/margin-collapse-bottom-nested.html: Added. * LayoutReloaded/test/margin-collapse-first-last-are-floating.html: Added. * LayoutReloaded/test/margin-collapse-simple.html: Added. * LayoutReloaded/test/margin-collapse-top-nested.html: Added. * LayoutReloaded/test/margin-collapse-when-child-has-padding-border.html: Added. * LayoutReloaded/test/margin-collapse-with-block-formatting-context.html: Added. * LayoutReloaded/test/margin-collapse-with-block-formatting-context2.html: Added. * LayoutReloaded/test/margin-left-right-sizing-out-of-flow.html: Added. * LayoutReloaded/test/margin-left-right-sizing.html: Added. * LayoutReloaded/test/margin-propagation-simple-content-height.html: Added. * LayoutReloaded/test/margin-sibling-collapse-propagated.html: Added. * LayoutReloaded/test/margin-simple.html: Added. * LayoutReloaded/test/negative-margin-simple.html: Added. * LayoutReloaded/test/padding-nested.html: Added. * LayoutReloaded/test/padding-simple.html: Added. * LayoutReloaded/test/relative-auto-with-parent-offset.html: Added. * LayoutReloaded/test/relative-auto.html: Added. * LayoutReloaded/test/relative-bottom.html: Added. * LayoutReloaded/test/relative-right.html: Added. * LayoutReloaded/test/relative-siblings.html: Added. * LayoutReloaded/test/relative-simple.html: Added. Canonical link: https://commits.webkit.org/199175@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-09 19:10:37 +00:00
initialBlockContainer.setRendererName("RenderView");
renderTreeDump = renderTreeDump.substring(renderTreeDump.indexOf("|") + 1);
while (true) {
let endOfId = renderTreeDump.indexOf("(");
let boxId = parseInt(renderTreeDump.substring(0, endOfId));
let endOfParentId = renderTreeDump.indexOf(")");
let parentId = parseInt(renderTreeDump.substring(endOfId + 1, endOfParentId));
let endOfName = renderTreeDump.indexOf("|");
let name = renderTreeDump.substring(endOfParentId + 1, endOfName);
this._createAndAttachBox(initialBlockContainer, boxId, name, parentId);
if (endOfName == renderTreeDump.length - 1)
break;
renderTreeDump = renderTreeDump.substring(endOfName + 1);
}
return initialBlockContainer;
}
_createAndAttachBox(initialBlockContainer, id, name, parentId) {
let box = null;
let text = null;
let node = this._findNode(initialBlockContainer.node(), id, name);
if (name == "RenderBlock" || name == "RenderBody")
[LayoutReloaded] Introduce Layout namespace https://bugs.webkit.org/show_bug.cgi?id=183659 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. Box -> Layout.Box * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype.computeWidth): (BlockFormattingContext.prototype.computeHeight): (BlockFormattingContext.prototype.marginTop): (BlockFormattingContext.prototype.marginBottom): (BlockFormattingContext.prototype._computeStaticPosition): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._placeOutOfFlowDescendants): (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._horizontalConstraint): (BlockFormattingContext.prototype._contentHeight): (BlockFormattingContext.prototype._adjustBottomWithFIXME): (BlockFormattingContext.prototype._computeInFlowPositionedPosition): (BlockFormattingContext.prototype._computeOutOfFlowPosition): (BlockFormattingContext.prototype._shrinkToFitWidth): (BlockFormattingContext): (BlockFormattingContext.prototype._computeHorizontalConstraint): Deleted. (BlockFormattingContext.prototype._computeContentHeight): Deleted. * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse.marginTop): (BlockMarginCollapse.marginBottom): (BlockMarginCollapse._isMarginTopCollapsedWithSibling): (BlockMarginCollapse._isMarginBottomCollapsedWithSibling): (BlockMarginCollapse._isMarginTopCollapsedWithParent): (BlockMarginCollapse._isMarginBottomCollapsedWithParent): (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): (BlockMarginCollapse._hasAdjoiningMarginTopAndBottom): (BlockMarginCollapse): * LayoutReloaded/FormattingContext/FloatingContext.js: (FloatingContext.prototype.computePosition): (FloatingContext.prototype._positionForClear): (FloatingContext.prototype._computePositionToAvoidIntrudingFloats): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.computeWidth): (FormattingContext.prototype.computeHeight): (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): (FormattingContext.prototype.absoluteMarginBox): (FormattingContext.prototype.absoluteBorderBox): (FormattingContext.prototype.absolutePaddingBox): (FormattingContext.prototype.absoluteContentBox): (FormattingContext): * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js: (InlineFormattingContext.prototype.layout): * LayoutReloaded/LayoutTree/BlockContainer.js: (BlockContainer): Deleted. (BlockContainer.prototype.establishesInlineFormattingContext): Deleted. * LayoutReloaded/LayoutTree/Box.js: (Box): Deleted. (Box.prototype.id): Deleted. (Box.prototype.setRendererName): Deleted. (Box.prototype.name): Deleted. (Box.prototype.node): Deleted. (Box.prototype.parent): Deleted. (Box.prototype.nextSibling): Deleted. (Box.prototype.nextInFlowSibling): Deleted. (Box.prototype.previousSibling): Deleted. (Box.prototype.previousInFlowSibling): Deleted. (Box.prototype.setParent): Deleted. (Box.prototype.setNextSibling): Deleted. (Box.prototype.setPreviousSibling): Deleted. (Box.prototype.rect): Deleted. (Box.prototype.topLeft): Deleted. (Box.prototype.bottomRight): Deleted. (Box.prototype.setTopLeft): Deleted. (Box.prototype.setSize): Deleted. (Box.prototype.setWidth): Deleted. (Box.prototype.setHeight): Deleted. (Box.prototype.isContainer): Deleted. (Box.prototype.isBlockLevelBox): Deleted. (Box.prototype.isBlockContainerBox): Deleted. (Box.prototype.isInlineLevelBox): Deleted. (Box.prototype.setIsAnonymous): Deleted. (Box.prototype.isAnonymous): Deleted. (Box.prototype.establishesFormattingContext): Deleted. (Box.prototype.establishedFormattingContext): Deleted. (Box.prototype.establishesBlockFormattingContext): Deleted. (Box.prototype.establishesInlineFormattingContext): Deleted. (Box.prototype.isPositioned): Deleted. (Box.prototype.isRelativePositioned): Deleted. (Box.prototype.isAbsolutePositioned): Deleted. (Box.prototype.isFixedPositioned): Deleted. (Box.prototype.isInFlow): Deleted. (Box.prototype.isOutOfFlowPositioned): Deleted. (Box.prototype.isInFlowPositioned): Deleted. (Box.prototype.isFloatingPositioned): Deleted. (Box.prototype.isFloatingOrOutOfFlowPositioned): Deleted. (Box.prototype.isRootElement): Deleted. (Box.prototype.containingBlock): Deleted. (Box.prototype.borderBox): Deleted. (Box.prototype.paddingBox): Deleted. (Box.prototype.contentBox): Deleted. * LayoutReloaded/LayoutTree/Container.js: (Container): Deleted. (Container.prototype.isContainer): Deleted. (Container.prototype.setFirstChild): Deleted. (Container.prototype.setLastChild): Deleted. (Container.prototype.firstChild): Deleted. (Container.prototype.firstInFlowChild): Deleted. (Container.prototype.lastChild): Deleted. (Container.prototype.lastInFlowChild): Deleted. (Container.prototype.hasChild): Deleted. (Container.prototype.hasInFlowChild): Deleted. * LayoutReloaded/LayoutTree/InitialBlockContainer.js: (InitialBlockContainer): Deleted. (InitialBlockContainer.prototype.establishesBlockFormattingContext): Deleted. (InitialBlockContainer.prototype.paddingBox): Deleted. (InitialBlockContainer.prototype.contentBox): Deleted. * LayoutReloaded/LayoutTree/InlineBox.js: (InlineBox): Deleted. (InlineBox.prototype.setText): Deleted. (InlineBox.prototype.text): Deleted. * LayoutReloaded/TreeBuilder.js: (TreeBuilder.prototype.createTree): (TreeBuilder.prototype._createAndAttachBox): * LayoutReloaded/Utils.js: (Utils._dumpBox): Canonical link: https://commits.webkit.org/199303@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-15 15:59:46 +00:00
box = new Layout.BlockContainer(node, id);
else if (name == "RenderInline")
[LayoutReloaded] Introduce Layout namespace https://bugs.webkit.org/show_bug.cgi?id=183659 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. Box -> Layout.Box * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype.computeWidth): (BlockFormattingContext.prototype.computeHeight): (BlockFormattingContext.prototype.marginTop): (BlockFormattingContext.prototype.marginBottom): (BlockFormattingContext.prototype._computeStaticPosition): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._placeOutOfFlowDescendants): (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._horizontalConstraint): (BlockFormattingContext.prototype._contentHeight): (BlockFormattingContext.prototype._adjustBottomWithFIXME): (BlockFormattingContext.prototype._computeInFlowPositionedPosition): (BlockFormattingContext.prototype._computeOutOfFlowPosition): (BlockFormattingContext.prototype._shrinkToFitWidth): (BlockFormattingContext): (BlockFormattingContext.prototype._computeHorizontalConstraint): Deleted. (BlockFormattingContext.prototype._computeContentHeight): Deleted. * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse.marginTop): (BlockMarginCollapse.marginBottom): (BlockMarginCollapse._isMarginTopCollapsedWithSibling): (BlockMarginCollapse._isMarginBottomCollapsedWithSibling): (BlockMarginCollapse._isMarginTopCollapsedWithParent): (BlockMarginCollapse._isMarginBottomCollapsedWithParent): (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): (BlockMarginCollapse._hasAdjoiningMarginTopAndBottom): (BlockMarginCollapse): * LayoutReloaded/FormattingContext/FloatingContext.js: (FloatingContext.prototype.computePosition): (FloatingContext.prototype._positionForClear): (FloatingContext.prototype._computePositionToAvoidIntrudingFloats): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.computeWidth): (FormattingContext.prototype.computeHeight): (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): (FormattingContext.prototype.absoluteMarginBox): (FormattingContext.prototype.absoluteBorderBox): (FormattingContext.prototype.absolutePaddingBox): (FormattingContext.prototype.absoluteContentBox): (FormattingContext): * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js: (InlineFormattingContext.prototype.layout): * LayoutReloaded/LayoutTree/BlockContainer.js: (BlockContainer): Deleted. (BlockContainer.prototype.establishesInlineFormattingContext): Deleted. * LayoutReloaded/LayoutTree/Box.js: (Box): Deleted. (Box.prototype.id): Deleted. (Box.prototype.setRendererName): Deleted. (Box.prototype.name): Deleted. (Box.prototype.node): Deleted. (Box.prototype.parent): Deleted. (Box.prototype.nextSibling): Deleted. (Box.prototype.nextInFlowSibling): Deleted. (Box.prototype.previousSibling): Deleted. (Box.prototype.previousInFlowSibling): Deleted. (Box.prototype.setParent): Deleted. (Box.prototype.setNextSibling): Deleted. (Box.prototype.setPreviousSibling): Deleted. (Box.prototype.rect): Deleted. (Box.prototype.topLeft): Deleted. (Box.prototype.bottomRight): Deleted. (Box.prototype.setTopLeft): Deleted. (Box.prototype.setSize): Deleted. (Box.prototype.setWidth): Deleted. (Box.prototype.setHeight): Deleted. (Box.prototype.isContainer): Deleted. (Box.prototype.isBlockLevelBox): Deleted. (Box.prototype.isBlockContainerBox): Deleted. (Box.prototype.isInlineLevelBox): Deleted. (Box.prototype.setIsAnonymous): Deleted. (Box.prototype.isAnonymous): Deleted. (Box.prototype.establishesFormattingContext): Deleted. (Box.prototype.establishedFormattingContext): Deleted. (Box.prototype.establishesBlockFormattingContext): Deleted. (Box.prototype.establishesInlineFormattingContext): Deleted. (Box.prototype.isPositioned): Deleted. (Box.prototype.isRelativePositioned): Deleted. (Box.prototype.isAbsolutePositioned): Deleted. (Box.prototype.isFixedPositioned): Deleted. (Box.prototype.isInFlow): Deleted. (Box.prototype.isOutOfFlowPositioned): Deleted. (Box.prototype.isInFlowPositioned): Deleted. (Box.prototype.isFloatingPositioned): Deleted. (Box.prototype.isFloatingOrOutOfFlowPositioned): Deleted. (Box.prototype.isRootElement): Deleted. (Box.prototype.containingBlock): Deleted. (Box.prototype.borderBox): Deleted. (Box.prototype.paddingBox): Deleted. (Box.prototype.contentBox): Deleted. * LayoutReloaded/LayoutTree/Container.js: (Container): Deleted. (Container.prototype.isContainer): Deleted. (Container.prototype.setFirstChild): Deleted. (Container.prototype.setLastChild): Deleted. (Container.prototype.firstChild): Deleted. (Container.prototype.firstInFlowChild): Deleted. (Container.prototype.lastChild): Deleted. (Container.prototype.lastInFlowChild): Deleted. (Container.prototype.hasChild): Deleted. (Container.prototype.hasInFlowChild): Deleted. * LayoutReloaded/LayoutTree/InitialBlockContainer.js: (InitialBlockContainer): Deleted. (InitialBlockContainer.prototype.establishesBlockFormattingContext): Deleted. (InitialBlockContainer.prototype.paddingBox): Deleted. (InitialBlockContainer.prototype.contentBox): Deleted. * LayoutReloaded/LayoutTree/InlineBox.js: (InlineBox): Deleted. (InlineBox.prototype.setText): Deleted. (InlineBox.prototype.text): Deleted. * LayoutReloaded/TreeBuilder.js: (TreeBuilder.prototype.createTree): (TreeBuilder.prototype._createAndAttachBox): * LayoutReloaded/Utils.js: (Utils._dumpBox): Canonical link: https://commits.webkit.org/199303@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-15 15:59:46 +00:00
box = new Layout.InlineContainer(node, id);
else if (name == "RenderText")
[LayoutReloaded] Initial commit -block formatting context. https://bugs.webkit.org/show_bug.cgi?id=183462 Reviewed by Antti Koivisto. See README.md * LayoutReloaded/BlockContainer.js: Added. (BlockContainer): (BlockContainer.prototype.establishesInlineFormattingContext): * LayoutReloaded/BlockFormattingContext.js: Added. (BlockFormattingContext): (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype.computeWidth): (BlockFormattingContext.prototype.computeHeight): (BlockFormattingContext.prototype.marginTop): (BlockFormattingContext.prototype.marginBottom): (BlockFormattingContext.prototype._computeStaticPosition): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._placeOutOfFlowDescendants): (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._computeHorizontalConstraint): (BlockFormattingContext.prototype._computeContentHeight): (BlockFormattingContext.prototype._computeInFlowPositionedPosition): (BlockFormattingContext.prototype._computeOutOfFlowPosition): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/BlockMarginCollapse.js: Added. (BlockMarginCollapse.marginTop): (BlockMarginCollapse.marginBottom): (BlockMarginCollapse._isMarginTopCollapsedWithSibling): (BlockMarginCollapse._isMarginBottomCollapsedWithSibling): (BlockMarginCollapse._isMarginTopCollapsedWithParent): (BlockMarginCollapse._isMarginBottomCollapsedWithParent): (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): (BlockMarginCollapse._marginValue): (BlockMarginCollapse._hasAdjoiningMarginTopAndBottom): (BlockMarginCollapse): * LayoutReloaded/Box.js: Added. (Box): (Box.prototype.id): (Box.prototype.setRendererName): (Box.prototype.name): (Box.prototype.node): (Box.prototype.parent): (Box.prototype.nextSibling): (Box.prototype.nextInFlowSibling): (Box.prototype.previousSibling): (Box.prototype.previousInFlowSibling): (Box.prototype.setParent): (Box.prototype.setNextSibling): (Box.prototype.setPreviousSibling): (Box.prototype.rect): (Box.prototype.topLeft): (Box.prototype.bottomRight): (Box.prototype.setTopLeft): (Box.prototype.setSize): (Box.prototype.setWidth): (Box.prototype.setHeight): (Box.prototype.isContainer): (Box.prototype.isBlockLevelBox): (Box.prototype.isBlockContainerBox): (Box.prototype.isInlineLevelBox): (Box.prototype.setIsAnonymous): (Box.prototype.isAnonymous): (Box.prototype.establishesFormattingContext): (Box.prototype.establishedFormattingContext): (Box.prototype.establishesBlockFormattingContext): (Box.prototype.establishesInlineFormattingContext): (Box.prototype.isPositioned): (Box.prototype.isRelativePositioned): (Box.prototype.isAbsolutePositioned): (Box.prototype.isFixedPositioned): (Box.prototype.isInFlow): (Box.prototype.isOutOfFlowPositioned): (Box.prototype.isInFlowPositioned): (Box.prototype.isFloatingPositioned): (Box.prototype.isFloatingOrOutOfFlowPositioned): (Box.prototype.isRootElement): (Box.prototype.containingBlock): (Box.prototype.borderBox): (Box.prototype.paddingBox): (Box.prototype.contentBox): * LayoutReloaded/Container.js: Added. (Container): (Container.prototype.isContainer): (Container.prototype.setFirstChild): (Container.prototype.setLastChild): (Container.prototype.firstChild): (Container.prototype.firstInFlowChild): (Container.prototype.lastChild): (Container.prototype.lastInFlowChild): (Container.prototype.hasChild): (Container.prototype.hasInFlowChild): * LayoutReloaded/FloatingContext.js: Added. (FloatingContext): (FloatingContext.prototype.computePosition): (FloatingContext.prototype.bottom): (FloatingContext.prototype._positionForFloating): (FloatingContext.prototype._positionForClear): (FloatingContext.prototype._computePositionToAvoidIntrudingFloats): (FloatingContext.prototype._addFloating): (FloatingContext.prototype._findInnerMostLeftAndRight): (FloatingContext.prototype._moveToNextVerticalPosition): (FloatingContext.prototype._availableSpace): (FloatingContext.prototype._findFloatingAtVerticalPosition): (FloatingContext.prototype._isEmpty): (FloatingContext.prototype._adjustedFloatingPosition): (FloatingContext.prototype._bottom): (FloatingContext.prototype._formattingContext): * LayoutReloaded/FormattingContext.js: Added. (FormattingContext): (FormattingContext.prototype.rootContainer): (FormattingContext.prototype.floatingContext): (FormattingContext.prototype.layout): (FormattingContext.prototype.computeWidth): (FormattingContext.prototype.computeHeight): (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): (FormattingContext.prototype.absoluteMarginBox): (FormattingContext.prototype.absoluteBorderBox): (FormattingContext.prototype.absolutePaddingBox): (FormattingContext.prototype.absoluteContentBox): * LayoutReloaded/InitialBlockContainer.js: Added. (InitialBlockContainer): (InitialBlockContainer.prototype.establishesBlockFormattingContext): (InitialBlockContainer.prototype.paddingBox): (InitialBlockContainer.prototype.contentBox): * LayoutReloaded/InlineBox.js: Added. (InlineBox): (InlineBox.prototype.setText): (InlineBox.prototype.text): * LayoutReloaded/InlineFormattingContext.js: Added. (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._handleInlineBox): (InlineFormattingContext.prototype._handleText): * LayoutReloaded/Layout.js: Added. (layout): * LayoutReloaded/LayoutContext.js: Added. (LayoutContext): (LayoutContext.prototype.layoutFormattingContext): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: Added. * LayoutReloaded/LayoutReloaded.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: Added. * LayoutReloaded/README.md: Added. * LayoutReloaded/Text.js: Added. (Text): * LayoutReloaded/TreeBuilder.js: Added. (TreeBuilder.prototype.createTree): (TreeBuilder.prototype._createAndAttachBox): (TreeBuilder.prototype._appendChild): (TreeBuilder.prototype._findBox): (TreeBuilder.prototype._findNode): (TreeBuilder): * LayoutReloaded/Utils.js: Added. (LayoutPoint): (LayoutPoint.prototype.setLeft): (LayoutPoint.prototype.setTop): (LayoutPoint.prototype.left): (LayoutPoint.prototype.top): (LayoutPoint.prototype.shiftLeft): (LayoutPoint.prototype.shiftTop): (LayoutPoint.prototype.moveBy): (LayoutPoint.prototype.equal): (LayoutPoint.prototype.clone): (LayoutSize): (LayoutSize.prototype.setWidth): (LayoutSize.prototype.setHeight): (LayoutSize.prototype.width): (LayoutSize.prototype.height): (LayoutSize.prototype.growBy): (LayoutSize.prototype.shrinkBy): (LayoutSize.prototype.isEmpty): (LayoutSize.prototype.equal): (LayoutSize.prototype.clone): (LayoutRect): (LayoutRect.prototype.setTop): (LayoutRect.prototype.setLeft): (LayoutRect.prototype.setBottom): (LayoutRect.prototype.setRight): (LayoutRect.prototype.left): (LayoutRect.prototype.top): (LayoutRect.prototype.bottom): (LayoutRect.prototype.right): (LayoutRect.prototype.setTopLeft): (LayoutRect.prototype.topLeft): (LayoutRect.prototype.topRight): (LayoutRect.prototype.bottomRight): (LayoutRect.prototype.setWidth): (LayoutRect.prototype.setHeight): (LayoutRect.prototype.setSize): (LayoutRect.prototype.size): (LayoutRect.prototype.width): (LayoutRect.prototype.height): (LayoutRect.prototype.growBy): (LayoutRect.prototype.shrinkBy): (LayoutRect.prototype.moveBy): (LayoutRect.prototype.isEmpty): (LayoutRect.prototype.equal): (LayoutRect.prototype.intersects): (LayoutRect.prototype.contains): (LayoutRect.prototype.clone): (ASSERT_NOT_REACHED): (ASSERT): (Utils.computedValue): (Utils.propertyIsAuto): (Utils.isWidthAuto): (Utils.isHeightAuto): (Utils.isTopAuto): (Utils.isLeftAuto): (Utils.isBottomAuto): (Utils.isRightAuto): (Utils.width): (Utils.height): (Utils.top): (Utils.bottom): (Utils.left): (Utils.right): (Utils.hasBorderTop): (Utils.hasBorderBottom): (Utils.hasPaddingTop): (Utils.hasPaddingBottom): (Utils.computedMarginTop): (Utils.computedMarginLeft): (Utils.computedMarginBottom): (Utils.computedMarginRight): (Utils.computedBorderTopLeft): (Utils.computedBorderBottomRight): (Utils.computedPaddingTopLeft): (Utils.computedPaddingBottomRight): (Utils.computedBorderAndPaddingTop): (Utils.computedBorderAndPaddingLeft): (Utils.computedBorderAndPaddingBottom): (Utils.computedBorderAndPaddingRight): (Utils.computedHorizontalBorderAndPadding): (Utils.computedVerticalBorderAndPadding): (Utils.hasClear): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): (Utils.isBlockLevelElement): (Utils.isBlockContainerElement): (Utils.isInlineLevelElement): (Utils.isTableElement): (Utils.isRelativePositioned): (Utils.isAbsolutePositioned): (Utils.isFixedPositioned): (Utils.isOverflowVisible): (Utils.isFloatingPositioned): (Utils.isFloatingLeft): (Utils.mapToContainer): (Utils.mapStaticToAbsolute): (Utils.collectOutOfFlowDescendants): (Utils.nextBreakingOpportunity): (Utils.measureText): (Utils.layoutTreeDump): (Utils._dumpBox): (Utils._dumpTree): (Utils): * LayoutReloaded/misc/LayoutReloadedWebKit.patch: Added. * LayoutReloaded/misc/headers/BlockContainer.h: Added. * LayoutReloaded/misc/headers/BlockFormattingContext.h: Added. * LayoutReloaded/misc/headers/BlockMarginCollapse.h: Added. * LayoutReloaded/misc/headers/Box.h: Added. * LayoutReloaded/misc/headers/Container.h: Added. * LayoutReloaded/misc/headers/FloatingContext.h: Added. * LayoutReloaded/misc/headers/FormattingContext.h: Added. * LayoutReloaded/misc/headers/InitialBlockContainer.h: Added. * LayoutReloaded/misc/headers/InlineBox.h: Added. * LayoutReloaded/misc/headers/LayoutContext.h: Added. * LayoutReloaded/misc/headers/Text.h: Added. * LayoutReloaded/test/TestHarness.js: Added. (verifyLayoutTreeDump): (runLayout): * LayoutReloaded/test/absolute-auto-with-sibling-margin-bottom.html: Added. * LayoutReloaded/test/absolute-bottom.html: Added. * LayoutReloaded/test/absolute-height-stretch.html: Added. * LayoutReloaded/test/absolute-left-auto.html: Added. * LayoutReloaded/test/absolute-left-right-top-bottom-auto.html: Added. * LayoutReloaded/test/absolute-nested.html: Added. * LayoutReloaded/test/absolute-nested2.html: Added. * LayoutReloaded/test/absolute-simple.html: Added. * LayoutReloaded/test/absolute-width-shrink-to-fit.html: Added. * LayoutReloaded/test/absolute-width-stretch.html: Added. * LayoutReloaded/test/absolute-with-inline-preferred-width.html: Added. * LayoutReloaded/test/absolute-with-static-block-position-nested.html: Added. * LayoutReloaded/test/almost-intruding-left-float-simple.html: Added. * LayoutReloaded/test/border-simple.html: Added. * LayoutReloaded/test/fixed-nested.html: Added. * LayoutReloaded/test/float-left-when-container-has-padding-margin.html: Added. * LayoutReloaded/test/floating-box-clear-both-simple.html: Added. * LayoutReloaded/test/floating-box-clear-right-simple.html: Added. * LayoutReloaded/test/floating-box-left-and-right-multiple-with-top-offset.html: Added. * LayoutReloaded/test/floating-box-left-and-right-multiple.html: Added. * LayoutReloaded/test/floating-box-right-simple.html: Added. * LayoutReloaded/test/floating-box-with-clear-siblings.html: Added. * LayoutReloaded/test/floating-box-with-clear-simple.html: Added. * LayoutReloaded/test/floating-box-with-new-formatting-context.html: Added. * LayoutReloaded/test/floating-box-with-relative-positioned-sibling.html: Added. * LayoutReloaded/test/floating-left-right-simple.html: Added. * LayoutReloaded/test/floating-left-right-with-all-margins.html: Added. * LayoutReloaded/test/floating-lefts-and-rights-simple.html: Added. * LayoutReloaded/test/floating-multiple-lefts-in-body.html: Added. * LayoutReloaded/test/floating-multiple-lefts-multiple-lines.html: Added. * LayoutReloaded/test/floating-multiple-lefts.html: Added. * LayoutReloaded/test/floating-sizing.html: Added. * LayoutReloaded/test/floating-sizing2.html: Added. * LayoutReloaded/test/floating-sizing3.html: Added. * LayoutReloaded/test/floating-with-new-block-formatting-context.html: Added. * LayoutReloaded/test/index.html: Added. * LayoutReloaded/test/inline-content-simple.html: Added. * LayoutReloaded/test/intruding-left-float-simple.html: Added. * LayoutReloaded/test/margin-collapse-bottom-bottom.html: Added. * LayoutReloaded/test/margin-collapse-bottom-nested.html: Added. * LayoutReloaded/test/margin-collapse-first-last-are-floating.html: Added. * LayoutReloaded/test/margin-collapse-simple.html: Added. * LayoutReloaded/test/margin-collapse-top-nested.html: Added. * LayoutReloaded/test/margin-collapse-when-child-has-padding-border.html: Added. * LayoutReloaded/test/margin-collapse-with-block-formatting-context.html: Added. * LayoutReloaded/test/margin-collapse-with-block-formatting-context2.html: Added. * LayoutReloaded/test/margin-left-right-sizing-out-of-flow.html: Added. * LayoutReloaded/test/margin-left-right-sizing.html: Added. * LayoutReloaded/test/margin-propagation-simple-content-height.html: Added. * LayoutReloaded/test/margin-sibling-collapse-propagated.html: Added. * LayoutReloaded/test/margin-simple.html: Added. * LayoutReloaded/test/negative-margin-simple.html: Added. * LayoutReloaded/test/padding-nested.html: Added. * LayoutReloaded/test/padding-simple.html: Added. * LayoutReloaded/test/relative-auto-with-parent-offset.html: Added. * LayoutReloaded/test/relative-auto.html: Added. * LayoutReloaded/test/relative-bottom.html: Added. * LayoutReloaded/test/relative-right.html: Added. * LayoutReloaded/test/relative-siblings.html: Added. * LayoutReloaded/test/relative-simple.html: Added. Canonical link: https://commits.webkit.org/199175@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-09 19:10:37 +00:00
text = new Text(node, id);
else if (name == "RenderImage")
box = new Layout.InlineBox(node, id);
else
[LayoutReloaded] Introduce Layout namespace https://bugs.webkit.org/show_bug.cgi?id=183659 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. Box -> Layout.Box * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype.computeWidth): (BlockFormattingContext.prototype.computeHeight): (BlockFormattingContext.prototype.marginTop): (BlockFormattingContext.prototype.marginBottom): (BlockFormattingContext.prototype._computeStaticPosition): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._placeOutOfFlowDescendants): (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._horizontalConstraint): (BlockFormattingContext.prototype._contentHeight): (BlockFormattingContext.prototype._adjustBottomWithFIXME): (BlockFormattingContext.prototype._computeInFlowPositionedPosition): (BlockFormattingContext.prototype._computeOutOfFlowPosition): (BlockFormattingContext.prototype._shrinkToFitWidth): (BlockFormattingContext): (BlockFormattingContext.prototype._computeHorizontalConstraint): Deleted. (BlockFormattingContext.prototype._computeContentHeight): Deleted. * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse.marginTop): (BlockMarginCollapse.marginBottom): (BlockMarginCollapse._isMarginTopCollapsedWithSibling): (BlockMarginCollapse._isMarginBottomCollapsedWithSibling): (BlockMarginCollapse._isMarginTopCollapsedWithParent): (BlockMarginCollapse._isMarginBottomCollapsedWithParent): (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): (BlockMarginCollapse._hasAdjoiningMarginTopAndBottom): (BlockMarginCollapse): * LayoutReloaded/FormattingContext/FloatingContext.js: (FloatingContext.prototype.computePosition): (FloatingContext.prototype._positionForClear): (FloatingContext.prototype._computePositionToAvoidIntrudingFloats): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.computeWidth): (FormattingContext.prototype.computeHeight): (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): (FormattingContext.prototype.absoluteMarginBox): (FormattingContext.prototype.absoluteBorderBox): (FormattingContext.prototype.absolutePaddingBox): (FormattingContext.prototype.absoluteContentBox): (FormattingContext): * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js: (InlineFormattingContext.prototype.layout): * LayoutReloaded/LayoutTree/BlockContainer.js: (BlockContainer): Deleted. (BlockContainer.prototype.establishesInlineFormattingContext): Deleted. * LayoutReloaded/LayoutTree/Box.js: (Box): Deleted. (Box.prototype.id): Deleted. (Box.prototype.setRendererName): Deleted. (Box.prototype.name): Deleted. (Box.prototype.node): Deleted. (Box.prototype.parent): Deleted. (Box.prototype.nextSibling): Deleted. (Box.prototype.nextInFlowSibling): Deleted. (Box.prototype.previousSibling): Deleted. (Box.prototype.previousInFlowSibling): Deleted. (Box.prototype.setParent): Deleted. (Box.prototype.setNextSibling): Deleted. (Box.prototype.setPreviousSibling): Deleted. (Box.prototype.rect): Deleted. (Box.prototype.topLeft): Deleted. (Box.prototype.bottomRight): Deleted. (Box.prototype.setTopLeft): Deleted. (Box.prototype.setSize): Deleted. (Box.prototype.setWidth): Deleted. (Box.prototype.setHeight): Deleted. (Box.prototype.isContainer): Deleted. (Box.prototype.isBlockLevelBox): Deleted. (Box.prototype.isBlockContainerBox): Deleted. (Box.prototype.isInlineLevelBox): Deleted. (Box.prototype.setIsAnonymous): Deleted. (Box.prototype.isAnonymous): Deleted. (Box.prototype.establishesFormattingContext): Deleted. (Box.prototype.establishedFormattingContext): Deleted. (Box.prototype.establishesBlockFormattingContext): Deleted. (Box.prototype.establishesInlineFormattingContext): Deleted. (Box.prototype.isPositioned): Deleted. (Box.prototype.isRelativePositioned): Deleted. (Box.prototype.isAbsolutePositioned): Deleted. (Box.prototype.isFixedPositioned): Deleted. (Box.prototype.isInFlow): Deleted. (Box.prototype.isOutOfFlowPositioned): Deleted. (Box.prototype.isInFlowPositioned): Deleted. (Box.prototype.isFloatingPositioned): Deleted. (Box.prototype.isFloatingOrOutOfFlowPositioned): Deleted. (Box.prototype.isRootElement): Deleted. (Box.prototype.containingBlock): Deleted. (Box.prototype.borderBox): Deleted. (Box.prototype.paddingBox): Deleted. (Box.prototype.contentBox): Deleted. * LayoutReloaded/LayoutTree/Container.js: (Container): Deleted. (Container.prototype.isContainer): Deleted. (Container.prototype.setFirstChild): Deleted. (Container.prototype.setLastChild): Deleted. (Container.prototype.firstChild): Deleted. (Container.prototype.firstInFlowChild): Deleted. (Container.prototype.lastChild): Deleted. (Container.prototype.lastInFlowChild): Deleted. (Container.prototype.hasChild): Deleted. (Container.prototype.hasInFlowChild): Deleted. * LayoutReloaded/LayoutTree/InitialBlockContainer.js: (InitialBlockContainer): Deleted. (InitialBlockContainer.prototype.establishesBlockFormattingContext): Deleted. (InitialBlockContainer.prototype.paddingBox): Deleted. (InitialBlockContainer.prototype.contentBox): Deleted. * LayoutReloaded/LayoutTree/InlineBox.js: (InlineBox): Deleted. (InlineBox.prototype.setText): Deleted. (InlineBox.prototype.text): Deleted. * LayoutReloaded/TreeBuilder.js: (TreeBuilder.prototype.createTree): (TreeBuilder.prototype._createAndAttachBox): * LayoutReloaded/Utils.js: (Utils._dumpBox): Canonical link: https://commits.webkit.org/199303@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-15 15:59:46 +00:00
box = new Layout.Box(node, id);
[LayoutReloaded] Initial commit -block formatting context. https://bugs.webkit.org/show_bug.cgi?id=183462 Reviewed by Antti Koivisto. See README.md * LayoutReloaded/BlockContainer.js: Added. (BlockContainer): (BlockContainer.prototype.establishesInlineFormattingContext): * LayoutReloaded/BlockFormattingContext.js: Added. (BlockFormattingContext): (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype.computeWidth): (BlockFormattingContext.prototype.computeHeight): (BlockFormattingContext.prototype.marginTop): (BlockFormattingContext.prototype.marginBottom): (BlockFormattingContext.prototype._computeStaticPosition): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._placeOutOfFlowDescendants): (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._computeHorizontalConstraint): (BlockFormattingContext.prototype._computeContentHeight): (BlockFormattingContext.prototype._computeInFlowPositionedPosition): (BlockFormattingContext.prototype._computeOutOfFlowPosition): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/BlockMarginCollapse.js: Added. (BlockMarginCollapse.marginTop): (BlockMarginCollapse.marginBottom): (BlockMarginCollapse._isMarginTopCollapsedWithSibling): (BlockMarginCollapse._isMarginBottomCollapsedWithSibling): (BlockMarginCollapse._isMarginTopCollapsedWithParent): (BlockMarginCollapse._isMarginBottomCollapsedWithParent): (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): (BlockMarginCollapse._marginValue): (BlockMarginCollapse._hasAdjoiningMarginTopAndBottom): (BlockMarginCollapse): * LayoutReloaded/Box.js: Added. (Box): (Box.prototype.id): (Box.prototype.setRendererName): (Box.prototype.name): (Box.prototype.node): (Box.prototype.parent): (Box.prototype.nextSibling): (Box.prototype.nextInFlowSibling): (Box.prototype.previousSibling): (Box.prototype.previousInFlowSibling): (Box.prototype.setParent): (Box.prototype.setNextSibling): (Box.prototype.setPreviousSibling): (Box.prototype.rect): (Box.prototype.topLeft): (Box.prototype.bottomRight): (Box.prototype.setTopLeft): (Box.prototype.setSize): (Box.prototype.setWidth): (Box.prototype.setHeight): (Box.prototype.isContainer): (Box.prototype.isBlockLevelBox): (Box.prototype.isBlockContainerBox): (Box.prototype.isInlineLevelBox): (Box.prototype.setIsAnonymous): (Box.prototype.isAnonymous): (Box.prototype.establishesFormattingContext): (Box.prototype.establishedFormattingContext): (Box.prototype.establishesBlockFormattingContext): (Box.prototype.establishesInlineFormattingContext): (Box.prototype.isPositioned): (Box.prototype.isRelativePositioned): (Box.prototype.isAbsolutePositioned): (Box.prototype.isFixedPositioned): (Box.prototype.isInFlow): (Box.prototype.isOutOfFlowPositioned): (Box.prototype.isInFlowPositioned): (Box.prototype.isFloatingPositioned): (Box.prototype.isFloatingOrOutOfFlowPositioned): (Box.prototype.isRootElement): (Box.prototype.containingBlock): (Box.prototype.borderBox): (Box.prototype.paddingBox): (Box.prototype.contentBox): * LayoutReloaded/Container.js: Added. (Container): (Container.prototype.isContainer): (Container.prototype.setFirstChild): (Container.prototype.setLastChild): (Container.prototype.firstChild): (Container.prototype.firstInFlowChild): (Container.prototype.lastChild): (Container.prototype.lastInFlowChild): (Container.prototype.hasChild): (Container.prototype.hasInFlowChild): * LayoutReloaded/FloatingContext.js: Added. (FloatingContext): (FloatingContext.prototype.computePosition): (FloatingContext.prototype.bottom): (FloatingContext.prototype._positionForFloating): (FloatingContext.prototype._positionForClear): (FloatingContext.prototype._computePositionToAvoidIntrudingFloats): (FloatingContext.prototype._addFloating): (FloatingContext.prototype._findInnerMostLeftAndRight): (FloatingContext.prototype._moveToNextVerticalPosition): (FloatingContext.prototype._availableSpace): (FloatingContext.prototype._findFloatingAtVerticalPosition): (FloatingContext.prototype._isEmpty): (FloatingContext.prototype._adjustedFloatingPosition): (FloatingContext.prototype._bottom): (FloatingContext.prototype._formattingContext): * LayoutReloaded/FormattingContext.js: Added. (FormattingContext): (FormattingContext.prototype.rootContainer): (FormattingContext.prototype.floatingContext): (FormattingContext.prototype.layout): (FormattingContext.prototype.computeWidth): (FormattingContext.prototype.computeHeight): (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): (FormattingContext.prototype.absoluteMarginBox): (FormattingContext.prototype.absoluteBorderBox): (FormattingContext.prototype.absolutePaddingBox): (FormattingContext.prototype.absoluteContentBox): * LayoutReloaded/InitialBlockContainer.js: Added. (InitialBlockContainer): (InitialBlockContainer.prototype.establishesBlockFormattingContext): (InitialBlockContainer.prototype.paddingBox): (InitialBlockContainer.prototype.contentBox): * LayoutReloaded/InlineBox.js: Added. (InlineBox): (InlineBox.prototype.setText): (InlineBox.prototype.text): * LayoutReloaded/InlineFormattingContext.js: Added. (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._handleInlineBox): (InlineFormattingContext.prototype._handleText): * LayoutReloaded/Layout.js: Added. (layout): * LayoutReloaded/LayoutContext.js: Added. (LayoutContext): (LayoutContext.prototype.layoutFormattingContext): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: Added. * LayoutReloaded/LayoutReloaded.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: Added. * LayoutReloaded/README.md: Added. * LayoutReloaded/Text.js: Added. (Text): * LayoutReloaded/TreeBuilder.js: Added. (TreeBuilder.prototype.createTree): (TreeBuilder.prototype._createAndAttachBox): (TreeBuilder.prototype._appendChild): (TreeBuilder.prototype._findBox): (TreeBuilder.prototype._findNode): (TreeBuilder): * LayoutReloaded/Utils.js: Added. (LayoutPoint): (LayoutPoint.prototype.setLeft): (LayoutPoint.prototype.setTop): (LayoutPoint.prototype.left): (LayoutPoint.prototype.top): (LayoutPoint.prototype.shiftLeft): (LayoutPoint.prototype.shiftTop): (LayoutPoint.prototype.moveBy): (LayoutPoint.prototype.equal): (LayoutPoint.prototype.clone): (LayoutSize): (LayoutSize.prototype.setWidth): (LayoutSize.prototype.setHeight): (LayoutSize.prototype.width): (LayoutSize.prototype.height): (LayoutSize.prototype.growBy): (LayoutSize.prototype.shrinkBy): (LayoutSize.prototype.isEmpty): (LayoutSize.prototype.equal): (LayoutSize.prototype.clone): (LayoutRect): (LayoutRect.prototype.setTop): (LayoutRect.prototype.setLeft): (LayoutRect.prototype.setBottom): (LayoutRect.prototype.setRight): (LayoutRect.prototype.left): (LayoutRect.prototype.top): (LayoutRect.prototype.bottom): (LayoutRect.prototype.right): (LayoutRect.prototype.setTopLeft): (LayoutRect.prototype.topLeft): (LayoutRect.prototype.topRight): (LayoutRect.prototype.bottomRight): (LayoutRect.prototype.setWidth): (LayoutRect.prototype.setHeight): (LayoutRect.prototype.setSize): (LayoutRect.prototype.size): (LayoutRect.prototype.width): (LayoutRect.prototype.height): (LayoutRect.prototype.growBy): (LayoutRect.prototype.shrinkBy): (LayoutRect.prototype.moveBy): (LayoutRect.prototype.isEmpty): (LayoutRect.prototype.equal): (LayoutRect.prototype.intersects): (LayoutRect.prototype.contains): (LayoutRect.prototype.clone): (ASSERT_NOT_REACHED): (ASSERT): (Utils.computedValue): (Utils.propertyIsAuto): (Utils.isWidthAuto): (Utils.isHeightAuto): (Utils.isTopAuto): (Utils.isLeftAuto): (Utils.isBottomAuto): (Utils.isRightAuto): (Utils.width): (Utils.height): (Utils.top): (Utils.bottom): (Utils.left): (Utils.right): (Utils.hasBorderTop): (Utils.hasBorderBottom): (Utils.hasPaddingTop): (Utils.hasPaddingBottom): (Utils.computedMarginTop): (Utils.computedMarginLeft): (Utils.computedMarginBottom): (Utils.computedMarginRight): (Utils.computedBorderTopLeft): (Utils.computedBorderBottomRight): (Utils.computedPaddingTopLeft): (Utils.computedPaddingBottomRight): (Utils.computedBorderAndPaddingTop): (Utils.computedBorderAndPaddingLeft): (Utils.computedBorderAndPaddingBottom): (Utils.computedBorderAndPaddingRight): (Utils.computedHorizontalBorderAndPadding): (Utils.computedVerticalBorderAndPadding): (Utils.hasClear): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): (Utils.isBlockLevelElement): (Utils.isBlockContainerElement): (Utils.isInlineLevelElement): (Utils.isTableElement): (Utils.isRelativePositioned): (Utils.isAbsolutePositioned): (Utils.isFixedPositioned): (Utils.isOverflowVisible): (Utils.isFloatingPositioned): (Utils.isFloatingLeft): (Utils.mapToContainer): (Utils.mapStaticToAbsolute): (Utils.collectOutOfFlowDescendants): (Utils.nextBreakingOpportunity): (Utils.measureText): (Utils.layoutTreeDump): (Utils._dumpBox): (Utils._dumpTree): (Utils): * LayoutReloaded/misc/LayoutReloadedWebKit.patch: Added. * LayoutReloaded/misc/headers/BlockContainer.h: Added. * LayoutReloaded/misc/headers/BlockFormattingContext.h: Added. * LayoutReloaded/misc/headers/BlockMarginCollapse.h: Added. * LayoutReloaded/misc/headers/Box.h: Added. * LayoutReloaded/misc/headers/Container.h: Added. * LayoutReloaded/misc/headers/FloatingContext.h: Added. * LayoutReloaded/misc/headers/FormattingContext.h: Added. * LayoutReloaded/misc/headers/InitialBlockContainer.h: Added. * LayoutReloaded/misc/headers/InlineBox.h: Added. * LayoutReloaded/misc/headers/LayoutContext.h: Added. * LayoutReloaded/misc/headers/Text.h: Added. * LayoutReloaded/test/TestHarness.js: Added. (verifyLayoutTreeDump): (runLayout): * LayoutReloaded/test/absolute-auto-with-sibling-margin-bottom.html: Added. * LayoutReloaded/test/absolute-bottom.html: Added. * LayoutReloaded/test/absolute-height-stretch.html: Added. * LayoutReloaded/test/absolute-left-auto.html: Added. * LayoutReloaded/test/absolute-left-right-top-bottom-auto.html: Added. * LayoutReloaded/test/absolute-nested.html: Added. * LayoutReloaded/test/absolute-nested2.html: Added. * LayoutReloaded/test/absolute-simple.html: Added. * LayoutReloaded/test/absolute-width-shrink-to-fit.html: Added. * LayoutReloaded/test/absolute-width-stretch.html: Added. * LayoutReloaded/test/absolute-with-inline-preferred-width.html: Added. * LayoutReloaded/test/absolute-with-static-block-position-nested.html: Added. * LayoutReloaded/test/almost-intruding-left-float-simple.html: Added. * LayoutReloaded/test/border-simple.html: Added. * LayoutReloaded/test/fixed-nested.html: Added. * LayoutReloaded/test/float-left-when-container-has-padding-margin.html: Added. * LayoutReloaded/test/floating-box-clear-both-simple.html: Added. * LayoutReloaded/test/floating-box-clear-right-simple.html: Added. * LayoutReloaded/test/floating-box-left-and-right-multiple-with-top-offset.html: Added. * LayoutReloaded/test/floating-box-left-and-right-multiple.html: Added. * LayoutReloaded/test/floating-box-right-simple.html: Added. * LayoutReloaded/test/floating-box-with-clear-siblings.html: Added. * LayoutReloaded/test/floating-box-with-clear-simple.html: Added. * LayoutReloaded/test/floating-box-with-new-formatting-context.html: Added. * LayoutReloaded/test/floating-box-with-relative-positioned-sibling.html: Added. * LayoutReloaded/test/floating-left-right-simple.html: Added. * LayoutReloaded/test/floating-left-right-with-all-margins.html: Added. * LayoutReloaded/test/floating-lefts-and-rights-simple.html: Added. * LayoutReloaded/test/floating-multiple-lefts-in-body.html: Added. * LayoutReloaded/test/floating-multiple-lefts-multiple-lines.html: Added. * LayoutReloaded/test/floating-multiple-lefts.html: Added. * LayoutReloaded/test/floating-sizing.html: Added. * LayoutReloaded/test/floating-sizing2.html: Added. * LayoutReloaded/test/floating-sizing3.html: Added. * LayoutReloaded/test/floating-with-new-block-formatting-context.html: Added. * LayoutReloaded/test/index.html: Added. * LayoutReloaded/test/inline-content-simple.html: Added. * LayoutReloaded/test/intruding-left-float-simple.html: Added. * LayoutReloaded/test/margin-collapse-bottom-bottom.html: Added. * LayoutReloaded/test/margin-collapse-bottom-nested.html: Added. * LayoutReloaded/test/margin-collapse-first-last-are-floating.html: Added. * LayoutReloaded/test/margin-collapse-simple.html: Added. * LayoutReloaded/test/margin-collapse-top-nested.html: Added. * LayoutReloaded/test/margin-collapse-when-child-has-padding-border.html: Added. * LayoutReloaded/test/margin-collapse-with-block-formatting-context.html: Added. * LayoutReloaded/test/margin-collapse-with-block-formatting-context2.html: Added. * LayoutReloaded/test/margin-left-right-sizing-out-of-flow.html: Added. * LayoutReloaded/test/margin-left-right-sizing.html: Added. * LayoutReloaded/test/margin-propagation-simple-content-height.html: Added. * LayoutReloaded/test/margin-sibling-collapse-propagated.html: Added. * LayoutReloaded/test/margin-simple.html: Added. * LayoutReloaded/test/negative-margin-simple.html: Added. * LayoutReloaded/test/padding-nested.html: Added. * LayoutReloaded/test/padding-simple.html: Added. * LayoutReloaded/test/relative-auto-with-parent-offset.html: Added. * LayoutReloaded/test/relative-auto.html: Added. * LayoutReloaded/test/relative-bottom.html: Added. * LayoutReloaded/test/relative-right.html: Added. * LayoutReloaded/test/relative-siblings.html: Added. * LayoutReloaded/test/relative-simple.html: Added. Canonical link: https://commits.webkit.org/199175@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-09 19:10:37 +00:00
if (box)
box.setRendererName(name);
let parentBox = Utils.layoutBoxById(parentId, initialBlockContainer);
[LayoutReloaded] Initial commit -block formatting context. https://bugs.webkit.org/show_bug.cgi?id=183462 Reviewed by Antti Koivisto. See README.md * LayoutReloaded/BlockContainer.js: Added. (BlockContainer): (BlockContainer.prototype.establishesInlineFormattingContext): * LayoutReloaded/BlockFormattingContext.js: Added. (BlockFormattingContext): (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype.computeWidth): (BlockFormattingContext.prototype.computeHeight): (BlockFormattingContext.prototype.marginTop): (BlockFormattingContext.prototype.marginBottom): (BlockFormattingContext.prototype._computeStaticPosition): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._placeOutOfFlowDescendants): (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._computeHorizontalConstraint): (BlockFormattingContext.prototype._computeContentHeight): (BlockFormattingContext.prototype._computeInFlowPositionedPosition): (BlockFormattingContext.prototype._computeOutOfFlowPosition): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/BlockMarginCollapse.js: Added. (BlockMarginCollapse.marginTop): (BlockMarginCollapse.marginBottom): (BlockMarginCollapse._isMarginTopCollapsedWithSibling): (BlockMarginCollapse._isMarginBottomCollapsedWithSibling): (BlockMarginCollapse._isMarginTopCollapsedWithParent): (BlockMarginCollapse._isMarginBottomCollapsedWithParent): (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): (BlockMarginCollapse._marginValue): (BlockMarginCollapse._hasAdjoiningMarginTopAndBottom): (BlockMarginCollapse): * LayoutReloaded/Box.js: Added. (Box): (Box.prototype.id): (Box.prototype.setRendererName): (Box.prototype.name): (Box.prototype.node): (Box.prototype.parent): (Box.prototype.nextSibling): (Box.prototype.nextInFlowSibling): (Box.prototype.previousSibling): (Box.prototype.previousInFlowSibling): (Box.prototype.setParent): (Box.prototype.setNextSibling): (Box.prototype.setPreviousSibling): (Box.prototype.rect): (Box.prototype.topLeft): (Box.prototype.bottomRight): (Box.prototype.setTopLeft): (Box.prototype.setSize): (Box.prototype.setWidth): (Box.prototype.setHeight): (Box.prototype.isContainer): (Box.prototype.isBlockLevelBox): (Box.prototype.isBlockContainerBox): (Box.prototype.isInlineLevelBox): (Box.prototype.setIsAnonymous): (Box.prototype.isAnonymous): (Box.prototype.establishesFormattingContext): (Box.prototype.establishedFormattingContext): (Box.prototype.establishesBlockFormattingContext): (Box.prototype.establishesInlineFormattingContext): (Box.prototype.isPositioned): (Box.prototype.isRelativePositioned): (Box.prototype.isAbsolutePositioned): (Box.prototype.isFixedPositioned): (Box.prototype.isInFlow): (Box.prototype.isOutOfFlowPositioned): (Box.prototype.isInFlowPositioned): (Box.prototype.isFloatingPositioned): (Box.prototype.isFloatingOrOutOfFlowPositioned): (Box.prototype.isRootElement): (Box.prototype.containingBlock): (Box.prototype.borderBox): (Box.prototype.paddingBox): (Box.prototype.contentBox): * LayoutReloaded/Container.js: Added. (Container): (Container.prototype.isContainer): (Container.prototype.setFirstChild): (Container.prototype.setLastChild): (Container.prototype.firstChild): (Container.prototype.firstInFlowChild): (Container.prototype.lastChild): (Container.prototype.lastInFlowChild): (Container.prototype.hasChild): (Container.prototype.hasInFlowChild): * LayoutReloaded/FloatingContext.js: Added. (FloatingContext): (FloatingContext.prototype.computePosition): (FloatingContext.prototype.bottom): (FloatingContext.prototype._positionForFloating): (FloatingContext.prototype._positionForClear): (FloatingContext.prototype._computePositionToAvoidIntrudingFloats): (FloatingContext.prototype._addFloating): (FloatingContext.prototype._findInnerMostLeftAndRight): (FloatingContext.prototype._moveToNextVerticalPosition): (FloatingContext.prototype._availableSpace): (FloatingContext.prototype._findFloatingAtVerticalPosition): (FloatingContext.prototype._isEmpty): (FloatingContext.prototype._adjustedFloatingPosition): (FloatingContext.prototype._bottom): (FloatingContext.prototype._formattingContext): * LayoutReloaded/FormattingContext.js: Added. (FormattingContext): (FormattingContext.prototype.rootContainer): (FormattingContext.prototype.floatingContext): (FormattingContext.prototype.layout): (FormattingContext.prototype.computeWidth): (FormattingContext.prototype.computeHeight): (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): (FormattingContext.prototype.absoluteMarginBox): (FormattingContext.prototype.absoluteBorderBox): (FormattingContext.prototype.absolutePaddingBox): (FormattingContext.prototype.absoluteContentBox): * LayoutReloaded/InitialBlockContainer.js: Added. (InitialBlockContainer): (InitialBlockContainer.prototype.establishesBlockFormattingContext): (InitialBlockContainer.prototype.paddingBox): (InitialBlockContainer.prototype.contentBox): * LayoutReloaded/InlineBox.js: Added. (InlineBox): (InlineBox.prototype.setText): (InlineBox.prototype.text): * LayoutReloaded/InlineFormattingContext.js: Added. (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._handleInlineBox): (InlineFormattingContext.prototype._handleText): * LayoutReloaded/Layout.js: Added. (layout): * LayoutReloaded/LayoutContext.js: Added. (LayoutContext): (LayoutContext.prototype.layoutFormattingContext): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: Added. * LayoutReloaded/LayoutReloaded.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: Added. * LayoutReloaded/README.md: Added. * LayoutReloaded/Text.js: Added. (Text): * LayoutReloaded/TreeBuilder.js: Added. (TreeBuilder.prototype.createTree): (TreeBuilder.prototype._createAndAttachBox): (TreeBuilder.prototype._appendChild): (TreeBuilder.prototype._findBox): (TreeBuilder.prototype._findNode): (TreeBuilder): * LayoutReloaded/Utils.js: Added. (LayoutPoint): (LayoutPoint.prototype.setLeft): (LayoutPoint.prototype.setTop): (LayoutPoint.prototype.left): (LayoutPoint.prototype.top): (LayoutPoint.prototype.shiftLeft): (LayoutPoint.prototype.shiftTop): (LayoutPoint.prototype.moveBy): (LayoutPoint.prototype.equal): (LayoutPoint.prototype.clone): (LayoutSize): (LayoutSize.prototype.setWidth): (LayoutSize.prototype.setHeight): (LayoutSize.prototype.width): (LayoutSize.prototype.height): (LayoutSize.prototype.growBy): (LayoutSize.prototype.shrinkBy): (LayoutSize.prototype.isEmpty): (LayoutSize.prototype.equal): (LayoutSize.prototype.clone): (LayoutRect): (LayoutRect.prototype.setTop): (LayoutRect.prototype.setLeft): (LayoutRect.prototype.setBottom): (LayoutRect.prototype.setRight): (LayoutRect.prototype.left): (LayoutRect.prototype.top): (LayoutRect.prototype.bottom): (LayoutRect.prototype.right): (LayoutRect.prototype.setTopLeft): (LayoutRect.prototype.topLeft): (LayoutRect.prototype.topRight): (LayoutRect.prototype.bottomRight): (LayoutRect.prototype.setWidth): (LayoutRect.prototype.setHeight): (LayoutRect.prototype.setSize): (LayoutRect.prototype.size): (LayoutRect.prototype.width): (LayoutRect.prototype.height): (LayoutRect.prototype.growBy): (LayoutRect.prototype.shrinkBy): (LayoutRect.prototype.moveBy): (LayoutRect.prototype.isEmpty): (LayoutRect.prototype.equal): (LayoutRect.prototype.intersects): (LayoutRect.prototype.contains): (LayoutRect.prototype.clone): (ASSERT_NOT_REACHED): (ASSERT): (Utils.computedValue): (Utils.propertyIsAuto): (Utils.isWidthAuto): (Utils.isHeightAuto): (Utils.isTopAuto): (Utils.isLeftAuto): (Utils.isBottomAuto): (Utils.isRightAuto): (Utils.width): (Utils.height): (Utils.top): (Utils.bottom): (Utils.left): (Utils.right): (Utils.hasBorderTop): (Utils.hasBorderBottom): (Utils.hasPaddingTop): (Utils.hasPaddingBottom): (Utils.computedMarginTop): (Utils.computedMarginLeft): (Utils.computedMarginBottom): (Utils.computedMarginRight): (Utils.computedBorderTopLeft): (Utils.computedBorderBottomRight): (Utils.computedPaddingTopLeft): (Utils.computedPaddingBottomRight): (Utils.computedBorderAndPaddingTop): (Utils.computedBorderAndPaddingLeft): (Utils.computedBorderAndPaddingBottom): (Utils.computedBorderAndPaddingRight): (Utils.computedHorizontalBorderAndPadding): (Utils.computedVerticalBorderAndPadding): (Utils.hasClear): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): (Utils.isBlockLevelElement): (Utils.isBlockContainerElement): (Utils.isInlineLevelElement): (Utils.isTableElement): (Utils.isRelativePositioned): (Utils.isAbsolutePositioned): (Utils.isFixedPositioned): (Utils.isOverflowVisible): (Utils.isFloatingPositioned): (Utils.isFloatingLeft): (Utils.mapToContainer): (Utils.mapStaticToAbsolute): (Utils.collectOutOfFlowDescendants): (Utils.nextBreakingOpportunity): (Utils.measureText): (Utils.layoutTreeDump): (Utils._dumpBox): (Utils._dumpTree): (Utils): * LayoutReloaded/misc/LayoutReloadedWebKit.patch: Added. * LayoutReloaded/misc/headers/BlockContainer.h: Added. * LayoutReloaded/misc/headers/BlockFormattingContext.h: Added. * LayoutReloaded/misc/headers/BlockMarginCollapse.h: Added. * LayoutReloaded/misc/headers/Box.h: Added. * LayoutReloaded/misc/headers/Container.h: Added. * LayoutReloaded/misc/headers/FloatingContext.h: Added. * LayoutReloaded/misc/headers/FormattingContext.h: Added. * LayoutReloaded/misc/headers/InitialBlockContainer.h: Added. * LayoutReloaded/misc/headers/InlineBox.h: Added. * LayoutReloaded/misc/headers/LayoutContext.h: Added. * LayoutReloaded/misc/headers/Text.h: Added. * LayoutReloaded/test/TestHarness.js: Added. (verifyLayoutTreeDump): (runLayout): * LayoutReloaded/test/absolute-auto-with-sibling-margin-bottom.html: Added. * LayoutReloaded/test/absolute-bottom.html: Added. * LayoutReloaded/test/absolute-height-stretch.html: Added. * LayoutReloaded/test/absolute-left-auto.html: Added. * LayoutReloaded/test/absolute-left-right-top-bottom-auto.html: Added. * LayoutReloaded/test/absolute-nested.html: Added. * LayoutReloaded/test/absolute-nested2.html: Added. * LayoutReloaded/test/absolute-simple.html: Added. * LayoutReloaded/test/absolute-width-shrink-to-fit.html: Added. * LayoutReloaded/test/absolute-width-stretch.html: Added. * LayoutReloaded/test/absolute-with-inline-preferred-width.html: Added. * LayoutReloaded/test/absolute-with-static-block-position-nested.html: Added. * LayoutReloaded/test/almost-intruding-left-float-simple.html: Added. * LayoutReloaded/test/border-simple.html: Added. * LayoutReloaded/test/fixed-nested.html: Added. * LayoutReloaded/test/float-left-when-container-has-padding-margin.html: Added. * LayoutReloaded/test/floating-box-clear-both-simple.html: Added. * LayoutReloaded/test/floating-box-clear-right-simple.html: Added. * LayoutReloaded/test/floating-box-left-and-right-multiple-with-top-offset.html: Added. * LayoutReloaded/test/floating-box-left-and-right-multiple.html: Added. * LayoutReloaded/test/floating-box-right-simple.html: Added. * LayoutReloaded/test/floating-box-with-clear-siblings.html: Added. * LayoutReloaded/test/floating-box-with-clear-simple.html: Added. * LayoutReloaded/test/floating-box-with-new-formatting-context.html: Added. * LayoutReloaded/test/floating-box-with-relative-positioned-sibling.html: Added. * LayoutReloaded/test/floating-left-right-simple.html: Added. * LayoutReloaded/test/floating-left-right-with-all-margins.html: Added. * LayoutReloaded/test/floating-lefts-and-rights-simple.html: Added. * LayoutReloaded/test/floating-multiple-lefts-in-body.html: Added. * LayoutReloaded/test/floating-multiple-lefts-multiple-lines.html: Added. * LayoutReloaded/test/floating-multiple-lefts.html: Added. * LayoutReloaded/test/floating-sizing.html: Added. * LayoutReloaded/test/floating-sizing2.html: Added. * LayoutReloaded/test/floating-sizing3.html: Added. * LayoutReloaded/test/floating-with-new-block-formatting-context.html: Added. * LayoutReloaded/test/index.html: Added. * LayoutReloaded/test/inline-content-simple.html: Added. * LayoutReloaded/test/intruding-left-float-simple.html: Added. * LayoutReloaded/test/margin-collapse-bottom-bottom.html: Added. * LayoutReloaded/test/margin-collapse-bottom-nested.html: Added. * LayoutReloaded/test/margin-collapse-first-last-are-floating.html: Added. * LayoutReloaded/test/margin-collapse-simple.html: Added. * LayoutReloaded/test/margin-collapse-top-nested.html: Added. * LayoutReloaded/test/margin-collapse-when-child-has-padding-border.html: Added. * LayoutReloaded/test/margin-collapse-with-block-formatting-context.html: Added. * LayoutReloaded/test/margin-collapse-with-block-formatting-context2.html: Added. * LayoutReloaded/test/margin-left-right-sizing-out-of-flow.html: Added. * LayoutReloaded/test/margin-left-right-sizing.html: Added. * LayoutReloaded/test/margin-propagation-simple-content-height.html: Added. * LayoutReloaded/test/margin-sibling-collapse-propagated.html: Added. * LayoutReloaded/test/margin-simple.html: Added. * LayoutReloaded/test/negative-margin-simple.html: Added. * LayoutReloaded/test/padding-nested.html: Added. * LayoutReloaded/test/padding-simple.html: Added. * LayoutReloaded/test/relative-auto-with-parent-offset.html: Added. * LayoutReloaded/test/relative-auto.html: Added. * LayoutReloaded/test/relative-bottom.html: Added. * LayoutReloaded/test/relative-right.html: Added. * LayoutReloaded/test/relative-siblings.html: Added. * LayoutReloaded/test/relative-simple.html: Added. Canonical link: https://commits.webkit.org/199175@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-09 19:10:37 +00:00
// WebKit does not construct anonymous inline container for text if the text
// is a direct child of a block container.
[LayoutReloaded] Add support for InlineContainer https://bugs.webkit.org/show_bug.cgi?id=184394 Reviewed by Antti Koivisto. * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype._addToLayoutQueue): * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js: (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._handleInlineContent): (InlineFormattingContext.prototype._handleFloatingBox): (InlineFormattingContext.prototype._adjustLineForInlineContainerStart): (InlineFormattingContext.prototype._adjustLineForInlineContainerEnd): (InlineFormattingContext.prototype._placeInFlowPositionedChildren): (InlineFormattingContext.prototype._placeOutOfFlowDescendants): (InlineFormattingContext.prototype._createNewLine): (InlineFormattingContext.prototype._handleContent): Deleted. * LayoutReloaded/LayoutState.js: (LayoutState.prototype._createFormattingState): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.isContainer): (Layout.Box.prototype.isInlineContainer): (Layout.Box.prototype.isInlineBox): * LayoutReloaded/LayoutTree/Container.js: (Layout.Container.prototype.isContainer): Deleted. * LayoutReloaded/LayoutTree/InlineContainer.js: Added. (Layout.InlineContainer): * LayoutReloaded/TreeBuilder.js: (TreeBuilder.prototype._createAndAttachBox): * LayoutReloaded/Utils.js: (Utils._dumpBox): (Utils.precisionRound): (Utils): * LayoutReloaded/test/index.html: * LayoutReloaded/test/inline-content-simple2.html: Added. * LayoutReloaded/test/inline-floating1.html: Added. * LayoutReloaded/test/inline-formatting-context-floats1.html: Added. * LayoutReloaded/test/inline-formatting-context-floats2.html: Added. Canonical link: https://commits.webkit.org/199947@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230373 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-08 05:27:36 +00:00
if (text) {
[LayoutReloaded] Introduce Layout namespace https://bugs.webkit.org/show_bug.cgi?id=183659 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. Box -> Layout.Box * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype.computeWidth): (BlockFormattingContext.prototype.computeHeight): (BlockFormattingContext.prototype.marginTop): (BlockFormattingContext.prototype.marginBottom): (BlockFormattingContext.prototype._computeStaticPosition): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._placeOutOfFlowDescendants): (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._horizontalConstraint): (BlockFormattingContext.prototype._contentHeight): (BlockFormattingContext.prototype._adjustBottomWithFIXME): (BlockFormattingContext.prototype._computeInFlowPositionedPosition): (BlockFormattingContext.prototype._computeOutOfFlowPosition): (BlockFormattingContext.prototype._shrinkToFitWidth): (BlockFormattingContext): (BlockFormattingContext.prototype._computeHorizontalConstraint): Deleted. (BlockFormattingContext.prototype._computeContentHeight): Deleted. * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse.marginTop): (BlockMarginCollapse.marginBottom): (BlockMarginCollapse._isMarginTopCollapsedWithSibling): (BlockMarginCollapse._isMarginBottomCollapsedWithSibling): (BlockMarginCollapse._isMarginTopCollapsedWithParent): (BlockMarginCollapse._isMarginBottomCollapsedWithParent): (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): (BlockMarginCollapse._hasAdjoiningMarginTopAndBottom): (BlockMarginCollapse): * LayoutReloaded/FormattingContext/FloatingContext.js: (FloatingContext.prototype.computePosition): (FloatingContext.prototype._positionForClear): (FloatingContext.prototype._computePositionToAvoidIntrudingFloats): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.computeWidth): (FormattingContext.prototype.computeHeight): (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): (FormattingContext.prototype.absoluteMarginBox): (FormattingContext.prototype.absoluteBorderBox): (FormattingContext.prototype.absolutePaddingBox): (FormattingContext.prototype.absoluteContentBox): (FormattingContext): * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js: (InlineFormattingContext.prototype.layout): * LayoutReloaded/LayoutTree/BlockContainer.js: (BlockContainer): Deleted. (BlockContainer.prototype.establishesInlineFormattingContext): Deleted. * LayoutReloaded/LayoutTree/Box.js: (Box): Deleted. (Box.prototype.id): Deleted. (Box.prototype.setRendererName): Deleted. (Box.prototype.name): Deleted. (Box.prototype.node): Deleted. (Box.prototype.parent): Deleted. (Box.prototype.nextSibling): Deleted. (Box.prototype.nextInFlowSibling): Deleted. (Box.prototype.previousSibling): Deleted. (Box.prototype.previousInFlowSibling): Deleted. (Box.prototype.setParent): Deleted. (Box.prototype.setNextSibling): Deleted. (Box.prototype.setPreviousSibling): Deleted. (Box.prototype.rect): Deleted. (Box.prototype.topLeft): Deleted. (Box.prototype.bottomRight): Deleted. (Box.prototype.setTopLeft): Deleted. (Box.prototype.setSize): Deleted. (Box.prototype.setWidth): Deleted. (Box.prototype.setHeight): Deleted. (Box.prototype.isContainer): Deleted. (Box.prototype.isBlockLevelBox): Deleted. (Box.prototype.isBlockContainerBox): Deleted. (Box.prototype.isInlineLevelBox): Deleted. (Box.prototype.setIsAnonymous): Deleted. (Box.prototype.isAnonymous): Deleted. (Box.prototype.establishesFormattingContext): Deleted. (Box.prototype.establishedFormattingContext): Deleted. (Box.prototype.establishesBlockFormattingContext): Deleted. (Box.prototype.establishesInlineFormattingContext): Deleted. (Box.prototype.isPositioned): Deleted. (Box.prototype.isRelativePositioned): Deleted. (Box.prototype.isAbsolutePositioned): Deleted. (Box.prototype.isFixedPositioned): Deleted. (Box.prototype.isInFlow): Deleted. (Box.prototype.isOutOfFlowPositioned): Deleted. (Box.prototype.isInFlowPositioned): Deleted. (Box.prototype.isFloatingPositioned): Deleted. (Box.prototype.isFloatingOrOutOfFlowPositioned): Deleted. (Box.prototype.isRootElement): Deleted. (Box.prototype.containingBlock): Deleted. (Box.prototype.borderBox): Deleted. (Box.prototype.paddingBox): Deleted. (Box.prototype.contentBox): Deleted. * LayoutReloaded/LayoutTree/Container.js: (Container): Deleted. (Container.prototype.isContainer): Deleted. (Container.prototype.setFirstChild): Deleted. (Container.prototype.setLastChild): Deleted. (Container.prototype.firstChild): Deleted. (Container.prototype.firstInFlowChild): Deleted. (Container.prototype.lastChild): Deleted. (Container.prototype.lastInFlowChild): Deleted. (Container.prototype.hasChild): Deleted. (Container.prototype.hasInFlowChild): Deleted. * LayoutReloaded/LayoutTree/InitialBlockContainer.js: (InitialBlockContainer): Deleted. (InitialBlockContainer.prototype.establishesBlockFormattingContext): Deleted. (InitialBlockContainer.prototype.paddingBox): Deleted. (InitialBlockContainer.prototype.contentBox): Deleted. * LayoutReloaded/LayoutTree/InlineBox.js: (InlineBox): Deleted. (InlineBox.prototype.setText): Deleted. (InlineBox.prototype.text): Deleted. * LayoutReloaded/TreeBuilder.js: (TreeBuilder.prototype.createTree): (TreeBuilder.prototype._createAndAttachBox): * LayoutReloaded/Utils.js: (Utils._dumpBox): Canonical link: https://commits.webkit.org/199303@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-15 15:59:46 +00:00
box = new Layout.InlineBox(null, -1);
[LayoutReloaded] Initial commit -block formatting context. https://bugs.webkit.org/show_bug.cgi?id=183462 Reviewed by Antti Koivisto. See README.md * LayoutReloaded/BlockContainer.js: Added. (BlockContainer): (BlockContainer.prototype.establishesInlineFormattingContext): * LayoutReloaded/BlockFormattingContext.js: Added. (BlockFormattingContext): (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype.computeWidth): (BlockFormattingContext.prototype.computeHeight): (BlockFormattingContext.prototype.marginTop): (BlockFormattingContext.prototype.marginBottom): (BlockFormattingContext.prototype._computeStaticPosition): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._placeOutOfFlowDescendants): (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._computeHorizontalConstraint): (BlockFormattingContext.prototype._computeContentHeight): (BlockFormattingContext.prototype._computeInFlowPositionedPosition): (BlockFormattingContext.prototype._computeOutOfFlowPosition): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/BlockMarginCollapse.js: Added. (BlockMarginCollapse.marginTop): (BlockMarginCollapse.marginBottom): (BlockMarginCollapse._isMarginTopCollapsedWithSibling): (BlockMarginCollapse._isMarginBottomCollapsedWithSibling): (BlockMarginCollapse._isMarginTopCollapsedWithParent): (BlockMarginCollapse._isMarginBottomCollapsedWithParent): (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): (BlockMarginCollapse._marginValue): (BlockMarginCollapse._hasAdjoiningMarginTopAndBottom): (BlockMarginCollapse): * LayoutReloaded/Box.js: Added. (Box): (Box.prototype.id): (Box.prototype.setRendererName): (Box.prototype.name): (Box.prototype.node): (Box.prototype.parent): (Box.prototype.nextSibling): (Box.prototype.nextInFlowSibling): (Box.prototype.previousSibling): (Box.prototype.previousInFlowSibling): (Box.prototype.setParent): (Box.prototype.setNextSibling): (Box.prototype.setPreviousSibling): (Box.prototype.rect): (Box.prototype.topLeft): (Box.prototype.bottomRight): (Box.prototype.setTopLeft): (Box.prototype.setSize): (Box.prototype.setWidth): (Box.prototype.setHeight): (Box.prototype.isContainer): (Box.prototype.isBlockLevelBox): (Box.prototype.isBlockContainerBox): (Box.prototype.isInlineLevelBox): (Box.prototype.setIsAnonymous): (Box.prototype.isAnonymous): (Box.prototype.establishesFormattingContext): (Box.prototype.establishedFormattingContext): (Box.prototype.establishesBlockFormattingContext): (Box.prototype.establishesInlineFormattingContext): (Box.prototype.isPositioned): (Box.prototype.isRelativePositioned): (Box.prototype.isAbsolutePositioned): (Box.prototype.isFixedPositioned): (Box.prototype.isInFlow): (Box.prototype.isOutOfFlowPositioned): (Box.prototype.isInFlowPositioned): (Box.prototype.isFloatingPositioned): (Box.prototype.isFloatingOrOutOfFlowPositioned): (Box.prototype.isRootElement): (Box.prototype.containingBlock): (Box.prototype.borderBox): (Box.prototype.paddingBox): (Box.prototype.contentBox): * LayoutReloaded/Container.js: Added. (Container): (Container.prototype.isContainer): (Container.prototype.setFirstChild): (Container.prototype.setLastChild): (Container.prototype.firstChild): (Container.prototype.firstInFlowChild): (Container.prototype.lastChild): (Container.prototype.lastInFlowChild): (Container.prototype.hasChild): (Container.prototype.hasInFlowChild): * LayoutReloaded/FloatingContext.js: Added. (FloatingContext): (FloatingContext.prototype.computePosition): (FloatingContext.prototype.bottom): (FloatingContext.prototype._positionForFloating): (FloatingContext.prototype._positionForClear): (FloatingContext.prototype._computePositionToAvoidIntrudingFloats): (FloatingContext.prototype._addFloating): (FloatingContext.prototype._findInnerMostLeftAndRight): (FloatingContext.prototype._moveToNextVerticalPosition): (FloatingContext.prototype._availableSpace): (FloatingContext.prototype._findFloatingAtVerticalPosition): (FloatingContext.prototype._isEmpty): (FloatingContext.prototype._adjustedFloatingPosition): (FloatingContext.prototype._bottom): (FloatingContext.prototype._formattingContext): * LayoutReloaded/FormattingContext.js: Added. (FormattingContext): (FormattingContext.prototype.rootContainer): (FormattingContext.prototype.floatingContext): (FormattingContext.prototype.layout): (FormattingContext.prototype.computeWidth): (FormattingContext.prototype.computeHeight): (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): (FormattingContext.prototype.absoluteMarginBox): (FormattingContext.prototype.absoluteBorderBox): (FormattingContext.prototype.absolutePaddingBox): (FormattingContext.prototype.absoluteContentBox): * LayoutReloaded/InitialBlockContainer.js: Added. (InitialBlockContainer): (InitialBlockContainer.prototype.establishesBlockFormattingContext): (InitialBlockContainer.prototype.paddingBox): (InitialBlockContainer.prototype.contentBox): * LayoutReloaded/InlineBox.js: Added. (InlineBox): (InlineBox.prototype.setText): (InlineBox.prototype.text): * LayoutReloaded/InlineFormattingContext.js: Added. (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._handleInlineBox): (InlineFormattingContext.prototype._handleText): * LayoutReloaded/Layout.js: Added. (layout): * LayoutReloaded/LayoutContext.js: Added. (LayoutContext): (LayoutContext.prototype.layoutFormattingContext): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: Added. * LayoutReloaded/LayoutReloaded.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: Added. * LayoutReloaded/README.md: Added. * LayoutReloaded/Text.js: Added. (Text): * LayoutReloaded/TreeBuilder.js: Added. (TreeBuilder.prototype.createTree): (TreeBuilder.prototype._createAndAttachBox): (TreeBuilder.prototype._appendChild): (TreeBuilder.prototype._findBox): (TreeBuilder.prototype._findNode): (TreeBuilder): * LayoutReloaded/Utils.js: Added. (LayoutPoint): (LayoutPoint.prototype.setLeft): (LayoutPoint.prototype.setTop): (LayoutPoint.prototype.left): (LayoutPoint.prototype.top): (LayoutPoint.prototype.shiftLeft): (LayoutPoint.prototype.shiftTop): (LayoutPoint.prototype.moveBy): (LayoutPoint.prototype.equal): (LayoutPoint.prototype.clone): (LayoutSize): (LayoutSize.prototype.setWidth): (LayoutSize.prototype.setHeight): (LayoutSize.prototype.width): (LayoutSize.prototype.height): (LayoutSize.prototype.growBy): (LayoutSize.prototype.shrinkBy): (LayoutSize.prototype.isEmpty): (LayoutSize.prototype.equal): (LayoutSize.prototype.clone): (LayoutRect): (LayoutRect.prototype.setTop): (LayoutRect.prototype.setLeft): (LayoutRect.prototype.setBottom): (LayoutRect.prototype.setRight): (LayoutRect.prototype.left): (LayoutRect.prototype.top): (LayoutRect.prototype.bottom): (LayoutRect.prototype.right): (LayoutRect.prototype.setTopLeft): (LayoutRect.prototype.topLeft): (LayoutRect.prototype.topRight): (LayoutRect.prototype.bottomRight): (LayoutRect.prototype.setWidth): (LayoutRect.prototype.setHeight): (LayoutRect.prototype.setSize): (LayoutRect.prototype.size): (LayoutRect.prototype.width): (LayoutRect.prototype.height): (LayoutRect.prototype.growBy): (LayoutRect.prototype.shrinkBy): (LayoutRect.prototype.moveBy): (LayoutRect.prototype.isEmpty): (LayoutRect.prototype.equal): (LayoutRect.prototype.intersects): (LayoutRect.prototype.contains): (LayoutRect.prototype.clone): (ASSERT_NOT_REACHED): (ASSERT): (Utils.computedValue): (Utils.propertyIsAuto): (Utils.isWidthAuto): (Utils.isHeightAuto): (Utils.isTopAuto): (Utils.isLeftAuto): (Utils.isBottomAuto): (Utils.isRightAuto): (Utils.width): (Utils.height): (Utils.top): (Utils.bottom): (Utils.left): (Utils.right): (Utils.hasBorderTop): (Utils.hasBorderBottom): (Utils.hasPaddingTop): (Utils.hasPaddingBottom): (Utils.computedMarginTop): (Utils.computedMarginLeft): (Utils.computedMarginBottom): (Utils.computedMarginRight): (Utils.computedBorderTopLeft): (Utils.computedBorderBottomRight): (Utils.computedPaddingTopLeft): (Utils.computedPaddingBottomRight): (Utils.computedBorderAndPaddingTop): (Utils.computedBorderAndPaddingLeft): (Utils.computedBorderAndPaddingBottom): (Utils.computedBorderAndPaddingRight): (Utils.computedHorizontalBorderAndPadding): (Utils.computedVerticalBorderAndPadding): (Utils.hasClear): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): (Utils.isBlockLevelElement): (Utils.isBlockContainerElement): (Utils.isInlineLevelElement): (Utils.isTableElement): (Utils.isRelativePositioned): (Utils.isAbsolutePositioned): (Utils.isFixedPositioned): (Utils.isOverflowVisible): (Utils.isFloatingPositioned): (Utils.isFloatingLeft): (Utils.mapToContainer): (Utils.mapStaticToAbsolute): (Utils.collectOutOfFlowDescendants): (Utils.nextBreakingOpportunity): (Utils.measureText): (Utils.layoutTreeDump): (Utils._dumpBox): (Utils._dumpTree): (Utils): * LayoutReloaded/misc/LayoutReloadedWebKit.patch: Added. * LayoutReloaded/misc/headers/BlockContainer.h: Added. * LayoutReloaded/misc/headers/BlockFormattingContext.h: Added. * LayoutReloaded/misc/headers/BlockMarginCollapse.h: Added. * LayoutReloaded/misc/headers/Box.h: Added. * LayoutReloaded/misc/headers/Container.h: Added. * LayoutReloaded/misc/headers/FloatingContext.h: Added. * LayoutReloaded/misc/headers/FormattingContext.h: Added. * LayoutReloaded/misc/headers/InitialBlockContainer.h: Added. * LayoutReloaded/misc/headers/InlineBox.h: Added. * LayoutReloaded/misc/headers/LayoutContext.h: Added. * LayoutReloaded/misc/headers/Text.h: Added. * LayoutReloaded/test/TestHarness.js: Added. (verifyLayoutTreeDump): (runLayout): * LayoutReloaded/test/absolute-auto-with-sibling-margin-bottom.html: Added. * LayoutReloaded/test/absolute-bottom.html: Added. * LayoutReloaded/test/absolute-height-stretch.html: Added. * LayoutReloaded/test/absolute-left-auto.html: Added. * LayoutReloaded/test/absolute-left-right-top-bottom-auto.html: Added. * LayoutReloaded/test/absolute-nested.html: Added. * LayoutReloaded/test/absolute-nested2.html: Added. * LayoutReloaded/test/absolute-simple.html: Added. * LayoutReloaded/test/absolute-width-shrink-to-fit.html: Added. * LayoutReloaded/test/absolute-width-stretch.html: Added. * LayoutReloaded/test/absolute-with-inline-preferred-width.html: Added. * LayoutReloaded/test/absolute-with-static-block-position-nested.html: Added. * LayoutReloaded/test/almost-intruding-left-float-simple.html: Added. * LayoutReloaded/test/border-simple.html: Added. * LayoutReloaded/test/fixed-nested.html: Added. * LayoutReloaded/test/float-left-when-container-has-padding-margin.html: Added. * LayoutReloaded/test/floating-box-clear-both-simple.html: Added. * LayoutReloaded/test/floating-box-clear-right-simple.html: Added. * LayoutReloaded/test/floating-box-left-and-right-multiple-with-top-offset.html: Added. * LayoutReloaded/test/floating-box-left-and-right-multiple.html: Added. * LayoutReloaded/test/floating-box-right-simple.html: Added. * LayoutReloaded/test/floating-box-with-clear-siblings.html: Added. * LayoutReloaded/test/floating-box-with-clear-simple.html: Added. * LayoutReloaded/test/floating-box-with-new-formatting-context.html: Added. * LayoutReloaded/test/floating-box-with-relative-positioned-sibling.html: Added. * LayoutReloaded/test/floating-left-right-simple.html: Added. * LayoutReloaded/test/floating-left-right-with-all-margins.html: Added. * LayoutReloaded/test/floating-lefts-and-rights-simple.html: Added. * LayoutReloaded/test/floating-multiple-lefts-in-body.html: Added. * LayoutReloaded/test/floating-multiple-lefts-multiple-lines.html: Added. * LayoutReloaded/test/floating-multiple-lefts.html: Added. * LayoutReloaded/test/floating-sizing.html: Added. * LayoutReloaded/test/floating-sizing2.html: Added. * LayoutReloaded/test/floating-sizing3.html: Added. * LayoutReloaded/test/floating-with-new-block-formatting-context.html: Added. * LayoutReloaded/test/index.html: Added. * LayoutReloaded/test/inline-content-simple.html: Added. * LayoutReloaded/test/intruding-left-float-simple.html: Added. * LayoutReloaded/test/margin-collapse-bottom-bottom.html: Added. * LayoutReloaded/test/margin-collapse-bottom-nested.html: Added. * LayoutReloaded/test/margin-collapse-first-last-are-floating.html: Added. * LayoutReloaded/test/margin-collapse-simple.html: Added. * LayoutReloaded/test/margin-collapse-top-nested.html: Added. * LayoutReloaded/test/margin-collapse-when-child-has-padding-border.html: Added. * LayoutReloaded/test/margin-collapse-with-block-formatting-context.html: Added. * LayoutReloaded/test/margin-collapse-with-block-formatting-context2.html: Added. * LayoutReloaded/test/margin-left-right-sizing-out-of-flow.html: Added. * LayoutReloaded/test/margin-left-right-sizing.html: Added. * LayoutReloaded/test/margin-propagation-simple-content-height.html: Added. * LayoutReloaded/test/margin-sibling-collapse-propagated.html: Added. * LayoutReloaded/test/margin-simple.html: Added. * LayoutReloaded/test/negative-margin-simple.html: Added. * LayoutReloaded/test/padding-nested.html: Added. * LayoutReloaded/test/padding-simple.html: Added. * LayoutReloaded/test/relative-auto-with-parent-offset.html: Added. * LayoutReloaded/test/relative-auto.html: Added. * LayoutReloaded/test/relative-bottom.html: Added. * LayoutReloaded/test/relative-right.html: Added. * LayoutReloaded/test/relative-siblings.html: Added. * LayoutReloaded/test/relative-simple.html: Added. Canonical link: https://commits.webkit.org/199175@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-09 19:10:37 +00:00
box.setIsAnonymous();
box.setText(text);
}
this._appendChild(parentBox, box);
return box;
}
_appendChild(parent, child) {
child.setParent(parent);
let firstChild = parent.firstChild();
if (!firstChild) {
parent.setFirstChild(child);
parent.setLastChild(child);
return;
}
let lastChild = parent.lastChild();
lastChild.setNextSibling(child);
child.setPreviousSibling(lastChild);
parent.setLastChild(child);
}
_findNode(node, boxId) {
// Super inefficient but this is all temporary anyway.
for (let currentNode = node.firstChild; currentNode; currentNode = currentNode.nextSibling) {
if (currentNode.rendererId == boxId)
return currentNode;
let candidate = this._findNode(currentNode, boxId);
if (candidate)
return candidate;
}
}
}