RESOLVED FIXED 257811
Inline-level elements with self-painting layer renders overlapping ellipsis.
https://bugs.webkit.org/show_bug.cgi?id=257811
Summary Inline-level elements with self-painting layer renders overlapping ellipsis.
Ethan Wong
Reported 2023-06-07 09:33:10 PDT
Created attachment 466623 [details] A case to reproduce this issue Inline-level elements with self-painting layer (`hasSelfPaintingLayer == true`) may be rendered renders overlapping ellipsis generated by `text-overflow: ellipsis`. See the attached case and screenshot. Specifically `position: relative` causes the `<span>` element to be self-painted from the layer. This issue is caused due to self-painting layer chilldrens being painted in a different flow without the knowledge about its the line layout context. The actual behavior that hides the overflow element happens at `InlineContentPainter::paintDisplayBox(const InlineDisplay::Box&)` when `box.isFullyTruncated() == true`.
Attachments
A case to reproduce this issue (722 bytes, text/html)
2023-06-07 09:33 PDT, Ethan Wong
no flags
Browser comparations of the attached case (203.85 KB, image/png)
2023-06-07 09:33 PDT, Ethan Wong
no flags
Patch (5.26 KB, patch)
2023-06-07 12:21 PDT, zalan
no flags
Patch (7.42 KB, patch)
2023-06-07 14:54 PDT, zalan
no flags
Ethan Wong
Comment 1 2023-06-07 09:33:48 PDT
Created attachment 466624 [details] Browser comparations of the attached case
zalan
Comment 2 2023-06-07 10:00:08 PDT
that's a good catch. so this can be triggered on any self-painting inline level element e.g. <style> div { width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: pre; } img { height: 50px; width: 50px; background: green; } .overflow { background: red; transform: translateZ(0); } </style> PASS in no red shows. <div><img><img class=overflow></div>
Ethan Wong
Comment 3 2023-06-07 10:04:49 PDT
Right, the initial issue we discovered in our app was an inline image with `position: relative` being cut in half.
zalan
Comment 4 2023-06-07 10:43:18 PDT
Ethan, are you planning on working on this? (asking because you landed some great fixes in the past and wanted to make sure we don't start working on the same issue).
Ethan Wong
Comment 5 2023-06-07 11:01:36 PDT
(In reply to zalan from comment #4) > Ethan, are you planning on working on this? (asking because you landed some > great fixes in the past and wanted to make sure we don't start working on > the same issue). I spent some time debugging on this issue but have no idea how to fix it, so I just reported it here.
zalan
Comment 6 2023-06-07 11:05:46 PDT
(In reply to Ethan Wong from comment #5) > (In reply to zalan from comment #4) > > Ethan, are you planning on working on this? (asking because you landed some > > great fixes in the past and wanted to make sure we don't start working on > > the same issue). > > I spent some time debugging on this issue but have no idea how to fix it, so > I just reported it here. Thank you. Looking into it now.
Radar WebKit Bug Importer
Comment 7 2023-06-07 11:06:56 PDT
zalan
Comment 8 2023-06-07 12:21:08 PDT
zalan
Comment 9 2023-06-07 12:21:55 PDT
^^^ fixes the attached test case (I still need to come up with some more cases and include them in this patch).
zalan
Comment 10 2023-06-07 14:54:23 PDT
EWS
Comment 11 2023-06-07 21:41:05 PDT
Committed 264973@main (c38822c4ed1c): <https://commits.webkit.org/264973@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 466630 [details].
Note You need to log in before you can comment on or make changes to this bug.