Commit 58aad48a authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Chromium LUCI CQ

Handle inner floated multicol at outer boundary.

This used to crash, because we ignored layout abortions on floats,
and would attempt to use the fragment (which is nullptr).

Bug: 829028
Change-Id: I04c44030d33182fd3020e8091228668d7f8a7190
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2592805Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837713}
parent 90c0bb3a
...@@ -1137,11 +1137,6 @@ void NGBlockLayoutAlgorithm::HandleFloat( ...@@ -1137,11 +1137,6 @@ void NGBlockLayoutAlgorithm::HandleFloat(
NGPositionedFloat positioned_float = NGPositionedFloat positioned_float =
PositionFloat(&unpositioned_float, &exclusion_space_); PositionFloat(&unpositioned_float, &exclusion_space_);
const NGLayoutResult& layout_result = *positioned_float.layout_result;
// TODO(mstensho): Handle abortions caused by block fragmentation.
DCHECK_EQ(layout_result.Status(), NGLayoutResult::kSuccess);
if (positioned_float.need_break_before) { if (positioned_float.need_break_before) {
DCHECK(ConstraintSpace().HasBlockFragmentation()); DCHECK(ConstraintSpace().HasBlockFragmentation());
LayoutUnit fragmentainer_block_offset = LayoutUnit fragmentainer_block_offset =
...@@ -1158,6 +1153,8 @@ void NGBlockLayoutAlgorithm::HandleFloat( ...@@ -1158,6 +1153,8 @@ void NGBlockLayoutAlgorithm::HandleFloat(
return; return;
} }
DCHECK_EQ(positioned_float.layout_result->Status(), NGLayoutResult::kSuccess);
// TODO(mstensho): There should be a class A breakpoint between a float and // TODO(mstensho): There should be a class A breakpoint between a float and
// another float, and also between a float and an in-flow block. // another float, and also between a float and an in-flow block.
......
...@@ -262,6 +262,14 @@ NGPositionedFloat PositionFloat(NGUnpositionedFloat* unpositioned_float, ...@@ -262,6 +262,14 @@ NGPositionedFloat PositionFloat(NGUnpositionedFloat* unpositioned_float,
layout_result = node.Layout(space, unpositioned_float->token.get()); layout_result = node.Layout(space, unpositioned_float->token.get());
if (layout_result->Status() != NGLayoutResult::kSuccess) {
DCHECK_EQ(layout_result->Status(),
NGLayoutResult::kOutOfFragmentainerSpace);
need_break_before = true;
return NGPositionedFloat(std::move(layout_result), NGBfcOffset(),
need_break_before);
}
// If we knew the right block-offset up front, we're done. // If we knew the right block-offset up front, we're done.
if (!optimistically_placed) if (!optimistically_placed)
break; break;
......
<!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/#the-multi-column-model">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="margin-left:-100px; columns:2; height:200px; width:200px; column-gap:0; column-fill:auto;">
<div style="height:200px;"></div>
<div style="float:left; columns:2; width:100%; column-gap:0; background:red;">
<div style="height:200px; background:green;"></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