Re: [csswg-drafts] [css-overflow-4] max-lines and independent formatting contexts (#12962)

The CSS Working Group just discussed `[css-overflow-4] max-lines and independent formatting contexts`, and agreed to the following:

* `RESOLVED: Keep the behavior of line-clamp as-is, but design an opt-in for max-lines to count IFCs/tracks/lines to satisfy this use case`

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> fantasai: this came up when discussing select<br>
&lt;emilio> ... the fact that max-lines counts line is useful but it doesn't count ifcs<br>
&lt;emilio> ... options in a select they are each one line but with customizable selects they could be a flexbox<br>
&lt;emilio> ... and it seemed useful that max-lines should count theme<br>
&lt;emilio> s/theme/them<br>
&lt;emilio> ... ian and tab say it probably runs into compat issues<br>
&lt;emilio> ... but they noted that line-clamp in other than a flexbox or other such formatting context it could be made to work<br>
&lt;emilio> q+<br>
&lt;emilio> TabAtkins: proposal is making max-lines do something useful in other display-modes so it adds children or lines (whatever appropriate)<br>
&lt;emilio> iank_: implementation wise we could ship unprefixed line-clamp ahead of this<br>
&lt;florian> q+<br>
&lt;emilio> ... assuming we don't split it out into all its shorthands<br>
&lt;emilio> TabAtkins: it'd be a potential compat issue<br>
&lt;oriol> q+<br>
&lt;emilio> iank_: already a compat issue for the -webkit- version right?<br>
&lt;emilio> florian: we might want to differentiate the -webkit- line clamp<br>
&lt;emilio> emilio: let's not<br>
&lt;emilio> florian: otherwise you try to apply lineclamp to a flexbox and it doesn't work<br>
&lt;emilio> ... if you do so it turns the flexbox into a block and then applies<br>
&lt;emilio> ... if you don't then it stays a flexbox<br>
&lt;emilio> ... for every page that has set up the webkit line-clamp a little wrong it might break<br>
&lt;emilio> iank_: we have a use counter for this, it'll break pages<br>
&lt;emilio> ... there's also autoprefixers that remove<br>
&lt;emilio> emilio: then differentiating the -webkit- prefix doesn't really help either right?<br>
&lt;emilio> florian: so we need an opt-in<br>
&lt;emilio> fantasai: key off block-ellipsis?<br>
&lt;emilio> iank_: that might work<br>
&lt;emilio> (+1)<br>
&lt;florian> q-<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> scribe+<br>
&lt;fantasai> emilio: Seems like keying off of block-ellipsis may be useful, because you don't need to figure out how to put an ellipsis on e.g. a flexbox<br>
&lt;iank_> q+<br>
&lt;fantasai> emilio: Also it seems like it could be a useful thing in block layout, so this would make it possible to opt in<br>
&lt;fantasai> TabAtkins: problem with block is that you have mixed text lines and blocks<br>
&lt;fantasai> emilio: if it's opt in, no compat issue<br>
&lt;fantasai> emilio: not hard either way, you have lines. Some are IFCs, we skip over atm.<br>
&lt;fantasai> TabAtkins: so opposite, count IFCs instead of lines<br>
&lt;fantasai> emilio: I was thinking you count both<br>
&lt;fantasai> emilio: Seems useful<br>
&lt;astearns> ack oriol<br>
&lt;fantasai> emilio: and doesn't do anything useful on flexboxes atm<br>
&lt;emilio> oriol: If I understand correctly it'd work when set directly on flex / grid<br>
&lt;fantasai> oriol: If I understand, proposal is that it would work when set directly on flex or grid container<br>
&lt;emilio> ... would it recurse on a flex child?<br>
&lt;emilio> TabAtkins: it wouldn't recurse<br>
&lt;emilio> ... flex children are IFCs<br>
&lt;emilio> oriol: would it count as 0 or 1?<br>
&lt;astearns> ack iank_<br>
&lt;emilio> TabAtkins: counting as 1 was a way of making this work with the existing functionality, but leaning to an opt-in<br>
&lt;emilio> oriol: sounds good then<br>
&lt;emilio> iank_: just for a sense of the compat issue, it's in 40% of loads, so deviating from current -webkit-line-clamp is hard<br>
&lt;emilio> ... auto-prefixers are also adding unprefixed line-clamps<br>
&lt;emilio> ... general preference is keeping -webkit-line-clamp the same<br>
&lt;emilio> ... so we don't need to come back here :)<br>
&lt;emilio> ... fine with this working in other layout modes as long as it's opt-in<br>
&lt;emilio> ... the explicit compat issue of changing atm is that it's not inconceivable that someone places an empty div or flex<br>
&lt;astearns> ack fantasai<br>
&lt;emilio> ... so I think we're a bit constrained<br>
&lt;emilio> fantasai: the benefit of using block-ellipsis as the opt-in is that line-clamp sets it to something<br>
&lt;emilio> iank_: so we could ship line-clamp without shorthandifying<br>
&lt;emilio> astearns: do we want to resolve on this opt-in?<br>
&lt;fantasai> emilio: 2 options - keying off block-ellipsis and adding some opt-in into max-lines explicitly<br>
&lt;fantasai> emilio: Both are fine compat-wise, question is, do you want both behaviors in max-lines<br>
&lt;florian> q+<br>
&lt;fantasai> emilio: It'd be a bit weird if in order to get the non-IFC thing you have to set block-ellipsis to an empty string<br>
&lt;astearns> ack florian<br>
&lt;fantasai> florian: Depends on whether we only want to have it apply to flex directly<br>
&lt;fantasai> florian: there's nowhere to put ellipsis anywhere anyway<br>
&lt;fantasai> florian: but if a block has flex children and want to count the flex children, then that's different<br>
&lt;fantasai> fantasai: Not proposing to cross IFC boundaries<br>
&lt;fantasai> florian: Currently flex containers don't get counted.<br>
&lt;fantasai> florian: Could count as 0 or 1 or number of children<br>
&lt;fantasai> emilio: No, counting children is crossing IFC boundaries<br>
&lt;TabAtkins> q+<br>
&lt;fantasai> emilio: The only thing keying off block ellispsis doesn't allow is to count IFCs *and* put a block ellipsis<br>
&lt;TabAtkins> q-<br>
&lt;fantasai> florian: block-ellipsis isn't set on the clamping container, and takes effect on the innermost block<br>
&lt;fantasai> TabAtkins: propose to not resolve on a specific syntax now, but resolve that we will create an IFC-counting system<br>
&lt;fantasai> astearns: but not changing what line-clamp does<br>
&lt;emilio> PROPOSED: Keep line-clamp as is, design opt-in to allow counting IFCs to solve this use-case<br>
&lt;fantasai> PROPOSED: Keep the behavior of line-clamp as-is, but design an opt-in for max-lines to count IFCs to satisfy this use case<br>
&lt;oriol> q+<br>
&lt;fantasai> PROPOSED: Keep the behavior of line-clamp as-is, but design an opt-in for max-lines to count IFCs/tracks/lines to satisfy this use case<br>
&lt;florian> q-<br>
&lt;astearns> ack oriol<br>
&lt;fantasai> oriol: Instead of having to use an opt-in, what about an opt-out that would be automatically set using -webkit-line-clamp<br>
&lt;fantasai> emilio, iank_: Need to also set for unprefixed line-clamp. It's being used already.<br>
&lt;fantasai> RESOLVED: Keep the behavior of line-clamp as-is, but design an opt-in for max-lines to count IFCs/tracks/lines to satisfy this use case<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12962#issuecomment-3807724332 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 27 January 2026 21:54:36 UTC