column-width not handled correctly for intrinsic sizing

#41459384 Filed 2019-05-17 Status: New (P4 / S5) CL 8608947

Summary

Problem

A multicol with column-width set and column-count:auto currently reports a max-content inline size of max(column-width, content_max_content), so a child wider than column-width stretches the container. Per css-sizing-4 "Max-content Sizes in Unconstrained-height Multi-column Layout", the max-content inline size is column-width × used_column_count, which is one column when column-count is auto. Firefox already does this. Open since 2019.

Fix (CL 8608947)

In ColumnLayoutAlgorithm::ComputeMinMaxSizes, when Style().HasAutoColumnCount(), clamp result.sizes.max_size to column_width. Behind MulticolColumnWidthMaxContentClamp (status: "stable") as a kill switch; drops the stale multicol-width-005.html TestExpectations line.

Repro

Two multicols with width: fit-content and a 100px child. With columns: 50px (= column-width:50;column-count:auto) the first multicol stretches to 100px pre-fix; post-fix it collapses to the column-width (50px) and the child overflows. With columns: 150px the child already fits one column, so nothing changes.

multicol with column-count:auto + wide child

Live render. On unpatched Chrome the top (blue) multicol stretches to 100px to fit the yellow child; on patched Chrome (or Firefox) it stays at 50px (= column-width) and the child overflows.
Expected: blue multicol at 50px with overflowing child
Patched content_shell = spec = Firefox.
Diff: pixels that change between before and after
Magenta: 347 px changed between before and after, all in the top (columns:50px) case.

content_shell: before / after

pre-fix: #m50 stretches to 100px
before#m50 = 100 px (stretches to child)
post-fix: #m50 stays at 50px (column-width)
after#m50 = 50 px (= column-width)

References

crbug.com/41459384 -- original report (filed 2019-05-17)

CL 8608947 -- Clamp multicol max-content size to column-width with column-count:auto

css-sizing-4 § Max-content Sizes in Unconstrained-height Multi-column Layout

standalone sampler.html