Bug 249974 - [IFC][line-clamp] Incorrect ellipsis placement when text-align is not "start"
Summary: [IFC][line-clamp] Incorrect ellipsis placement when text-align is not "start"
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Local Build
Hardware: Mac (Apple Silicon) macOS 13
: P2 Minor
Assignee: zalan
URL:
Keywords: InRadar
Depends on: 250030 250077
Blocks:
  Show dependency treegraph
 
Reported: 2022-12-31 14:06 PST by Michael Nutt
Modified: 2023-01-05 10:41 PST (History)
6 users (show)

See Also:


Attachments
screenshot of line clamp issue (12.54 KB, image/png)
2022-12-31 14:06 PST, Michael Nutt
no flags Details
ellipsis-align-possible-fix (1.25 KB, patch)
2022-12-31 14:12 PST, Michael Nutt
no flags Details | Formatted Diff | Diff
Patch (3.60 KB, patch)
2023-01-04 09:49 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (3.60 KB, patch)
2023-01-04 11:59 PST, zalan
no flags Details | Formatted Diff | Diff
[fast-cq]Patch (3.60 KB, patch)
2023-01-05 08:13 PST, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].