RESOLVED FIXED 281136
webkit-line-clamp in nested context does not render ellipsis when inline content fits.
https://bugs.webkit.org/show_bug.cgi?id=281136
Summary webkit-line-clamp in nested context does not render ellipsis when inline cont...
Karl Dubost
Reported 2024-10-09 05:56:11 PDT
Created attachment 472879 [details] testcase See the testcase in the attachment, only on Safari the text doesn't get proper ellipsis. Initially reported on https://oisaur.com/@renchap/113276852782235890 but wrongly attributed to Bug 5990, which is a different bug.
Attachments
testcase (1.30 KB, text/html)
2024-10-09 05:56 PDT, Karl Dubost
no flags
testcase-not-lists (1.90 KB, text/html)
2024-10-09 07:12 PDT, Renaud Chaput
no flags
Test reduction (302 bytes, text/html)
2024-10-09 08:23 PDT, zalan
no flags
Patch (14.77 KB, patch)
2024-12-03 19:08 PST, zalan
no flags
Patch (16.27 KB, patch)
2024-12-04 06:04 PST, zalan
no flags
Patch (18.29 KB, patch)
2024-12-05 16:37 PST, zalan
ews-feeder: commit-queue-
[fast-cq]Patch (18.36 KB, patch)
2024-12-05 20:46 PST, zalan
no flags
Radar WebKit Bug Importer
Comment 1 2024-10-09 05:56:21 PDT
Renaud Chaput
Comment 2 2024-10-09 07:12:08 PDT
Created attachment 472880 [details] testcase-not-lists This bug is not specific to lists, it also happens if for example the content is multiple <p> tags.
zalan
Comment 3 2024-10-09 07:17:33 PDT
(In reply to Renaud Chaput from comment #2) > Created attachment 472880 [details] > testcase-not-lists > > This bug is not specific to lists, it also happens if for example the > content is multiple <p> tags. Do you mind adding a test case, please? The codepen shows ellipsis on the second (<p>) example on trunk webkit.
zalan
Comment 4 2024-10-09 07:18:14 PDT
never mind, I didn't see the test case. Thank you.
zalan
Comment 5 2024-10-09 08:17:59 PDT
This bugs (not rendering ellipsis) seems to happen when the content actually fits.
zalan
Comment 6 2024-10-09 08:23:13 PDT
Created attachment 472881 [details] Test reduction
zalan
Comment 7 2024-10-09 08:33:23 PDT
(In reply to zalan from comment #5) > This bugs (not rendering ellipsis) seems to happen when the content actually > fits. in block direction (i.e. clamping direction)
zalan
Comment 8 2024-10-09 09:09:42 PDT
This is the classic "last formatting line" bug where individual inline formatting contexts can't decided whether ellipsis is required or not on their _last_ line since they can't tell if that's the actual _last_ line in the line clamp context (as we are not supposed to put ellipsis when the clamped line is the actual _last_ line in the clamp context) e.g. <div clamp=1> <div>this is the last line both in this FC and in the clamp context</div> </div> vs. <div clamp=1> <div>this is the last line in this formatting context</div> <div>this is the last line both in this FC and in the clamp context</div> </div> where only the second case should show ellipsis.
zalan
Comment 9 2024-10-09 09:10:21 PDT
(In reply to zalan from comment #8) > This is the classic "last formatting line" bug where individual inline "last formatting line" should read "last formatted line"
github
Comment 10 2024-12-03 06:18:57 PST
I'm facing the same issue (Safari Version 18.1.1 (20619.2.8.11.12)): https://codepen.io/CyrilKrylatov/pen/dPbYOEK
zalan
Comment 11 2024-12-03 19:08:07 PST
zalan
Comment 12 2024-12-04 06:04:38 PST
zalan
Comment 13 2024-12-05 16:37:56 PST
zalan
Comment 14 2024-12-05 20:46:58 PST
Created attachment 473481 [details] [fast-cq]Patch
EWS
Comment 15 2024-12-06 05:10:34 PST
Committed 287441@main (8ea2903a98c4): <https://commits.webkit.org/287441@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 473481 [details].
Note You need to log in before you can comment on or make changes to this bug.