Open Bug 1540681 Opened 6 years ago Updated 1 year ago

Implement line-clamp property

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: sebo, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs, )

Details

Attachments

(1 file)

The CSS Overflow Module defines a line-clamp shorthand property that allows to limit the contents of a block container to the specified number of lines.

According to the spec. this includes the implementation of -webkit-line-clamp, which is covered by bug 866102.

Sebastian

The current support is a little ironic:
Blink : line-clamp
Webkit : line-clamp
Firefox: -webkit-line-clamp

This issue is meant to implement the standardized version of line-clamp. Neither Blink nor WebKit currently support the unprefixed version, see https://caniuse.com/css-line-clamp. They only support the -webkit prefixed version, which also got implemented in Gecko in the meantime.

Here are the related feature requests:

https://crbug.com/305376
https://bugs.webkit.org/show_bug.cgi?id=206748

Sebastian

Severity: normal → S3
Depends on: 1799494
Attached image line-clamp being used on Google (.ca) (deleted) —

Hm. Looks like Google's search result showing "Top stories" expect this property to work - see attached screenshot.

Interesting, because nothing has changed since my last comment. No browser supports the unprefixed version yet.

line-clamp was also moved to CSS Overflow 4 in the meantime, so I'm adusting the references.

I am also wondering, what are the issues preventing the implementation? I mean, -webkit-line-clamp is already implemented. The standardized version basically does the same. The main differences are that it avoids all the quirks the prefixed version has and allows to change the ellipsis similar to text-overflow. So, I assume, a lot of code could be reused for that.
Is it just a question of resources and priorization or is there something missing in the spec.?

Emilio, maybe you can answer those questions.

Sebastian

The standardized version does something very different, see https://github.com/w3c/csswg-drafts/issues/7708 for example.

Flags: needinfo?(emilio)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: