Commit 3c574083 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Chromium LUCI CQ

If a fragment is too tall, just break before it.

There was some old code that wasn't needed anymore, and it was causing
trouble for nested multicol. We need to break before a multicol
container if it doesn't fit. The column layout algorithm always tries to
limit the block size of an inner multicol container, so that it will fit
in the outer fragmentation context. If that's not possible, though, we
need to break before it and retry in the next outer fragmentainer.

So for multicol container children we needed the code path that we
previously only ran for child.IsMonolithic(), but we can in fact always
do that (if it doesn't fit, and we're allowed to break, let's break!),
so just delete the unnecessary code, and fix 5 tests. :)

Bug: 829028
Change-Id: I93b6b10c8b427055e69f094b460c13fa68a49fa6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575031
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834585}
parent 67c1bb64
...@@ -639,38 +639,20 @@ bool MovePastBreakpoint(const NGConstraintSpace& space, ...@@ -639,38 +639,20 @@ bool MovePastBreakpoint(const NGConstraintSpace& space,
builder->SetBreakAppeal(appeal_inside); builder->SetBreakAppeal(appeal_inside);
return true; return true;
} }
} else { } else if (refuse_break_before || fragment.BlockSize() <= space_left) {
bool need_break; // The child either fits, or we are not allowed to break. So we can move
if (refuse_break_before) { // past this breakpoint.
need_break = false; if (child.IsBlock() && builder) {
} else if (child.IsMonolithic()) { // We're tentatively not going to break before or inside this child, but
// If the monolithic piece of content (e.g. a line, or block-level // we'll check the appeal of breaking there anyway. It may be the best
// replaced content) doesn't fit, we need a break. // breakpoint we'll ever find. (Note that we only do this for block
need_break = fragment.BlockSize() > space_left; // children, since, when it comes to inline layout, we first need to lay
} else { // out all the line boxes, so that we know what do to in order to honor
// If the block-offset is past the fragmentainer boundary (or exactly at // orphans and widows, if at all possible.)
// the boundary), no part of the fragment is going to fit in the current UpdateEarlyBreakAtBlockChild(space, To<NGBlockNode>(child), layout_result,
// fragmentainer. Fragments may be pushed past the fragmentainer boundary appeal_before, builder);
// by margins. We shouldn't break before a zero-size block that's exactly
// at a fragmentainer boundary, though.
need_break = space_left < LayoutUnit() ||
(space_left == LayoutUnit() && fragment.BlockSize());
}
if (!need_break) {
if (child.IsBlock() && builder) {
// If this doesn't happen, though, we're tentatively not going to break
// before or inside this child, but we'll check the appeal of breaking
// there anyway. It may be the best breakpoint we'll ever find. (Note
// that we only do this for block children, since, when it comes to
// inline layout, we first need to lay out all the line boxes, so that
// we know what do to in order to honor orphans and widows, if at all
// possible.)
UpdateEarlyBreakAtBlockChild(space, To<NGBlockNode>(child),
layout_result, appeal_before, builder);
}
return true;
} }
return true;
} }
// We don't want to break inside, so we should attempt to break before. // We don't want to break inside, so we should attempt to break before.
......
...@@ -1073,13 +1073,10 @@ crbug.com/1066629 virtual/layout_ng_block_frag/fast/multicol/hit-test-translate- ...@@ -1073,13 +1073,10 @@ crbug.com/1066629 virtual/layout_ng_block_frag/fast/multicol/hit-test-translate-
crbug.com/829181 virtual/layout_ng_block_frag/fast/multicol/infinitely-tall-content-in-outer-crash.html [ Skip ] crbug.com/829181 virtual/layout_ng_block_frag/fast/multicol/infinitely-tall-content-in-outer-crash.html [ Skip ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/insane-column-gap.html [ Failure ] crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/insane-column-gap.html [ Failure ]
crbug.com/1066626 virtual/layout_ng_block_frag/fast/multicol/layers-split-across-columns.html [ Failure ] crbug.com/1066626 virtual/layout_ng_block_frag/fast/multicol/layers-split-across-columns.html [ Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/line-too-tall-for-second-outer-row.html [ Failure ]
crbug.com/1066626 virtual/layout_ng_block_frag/fast/multicol/mixed-opacity-fixed-test.html [ Failure ] crbug.com/1066626 virtual/layout_ng_block_frag/fast/multicol/mixed-opacity-fixed-test.html [ Failure ]
crbug.com/1079031 virtual/layout_ng_block_frag/fast/multicol/mixed-opacity-test.html [ Crash Failure ] crbug.com/1079031 virtual/layout_ng_block_frag/fast/multicol/mixed-opacity-test.html [ Crash Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/nested-auto-height-short-first-row.html [ Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/nested-balanced-inner-column-count-1-with-forced-break.html [ Failure ] crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/nested-balanced-inner-column-count-1-with-forced-break.html [ Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/nested-short-first-row-extra-tall-line.html [ Failure ] crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/nested-short-first-row-extra-tall-line.html [ Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/nested-short-first-row-unsplittable-block.html [ Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/nested-very-tall-inside-short-crash.html [ Skip ] crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/nested-very-tall-inside-short-crash.html [ Skip ]
crbug.com/1058792 virtual/layout_ng_block_frag/fast/multicol/nested-with-composited-and-multicol-crash.html [ Crash ] crbug.com/1058792 virtual/layout_ng_block_frag/fast/multicol/nested-with-composited-and-multicol-crash.html [ Crash ]
crbug.com/1131125 virtual/layout_ng_block_frag/fast/multicol/nested-with-forced-breaks-in-eariler-rows.html [ Failure ] crbug.com/1131125 virtual/layout_ng_block_frag/fast/multicol/nested-with-forced-breaks-in-eariler-rows.html [ Failure ]
...@@ -1096,8 +1093,6 @@ crbug.com/1079031 virtual/layout_ng_block_frag/fast/multicol/positioned-outside- ...@@ -1096,8 +1093,6 @@ crbug.com/1079031 virtual/layout_ng_block_frag/fast/multicol/positioned-outside-
crbug.com/1079031 virtual/layout_ng_block_frag/fast/multicol/positioned-split.html [ Failure ] crbug.com/1079031 virtual/layout_ng_block_frag/fast/multicol/positioned-split.html [ Failure ]
crbug.com/1058792 virtual/layout_ng_block_frag/fast/multicol/span/invalid-spanner-in-transform.html [ Failure Crash ] crbug.com/1058792 virtual/layout_ng_block_frag/fast/multicol/span/invalid-spanner-in-transform.html [ Failure Crash ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/span/outer-column-break-after-inner-spanner-2.html [ Failure ] crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/span/outer-column-break-after-inner-spanner-2.html [ Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/span/outer-column-break-after-inner-spanner-and-float.html [ Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/span/outer-column-break-after-inner-spanner.html [ Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/span/preferred-widths-with-column-content.html [ Failure ] crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/span/preferred-widths-with-column-content.html [ Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/span/spanner-with-margins-between-margins.html [ Failure ] crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/span/spanner-with-margins-between-margins.html [ Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/span/trailing-margin-before-spanner.html [ Failure ] crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/span/trailing-margin-before-spanner.html [ Failure ]
......
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