Open andreubotella opened 1 month ago
cc @frivoal @fantasai @emilio @bfgeek
Talking with Florian earlier, it looks like the "immediately preceding" spec text might have been written in the context of clamping by a number of lines, and the possibility of clamping by a height was not considered at that time. Given that, should the last line box before the clamp point always be ellipsized?
block-ellipsis
, which is one of the properties thatline-clamp
is a shorthand for, creates an ellipsis on the last line before clamp, if that line box "immediately precedes" the region break. Sincemax-lines
creates a region break after a line box, when that property is used, the immediately preceding line box is clear. But when clamping by height, the interpretation of that isn't always clear.My expectation is that a line box would get ellipsized if there is no content between it and the clamp point in the box tree, except that ancestor boxes of the line box can end in between:
But there wouldn't be an ellipsis if an entire box sits in between:
My expectation is also that a line box would be ellipsized even it is contained inside a box with a non-overflowing
height
property.(This does not currently work in my in-progress implementation ofcontinue: collapse
in Chromium, though, and it would need some heavy refactoring before it would be possible.)One interesting question is what to do when there are out-of-flow block-level elements, between the last line box and the clamp point. By the above definition, the line box shouldn't be ellipsized in that case. However, especially for an abspos box which is positioned elsewhere, this might not be intuitive to authors.
cc @frivoal @bfgeek @emilio