haikuwebkit/Tools/LayoutReloaded/Utils.js

634 lines
19 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.
*/
class LayoutPoint {
constructor(top, left) {
this.m_top = top;
this.m_left = left;
}
setLeft(left) {
this.m_left = left;
}
setTop(top) {
this.m_top = top;
}
left() {
return this.m_left;
}
top() {
return this.m_top;
}
shiftLeft(distance) {
this.m_left += distance;
}
shiftTop(distance) {
this.m_top += distance;
}
moveBy(distance) {
if (distance.top && distance.left) {
this.m_top += distance.top();
this.m_left += distance.left();
}
else if (distance.width && distance.height) {
this.m_top += distance.height();
this.m_left += distance.width();
}
}
equal(other) {
return this.top() == other.top() && this.left() == other.left();
}
clone() {
return new LayoutPoint(this.top(), this.left());
}
}
class LayoutSize {
constructor(width, height) {
this.m_width = width;
this.m_height = height;
}
setWidth(width) {
this.m_width = width;
}
setHeight(height) {
this.m_height = height;
}
width() {
return this.m_width;
}
height() {
return this.m_height;
}
growBy(distance) {
this.m_width += distance.width();
this.m_height += distance.height();
}
shrinkBy(distance) {
this.m_width -= distance.width();
this.m_height -= distance.height();
}
isEmpty() {
return this.m_width <= 0 || this.m_height <= 0;
}
equal(other) {
return this.width() == other.width() && this.height() == other.height();
}
clone() {
return new LayoutSize(this.width(), this.height());
}
}
class LayoutRect {
constructor(topLeft, size) {
this.m_topLeft = topLeft.clone();
this.m_size = size.clone();
}
setTop(top) {
this.m_topLeft.setTop(top);
}
setLeft(left) {
this.m_topLeft.setLeft(left);
}
setBottom(bottom) {
this.m_size.setHeight(bottom - this.m_topLeft.top());
}
setRight(right) {
this.m_size.setWidth(right - this.m_topLeft.left());
}
left() {
return this.m_topLeft.left();
}
top() {
return this.m_topLeft.top();
}
bottom() {
return this.m_topLeft.top() + this.m_size.height();
}
right() {
return this.m_topLeft.left() + this.m_size.width();
}
setTopLeft(topLeft) {
this.m_topLeft = topLeft.clone();
}
topLeft() {
return this.m_topLeft.clone();
}
topRight() {
return new LayoutPoint(this.top(), this.right());
}
bottomRight() {
return new LayoutPoint(this.bottom(), this.right());
}
setWidth(width) {
this.m_size.setWidth(width);
}
setHeight(height) {
this.m_size.setHeight(height);
}
setSize(newSize) {
this.m_size = newSize.clone();
}
size() {
return this.m_size.clone();
}
width() {
return this.m_size.width();
}
height() {
return this.m_size.height();
}
growBy(distance) {
this.m_size.growBy(distance);
}
shrinkBy(distance) {
this.m_size.shrinkBy(distance);
}
moveBy(distance) {
this.m_topLeft.moveBy(distance);
}
growHorizontally(distance) {
this.m_size.setWidth(this.m_size.width() + distance);
}
moveHorizontally(distance) {
this.m_topLeft.shiftLeft(distance);
}
moveVertically(distance) {
this.m_topLeft.shiftTop(distance);
}
[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
isEmpty() {
return this.m_size.isEmpty();
}
equal(other) {
return this.m_topLeft.equal(other.topLeft()) && this.m_size.equal(other.size());
}
intersects(other) {
return !this.isEmpty() && !other.isEmpty()
&& this.left() < other.right() && other.left() < this.right()
&& this.top() < other.bottom() && other.top() < this.bottom();
}
contains(other) {
return this.left() <= other.left() && this.right() >= other.right()
&& this.top() <= other.top() && this.bottom() >= other.bottom();
}
clone() {
return new LayoutRect(this.topLeft().clone(), this.size().clone());
}
}
function ASSERT_NOT_REACHED() {
throw Error("Should not reach!");
}
function ASSERT(statement) {
if (statement)
return;
throw Error("Assertion failure");
}
class Utils {
static computedValue(strValue, baseValue) {
if (strValue.indexOf("px") > -1)
return parseFloat(strValue);
if (strValue.indexOf("%") > -1)
return parseFloat(strValue) * baseValue / 100;
return Number.NaN;
}
static propertyIsAuto(propertyName, box) {
if (box.isAnonymous())
return true;
return window.getComputedStyle(box.node()).isPropertyValueInitial(propertyName);
}
static isWidthAuto(box) {
return Utils.propertyIsAuto("width", box);
}
static isHeightAuto(box) {
return Utils.propertyIsAuto("height", box);
}
static isTopAuto(box) {
return Utils.propertyIsAuto("top", box);
}
static isLeftAuto(box) {
return Utils.propertyIsAuto("left", box);
}
static isBottomAuto(box) {
return Utils.propertyIsAuto("bottom", box);
}
static isRightAuto(box) {
return Utils.propertyIsAuto("right", box);
}
static width(box) {
ASSERT(!Utils.isWidthAuto(box));
return parseFloat(window.getComputedStyle(box.node()).width);
}
static height(box) {
ASSERT(!Utils.isHeightAuto(box));
return parseFloat(window.getComputedStyle(box.node()).height);
}
static top(box) {
return parseFloat(box.node().style.top);
}
static bottom(box) {
return parseFloat(box.node().style.bottom);
}
static left(box) {
return parseFloat(box.node().style.left);
}
static right(box) {
return parseFloat(box.node().style.right);
}
static hasBorderTop(box) {
return window.getComputedStyle(box.node()).borderTopWidth != "0px";
}
static hasBorderBottom(box) {
return window.getComputedStyle(box.node()).borderBottomWidth != "0px";
}
static hasPaddingTop(box) {
return window.getComputedStyle(box.node()).paddingTop != "0px";
}
static hasPaddingBottom(box) {
return window.getComputedStyle(box.node()).paddingBottom != "0px";
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedMarginTop(node) {
return Utils.computedValue(window.getComputedStyle(node).marginTop);
[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
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedMarginLeft(node) {
return Utils.computedValue(window.getComputedStyle(node).marginLeft);
[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
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedMarginBottom(node) {
return Utils.computedValue(window.getComputedStyle(node).marginBottom);
[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
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedMarginRight(node) {
return Utils.computedValue(window.getComputedStyle(node).marginRight);
[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
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedBorderTopLeft(node) {
[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
return new LayoutSize(Utils.computedValue(window.getComputedStyle(node).borderLeftWidth), Utils.computedValue(window.getComputedStyle(node).borderTopWidth));
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedBorderBottomRight(node) {
[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
return new LayoutSize(Utils.computedValue(window.getComputedStyle(node).borderRightWidth), Utils.computedValue(window.getComputedStyle(node).borderBottomWidth));
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedPaddingTopLeft(node) {
[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
return new LayoutSize(Utils.computedValue(window.getComputedStyle(node).paddingLeft), Utils.computedValue(window.getComputedStyle(node).paddingTop));
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedPaddingBottomRight(node) {
[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
return new LayoutSize(Utils.computedValue(window.getComputedStyle(node).paddingRight), Utils.computedValue(window.getComputedStyle(node).paddingBottom));
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedBorderAndPaddingTop(node) {
return Utils.computedBorderTopLeft(node).height() + Utils.computedPaddingTopLeft(node).height();
[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
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedBorderAndPaddingLeft(node) {
return Utils.computedBorderTopLeft(node).width() + Utils.computedPaddingTopLeft(node).width();
[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
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedBorderAndPaddingTop(node) {
return Utils.computedBorderTopLeft(node).height() + Utils.computedPaddingTopLeft(node).height();
[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
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedBorderAndPaddingLeft(node) {
return Utils.computedBorderTopLeft(node).width() + Utils.computedPaddingTopLeft(node).width();
[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
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedBorderAndPaddingBottom(node) {
return Utils.computedBorderBottomRight(node).height() + Utils.computedPaddingBottomRight(node).height();
[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
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedBorderAndPaddingRight(node) {
return Utils.computedBorderBottomRight(node).width() + Utils.computedPaddingBottomRight(node).width();
[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
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedHorizontalBorderAndPadding(node) {
return this.computedBorderAndPaddingLeft(node) + this.computedBorderAndPaddingRight(node);
[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
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedVerticalBorderAndPadding(node) {
return this.computedBorderAndPaddingTop(node) + this.computedBorderAndPaddingBottom(node);
[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
}
[LayoutReloaded] Utils.computed* functions should just take node instead of box. https://bugs.webkit.org/show_bug.cgi?id=183697 Reviewed by Antti Koivisto. This is in preparation for introducing the display tree. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeOutOfFlowWidth): (BlockFormattingContext.prototype._computeFloatingWidth): (BlockFormattingContext.prototype._computeInFlowWidth): (BlockFormattingContext.prototype._computeOutOfFlowHeight): (BlockFormattingContext.prototype._computeFloatingHeight): (BlockFormattingContext.prototype._computeInFlowHeight): (BlockFormattingContext.prototype._shrinkToFitWidth): * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: (BlockMarginCollapse._nonCollapsedMarginTop): (BlockMarginCollapse._nonCollapsedMarginBottom): (BlockMarginCollapse._collapsedMarginTopFromFirstChild): (BlockMarginCollapse._collapsedMarginBottomFromLastChild): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.marginTop): (FormattingContext.prototype.marginLeft): (FormattingContext.prototype.marginBottom): (FormattingContext.prototype.marginRight): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.paddingBox): (Layout.Box.prototype.contentBox): (Layout.Box): * LayoutReloaded/Utils.js: (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.computedLineHeight): (Utils.hasClearLeft): (Utils.hasClearRight): (Utils.hasClearBoth): Canonical link: https://commits.webkit.org/199336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 14:52:42 +00:00
static computedLineHeight(node) {
return Utils.computedValue(window.getComputedStyle(node).lineHeight);
}
[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
static hasClear(box) {
return Utils.hasClearLeft(box) || Utils.hasClearRight(box) || Utils.hasClearBoth(box);
}
static hasClearLeft(box) {
return window.getComputedStyle(box.node()).clear == "left";
}
static hasClearRight(box) {
return window.getComputedStyle(box.node()).clear == "right";
}
static hasClearBoth(box) {
return window.getComputedStyle(box.node()).clear == "both";
}
static isBlockLevelElement(node) {
if (!node)
return false;
let display = window.getComputedStyle(node).display;
return display == "block" || display == "list-item" || display == "table";
}
static isBlockContainerElement(node) {
if (!node || node.nodeType != Node.ELEMENT_NODE)
return false;
[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
let display = window.getComputedStyle(node).display;
return display == "block" || display == "list-item" || display == "inline-block" || display == "table-cell" || display == "table-caption"; //TODO && !replaced element
}
static isInlineLevelElement(node) {
let display = window.getComputedStyle(node).display;
return display == "inline" || display == "inline-block" || display == "inline-table";
}
static isTableElement(node) {
let display = window.getComputedStyle(node).display;
return display == "table" || display == "inline-table";
}
static isInlineBlockElement(node) {
if (!node || node.nodeType != Node.ELEMENT_NODE)
return false;
let display = window.getComputedStyle(node).display;
return display == "inline-block";
}
static isRelativelyPositioned(box) {
[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.isAnonymous())
return false;
let node = box.node();
return window.getComputedStyle(node).position == "relative";
}
static isAbsolutelyPositioned(box) {
[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.isAnonymous())
return false;
let node = box.node();
return window.getComputedStyle(node).position == "absolute";
}
static isFixedPositioned(box) {
if (box.isAnonymous())
return false;
let node = box.node();
return window.getComputedStyle(node).position == "fixed";
}
[LayoutReloaded] Move statically positioned absolute box positioning to _computeOutOfFlowPosition https://bugs.webkit.org/show_bug.cgi?id=183750 Reviewed by Antti Koivisto. * LayoutReloaded/DisplayTree/Box.js: (Display.Box.prototype.setTop): (Display.Box.prototype.paddingBox): (Display.Box.prototype.contentBox): (Display.Box): * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeStaticPosition): (BlockFormattingContext.prototype._layoutOutOfFlowDescendants): (BlockFormattingContext.prototype._computeOutOfFlowPosition): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.absoluteMarginBox): (FormattingContext.prototype.absoluteBorderBox): (FormattingContext.prototype.absolutePaddingBox): (FormattingContext.prototype.absoluteContentBox): (FormattingContext.prototype._toAbsolutePosition): (FormattingContext.prototype._toRootAbsolutePosition): (FormattingContext.prototype.toDisplayBox): * LayoutReloaded/LayoutTree/InitialBlockContainer.js: (Layout.InitialBlockContainer.prototype.establishesBlockFormattingContext): (Layout.InitialBlockContainer): (Layout.InitialBlockContainer.prototype.paddingBox): Deleted. (Layout.InitialBlockContainer.prototype.contentBox): Deleted. * LayoutReloaded/Utils.js: (Utils.isStaticallyPositioned): Canonical link: https://commits.webkit.org/199385@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-19 22:58:10 +00:00
static isStaticallyPositioned(box) {
if (box.isAnonymous())
return true;
let node = box.node();
return (Utils.propertyIsAuto("top", box) && Utils.propertyIsAuto("bottom", box)) || (Utils.propertyIsAuto("left", box) && Utils.propertyIsAuto("right", box));
}
[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
static isOverflowVisible(box) {
return window.getComputedStyle(box.node()).overflow == "visible";
}
static isFloatingPositioned(box) {
if (box.isAnonymous())
return false;
let node = box.node();
return window.getComputedStyle(node).float != "none";
}
static isFloatingLeft(box) {
let node = box.node();
return window.getComputedStyle(node).float == "left";
}
static mapPosition(position, box, container) {
ASSERT(box instanceof Display.Box);
ASSERT(container instanceof Display.Box);
if (box == container)
return position;
for (let ascendant = box.parent(); ascendant && ascendant != container; ascendant = ascendant.parent())
position.moveBy(ascendant.topLeft());
return position;
}
static marginBox(box, container) {
let marginBox = box.marginBox();
let mappedPosition = Utils.mapPosition(marginBox.topLeft(), box, container);
return new LayoutRect(mappedPosition, marginBox.size());
}
static borderBox(box, container) {
let borderBox = box.borderBox();
let mappedPosition = Utils.mapPosition(box.topLeft(), box, container);
mappedPosition.moveBy(borderBox.topLeft());
return new LayoutRect(mappedPosition, borderBox.size());
}
static contentBox(box, container) {
let contentBox = box.contentBox();
let mappedPosition = Utils.mapPosition(box.topLeft(), box, container);
mappedPosition.moveBy(contentBox.topLeft());
return new LayoutRect(mappedPosition, contentBox.size());
}
static textRuns(text, container) {
return window.collectTextRuns(text, container.node());
}
static textRunsForLine(text, availableSpace, container) {
return window.collectTextRuns(text, container.node(), availableSpace);
}
[LayoutReloaded] Add Line class for InlineFormattingContext -and move files around. https://bugs.webkit.org/show_bug.cgi?id=183551 Reviewed by Wenson Hsieh. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: Renamed from Tools/LayoutReloaded/BlockFormattingContext.js. (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/FormattingContext/BlockFormatting/BlockMarginCollapse.js: Renamed from Tools/LayoutReloaded/BlockMarginCollapse.js. (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/FormattingContext/FloatingContext.js: Renamed from Tools/LayoutReloaded/FloatingContext.js. (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/FormattingContext.js: Renamed from Tools/LayoutReloaded/FormattingContext.js. (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/FormattingContext/InlineFormatting/InlineFormattingContext.js: Renamed from Tools/LayoutReloaded/InlineFormattingContext.js. (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._handleInlineBox): (InlineFormattingContext.prototype._handleText): (InlineFormattingContext.prototype._commitLine): (InlineFormattingContext.prototype._line): * LayoutReloaded/FormattingContext/InlineFormatting/Line.js: Copied from Tools/LayoutReloaded/InitialBlockContainer.js. (Line): (Line.prototype.isEmpty): (Line.prototype.availableWidth): (Line.prototype.appendFragment): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: * LayoutReloaded/LayoutTree/BlockContainer.js: Renamed from Tools/LayoutReloaded/BlockContainer.js. (BlockContainer): (BlockContainer.prototype.establishesInlineFormattingContext): * LayoutReloaded/LayoutTree/Box.js: Renamed from Tools/LayoutReloaded/Box.js. (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/LayoutTree/Container.js: Renamed from Tools/LayoutReloaded/Container.js. (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/LayoutTree/InitialBlockContainer.js: Renamed from Tools/LayoutReloaded/InitialBlockContainer.js. (InitialBlockContainer): (InitialBlockContainer.prototype.establishesBlockFormattingContext): (InitialBlockContainer.prototype.paddingBox): (InitialBlockContainer.prototype.contentBox): * LayoutReloaded/LayoutTree/InlineBox.js: Renamed from Tools/LayoutReloaded/InlineBox.js. (InlineBox): (InlineBox.prototype.setText): (InlineBox.prototype.text): * LayoutReloaded/LayoutTree/Text.js: Renamed from Tools/LayoutReloaded/Text.js. (Text): (Text.prototype.node): (Text.prototype.content): (Text.prototype.length): * LayoutReloaded/Utils.js: (Utils.nextBreakingOpportunity): (Utils.measureText): * LayoutReloaded/misc/headers/Line.h: Copied from Tools/LayoutReloaded/misc/headers/Text.h. * LayoutReloaded/misc/headers/Text.h: * LayoutReloaded/test/border-simple.html: * LayoutReloaded/test/index.html: Canonical link: https://commits.webkit.org/199221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-12 03:46:57 +00:00
static nextBreakingOpportunity(textBox, currentPosition)
[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
{
[LayoutReloaded] Add Line class for InlineFormattingContext -and move files around. https://bugs.webkit.org/show_bug.cgi?id=183551 Reviewed by Wenson Hsieh. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: Renamed from Tools/LayoutReloaded/BlockFormattingContext.js. (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/FormattingContext/BlockFormatting/BlockMarginCollapse.js: Renamed from Tools/LayoutReloaded/BlockMarginCollapse.js. (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/FormattingContext/FloatingContext.js: Renamed from Tools/LayoutReloaded/FloatingContext.js. (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/FormattingContext.js: Renamed from Tools/LayoutReloaded/FormattingContext.js. (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/FormattingContext/InlineFormatting/InlineFormattingContext.js: Renamed from Tools/LayoutReloaded/InlineFormattingContext.js. (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._handleInlineBox): (InlineFormattingContext.prototype._handleText): (InlineFormattingContext.prototype._commitLine): (InlineFormattingContext.prototype._line): * LayoutReloaded/FormattingContext/InlineFormatting/Line.js: Copied from Tools/LayoutReloaded/InitialBlockContainer.js. (Line): (Line.prototype.isEmpty): (Line.prototype.availableWidth): (Line.prototype.appendFragment): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: * LayoutReloaded/LayoutTree/BlockContainer.js: Renamed from Tools/LayoutReloaded/BlockContainer.js. (BlockContainer): (BlockContainer.prototype.establishesInlineFormattingContext): * LayoutReloaded/LayoutTree/Box.js: Renamed from Tools/LayoutReloaded/Box.js. (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/LayoutTree/Container.js: Renamed from Tools/LayoutReloaded/Container.js. (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/LayoutTree/InitialBlockContainer.js: Renamed from Tools/LayoutReloaded/InitialBlockContainer.js. (InitialBlockContainer): (InitialBlockContainer.prototype.establishesBlockFormattingContext): (InitialBlockContainer.prototype.paddingBox): (InitialBlockContainer.prototype.contentBox): * LayoutReloaded/LayoutTree/InlineBox.js: Renamed from Tools/LayoutReloaded/InlineBox.js. (InlineBox): (InlineBox.prototype.setText): (InlineBox.prototype.text): * LayoutReloaded/LayoutTree/Text.js: Renamed from Tools/LayoutReloaded/Text.js. (Text): (Text.prototype.node): (Text.prototype.content): (Text.prototype.length): * LayoutReloaded/Utils.js: (Utils.nextBreakingOpportunity): (Utils.measureText): * LayoutReloaded/misc/headers/Line.h: Copied from Tools/LayoutReloaded/misc/headers/Text.h. * LayoutReloaded/misc/headers/Text.h: * LayoutReloaded/test/border-simple.html: * LayoutReloaded/test/index.html: Canonical link: https://commits.webkit.org/199221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-12 03:46:57 +00:00
return window.nextBreakingOpportunity(textBox.content(), currentPosition);
[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
}
[LayoutReloaded] Add Line class for InlineFormattingContext -and move files around. https://bugs.webkit.org/show_bug.cgi?id=183551 Reviewed by Wenson Hsieh. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: Renamed from Tools/LayoutReloaded/BlockFormattingContext.js. (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/FormattingContext/BlockFormatting/BlockMarginCollapse.js: Renamed from Tools/LayoutReloaded/BlockMarginCollapse.js. (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/FormattingContext/FloatingContext.js: Renamed from Tools/LayoutReloaded/FloatingContext.js. (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/FormattingContext.js: Renamed from Tools/LayoutReloaded/FormattingContext.js. (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/FormattingContext/InlineFormatting/InlineFormattingContext.js: Renamed from Tools/LayoutReloaded/InlineFormattingContext.js. (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._handleInlineBox): (InlineFormattingContext.prototype._handleText): (InlineFormattingContext.prototype._commitLine): (InlineFormattingContext.prototype._line): * LayoutReloaded/FormattingContext/InlineFormatting/Line.js: Copied from Tools/LayoutReloaded/InitialBlockContainer.js. (Line): (Line.prototype.isEmpty): (Line.prototype.availableWidth): (Line.prototype.appendFragment): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: * LayoutReloaded/LayoutTree/BlockContainer.js: Renamed from Tools/LayoutReloaded/BlockContainer.js. (BlockContainer): (BlockContainer.prototype.establishesInlineFormattingContext): * LayoutReloaded/LayoutTree/Box.js: Renamed from Tools/LayoutReloaded/Box.js. (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/LayoutTree/Container.js: Renamed from Tools/LayoutReloaded/Container.js. (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/LayoutTree/InitialBlockContainer.js: Renamed from Tools/LayoutReloaded/InitialBlockContainer.js. (InitialBlockContainer): (InitialBlockContainer.prototype.establishesBlockFormattingContext): (InitialBlockContainer.prototype.paddingBox): (InitialBlockContainer.prototype.contentBox): * LayoutReloaded/LayoutTree/InlineBox.js: Renamed from Tools/LayoutReloaded/InlineBox.js. (InlineBox): (InlineBox.prototype.setText): (InlineBox.prototype.text): * LayoutReloaded/LayoutTree/Text.js: Renamed from Tools/LayoutReloaded/Text.js. (Text): (Text.prototype.node): (Text.prototype.content): (Text.prototype.length): * LayoutReloaded/Utils.js: (Utils.nextBreakingOpportunity): (Utils.measureText): * LayoutReloaded/misc/headers/Line.h: Copied from Tools/LayoutReloaded/misc/headers/Text.h. * LayoutReloaded/misc/headers/Text.h: * LayoutReloaded/test/border-simple.html: * LayoutReloaded/test/index.html: Canonical link: https://commits.webkit.org/199221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-12 03:46:57 +00:00
static measureText(texBox, start, end)
[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
{
[LayoutReloaded] Add Line class for InlineFormattingContext -and move files around. https://bugs.webkit.org/show_bug.cgi?id=183551 Reviewed by Wenson Hsieh. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: Renamed from Tools/LayoutReloaded/BlockFormattingContext.js. (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/FormattingContext/BlockFormatting/BlockMarginCollapse.js: Renamed from Tools/LayoutReloaded/BlockMarginCollapse.js. (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/FormattingContext/FloatingContext.js: Renamed from Tools/LayoutReloaded/FloatingContext.js. (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/FormattingContext.js: Renamed from Tools/LayoutReloaded/FormattingContext.js. (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/FormattingContext/InlineFormatting/InlineFormattingContext.js: Renamed from Tools/LayoutReloaded/InlineFormattingContext.js. (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._handleInlineBox): (InlineFormattingContext.prototype._handleText): (InlineFormattingContext.prototype._commitLine): (InlineFormattingContext.prototype._line): * LayoutReloaded/FormattingContext/InlineFormatting/Line.js: Copied from Tools/LayoutReloaded/InitialBlockContainer.js. (Line): (Line.prototype.isEmpty): (Line.prototype.availableWidth): (Line.prototype.appendFragment): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: * LayoutReloaded/LayoutTree/BlockContainer.js: Renamed from Tools/LayoutReloaded/BlockContainer.js. (BlockContainer): (BlockContainer.prototype.establishesInlineFormattingContext): * LayoutReloaded/LayoutTree/Box.js: Renamed from Tools/LayoutReloaded/Box.js. (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/LayoutTree/Container.js: Renamed from Tools/LayoutReloaded/Container.js. (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/LayoutTree/InitialBlockContainer.js: Renamed from Tools/LayoutReloaded/InitialBlockContainer.js. (InitialBlockContainer): (InitialBlockContainer.prototype.establishesBlockFormattingContext): (InitialBlockContainer.prototype.paddingBox): (InitialBlockContainer.prototype.contentBox): * LayoutReloaded/LayoutTree/InlineBox.js: Renamed from Tools/LayoutReloaded/InlineBox.js. (InlineBox): (InlineBox.prototype.setText): (InlineBox.prototype.text): * LayoutReloaded/LayoutTree/Text.js: Renamed from Tools/LayoutReloaded/Text.js. (Text): (Text.prototype.node): (Text.prototype.content): (Text.prototype.length): * LayoutReloaded/Utils.js: (Utils.nextBreakingOpportunity): (Utils.measureText): * LayoutReloaded/misc/headers/Line.h: Copied from Tools/LayoutReloaded/misc/headers/Text.h. * LayoutReloaded/misc/headers/Text.h: * LayoutReloaded/test/border-simple.html: * LayoutReloaded/test/index.html: Canonical link: https://commits.webkit.org/199221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-12 03:46:57 +00:00
return texBox.node().textWidth(start, end);
[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
}
static textHeight(textBox)
{
return textBox.text().node().textHeight();
}
static layoutBoxById(layoutBoxId, box) {
if (box.id() == layoutBoxId)
return box;
if (!box.isContainer())
return null;
// Super inefficient but this is all temporary anyway.
for (let child = box.firstChild(); child; child = child.nextSibling()) {
if (child.id() == layoutBoxId)
return child;
let foundIt = Utils.layoutBoxById(layoutBoxId, child);
if (foundIt)
return foundIt;
}
return null;
}
[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
// "RenderView at (0,0) size 1317x366\n HTML RenderBlock at (0,0) size 1317x116\n BODY RenderBody at (8,8) size 1301x100\n DIV RenderBlock at (0,0) size 100x100\n";
static layoutTreeDump(layoutState) {
return this._dumpBox(layoutState, layoutState.rootContainer(), 1) + this._dumpTree(layoutState, layoutState.rootContainer(), 2);
[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
}
[LayoutReloaded] Disconnect Display.Box from Layout.Box https://bugs.webkit.org/show_bug.cgi?id=183805 Reviewed by Antti Koivisto. Display.Box is only accessed through the FormattingState. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext): (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._layoutOutOfFlowDescendants): (BlockFormattingContext.prototype._adjustBottomWithFIXME): (BlockFormattingContext.prototype._computeOutOfFlowPosition): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext): (FormattingContext.prototype.formattingRoot): (FormattingContext.prototype.formattingState): (FormattingContext.prototype.layoutState): (FormattingContext.prototype._toAbsolutePosition): (FormattingContext.prototype._toRootAbsolutePosition): (FormattingContext.prototype._addToLayoutQueue): (FormattingContext.prototype.displayBox): (FormattingContext.prototype._outOfFlowDescendants): (FormattingContext.prototype.rootContainer): Deleted. (FormattingContext.prototype.layoutContext): Deleted. * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js: (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._initializeLine): * LayoutReloaded/FormattingState/BlockFormattingState.js: (BlockFormattingState): * LayoutReloaded/FormattingState/FormattingState.js: (FormattingState): (FormattingState.prototype.formattingRoot): (FormattingState.prototype.layoutState): (FormattingState.prototype.createDisplayBox): (FormattingState.prototype.displayBoxMap): (FormattingState.prototype.displayBox): (FormattingState.prototype.layoutContext): Deleted. * LayoutReloaded/FormattingState/InlineFormattingState.js: (InlineFormattingState): * LayoutReloaded/Layout.js: (layout): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: * LayoutReloaded/LayoutState.js: Renamed from Tools/LayoutReloaded/LayoutContext.js. (LayoutState): (LayoutState.prototype.layout): (LayoutState.prototype._createFormattingState): (LayoutState.prototype.formattingStates): (LayoutState.prototype.initialDisplayBox): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.isOutOfFlowPositioned): (Layout.Box.prototype.containingBlock): (Layout.Box.prototype.setDisplayBox): Deleted. (Layout.Box.prototype.displayBox): Deleted. * LayoutReloaded/Utils.js: (Utils.layoutTreeDump): (Utils._findDisplayBox): (Utils._dumpBox): (Utils._dumpTree): * LayoutReloaded/misc/headers/BlockFormattingContext.h: * LayoutReloaded/misc/headers/FormattingContext.h: * LayoutReloaded/misc/headers/LayoutContext.h: * LayoutReloaded/test/index.html: Canonical link: https://commits.webkit.org/199430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-21 04:42:32 +00:00
static _dumpBox(layoutState, box, level) {
[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
// Skip anonymous boxes for now -This is the case where WebKit does not generate an anon inline container for text content where the text is a direct child
// of a block container.
let indentation = " ".repeat(level);
[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 (box.isInlineBox()) {
if (box.text())
return indentation + "#text RenderText\n";
}
if (box.name() == "RenderInline") {
if (box.isInFlowPositioned()) {
let displayBox = layoutState.displayBox(box);
let boxRect = displayBox.rect();
return indentation + box.node().tagName + " " + box.name() + " (" + Utils.precisionRoundWithDecimals(boxRect.left()) + ", " + Utils.precisionRoundWithDecimals(boxRect.top()) + ")\n";
}
[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
return indentation + box.node().tagName + " " + box.name() + "\n";
}
if (box.isAnonymous())
return "";
let displayBox = layoutState.displayBox(box);
[LayoutReloaded] Remove left/right width/height getters from Layout.Box https://bugs.webkit.org/show_bug.cgi?id=183734 Reviewed by Antti Koivisto. ...and use Display.Box instead. * LayoutReloaded/DisplayTree/Box.js: (Display.Box.prototype.bottomRight): (Display.Box.prototype.size): (Display.Box.prototype.height): (Display.Box.prototype.width): * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext.prototype._computeStaticPosition): (BlockFormattingContext.prototype._adjustBottomWithFIXME): (BlockFormattingContext.prototype._computeInFlowPositionedPosition): (BlockFormattingContext.prototype._computeOutOfFlowPosition): * LayoutReloaded/FormattingContext/FloatingContext.js: (FloatingContext.prototype._positionForClear): (FloatingContext.prototype._computePositionToAvoidIntrudingFloats): (FloatingContext.prototype._adjustedFloatingPosition): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext.prototype.absoluteMarginBox): (FormattingContext.prototype.absoluteBorderBox): (FormattingContext.prototype.absolutePaddingBox): (FormattingContext.prototype.absoluteContentBox): (FormattingContext.prototype._toAbsolutePosition): (FormattingContext.prototype._toRootAbsolutePosition): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.rect): Deleted. (Layout.Box.prototype.topLeft): Deleted. (Layout.Box.prototype.bottomRight): Deleted. * LayoutReloaded/Utils.js: (Utils._dumpBox): (Utils.mapToContainer): Deleted. Canonical link: https://commits.webkit.org/199370@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229703 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-19 03:00:26 +00:00
let boxRect = displayBox.rect();
return indentation + (box.node().tagName ? (box.node().tagName + " ") : "") + box.name() + " at (" + Utils.precisionRound(boxRect.left()) + "," + Utils.precisionRound(boxRect.top()) + ") size " + Utils.precisionRound(boxRect.width()) + "x" + Utils.precisionRound(boxRect.height()) + "\n";
[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
}
static _dumpLines(layoutState, root, level) {
ASSERT(root.establishesInlineFormattingContext());
let inlineFormattingState = layoutState.establishedFormattingState(root);
let lines = inlineFormattingState.lines();
let content = "";
let indentation = " ".repeat(level);
lines.forEach(function(line) {
let lineRect = line.rect();
content += indentation + "RootInlineBox at (" + lineRect.left() + "," + lineRect.top() + ") size " + Utils.precisionRound(lineRect.width()) + "x" + lineRect.height() + "\n";
line.lineBoxes().forEach(function(lineBox) {
let indentation = " ".repeat(level + 1);
let inlineBoxName = lineBox.startPosition === undefined ? "InlineBox" : "InlineTextBox";
content += indentation + inlineBoxName + " at (" + Utils.precisionRound(lineBox.lineBoxRect.left()) + "," + Utils.precisionRound(lineBox.lineBoxRect.top()) + ") size " + Utils.precisionRound(lineBox.lineBoxRect.width()) + "x" + lineBox.lineBoxRect.height() + "\n";
});
});
return content;
}
[LayoutReloaded] Disconnect Display.Box from Layout.Box https://bugs.webkit.org/show_bug.cgi?id=183805 Reviewed by Antti Koivisto. Display.Box is only accessed through the FormattingState. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext): (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._layoutOutOfFlowDescendants): (BlockFormattingContext.prototype._adjustBottomWithFIXME): (BlockFormattingContext.prototype._computeOutOfFlowPosition): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext): (FormattingContext.prototype.formattingRoot): (FormattingContext.prototype.formattingState): (FormattingContext.prototype.layoutState): (FormattingContext.prototype._toAbsolutePosition): (FormattingContext.prototype._toRootAbsolutePosition): (FormattingContext.prototype._addToLayoutQueue): (FormattingContext.prototype.displayBox): (FormattingContext.prototype._outOfFlowDescendants): (FormattingContext.prototype.rootContainer): Deleted. (FormattingContext.prototype.layoutContext): Deleted. * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js: (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._initializeLine): * LayoutReloaded/FormattingState/BlockFormattingState.js: (BlockFormattingState): * LayoutReloaded/FormattingState/FormattingState.js: (FormattingState): (FormattingState.prototype.formattingRoot): (FormattingState.prototype.layoutState): (FormattingState.prototype.createDisplayBox): (FormattingState.prototype.displayBoxMap): (FormattingState.prototype.displayBox): (FormattingState.prototype.layoutContext): Deleted. * LayoutReloaded/FormattingState/InlineFormattingState.js: (InlineFormattingState): * LayoutReloaded/Layout.js: (layout): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: * LayoutReloaded/LayoutState.js: Renamed from Tools/LayoutReloaded/LayoutContext.js. (LayoutState): (LayoutState.prototype.layout): (LayoutState.prototype._createFormattingState): (LayoutState.prototype.formattingStates): (LayoutState.prototype.initialDisplayBox): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.isOutOfFlowPositioned): (Layout.Box.prototype.containingBlock): (Layout.Box.prototype.setDisplayBox): Deleted. (Layout.Box.prototype.displayBox): Deleted. * LayoutReloaded/Utils.js: (Utils.layoutTreeDump): (Utils._findDisplayBox): (Utils._dumpBox): (Utils._dumpTree): * LayoutReloaded/misc/headers/BlockFormattingContext.h: * LayoutReloaded/misc/headers/FormattingContext.h: * LayoutReloaded/misc/headers/LayoutContext.h: * LayoutReloaded/test/index.html: Canonical link: https://commits.webkit.org/199430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-21 04:42:32 +00:00
static _dumpTree(layoutState, root, level) {
[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
let content = "";
if (root.isBlockContainerBox() && root.establishesInlineFormattingContext())
content += this._dumpLines(layoutState, root, level);
[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
for (let child = root.firstChild(); child; child = child.nextSibling()) {
[LayoutReloaded] Disconnect Display.Box from Layout.Box https://bugs.webkit.org/show_bug.cgi?id=183805 Reviewed by Antti Koivisto. Display.Box is only accessed through the FormattingState. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext): (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._layoutOutOfFlowDescendants): (BlockFormattingContext.prototype._adjustBottomWithFIXME): (BlockFormattingContext.prototype._computeOutOfFlowPosition): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext): (FormattingContext.prototype.formattingRoot): (FormattingContext.prototype.formattingState): (FormattingContext.prototype.layoutState): (FormattingContext.prototype._toAbsolutePosition): (FormattingContext.prototype._toRootAbsolutePosition): (FormattingContext.prototype._addToLayoutQueue): (FormattingContext.prototype.displayBox): (FormattingContext.prototype._outOfFlowDescendants): (FormattingContext.prototype.rootContainer): Deleted. (FormattingContext.prototype.layoutContext): Deleted. * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js: (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._initializeLine): * LayoutReloaded/FormattingState/BlockFormattingState.js: (BlockFormattingState): * LayoutReloaded/FormattingState/FormattingState.js: (FormattingState): (FormattingState.prototype.formattingRoot): (FormattingState.prototype.layoutState): (FormattingState.prototype.createDisplayBox): (FormattingState.prototype.displayBoxMap): (FormattingState.prototype.displayBox): (FormattingState.prototype.layoutContext): Deleted. * LayoutReloaded/FormattingState/InlineFormattingState.js: (InlineFormattingState): * LayoutReloaded/Layout.js: (layout): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: * LayoutReloaded/LayoutState.js: Renamed from Tools/LayoutReloaded/LayoutContext.js. (LayoutState): (LayoutState.prototype.layout): (LayoutState.prototype._createFormattingState): (LayoutState.prototype.formattingStates): (LayoutState.prototype.initialDisplayBox): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.isOutOfFlowPositioned): (Layout.Box.prototype.containingBlock): (Layout.Box.prototype.setDisplayBox): Deleted. (Layout.Box.prototype.displayBox): Deleted. * LayoutReloaded/Utils.js: (Utils.layoutTreeDump): (Utils._findDisplayBox): (Utils._dumpBox): (Utils._dumpTree): * LayoutReloaded/misc/headers/BlockFormattingContext.h: * LayoutReloaded/misc/headers/FormattingContext.h: * LayoutReloaded/misc/headers/LayoutContext.h: * LayoutReloaded/test/index.html: Canonical link: https://commits.webkit.org/199430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-21 04:42:32 +00:00
content += this._dumpBox(layoutState, child, level);
[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 (child.isContainer())
[LayoutReloaded] Disconnect Display.Box from Layout.Box https://bugs.webkit.org/show_bug.cgi?id=183805 Reviewed by Antti Koivisto. Display.Box is only accessed through the FormattingState. * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: (BlockFormattingContext): (BlockFormattingContext.prototype.layout): (BlockFormattingContext.prototype._placeInFlowPositionedChildren): (BlockFormattingContext.prototype._layoutOutOfFlowDescendants): (BlockFormattingContext.prototype._adjustBottomWithFIXME): (BlockFormattingContext.prototype._computeOutOfFlowPosition): * LayoutReloaded/FormattingContext/FormattingContext.js: (FormattingContext): (FormattingContext.prototype.formattingRoot): (FormattingContext.prototype.formattingState): (FormattingContext.prototype.layoutState): (FormattingContext.prototype._toAbsolutePosition): (FormattingContext.prototype._toRootAbsolutePosition): (FormattingContext.prototype._addToLayoutQueue): (FormattingContext.prototype.displayBox): (FormattingContext.prototype._outOfFlowDescendants): (FormattingContext.prototype.rootContainer): Deleted. (FormattingContext.prototype.layoutContext): Deleted. * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js: (InlineFormattingContext): (InlineFormattingContext.prototype.layout): (InlineFormattingContext.prototype._initializeLine): * LayoutReloaded/FormattingState/BlockFormattingState.js: (BlockFormattingState): * LayoutReloaded/FormattingState/FormattingState.js: (FormattingState): (FormattingState.prototype.formattingRoot): (FormattingState.prototype.layoutState): (FormattingState.prototype.createDisplayBox): (FormattingState.prototype.displayBoxMap): (FormattingState.prototype.displayBox): (FormattingState.prototype.layoutContext): Deleted. * LayoutReloaded/FormattingState/InlineFormattingState.js: (InlineFormattingState): * LayoutReloaded/Layout.js: (layout): * LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata: * LayoutReloaded/LayoutState.js: Renamed from Tools/LayoutReloaded/LayoutContext.js. (LayoutState): (LayoutState.prototype.layout): (LayoutState.prototype._createFormattingState): (LayoutState.prototype.formattingStates): (LayoutState.prototype.initialDisplayBox): * LayoutReloaded/LayoutTree/Box.js: (Layout.Box.prototype.isOutOfFlowPositioned): (Layout.Box.prototype.containingBlock): (Layout.Box.prototype.setDisplayBox): Deleted. (Layout.Box.prototype.displayBox): Deleted. * LayoutReloaded/Utils.js: (Utils.layoutTreeDump): (Utils._findDisplayBox): (Utils._dumpBox): (Utils._dumpTree): * LayoutReloaded/misc/headers/BlockFormattingContext.h: * LayoutReloaded/misc/headers/FormattingContext.h: * LayoutReloaded/misc/headers/LayoutContext.h: * LayoutReloaded/test/index.html: Canonical link: https://commits.webkit.org/199430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-21 04:42:32 +00:00
content += this._dumpTree(layoutState, child, level + 1, content);
[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
}
return content;
}
static precisionRoundWithDecimals(number) {
return number.toFixed(2);
}
static precisionRound(number) {
let factor = Math.pow(10, 2);
return Math.round(number * factor) / factor;
}
[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
}