Commit 66ac041a authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[LayoutNG] Handle 'auto' for new formatting contexts within a BFC.

This implements our current behaviour for 'auto' sized FCs within a BFC.

We need to perform layout twice under two scenarios:
 1. 'auto' inline size child. In this case we need to perform layout
    once, and if the child doesn't fit, we perform layout a second time
    with an "open" layout opportunity, so we can guarantee it will fit.

 2. Non-adjoining margin strut and unpositioned floats/current layout.
    In this case we need to perform a relayout as the BFCOffset where
    floats will be positioned will change. This happens if the child
    doesn't fit on the "top" of the exclusion space.

This also adds more TODOs everywhere which we can handle later.
I kept this as small as possible to keep sanity. :)

Bug: 635619
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I499dc9722fac47f43694f35c507e9d2742d317db
Reviewed-on: https://chromium-review.googlesource.com/680176
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506963}
parent 41032806
...@@ -1232,6 +1232,7 @@ crbug.com/591099 css3/flexbox/flexbox-baseline.html [ Failure ] ...@@ -1232,6 +1232,7 @@ crbug.com/591099 css3/flexbox/flexbox-baseline.html [ Failure ]
crbug.com/591099 css3/flexbox/floated-flexbox.html [ Failure ] crbug.com/591099 css3/flexbox/floated-flexbox.html [ Failure ]
crbug.com/591099 css3/flexbox/intrinsic-width-orthogonal-writing-mode.html [ Failure ] crbug.com/591099 css3/flexbox/intrinsic-width-orthogonal-writing-mode.html [ Failure ]
crbug.com/591099 css3/flexbox/line-wrapping.html [ Failure ] crbug.com/591099 css3/flexbox/line-wrapping.html [ Failure ]
crbug.com/591099 css3/flexbox/nested-orthogonal-flexbox-relayout.html [ Failure ]
crbug.com/591099 css3/flexbox/overflow-auto-dynamic-changes.html [ Failure ] crbug.com/591099 css3/flexbox/overflow-auto-dynamic-changes.html [ Failure ]
crbug.com/591099 css3/flexbox/position-absolute-child-with-contenteditable.html [ Failure ] crbug.com/591099 css3/flexbox/position-absolute-child-with-contenteditable.html [ Failure ]
crbug.com/591099 css3/flexbox/scrollbars-auto.html [ Failure ] crbug.com/591099 css3/flexbox/scrollbars-auto.html [ Failure ]
...@@ -2570,6 +2571,8 @@ crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-157.xht [ Fa ...@@ -2570,6 +2571,8 @@ crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-157.xht [ Fa
crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-clear-008.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats-clear/margin-collapse-clear-008.xht [ Failure ]
crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-001-left-overflow.xht [ Crash Failure ] crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-001-left-overflow.xht [ Crash Failure ]
crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-002-left-overflow.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-002-left-overflow.xht [ Failure ]
crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-002-left-table.xht [ Failure ]
crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-002-right-table.xht [ Failure ]
crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-003-left-overflow.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-003-left-overflow.xht [ Failure ]
crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-003-right-overflow.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-003-right-overflow.xht [ Failure ]
crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-004.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-004.xht [ Failure ]
...@@ -3447,6 +3450,7 @@ crbug.com/591099 fast/block/basic/quirk-height.html [ Failure ] ...@@ -3447,6 +3450,7 @@ crbug.com/591099 fast/block/basic/quirk-height.html [ Failure ]
crbug.com/591099 fast/block/basic/quirk-percent-height-grandchild.html [ Failure ] crbug.com/591099 fast/block/basic/quirk-percent-height-grandchild.html [ Failure ]
crbug.com/591099 fast/block/block-add-child-crash.html [ Failure Pass ] crbug.com/591099 fast/block/block-add-child-crash.html [ Failure Pass ]
crbug.com/591099 fast/block/block-width-recalc-with-relative-height.html [ Crash Failure ] crbug.com/591099 fast/block/block-width-recalc-with-relative-height.html [ Crash Failure ]
crbug.com/591099 fast/block/containing-block-negative-margins.html [ Failure ]
crbug.com/591099 fast/block/float-avoids-padding-inline-ancestors.html [ Failure ] crbug.com/591099 fast/block/float-avoids-padding-inline-ancestors.html [ Failure ]
crbug.com/591099 fast/block/float/002.html [ Crash Failure ] crbug.com/591099 fast/block/float/002.html [ Crash Failure ]
crbug.com/591099 fast/block/float/003.html [ Failure ] crbug.com/591099 fast/block/float/003.html [ Failure ]
...@@ -7954,6 +7958,7 @@ crbug.com/591099 tables/mozilla/bugs/bug133948.html [ Failure ] ...@@ -7954,6 +7958,7 @@ crbug.com/591099 tables/mozilla/bugs/bug133948.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug137388-3.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug137388-3.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug149275-1.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug149275-1.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug149275-2.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug149275-2.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug15247.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug154780.html [ Crash Failure ] crbug.com/591099 tables/mozilla/bugs/bug154780.html [ Crash Failure ]
crbug.com/591099 tables/mozilla/bugs/bug16252.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug16252.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug18440.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug18440.html [ Failure ]
......
...@@ -298,6 +298,8 @@ crbug.com/711704 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-rule7-out ...@@ -298,6 +298,8 @@ crbug.com/711704 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-rule7-out
crbug.com/711704 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-rule7-outside-right-001.xht [ Failure ] crbug.com/711704 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-rule7-outside-right-001.xht [ Failure ]
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-001-left-overflow.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-001-left-overflow.xht [ Failure ]
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-002-left-overflow.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-002-left-overflow.xht [ Failure ]
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-002-left-table.xht [ Failure ]
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-002-right-table.xht [ Failure ]
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-003-left-overflow.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-003-left-overflow.xht [ Failure ]
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-003-right-overflow.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-003-right-overflow.xht [ Failure ]
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-004.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats/floats-wrap-bfc-004.xht [ Failure ]
...@@ -332,7 +334,6 @@ crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-131 ...@@ -332,7 +334,6 @@ crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-131
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-137.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-137.xht [ Skip ]
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-143.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-143.xht [ Failure ]
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-157.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-157.xht [ Failure ]
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-008.xht [ Failure ]
# Regressions while changing zero-block-size float behaviour. # Regressions while changing zero-block-size float behaviour.
crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/001.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/001.html [ Failure ]
...@@ -471,15 +472,12 @@ crbug.com/635619 virtual/layout_ng/fast/block/float/017.html [ Failure ] ...@@ -471,15 +472,12 @@ crbug.com/635619 virtual/layout_ng/fast/block/float/017.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/018.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/float/018.html [ Failure ]
crbug.com/635619 [ Mac ] virtual/layout_ng/fast/block/float/020.html [ Failure ] crbug.com/635619 [ Mac ] virtual/layout_ng/fast/block/float/020.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/022.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/float/022.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/025.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/026.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/float/026.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/027.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/028.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/float/028.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/031.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/float/031.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/035.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/float/035.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/assert-when-moving-float.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/float/assert-when-moving-float.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/assert-when-moving-float-2.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/float/assert-when-moving-float-2.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/avoiding-float-centered.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/block-with-negative-margin-clears-float.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/float/block-with-negative-margin-clears-float.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/br-with-clear-2.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/float/br-with-clear-2.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/centered-float-avoidance-complexity.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/float/centered-float-avoidance-complexity.html [ Failure ]
...@@ -531,14 +529,12 @@ crbug.com/635619 virtual/layout_ng/fast/block/float/rubybase-children-moved-cras ...@@ -531,14 +529,12 @@ crbug.com/635619 virtual/layout_ng/fast/block/float/rubybase-children-moved-cras
crbug.com/635619 virtual/layout_ng/fast/block/float/rubybase-children-moved-crash.html [ Crash Pass ] crbug.com/635619 virtual/layout_ng/fast/block/float/rubybase-children-moved-crash.html [ Crash Pass ]
crbug.com/635619 virtual/layout_ng/fast/block/float/shrink-to-avoid-float-complexity.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/float/shrink-to-avoid-float-complexity.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/trailing-float-with-columns.html [ Crash Failure ] crbug.com/635619 virtual/layout_ng/fast/block/float/trailing-float-with-columns.html [ Crash Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/float/width-update-after-clear.html [ Failure ]
### virtual/layout_ng/fast/block/margin-collapse ### virtual/layout_ng/fast/block/margin-collapse
crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/032.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/032.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/033.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/033.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/057.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/057.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/103.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/103.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/bfc-beside-float-complex-margin-collapsing.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-cols-creates-block-formatting-context.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-cols-creates-block-formatting-context.html [ Failure ]
### virtual/layout_ng/fast/block/margin-collapse/block-inside-inline ### virtual/layout_ng/fast/block/margin-collapse/block-inside-inline
...@@ -550,7 +546,6 @@ crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inlin ...@@ -550,7 +546,6 @@ crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/block-inside-inlin
### virtual/layout_ng/fast/block/margin-collapse ### virtual/layout_ng/fast/block/margin-collapse
crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/clear-nested-float-more-than-one-previous-sibling-away.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/clear-nested-float-more-than-one-previous-sibling-away.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/empty-clear-blocks.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-container.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-container.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-separate-position.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-separate-position.html [ Failure ]
crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-siblings.html [ Failure ] crbug.com/635619 virtual/layout_ng/fast/block/margin-collapse/webkit-margin-collapse-siblings.html [ Failure ]
......
...@@ -304,7 +304,9 @@ void LayoutTable::UpdateLogicalWidth() { ...@@ -304,7 +304,9 @@ void LayoutTable::UpdateLogicalWidth() {
MinimumValueForLength(Style()->MarginStart(), available_logical_width); MinimumValueForLength(Style()->MarginStart(), available_logical_width);
LayoutUnit margin_end = LayoutUnit margin_end =
MinimumValueForLength(Style()->MarginEnd(), available_logical_width); MinimumValueForLength(Style()->MarginEnd(), available_logical_width);
LayoutUnit margin_total = margin_start + margin_end; LayoutUnit margin_total = RuntimeEnabledFeatures::LayoutNGEnabled()
? LayoutUnit()
: margin_start + margin_end;
// Subtract out our margins to get the available content width. // Subtract out our margins to get the available content width.
LayoutUnit available_content_logical_width = LayoutUnit available_content_logical_width =
...@@ -312,7 +314,8 @@ void LayoutTable::UpdateLogicalWidth() { ...@@ -312,7 +314,8 @@ void LayoutTable::UpdateLogicalWidth() {
.ClampNegativeToZero(); .ClampNegativeToZero();
if (ShrinkToAvoidFloats() && cb->IsLayoutBlockFlow() && if (ShrinkToAvoidFloats() && cb->IsLayoutBlockFlow() &&
ToLayoutBlockFlow(cb)->ContainsFloats() && ToLayoutBlockFlow(cb)->ContainsFloats() &&
!has_perpendicular_containing_block) !has_perpendicular_containing_block &&
!RuntimeEnabledFeatures::LayoutNGEnabled())
available_content_logical_width = ShrinkLogicalWidthToAvoidFloats( available_content_logical_width = ShrinkLogicalWidthToAvoidFloats(
margin_start, margin_end, ToLayoutBlockFlow(cb)); margin_start, margin_end, ToLayoutBlockFlow(cb));
......
...@@ -74,7 +74,8 @@ class CORE_EXPORT NGBlockLayoutAlgorithm ...@@ -74,7 +74,8 @@ class CORE_EXPORT NGBlockLayoutAlgorithm
RefPtr<NGConstraintSpace> CreateConstraintSpaceForChild( RefPtr<NGConstraintSpace> CreateConstraintSpaceForChild(
const NGLayoutInputNode child, const NGLayoutInputNode child,
const NGInflowChildData& child_data, const NGInflowChildData& child_data,
const WTF::Optional<NGBfcOffset> floats_bfc_offset = WTF::nullopt); const WTF::Optional<NGBfcOffset> floats_bfc_offset = WTF::nullopt,
const WTF::Optional<LayoutUnit> fixed_inline_size = WTF::nullopt);
// @return Estimated BFC offset for the "to be layout" child. // @return Estimated BFC offset for the "to be layout" child.
NGInflowChildData ComputeChildData(const NGPreviousInflowPosition&, NGInflowChildData ComputeChildData(const NGPreviousInflowPosition&,
...@@ -91,7 +92,6 @@ class CORE_EXPORT NGBlockLayoutAlgorithm ...@@ -91,7 +92,6 @@ class CORE_EXPORT NGBlockLayoutAlgorithm
const NGFragment& fragment, const NGFragment& fragment,
bool empty_block_affected_by_clearance); bool empty_block_affected_by_clearance);
// Positions the fragment that knows its BFC offset. // Positions the fragment that knows its BFC offset.
WTF::Optional<NGBfcOffset> PositionWithBfcOffset( WTF::Optional<NGBfcOffset> PositionWithBfcOffset(
const NGBfcOffset& bfc_offset); const NGBfcOffset& bfc_offset);
...@@ -137,6 +137,15 @@ class CORE_EXPORT NGBlockLayoutAlgorithm ...@@ -137,6 +137,15 @@ class CORE_EXPORT NGBlockLayoutAlgorithm
NGBreakToken* child_break_token, NGBreakToken* child_break_token,
NGPreviousInflowPosition*); NGPreviousInflowPosition*);
// Performs the actual layout of a new formatting context. This may be called
// multiple times from HandleNewFormattingContext.
std::pair<RefPtr<NGLayoutResult>, NGLayoutOpportunity>
LayoutNewFormattingContext(NGLayoutInputNode child,
NGBreakToken* child_break_token,
bool is_auto_inline_size,
const NGInflowChildData&,
LayoutUnit child_origin_block_offset);
// Handle an in-flow child. // Handle an in-flow child.
// Returns false if we need to abort layout, because a previously unknown BFC // Returns false if we need to abort layout, because a previously unknown BFC
// offset has now been resolved. (Same as HandleNewFormattingContext). // offset has now been resolved. (Same as HandleNewFormattingContext).
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "core/layout/LayoutBlockFlow.h" #include "core/layout/LayoutBlockFlow.h"
#include "core/layout/LayoutMultiColumnFlowThread.h" #include "core/layout/LayoutMultiColumnFlowThread.h"
#include "core/layout/LayoutMultiColumnSet.h" #include "core/layout/LayoutMultiColumnSet.h"
#include "core/layout/LayoutTable.h"
#include "core/layout/MinMaxSize.h" #include "core/layout/MinMaxSize.h"
#include "core/layout/ng/inline/ng_inline_node.h" #include "core/layout/ng/inline/ng_inline_node.h"
#include "core/layout/ng/layout_ng_block_flow.h" #include "core/layout/ng/layout_ng_block_flow.h"
...@@ -488,16 +489,19 @@ RefPtr<NGLayoutResult> NGBlockNode::RunOldLayout( ...@@ -488,16 +489,19 @@ RefPtr<NGLayoutResult> NGBlockNode::RunOldLayout(
box_->SetOverrideContainingBlockContentLogicalHeight( box_->SetOverrideContainingBlockContentLogicalHeight(
available_size.inline_size); available_size.inline_size);
} }
// TODO(layout-ng): Does this handle scrollbars correctly? // TODO(layout-ng): Does this handle scrollbars correctly?
if (constraint_space.IsFixedSizeInline()) { if (constraint_space.IsFixedSizeInline()) {
box_->SetOverrideLogicalContentWidth( box_->SetOverrideLogicalContentWidth(
constraint_space.AvailableSize().inline_size - (constraint_space.AvailableSize().inline_size -
box_->BorderAndPaddingLogicalWidth()); box_->BorderAndPaddingLogicalWidth())
.ClampNegativeToZero());
} }
if (constraint_space.IsFixedSizeBlock()) { if (constraint_space.IsFixedSizeBlock()) {
box_->SetOverrideLogicalContentHeight( box_->SetOverrideLogicalContentHeight(
constraint_space.AvailableSize().block_size - (constraint_space.AvailableSize().block_size -
box_->BorderAndPaddingLogicalHeight()); box_->BorderAndPaddingLogicalHeight())
.ClampNegativeToZero());
} }
if (box_->IsLayoutNGBlockFlow() && box_->NeedsLayout()) { if (box_->IsLayoutNGBlockFlow() && box_->NeedsLayout()) {
......
...@@ -77,6 +77,10 @@ bool NGLayoutInputNode::IsReplaced() const { ...@@ -77,6 +77,10 @@ bool NGLayoutInputNode::IsReplaced() const {
return box_->IsLayoutReplaced(); return box_->IsLayoutReplaced();
} }
bool NGLayoutInputNode::ShouldBeConsideredAsReplaced() const {
return box_->ShouldBeConsideredAsReplaced();
}
bool NGLayoutInputNode::IsQuirkyContainer() const { bool NGLayoutInputNode::IsQuirkyContainer() const {
return box_->GetDocument().InQuirksMode() && return box_->GetDocument().InQuirksMode() &&
(box_->IsBody() || box_->IsTableCell()); (box_->IsBody() || box_->IsTableCell());
......
...@@ -42,6 +42,7 @@ class CORE_EXPORT NGLayoutInputNode { ...@@ -42,6 +42,7 @@ class CORE_EXPORT NGLayoutInputNode {
bool IsReplaced() const; bool IsReplaced() const;
bool IsAbsoluteContainer() const; bool IsAbsoluteContainer() const;
bool IsFixedContainer() const; bool IsFixedContainer() const;
bool ShouldBeConsideredAsReplaced() const;
// If the node is a quirky container for margin collapsing, see: // If the node is a quirky container for margin collapsing, see:
// https://html.spec.whatwg.org/#margin-collapsing-quirks // https://html.spec.whatwg.org/#margin-collapsing-quirks
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment