Skip to content

[css-overflow-4] Don't clamp by height with line-clamp: <integer>#13532

Merged
frivoal merged 1 commit intomainfrom
issue-12041-clamp-by-lines-and-height
Mar 17, 2026
Merged

[css-overflow-4] Don't clamp by height with line-clamp: <integer>#13532
frivoal merged 1 commit intomainfrom
issue-12041-clamp-by-lines-and-height

Conversation

@andreubotella
Copy link
Copy Markdown
Member

As per the latest resolution on #12041, line-clamp: <integer> cannot clamp by both lines and height due to web compat issues with its prefixed -webkit-line-clamp alias. The behavior of clamping by lines and height, whichever comes earlier, is still wanted; but it needs an opt-in syntax that has not been decided yet.

Since neither the syntax of this behavior on the line-clamp shorthand, nor its mapping into its longhands, are yet clear, this PR disables this behavior –clamping only by the auto clamp point when max-lines: none, and only by the line-based clamp point otherwise– while adding an issue marker.

This change also moves the definition of "line-based clamp point" to the max-lines section.

As per the latest resolution on #12041, `line-clamp: <integer>` cannot
clamp by both lines and height due to web compat issues with its
prefixed `-webkit-line-clamp` alias. The behavior of clamping by lines
and height, whichever comes earlier, is still wanted; but it needs an
opt-in syntax that has not been decided yet.

Since neither the syntax of this behavior on the `line-clamp`
shorthand, nor its mapping into its longhands, are yet clear, this
PR disables this behavior –clamping only by the auto clamp point when
`max-lines: none`, and only by the line-based clamp point otherwise–
while adding an issue marker.

This change also moves the definition of "line-based clamp point" to
the `max-lines` section.
@andreubotella andreubotella added css-overflow-4 topic: line-clamp line-clamp, -webkit-line-clamp, and related long hands, not including continue:discard labels Feb 19, 2026
@frivoal frivoal merged commit 82aea1f into main Mar 17, 2026
1 check passed
frivoal added a commit to frivoal/wpt that referenced this pull request Mar 17, 2026
frivoal added a commit to web-platform-tests/wpt that referenced this pull request Mar 17, 2026
@andreubotella andreubotella deleted the issue-12041-clamp-by-lines-and-height branch March 17, 2026 07:47
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Mar 30, 2026
Automatic update from web-platform-tests
Update tests to match spec

Based on the decision in
w3c/csswg-drafts#12041, and the PR in
w3c/csswg-drafts#13532

--

wpt-commits: f345757222019e096f3a7f7040b7dd15c69684bc
wpt-pr: 58542
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

css-overflow-4 topic: line-clamp line-clamp, -webkit-line-clamp, and related long hands, not including continue:discard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants