RESOLVED FIXED301944
-webkit-line-clamp doesn't support inline-block children
https://bugs.webkit.org/show_bug.cgi?id=301944
Summary -webkit-line-clamp doesn't support inline-block children
aristidesfl
Reported 2025-11-04 09:31:07 PST
Created attachment 477288 [details] Codepen reproduction When an element with `-webkit-line-clamp: 1` has children with `display: inline-block`, ellipsis appear semi-arbitrarily. It seems like the algorithm considers these elements to be in different lines, and it tries to add ellipsis to the first element with inline-block. Children with `display: inline-block` are required in some situations for text animations. Chromium and Firefox seem to support this use-case correctly. Reproduction: https://codepen.io/aristidesfl/pen/myVgOYg?editors=1100 ```html <style> .container { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: clip; } .child { display: inline-block; } </style> <div class="container"> <span class="child">The</span> <span class="child">Quick</span> <span class="child">Brown</span> <span class="child">Fox</span> <span class="child">Jumps</span> <span class="child">Over</span> <span class="child">The</span> <span class="child">Lazy</span> <span class="child">Dog</span> </div>```
Attachments
Codepen reproduction (106.28 KB, image/png)
2025-11-04 09:31 PST, aristidesfl
no flags
Patch (3.67 KB, patch)
2025-12-26 14:12 PST, alan
no flags
Patch (5.37 KB, patch)
2025-12-26 16:47 PST, alan
no flags
[fast-cq]Patch (5.43 KB, patch)
2025-12-26 20:03 PST, alan
no flags
Radar WebKit Bug Importer
Comment 1 2025-11-11 09:32:10 PST
alan
Comment 2 2025-12-26 14:12:44 PST
alan
Comment 3 2025-12-26 16:47:14 PST
alan
Comment 4 2025-12-26 20:03:39 PST
Created attachment 477856 [details] [fast-cq]Patch
EWS
Comment 5 2025-12-27 06:01:21 PST
Committed 304956@main (feedd6408047): <https://commits.webkit.org/304956@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 477856 [details].
Note You need to log in before you can comment on or make changes to this bug.