Skip to content

[css-multicol] Improve column-fill and make it backward-compatible #3224

Closed
@mstensho

Description

@mstensho

Chromium, Edge and WebKit all seem to implement column-fill:auto as specified in the CR: https://www.w3.org/TR/2011/CR-css3-multicol-20110412/#cf

In particular, when block size is unconstrained, balancing is forced.

Example:

<div style="columns:3; column-fill:auto;">
  column-fill is auto.<br>
  Height is unconstrained<br>
  The old spec says to force balancing in such situations.<br>
  The new spec does not say anything about to that effect.<br>
</div>

Gecko doesn't force balancing in this case, while all the other do it. Gecko appears to follow the new spec: https://drafts.csswg.org/css-multicol/#cf for column-fill:auto. It does have issues with column-fill:balance if height is non-auto, though:

<div style="columns:3; height:20em; column-fill:balance;">
  column-fill is balance.<br>
  Height is non-auto, and large.<br>
  This should still be balanced<br>
  although everything *could* fit in the first column<br>
</div>

All spec versions require the above to be balanced, but Gecko doesn't do it. But note that if you shrink the height from 20em to e.g. 10em it gets balanced - so this looks like a bug and not deliberate behavior.

The spec was changed in 2012 by Håkon Wium Lie:
e0a990c

Given that Gecko has bugs in its implementation, and given that all the others still follow the old spec, I think we have an opportunity to fix the new spec. Most importantly, I'd like the spec to be backward-compatible, so that column-fill:auto forces balancing if block size is unconstrained (and before each spanner).

If we really want a mode that never forces balancing, how about introducing column-fill:fill for that? That mode could even refrain from balancing before spanners (and only break if there are explicit breaks).

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions