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

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

== [css-overflow] interaction between text-overflow:ellipsis and line-clamp ==
http://wpt.live/css/css-overflow/line-clamp/webkit-line-clamp-036.html assumes that if `-webkit-line-clamp` is on, the `text-overflow: ellipsis` has no effect.

This is not backed up by the spec, which expects both effects to be independent. Assuming the preconditions for both properties are fulfilled:
* if there are more lines than the clamp number, the excess lines are clamped, and an ellipsis is shown on the last line
* if some (non clamped) lines are too long and overflow, they get truncated and an ellipsis is added at their end.

The spec also defines how the two interact when they'd happen on the same line, which can happen given that the string for line-clamp can be customized to something different, and possibly longer, than "…":
> The UA must treat the [block overflow ellipsis](https://drafts.csswg.org/css-overflow-4/#block-overflow-ellipsis) as an unbreakable string, If any part of the block overflow ellipsis overflows, it is treated as [scrollable overflow](https://drafts.csswg.org/css-overflow-3/#scrollable-overflow), and its rendering is affected by the [text-overflow](https://drafts.csswg.org/css-overflow-4/#propdef-text-overflow) property.

Should we:
1. consider the test to be wrong, fix it, and keep the spec as is?
    rationale: if gives maximum control to authors, and the interaction can be useful
2. change the spec to turn off `text-overflow: ellipsis` when using `-webkit-line-clamp` for compat reasons, but not when using `line-clamp`?
    rationale: this behavior originated in a [compat workaround](https://issues.chromium.org/issues/40151484), but keep authors in control in the unprefixed version which does not have compat bagage
3. change the spec to turn off `text-overflow: ellipsis` when using either `-webkit-line-clamp` or `line-clamp`?
    rationale:  this behavior originated in a [compat workaround](https://issues.chromium.org/issues/40151484), and keep both prefixed and unprefixed versions consistent

cc: @andreubotella @bfgeek 

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


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

Received on Tuesday, 3 September 2024 01:26:07 UTC