diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc | 58 |
1 files changed, 36 insertions, 22 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc b/chromium/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc index 32c22ff4f54..ded2845c057 100644 --- a/chromium/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc +++ b/chromium/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc @@ -230,7 +230,7 @@ TEST_F(NGBlockLayoutAlgorithmTest, PercentageBlockSizeQuirkDescendantsCaching) { /* is_new_formatting_context */ false); builder.SetAvailableSize(size); builder.SetPercentageResolutionSize(size); - builder.SetNeedsBaseline(true); + builder.SetStretchInlineSizeIfAuto(true); return builder.ToConstraintSpace(); }; @@ -297,7 +297,6 @@ TEST_F(NGBlockLayoutAlgorithmTest, LineOffsetCaching) { /* is_new_formatting_context */ false); builder.SetAvailableSize(size); builder.SetPercentageResolutionSize(size); - builder.SetNeedsBaseline(true); builder.SetBfcOffset(bfc_offset); return builder.ToConstraintSpace(); }; @@ -1653,7 +1652,8 @@ TEST_F(NGBlockLayoutAlgorithmTest, ShrinkToFit) { NGConstraintSpace space = ConstructBlockLayoutTestConstraintSpace( {WritingMode::kHorizontalTb, TextDirection::kLtr}, - LogicalSize(LayoutUnit(100), kIndefiniteSize), true); + LogicalSize(LayoutUnit(100), kIndefiniteSize), + /* stretch_inline_size_if_auto */ false); scoped_refptr<const NGPhysicalBoxFragment> fragment = RunBlockLayoutAlgorithm(container, space); @@ -1802,7 +1802,8 @@ TEST_F(NGBlockLayoutAlgorithmTest, NoFragmentation) { NGBlockNode node(GetLayoutBoxByElementId("container")); NGConstraintSpace space = ConstructBlockLayoutTestConstraintSpace( {WritingMode::kHorizontalTb, TextDirection::kLtr}, - LogicalSize(LayoutUnit(1000), kIndefiniteSize), false, + LogicalSize(LayoutUnit(1000), kIndefiniteSize), + /* stretch_inline_size_if_auto */ true, node.CreatesNewFormattingContext(), kFragmentainerSpaceAvailable); // We should only have one 150x200 fragment with no fragmentation. @@ -1830,13 +1831,14 @@ TEST_F(NGBlockLayoutAlgorithmTest, SimpleFragmentation) { NGBlockNode node(GetLayoutBoxByElementId("container")); NGConstraintSpace space = ConstructBlockLayoutTestConstraintSpace( {WritingMode::kHorizontalTb, TextDirection::kLtr}, - LogicalSize(LayoutUnit(1000), kIndefiniteSize), false, + LogicalSize(LayoutUnit(1000), kIndefiniteSize), + /* stretch_inline_size_if_auto */ true, node.CreatesNewFormattingContext(), kFragmentainerSpaceAvailable); scoped_refptr<const NGPhysicalBoxFragment> fragment = RunBlockLayoutAlgorithm(node, space); EXPECT_EQ(PhysicalSize(150, 200), fragment->Size()); - ASSERT_FALSE(fragment->BreakToken()->IsFinished()); + EXPECT_TRUE(fragment->BreakToken()); fragment = RunBlockLayoutAlgorithm(node, space, fragment->BreakToken()); EXPECT_EQ(PhysicalSize(150, 100), fragment->Size()); @@ -1873,13 +1875,14 @@ TEST_F(NGBlockLayoutAlgorithmTest, InnerChildrenFragmentation) { NGBlockNode node(GetLayoutBoxByElementId("container")); NGConstraintSpace space = ConstructBlockLayoutTestConstraintSpace( {WritingMode::kHorizontalTb, TextDirection::kLtr}, - LogicalSize(LayoutUnit(1000), kIndefiniteSize), false, + LogicalSize(LayoutUnit(1000), kIndefiniteSize), + /* stretch_inline_size_if_auto */ true, node.CreatesNewFormattingContext(), kFragmentainerSpaceAvailable); scoped_refptr<const NGPhysicalBoxFragment> fragment = RunBlockLayoutAlgorithm(node, space); EXPECT_EQ(PhysicalSize(150, 200), fragment->Size()); - ASSERT_FALSE(fragment->BreakToken()->IsFinished()); + EXPECT_TRUE(fragment->BreakToken()); FragmentChildIterator iterator(To<NGPhysicalBoxFragment>(fragment.get())); PhysicalOffset offset; @@ -1938,13 +1941,14 @@ TEST_F(NGBlockLayoutAlgorithmTest, NGBlockNode node(GetLayoutBoxByElementId("container")); NGConstraintSpace space = ConstructBlockLayoutTestConstraintSpace( {WritingMode::kHorizontalTb, TextDirection::kLtr}, - LogicalSize(LayoutUnit(1000), kIndefiniteSize), false, + LogicalSize(LayoutUnit(1000), kIndefiniteSize), + /* stretch_inline_size_if_auto */ true, node.CreatesNewFormattingContext(), kFragmentainerSpaceAvailable); scoped_refptr<const NGPhysicalBoxFragment> fragment = RunBlockLayoutAlgorithm(node, space); EXPECT_EQ(PhysicalSize(150, 200), fragment->Size()); - ASSERT_FALSE(fragment->BreakToken()->IsFinished()); + EXPECT_TRUE(fragment->BreakToken()); FragmentChildIterator iterator(To<NGPhysicalBoxFragment>(fragment.get())); PhysicalOffset offset; @@ -2001,13 +2005,14 @@ TEST_F(NGBlockLayoutAlgorithmTest, InnerChildrenFragmentationSmallHeight) { NGBlockNode node(GetLayoutBoxByElementId("container")); NGConstraintSpace space = ConstructBlockLayoutTestConstraintSpace( {WritingMode::kHorizontalTb, TextDirection::kLtr}, - LogicalSize(LayoutUnit(1000), kIndefiniteSize), false, + LogicalSize(LayoutUnit(1000), kIndefiniteSize), + /* stretch_inline_size_if_auto */ true, node.CreatesNewFormattingContext(), kFragmentainerSpaceAvailable); scoped_refptr<const NGPhysicalBoxFragment> fragment = RunBlockLayoutAlgorithm(node, space); EXPECT_EQ(PhysicalSize(150, 70), fragment->Size()); - ASSERT_FALSE(fragment->BreakToken()->IsFinished()); + EXPECT_TRUE(fragment->BreakToken()); FragmentChildIterator iterator(To<NGPhysicalBoxFragment>(fragment.get())); PhysicalOffset offset; @@ -2067,13 +2072,14 @@ TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_FloatFragmentationParallelFlows) { To<LayoutBlockFlow>(GetLayoutObjectByElementId("container"))); NGConstraintSpace space = ConstructBlockLayoutTestConstraintSpace( {WritingMode::kHorizontalTb, TextDirection::kLtr}, - LogicalSize(LayoutUnit(1000), kIndefiniteSize), false, + LogicalSize(LayoutUnit(1000), kIndefiniteSize), + /* stretch_inline_size_if_auto */ true, node.CreatesNewFormattingContext(), kFragmentainerSpaceAvailable); scoped_refptr<const NGPhysicalBoxFragment> fragment = RunBlockLayoutAlgorithm(node, space); EXPECT_EQ(PhysicalSize(150, 50), fragment->Size()); - ASSERT_FALSE(fragment->BreakToken()->IsFinished()); + EXPECT_TRUE(fragment->BreakToken()); FragmentChildIterator iterator(To<NGPhysicalBoxFragment>(fragment.get())); @@ -2090,7 +2096,8 @@ TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_FloatFragmentationParallelFlows) { space = ConstructBlockLayoutTestConstraintSpace( {WritingMode::kHorizontalTb, TextDirection::kLtr}, - LogicalSize(LayoutUnit(1000), kIndefiniteSize), false, + LogicalSize(LayoutUnit(1000), kIndefiniteSize), + /* stretch_inline_size_if_auto */ true, node.CreatesNewFormattingContext(), kFragmentainerSpaceAvailable); fragment = RunBlockLayoutAlgorithm(node, space, fragment->BreakToken()); @@ -2145,8 +2152,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, FloatFragmentationOrthogonalFlows) { To<LayoutBlockFlow>(GetLayoutObjectByElementId("container"))); NGConstraintSpace space = ConstructBlockLayoutTestConstraintSpace( {WritingMode::kHorizontalTb, TextDirection::kLtr}, - LogicalSize(LayoutUnit(1000), kIndefiniteSize), false, true, - kFragmentainerSpaceAvailable); + LogicalSize(LayoutUnit(1000), kIndefiniteSize), + /* stretch_inline_size_if_auto */ true, + /* is_new_formatting_context */ true, kFragmentainerSpaceAvailable); AdvanceToLayoutPhase(); @@ -2195,13 +2203,14 @@ TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_FloatFragmentationZeroHeight) { To<LayoutBlockFlow>(GetLayoutObjectByElementId("container"))); NGConstraintSpace space = ConstructBlockLayoutTestConstraintSpace( {WritingMode::kHorizontalTb, TextDirection::kLtr}, - LogicalSize(LayoutUnit(1000), kIndefiniteSize), false, + LogicalSize(LayoutUnit(1000), kIndefiniteSize), + /* stretch_inline_size_if_auto */ true, node.CreatesNewFormattingContext(), kFragmentainerSpaceAvailable); scoped_refptr<const NGPhysicalBoxFragment> fragment = RunBlockLayoutAlgorithm(node, space); EXPECT_EQ(PhysicalSize(150, 50), fragment->Size()); - ASSERT_FALSE(fragment->BreakToken()->IsFinished()); + EXPECT_TRUE(fragment->BreakToken()); FragmentChildIterator iterator(To<NGPhysicalBoxFragment>(fragment.get())); const auto* child = iterator.NextChild(); @@ -2215,7 +2224,8 @@ TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_FloatFragmentationZeroHeight) { space = ConstructBlockLayoutTestConstraintSpace( {WritingMode::kHorizontalTb, TextDirection::kLtr}, - LogicalSize(LayoutUnit(1000), kIndefiniteSize), false, + LogicalSize(LayoutUnit(1000), kIndefiniteSize), + /* stretch_inline_size_if_auto */ true, node.CreatesNewFormattingContext(), kFragmentainerSpaceAvailable); fragment = RunBlockLayoutAlgorithm(node, space, fragment->BreakToken()); @@ -2355,7 +2365,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, ZeroBlockSizeAboveEdge) { To<LayoutBlockFlow>(GetLayoutObjectByElementId("container"))); NGConstraintSpace space = ConstructBlockLayoutTestConstraintSpace( {WritingMode::kHorizontalTb, TextDirection::kLtr}, - LogicalSize(LayoutUnit(1000), kIndefiniteSize), false, true); + LogicalSize(LayoutUnit(1000), kIndefiniteSize), + /* stretch_inline_size_if_auto */ true, + /* is_new_formatting_context */ true); scoped_refptr<const NGPhysicalBoxFragment> fragment = RunBlockLayoutAlgorithm(node, space); @@ -2393,7 +2405,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, NewFcFirstChildIsZeroBlockSize) { To<LayoutBlockFlow>(GetLayoutObjectByElementId("container"))); NGConstraintSpace space = ConstructBlockLayoutTestConstraintSpace( {WritingMode::kHorizontalTb, TextDirection::kLtr}, - LogicalSize(LayoutUnit(1000), kIndefiniteSize), false, true); + LogicalSize(LayoutUnit(1000), kIndefiniteSize), + /* stretch_inline_size_if_auto */ true, + /* is_new_formatting_context */ true); scoped_refptr<const NGPhysicalBoxFragment> fragment = RunBlockLayoutAlgorithm(node, space); |