Commit 9d15ff73 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Chromium LUCI CQ

Handle inner fieldset / legend multicol at outer boundary.

This used to fail a DCHECK when nested multicol was specified on a
fieldset at an outer fragmentainer boundary, but apart from that, it
worked fine, because BreakBeforeChildIfNeeded() correctly detects the
situation (abortion) and inserts a break before. Just move the DCHECK a
bit down.

No code changes are required for legends, as they are monolithic. Just
replace the TODO with a proper comment, and keep the DCHECK (the legend
test also passes without the code changes in this CL).

Bug: 829028
Change-Id: I62bf97f9bd04c185f86e93103f204cc6d872c438
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2595288Reviewed-by: default avatarAlison Maher <almaher@microsoft.com>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837755}
parent 9b246de6
......@@ -246,7 +246,7 @@ void NGFieldsetLayoutAlgorithm::LayoutLegend(NGBlockNode& legend) {
scoped_refptr<const NGLayoutResult> result =
legend.Layout(legend_space, BreakToken());
// TODO(layout-dev): Handle abortions caused by block fragmentation.
// Legends are monolithic, so abortions are not expected.
DCHECK_EQ(result->Status(), NGLayoutResult::kSuccess);
const auto& physical_fragment = result->PhysicalFragment();
......@@ -350,9 +350,6 @@ NGBreakStatus NGFieldsetLayoutAlgorithm::LayoutFieldsetContent(
NGCacheSlot::kLayout);
auto result = fieldset_content.Layout(child_space, content_break_token.get());
// TODO(layout-dev): Handle abortions caused by block fragmentation.
DCHECK_EQ(result->Status(), NGLayoutResult::kSuccess);
NGBreakStatus break_status = NGBreakStatus::kContinue;
if (ConstraintSpace().HasBlockFragmentation()) {
bool has_container_separation = is_legend_past_border_;
......@@ -367,6 +364,7 @@ NGBreakStatus NGFieldsetLayoutAlgorithm::LayoutFieldsetContent(
}
if (break_status == NGBreakStatus::kContinue) {
DCHECK_EQ(result->Status(), NGLayoutResult::kSuccess);
LogicalOffset offset(borders_.inline_start, intrinsic_block_size_);
container_builder_.AddResult(*result, offset);
intrinsic_block_size_ +=
......
......@@ -997,6 +997,7 @@ virtual/layout_ng_block_frag/external/wpt/css/css-multicol/multicol-span-all-fie
virtual/layout_ng_block_frag/external/wpt/css/css-multicol/multicol-span-all-fieldset-003.html [ Pass ]
virtual/layout_ng_block_frag/external/wpt/css/css-multicol/multicol-span-all-margin-bottom-001.xht [ Pass ]
virtual/layout_ng_block_frag/external/wpt/css/css-multicol/multicol-span-float-001.xht [ Pass ]
virtual/layout_ng_block_frag/external/wpt/css/css-multicol/nested-at-outer-boundary-as-fieldset.html [ Pass ]
virtual/layout_ng_block_frag/external/wpt/css/css-multicol/nested-with-too-tall-line.html [ Pass ]
virtual/layout_ng_block_frag/external/wpt/css/css-multicol/non-adjacent-spanners-000.html [ Pass ]
virtual/layout_ng_block_frag/external/wpt/css/css-multicol/spanner-fragmentation-001.html [ Pass ]
......@@ -3214,6 +3215,7 @@ crbug.com/636055 external/wpt/css/css-multicol/multicol-span-all-margin-nested-0
crbug.com/990240 external/wpt/css/css-multicol/multicol-span-all-rule-001.html [ Failure ]
crbug.com/792446 external/wpt/css/css-multicol/multicol-span-float-001.xht [ Failure ]
crbug.com/964183 external/wpt/css/css-multicol/multicol-width-005.html [ Failure ]
crbug.com/829028 external/wpt/css/css-multicol/nested-at-outer-boundary-as-fieldset.html [ Failure ]
crbug.com/829028 external/wpt/css/css-multicol/nested-with-too-tall-line.html [ Failure ]
crbug.com/829028 external/wpt/css/css-multicol/non-adjacent-spanners-000.html [ Failure ]
crbug.com/829028 external/wpt/css/css-multicol/spanner-fragmentation-001.html [ Failure ]
......
<!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:100px; width:200px; column-gap:0; column-fill:auto; background:red;">
<div style="height:100px; background:white;"></div>
<fieldset style="columns:2; column-gap:0; border:none; margin:0; padding:0; background:red;">
<div style="height:200px; background:green;"></div>
</fieldset>
</div>
<!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:100px; width:200px; column-gap:0; column-fill:auto; background:red;">
<div style="height:100px; background:white;"></div>
<fieldset style="border:none; margin:0; padding:0; background:red;">
<legend style="columns:2; column-gap:0; margin:0; padding:0; width:100%;">
<div style="height:200px; background:green;"></div>
</legend>
</fieldset>
</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