Commit e8ad8cc4 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

[LayoutNG] Find sibling spanners using the child iterator.

We need to update the child iterator with where we ended up, so that the
check (after the outer loop) for whether we're at the end or not works
as intended, so that we SetHasSeenAllChildren() if we're at the end,
lest we start from the very beginning of the multicol container when
resuming layout after the spanners, which would result in an "infinite"
loop (well, until we run out of memory, anyway).

Bug: 1052834
Change-Id: I6650e9dc2c209ef6097b067344c9cff019ee4071
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527139Reviewed-by: default avatarAlison Maher <almaher@microsoft.com>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825983}
parent 08eeadf3
...@@ -642,8 +642,10 @@ inline scoped_refptr<const NGLayoutResult> NGBlockLayoutAlgorithm::Layout( ...@@ -642,8 +642,10 @@ inline scoped_refptr<const NGLayoutResult> NGBlockLayoutAlgorithm::Layout(
// there's a subsequent sibling that's not a spanner, we're resume right // there's a subsequent sibling that's not a spanner, we're resume right
// in front of that one. Otherwise we'll just resume after all the // in front of that one. Otherwise we'll just resume after all the
// children. // children.
for (NGLayoutInputNode sibling = child.NextSibling(); sibling; for (entry = child_iterator.NextChild();
sibling = sibling.NextSibling()) { NGLayoutInputNode sibling = entry.node;
entry = child_iterator.NextChild()) {
DCHECK(!entry.token);
if (sibling.IsColumnSpanAll()) if (sibling.IsColumnSpanAll())
continue; continue;
container_builder_.AddBreakBeforeChild(sibling, kBreakAppealPerfect, container_builder_.AddBreakBeforeChild(sibling, kBreakAppealPerfect,
......
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/css-multicol-1/#column-span">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1052834">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div style="columns:3; width:100px; background:green;">
<div>
<div style="column-span:all; height:10px; margin-bottom:50px;"></div>
<div style="column-span:all; height:10px; margin-top:80px;"></div>
</div>
</div>
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