Implement parsing of `line-clamp` as a longhand
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox154 | --- | fixed |
People
(Reporter: dshin, Assigned: kyoety)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, Whiteboard: css-line-clamp, [wptsync upstream])
Attachments
(1 file, 1 obsolete file)
... For phase 1 implementation, it will be a longhand.
Parsing this should be gated behind a pref.
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 1•2 months ago
|
||
| Assignee | ||
Comment 2•2 months ago
•
|
||
Extend existing line-clamp value to store max-lines, block-ellipsis, and
legacy behavior.
Enable line-clamp parsing for WPTs with updated expectations and
regenerate CSS use-counter metrics.
Updated•2 months ago
|
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/61271 for changes under testing/web-platform/tests
Comment 5•1 month ago
|
||
| bugherder | ||
Upstream PR merged by moz-wptsync-bot
Updated•1 month ago
|
Comment 7•1 month ago
•
|
||
This should have been named:
Implement parsing of
line-clampas a shorthand
right?
As it is a shorthand for:
- max-lines
- block-ellipsis
- legacy behavior
Comment 8•1 month ago
|
||
(In reply to Dave Letorey from comment #7)
This should have been named:
Implement parsing of
line-clampas a shorthandright?
As it is a shorthand for:
- max-lines
- block-ellipsis
- legacy behavior
My bad, I should have read the description
Comment 9•1 month ago
•
|
||
I have been doing some testing in the following browsers:
- Firefox Nightly 155 -
layout.css.line-clamp.enabled- true - Chrome Canary 153 - Experimental Web Platform features enabled
- Safari Technical Preview Release 245
All these browsers support:
.selector {
line-clamp: 2; /* <integer> only */
}
Only Chrome Canary supports no-ellipsis value:
.selector {
line-clamp: 2 no-ellipsis; /* <integer> and no-ellipsis */
}
Only Safari TP supports "custom string":
.selector {
line-clamp: 2 "… custom string"; /* <integer> and "custom string" */
}
Both Chrome & Safari respect the @supports but Firefox Nightly does not:
@supports not (line-clamp: 2 no-ellipsis) {
.card:has(.no-ellipsis) .supported {
display: block;
}
}
@supports not (line-clamp: 2 "string") {
.card:has(.string) .supported {
display: block;
}
}
| Reporter | ||
Comment 10•1 month ago
|
||
Ah, ellipsis-related values are tracked in Bug 2043000.
That said, overall, the feature isn't yet ready for general testing (Hence being behind the pref). @supports is hooked up to the parsing machinery, and we can't really guarantee its correctness for behind-the-pref features. Still, thanks for the interest & testing it out.
When we do reach a point more suitable for general testing, we will be flipping the pref on for Nightly. That will be a blocking bug for Bug 1540681.
| Assignee | ||
Updated•21 days ago
|
Description
•