Commit 09c506b2 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Chromium LUCI CQ

Honor min-block-size when calculating balanced column block-size.

We paid attention to block-size and max-block-size, but not
min-block-size.

Bug: 829028
Change-Id: Iad8920b7d46e3cd6b73645343d85ff9f1ee532dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2566750Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832225}
parent 2f1a893e
......@@ -1004,11 +1004,16 @@ LayoutUnit NGColumnLayoutAlgorithm::ConstrainColumnBlockSize(
extent = ResolveMainBlockLength(ConstraintSpace(), style, BorderPadding(),
style.LogicalHeight(), kIndefiniteSize,
LengthResolvePhase::kLayout);
// A specified block-size will just constrain the maximum length.
if (extent != kIndefiniteSize)
max = std::min(max, extent);
}
if (extent != kIndefiniteSize) {
// A specified height/width will just constrain the maximum length.
max = std::min(max, extent);
}
// A specified min-block-size may increase the maximum length.
LayoutUnit min = ResolveMinBlockLength(
ConstraintSpace(), style, BorderPadding(), style.LogicalMinHeight(),
LengthResolvePhase::kLayout);
max = std::max(max, min);
// If this multicol container is nested inside another fragmentation
// context, we need to subtract the space consumed in previous fragments.
......
<!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/#filling-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; height:20px; max-height:40px; min-height:100px; background:red;">
<div style="height:200px; background:green;"></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