Re: [csswg-drafts] [css-overflow] [css-text] Interaction between whitespace collapsing and line-clamp (#12008)

> For « nowrap does not remove wrap opportunities, it just prevents wrapping » I suspect that can be changed, and have the definition of `text-wrap-mode: nowrap` say that it suppresses opportunities. In that case, yes, if the whole line (or the whole block) is set to nowrap, then that means you cannot insert the ellipsis in the middle of the line, and you either have to tack it at the very end—including after preserved spaces if any—if there's room, or have to remove the whole line to make room if there isn't, but that seems appropriate: if the content is indivisible, it is indivisible.

We can probably say "soft wrap opportunities were breaking would be allowed (i.e. not `text-wrap: nowrap`) without needing to change css-text.
 
> I think the case where I'm least comfortable is when the line ends with preserved white-space (which is thus not discarded) which hang (as can happen with `white-space: pre-wrap`). This is different from the nowrap case: here, we can wrap, but we did ask for preserving. In that case, what would fall out of the above is that the ellipsis would be inserted after the space, even though the line is wrapable. This may also be the desirable behavior (the author did ask for spaces to be preserved after all), but I'm less sure.

Although I believe the goal is for browsers to implement hanging punctuation eventually, I'm not sure how possible this currently is in Chromium. Maybe it would be doable for line-clamp ellipsis, due to the special way in which we're implementing them, but wouldn't be for other punctuation. But I would need to look into it.

-- 
GitHub Notification of comment by andreubotella
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12008#issuecomment-2948337958 using your GitHub account


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

Received on Friday, 6 June 2025 07:21:12 UTC