Skip to content

[css-overflow] text-wrap-style interaction with height-based line-clamp #10827

@andreubotella

Description

@andreubotella

block-ellipsis is specified as affecting the line-breaking of a line, such that the width of the block overflow ellipsis is subtracted from the available width of the line. This means that, if a line must be ellipsized, its line height might be shorter than it would otherwise, since there might be tall content at the end of the line that would be pushed to the next line. (And with text-wrap: pretty or text-wrap: balance, it could be possible for the line height to also grow when ellipsized.)

When used together with the max-lines property, this doesn't pose a problem. But it does for height-based clamping, since the height of the lines determines in which line the ellipsis is placed, which in turn determines the height of the lines.

Note that currently, no browser implements block-ellipsis the way it's specified. The ellipsis behavior of -webkit-line-clamp in all browsers is to line-break without taking the ellipsis into account, and then apply the text-overflow: ellipsis behavior on the line to ellipsize, except the ellipsis is placed even if the line doesn't overflow. A line-clamp implementation that allows height-based clamping and uses this ellipsis behavior (like the one I'm working at in Chromium) would not have this circularity because the placement of the ellipsis on one line doesn't affect line-breaking.

@frivoal @bfgeek @kojiishi

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Thursday afternoon

    Status

    Wednesday Morning

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions