Bug 250071

Summary: Regression: -webkit-line-clamp with overflow: visible sizes the container to the height of the unclamped contents (IFC)
Product: WebKit Reporter: Andreu Botella <abotella>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Test case
none
Screenshot with the patch in bug 250270 none

Description Andreu Botella 2023-01-04 01:47:15 PST
Created attachment 464325 [details]
Test case

I recently noticed that on recent versions of WebKit, `-webkit-line-clamp` with `overflow: visible` will add an ellipsis, but it will size the container according to the block size of the full contents, which should overflow it. This is the behavior in other browsers, and the one that WebKit had before this regression. Note that with `overflow: hidden`, the container will be sized properly.

This is legacy behavior, since in the current definition of `(-webkit-)line-clamp` in the CSS Overflow Level 3 spec (which is based on fragmentation), as well as in the one that's being considered in https://github.com/w3c/csswg-drafts/issues/7708 (which hides clamped content), the clamped contents never visibly overflow the container. However, in both of those proposed behaviors, the size of the container is still set to the block size of the clamped contents.

This regressed in https://commits.webkit.org/256989@main (bug 248200). Although this patch is related to LFC, it also regresses without it enabled.
Comment 1 Andreu Botella 2023-01-04 01:59:48 PST
My bad, I thought LFC was a precondition for IFC, and therefore that IFC would not actually be enabled by default even though it is in the preferences yaml.

So this regression is indeed IFC-related.
Comment 2 Radar WebKit Bug Importer 2023-01-04 06:19:18 PST
<rdar://problem/103871939>
Comment 3 zalan 2023-01-09 15:48:04 PST
Thank you for the detailed description/test case!
Comment 4 zalan 2023-01-09 16:01:56 PST
I started working on bug 250270 and apparently the patch I attached fixes this issue too. I hope you don't mind if I forward dup it (should have started working on this first and dup it properly).
Comment 5 zalan 2023-01-09 16:02:32 PST
Created attachment 464429 [details]
Screenshot with the patch in bug 250270
Comment 6 zalan 2023-01-09 16:03:00 PST

*** This bug has been marked as a duplicate of bug 250270 ***