Bug 249974

Summary: [IFC][line-clamp] Incorrect ellipsis placement when text-align is not "start"
Product: WebKit Reporter: Michael Nutt <michael>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Minor CC: bfulgham, koivisto, michael, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   
Bug Depends on: 250030, 250077    
Bug Blocks:    
Attachments:
Description Flags
screenshot of line clamp issue
none
ellipsis-align-possible-fix
none
Patch
none
Patch
none
[fast-cq]Patch none

Description Michael Nutt 2022-12-31 14:06:11 PST
Created attachment 464272 [details]
screenshot of line clamp issue

When using -webkit-line-clamp and text-align: center, in certain cases the ellipses are drawn incorrectly aligned. Reproduction:

https://codepen.io/michaelnutt/pen/gOjrEre

(see attachment for screenshot of the above on my local build)

From some debugging, I notice that the ellipsis is drawn in the spot where it would be if the text were text-align: left.

I'm not very familiar with the text layout code so this may be incorrect, but it seems as if it is not taking into account the offset created by text-align.
Comment 1 Michael Nutt 2022-12-31 14:12:19 PST
Created attachment 464273 [details]
ellipsis-align-possible-fix

This patch appears to correct the issue for me, although I'm not sure if it's the correct fix or not.
Comment 2 Radar WebKit Bug Importer 2022-12-31 14:15:06 PST
<rdar://problem/103792912>
Comment 3 zalan 2023-01-04 09:49:06 PST
Created attachment 464331 [details]
Patch
Comment 4 zalan 2023-01-04 11:59:30 PST
Created attachment 464334 [details]
Patch
Comment 5 zalan 2023-01-05 08:13:10 PST
Created attachment 464350 [details]
[fast-cq]Patch
Comment 6 EWS 2023-01-05 10:41:39 PST
Committed 258491@main (c672a5df57fc): <https://commits.webkit.org/258491@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 464350 [details].