-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-webkit-line-clamp #16
Comments
Thanks for submitting this proposal, @bfgeek! Regarding |
Survey data supporting this is in #7. Most of the responses just said "line-clamp", but these were a bit more elaborate:
|
It would be good to get some more detail on which tests are incorrect/missing here. Also, if I understand correctly it also seems like there's some spec work needed? Although there's definitely a good case that authors are looking for improvements here, we don't want to include things that are likely to undergo significant churn. How confident are we that we will have an correct set of tests and an accurate/agreed-upon spec before the new year? |
We don't have an explicit bug for this. This was implemented in FF when they shipped -webkit-line-clamp, and is the main reason why Blink fails the various tests linked above.
https://groups.google.com/a/chromium.org/g/blink-dev/c/SVD5wSqVwKU/m/eY28UiNkAwAJ?pli=1 Are the two tests. These test the bad "line-clamp each child box individually" which nobody we've talked to wants.
There isn't really any spec work here. (Aside from any potential clarifications). The spec is currently aspirational, in that it requires dropping children after when the line-clamp is applied. This is currently very difficult for browsers, but importantly isn't the source of the developer pain here. We (Blink) believe that with our current behaviour we'll be able to completely transition to the un-prefixed version without any compat issues. However (again) the dropping content issue isn't the source of developer pain. Its the other interop issues.
This is great! At least two (three?) of these responses are happy with the better behaviour:
(for the list one I didn't even realize that we (Blink) supported this, but it makes sense: https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=9796 ) |
OK, that sounds good. Is it accurate to say the proposal is "pass the existing tests from https://wpt.fyi/results/css/css-overflow?label=master&label=experimental&aligned&q=webkit-line-clamp, with -008 and -029 changed to match the current Blink behaviour"? |
Thats correct. |
(at least I believe those are the only two tests which need to be updated from my previous analysis). |
Potentially also: http://wpt.live/css/css-overflow/webkit-line-clamp-024.html as this is assume flex baseline behaviour instead of block baseline behaviour. |
@bfgeek I added the For the spec situation, can you outline which bits of the spec that are included, or which should be ignored, whichever is the smaller set? Or could this be framed as following the spec, but the tests we include don't exercise some of the things that we want to leave out of scope? |
From the spec side, @frivoal has been paying attention to this topic, and maybe he can help to clarify the status of things. |
The spec's status is about as stable as it'll get without implementations progressing further. If implementation experience shows that we underestimated the demands of compatibility with the -webkit- version, then we may have to tweak things a bit, but otherwise it should be good to go. If there are questions as to why the design is the way it is, I'm happy to go into that, but for now, I think it's enough to say the design is intentional, not pending any particular rework by the CSSWG, and complete except for implementation feedback and a couple of comparatively small issues. The remaining two issues are w3c/csswg-drafts#2970 and w3c/csswg-drafts#2971. Happy to go into those too, but I don't think it should have a strong bearing on this discussion. |
Right the spec is effectively fine at the moment. Those final issues are important once implementations can support dropping the content after the ellipsis. (Which no implementations can currently support this easily). Since implementations aren't currently able to support dropping the content after the ellipsis (there isn't anything fundementally bad here, its just a lot of work to do correctly) - the focus of this issue would be getting implementations to be interoperable on everything except for dropping content. This moves the bar significantly for web developers. Better RTL support, better line-clamping behaviour with multiple boxes which people do complain about. |
I've removed the |
Do the tests match the spec, or does Blink match the spec? Either way, bugs should be filed as appropriate!
By this you mean the behaviour defined by |
Blink matches the spec here. I've got it on my list to update the noted tests above in the repo.
Correct. Basically dropping content as described by E.g.
|
Based on the Dec 9 meeting, with outcomes summarized in #39 (comment), we won't include |
In case we want to revisit this next year, does anyone see a need for spec change in order to ship the unprefixed Or, more simply: what is a credible path to getting both |
If we want to revisit this for Interop 2023, now would be a great time to figure out the state of standardization — or what credibly path to |
I'll go ahead and close this. This was an Interop 2022 proposal, and we should have a new issue for revisiting for Interop 2023. |
Disappointing that this never got re-proposed for Interop 2023. This remains one of the most cited CSS compatibility problem areas: https://2022.stateofcss.com/en-US/usage/#interoperability_features_freeform |
@jonrimmer I agree it's an important problem area. One reason it wasn't proposed for Interop 2023 was that we don't (yet) have a solution for the problem. One promising approach is described here; do you think it would meet your needs if that was the solution? |
FTR, the spec is now in L4: https://drafts.csswg.org/css-overflow-4/#propdef--webkit-line-clamp |
Can it be reopened? |
Not reopened, but someone can propose this for Interop 2025 in the fall. |
It seems to be covered by #702. |
Description
-webkit-line-clamp is a highly used feature to clamp the number of lines shown for inline-content.
Specification
https://drafts.csswg.org/css-overflow-3/#propdef--webkit-line-clamp
Tests
https://wpt.fyi/results/css/css-overflow?label=master&label=experimental&aligned&q=webkit-line-clamp
... kinda - some of these tests are incorrect.
Rationale
The un-prefixed version "line-clamp" is relatively expensive for engines to implemented. (Specifically dropping content after the trimmed line is difficult for /reasons/).
However that shouldn't stop getting the behaviour of -webkit-line-clamp closer to line-clamp.
There are roughly three areas for improvement across browsers.
RTL support. We (Blink) added this in 2020[1] and is the biggest show-stopper for people using this feature from us talking with various web developers.
Create a block-flow box, instead of a flex box. We (Blink) also fixed this in 2020 - under the hood Blink creates a block-flow box instead of a flex box. This means that it mirrors the spec more closely (making far more likely we can directly map it onto the un-prefixed version) and also matches what developers expect. See:
Support "-webkit-line-clamp: none" only FF supports this currently, and this would round out making it a minimal when un-prefixing.
cc/ @frivoal
[1] https://groups.google.com/a/chromium.org/g/blink-dev/c/SVD5wSqVwKU/m/eY28UiNkAwAJ?pli=1
The text was updated successfully, but these errors were encountered: