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

> No browser currently has the block-overflow behavior where the ellipsis is taken into account when line breaking.

Depending on exactly what you mean by this, I don't think this is actually what the spec calls for. My understanding is:
1. line break (without taking the ellipsis into account)
2. count lines or measure the height, an clamp based on that if there are too many lines if it it's too high.
3. if we did clamp, remove some content on the last line to make room for the ellipsis, and then insert it (don't re-wrap after doing that)
4. text-align

Now, at step 3, the spec does call for taking line-breaking opportunities into account in order to find what chunks of content you can actually remove:
> [the block ellipsis] is placed in the line box after the last [soft wrap opportunity](https://drafts.csswg.org/css-text-4/#soft-wrap-opportunity) (see [[CSS-TEXT-3]](https://drafts.csswg.org/css-overflow-4/#biblio-css-text-3)) that would still allow the entire block overflow ellipsis to fit on the line.

In this approach, it's not "taken into account when line breaking". Line breaking is step 1, and the ellipsis is ignored then. Yes, step 3 uses some concepts related to line breaking (soft wrap opportunities), but I don't think this should have an impact.

With this clarification, do you still think it is hard to make `block-ellipsis` and `text-overflow` interact on the same line?

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


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

Received on Monday, 9 September 2024 06:21:35 UTC