Re: [csswg-drafts] [css-overflow] interaction between text-overflow:ellipsis and line-clamp (#10823)

The CSS Working Group just discussed `[css-overflow] interaction between text-overflow:ellipsis and line-clamp`, and agreed to the following:

* `RESOLVED: Close no change (text-overflow shoudl work as normal in line-calmp containers)`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> andreubotella: in chrome's impl of -webkit-line-clamp if you set text-overflow:ellipsis<br>
&lt;TabAtkins> andreubotella: that will not take effect<br>
&lt;TabAtkins> andreubotella: i'm not sure if webkit's behavior, originally or currently, works liek that<br>
&lt;TabAtkins> (there's no ellipsis)<br>
&lt;florian> q+<br>
&lt;TabAtkins> andreubotella: the ellipsis defined by block-ellipsis is a different thing than text-overflow:ellipsis<br>
&lt;TabAtkins> andreubotella: block-ellipsis is specified to be placed at a soft-wrap opportunity<br>
&lt;TabAtkins> andreubotella: so with current spec text, text-overflow and block-overflow can apply to same element<br>
&lt;TabAtkins> andreubotella: so in chromium we're going to ship line-clamp without letting you specify a custom block ellipsis<br>
&lt;TabAtkins> andreubotella: this'll only really have an effect on the lines before the clamp point<br>
&lt;TabAtkins> andreubotella: if you have a block-ellipsis set to a string, and it's a long string, longer than the line lenth, that interaction with clamping must be considered<br>
&lt;TabAtkins> andreubotella: the chromium impl currently has an impl of this, with block-ellipsis and breaking at soft wrap, behidn a flag<br>
&lt;TabAtkins> andreubotella: and that would not prevent text-overflow from also working on the same line<br>
&lt;astearns> ack florian<br>
&lt;TabAtkins> florian: as a reminder, text-overflow:ellipsis, tho it also adds a ..., works super differently<br>
&lt;TabAtkins> florian: doesn't work on a block as a whole, it's on individual lines<br>
&lt;TabAtkins> florian: if a given line, after wrapping, overflows, it truncate sand visually places a ...<br>
&lt;TabAtkins> florian: no effect on layout<br>
&lt;TabAtkins> florian: lines after the last one (after clamp/balance/ellipse) and some lines above the clamp point overflow<br>
&lt;TabAtkins> florian: spec says to do the ellipsis on those<br>
&lt;TabAtkins> florian: i think theoreticaldly that's the right thing, but i think we don't really have a ton of use-cases for this<br>
&lt;TabAtkins> florian: i think text-overflow is best used on single-line things<br>
&lt;TabAtkins> florian: the things you use text-overflow:ellipsis on and line-calmp on are typically not the same<br>
&lt;TabAtkins> florian: so even tho they're specified to both work independently, if we said they can't work together, don't think i'd be sad<br>
&lt;TabAtkins> florian: second, for block-ellipsis with a long string, that might be long and overflow, then what<br>
&lt;TabAtkins> florian: spec currently says if the block-ellipsis overflow doesn't fit th eline, how you deal with *taht* is handled by text-overflow<br>
&lt;TabAtkins> florian: it gives you options for how to deal with the long ellipsis. makes sense in theory<br>
&lt;TabAtkins> q+<br>
&lt;fantasai> scribe+<br>
&lt;astearns> ack TabAtkins<br>
&lt;fantasai> TabAtkins: I don't understand what interaction is happening that makes line-clamp not work with text-overflow:ellipsis<br>
&lt;fantasai> florian: It could happen in theory, just not happening in practice<br>
&lt;fantasai> TabAtkins: what happens when you do have an extra-long line in a line-clamped container?<br>
&lt;fantasai> andreubotella: In current implementation, if this is not the last line, nothing happens and line overflows.<br>
&lt;fantasai> andreubotella: If it's the last line, currently all implementations currently behave the same as text-overflow:ellipsis, but not in my prototype<br>
&lt;fantasai> TabAtkins: That's odd and unfortunate.<br>
&lt;fantasai> TabAtkins: I really don't see why they're linked. Maybe some reason in implementation, but seems very strange.<br>
&lt;fantasai> TabAtkins: The one case that they should both work together is &lt;pre> is to have text-overflow to not be too long, and line-clamp to not be too long<br>
&lt;florian> q+<br>
&lt;fantasai> TabAtkins: having to choose between overflow down vs overflow to the side seems bad. IDK why we are adopting such a limitation<br>
&lt;fantasai> andreubotella: I don't know why that is the case. It was the case when I started working on line-clamp<br>
&lt;fantasai> andreubotella: I expect it's because initially the ellipsis for line-clamp was implemented the same way as text-ellipsis<br>
&lt;fantasai> andreubotella: I don't know why it wouldn't apply to other lines<br>
&lt;astearns> ack fantasai<br>
&lt;TabAtkins> fantasai: i think i agree with TAb that it doesn't amke sense for these to be interacting. text-overflow just applies after you do all the line-clamp stuff, makes sense<br>
&lt;TabAtkins> fantasai: it seems reasonble that if the -webkit-overflow did their ellipsis with the text-overflow mechanism, it doesn't work. makes sense as an accciendtal limitation<br>
&lt;astearns> ack florian<br>
&lt;TabAtkins> florian: the early ipml was quick and dirty, it used and abused all sorts of parts. that's almost certainly why you can't do both at the same time.<br>
&lt;TabAtkins> florian: my hope is to keep the spec as it is, hope browsers fix it.<br>
&lt;TabAtkins> florian: Hopefuly the interaction is rare enough that even if browsers dont' get it right currently that's okay<br>
&lt;TabAtkins> astearns: and the spec currently says you do both?<br>
&lt;TabAtkins> florian:<br>
&lt;TabAtkins> astearns: is there an ordering?<br>
&lt;TabAtkins> florian: yeah they're independent. after everything else, if some individual lines overflow, you text-overflow ellipsize them<br>
&lt;TabAtkins> andreubotella: yeah, spec says after everything is done, if a line overflows it's handled by text-overflow<br>
&lt;TabAtkins> astearns: so closing this issue no change?<br>
&lt;TabAtkins> florian: i think so. is that okay, Andreu?<br>
&lt;TabAtkins> andreubotella: yeah, i don't have a problem with that<br>
&lt;TabAtkins> astearns: objections?<br>
&lt;TabAtkins> RESOLVED: Close no change (text-overflow shoudl work as normal in line-calmp containers)<br>
</details>


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


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

Received on Wednesday, 2 April 2025 14:13:12 UTC