Bug 257794

Summary: Incorrect rendering for elements with animated transforms inside container with overflow: clip
Product: WebKit Reporter: Benjamin <benjamin.larsson+wkbz>
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: NEW    
Severity: Normal CC: bfulgham, jaybuz1993, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Test case
none
Image showing some lines being incorrectly clipped
none
Test reduction
none
Transform rendering issue none

Benjamin
Reported 2023-06-07 04:56:28 PDT
Created attachment 466613 [details] Test case A container with overflow: clip cause problems with rendering animated elements inside it. Changing the container to overflow: hidden solves these issues. It appears that removing the animations but adding will-change: transform to the elements will also reproduce the same issue. In the test case, the incorrectly rendered elements are thin divs used as horizontal lines, with animated position/rotation/scale. When these lines have a border radius, then during animations they are clipped, with only the top half being rendered. This gives the appearance of some of the lines being thinner than they should. See attached image. When the border radius is removed, the full elements are rendered, but now their positions are slightly offset vertically. Reproduced in Safari 16.5 and nightly WebKit build 264935 on MacOS Monterey, and in Safari on iPhone. Please see the attached test case for a demonstration. It's a largely unedited upload of the test case I used while debugging this issue in our app, so apologies if it isn't quite as clean as it could be.
Attachments
Test case (6.71 KB, text/html)
2023-06-07 04:56 PDT, Benjamin
no flags
Image showing some lines being incorrectly clipped (224.60 KB, image/png)
2023-06-07 04:57 PDT, Benjamin
no flags
Test reduction (445 bytes, text/html)
2023-06-07 09:19 PDT, alan
no flags
Transform rendering issue (442 bytes, text/html)
2023-11-21 01:31 PST, JasonB
no flags
Benjamin
Comment 1 2023-06-07 04:57:47 PDT
Created attachment 466614 [details] Image showing some lines being incorrectly clipped
alan
Comment 2 2023-06-07 09:19:45 PDT
Created attachment 466622 [details] Test reduction
Radar WebKit Bug Importer
Comment 3 2023-06-07 09:20:21 PDT
alan
Comment 4 2023-06-07 09:21:10 PDT
Thank you for filing this bug report and for the great test case!
alan
Comment 5 2023-06-07 09:50:18 PDT
Interestingly adding border to the container makes the animating green line appear. This seems be some layerish bug.
alan
Comment 6 2023-06-07 09:51:20 PDT
(it also works when the content is transitioned instead e.g. transition: margin-top 1s)
JasonB
Comment 7 2023-11-21 01:31:49 PST
Created attachment 468706 [details] Transform rendering issue I noticed something similar with overflow-x clip and transforms. See attachment.
Note You need to log in before you can comment on or make changes to this bug.