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

[LayoutNG] Don't prevent column breaks before a spanner.

A column spanner essentially overrides the rules in
https://www.w3.org/TR/css-break-3/#unforced-breaks ; e.g. if a block has
a spanner as its first child, it's perfectly okay to break right before
the spanner, even if this means that we're not really breaking *between*
stuff (class A breakpoints only occur *between* siblings). So set break
appeal to perfect, or it'd be a last-resort breakpoint.

Bug: 829028
Change-Id: I34cb1853febe38a766cc74ebbc5efff61aee653c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2440528Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812706}
parent 934d4435
...@@ -255,9 +255,14 @@ bool FinishFragmentation(NGBlockNode node, ...@@ -255,9 +255,14 @@ bool FinishFragmentation(NGBlockNode node,
LayoutUnit final_block_size = desired_block_size; LayoutUnit final_block_size = desired_block_size;
if (builder->FoundColumnSpanner()) if (builder->FoundColumnSpanner()) {
builder->SetDidBreakSelf(); builder->SetDidBreakSelf();
// A break before a spanner is a forced break, and is thus "perfect". It
// need not be weighed against other possible break points.
builder->SetBreakAppeal(kBreakAppealPerfect);
}
if (is_past_end) { if (is_past_end) {
final_block_size = intrinsic_block_size = LayoutUnit(); final_block_size = intrinsic_block_size = LayoutUnit();
} else if (builder->FoundColumnSpanner()) { } else if (builder->FoundColumnSpanner()) {
......
<!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/#spanning-columns">
<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="columns:2; column-gap:0; width:100px; background:red;">
<div style="height:40px; background:green;"></div>
<div style="padding-top:20px; background:green;">
<div style="column-span:all; height:70px; 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