[csswg-drafts] [css-overflow] Behavior of the line-clamp ellipsis after hanging glyphs (#12857)

andreubotella has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-overflow] Behavior of the line-clamp ellipsis after hanging glyphs ==
This is a follow-up issue split from #12008.

The `line-clamp` ellipsis gets inserted in the line after the last soft wrap opportunity that still allows the line with the ellipsis to not overflow. In #12008 we resolved that the rendering should be as if the line broke at that soft wrap opportunity, which includes applying [phase II of the whitespace processing rules](https://drafts.csswg.org/css-text-4/#white-space-phase-2), and then the ellipsis was inserted at the end.

However, if a line ends with non-collapsible whitespace, phase II of the whitespace processing rules can require it to [hang](https://drafts.csswg.org/css-text-4/#hang). Hanging glyphs are ignored when measuring a line's contents for fit, alignment or justification, so they can literally hang off the edge of the line even if there are line breaking opportunities before them.

One important point is that only sequences of glyphs at the start or end of a line can hang. So if phase II results in a sequence of hanging whitespace at the end of the line, inserting a non-hanging ellipsis after them would necessarily make the whitespace non-hanging.

Some ways to solve this could be:
- The ellipsis prevents any glyph sequence before it from hanging.
- Hanging whitespace before the ellipsis get removed instead. (How does this apply to conditionally hanging whitespace? What about `hanging-punctuation`?)
- If the ellipsis follows at least one hanging glyph, then the ellipsis hangs as well. This would work similarly to `hanging-punctuation`, which also allows hanging non-whitespace glyphs. (Should this also apply to user-provided ellipsis strings? Also, currently only WebKit ships `hanging-punctuation`, although Chromium sent an [Intent to Prototype](https://groups.google.com/a/chromium.org/g/blink-dev/c/5Vl2Du2fzT4/m/fIZRNMicBQAJ) earlier this year.)

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12857 using your GitHub account


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

Received on Thursday, 25 September 2025 18:31:30 UTC