NEW 226321
Animation FPS drops if SVG changes from becomes visible from opacity 0
https://bugs.webkit.org/show_bug.cgi?id=226321
Summary Animation FPS drops if SVG changes from becomes visible from opacity 0
Roland Soos
Reported 2021-05-27 03:08:38 PDT
Created attachment 429862 [details] Screen recording Steps to reproduce: 1. Open https://smartslider3.com/bugs/webkit/opacity0dropfps/ Expected result: FPS should be consistent during the animation Actual result: When the SVG becomes visible from opacity(opacity:0 and then in the next frame gets bigger than 0) cause the animation to feel sluggish as probably rendering of the resource allocate the main thread. Workaround: use non-zero small opacity like 0.1 for starting point. Able to reproduce: iPad 14.5.1 iPhone 14.6
Attachments
Screen recording (2.70 MB, video/mp4)
2021-05-27 03:08 PDT, Roland Soos
no flags
Long paints in timeline (154.65 KB, image/png)
2021-05-28 13:05 PDT, Simon Fraser (smfr)
no flags
Roland Soos
Comment 1 2021-05-27 03:11:36 PDT
It's possible that not opacity:0 itself cause this issue as we add visiblity:hidden to the elements which has opacity:0. So the cause could be that visibility:hidden changes to visibility:visible. [data-force-hidden], [data-force-hidden] * { visibility: hidden!important; }
Alexey Proskuryakov
Comment 2 2021-05-27 18:15:09 PDT
I can reproduce on iPhone 12 Pro; animates smoothly on a Mac.
Simon Fraser (smfr)
Comment 3 2021-05-27 20:22:11 PDT
The SVG takes over 500ms to render on iPhone 7 Plus because of the filters (largely the gaussian blur). There's a layering change when opacity and/or transform transitions finish, which triggers a second paint of the SVG which is the visible stall. Some `will-change:` should fix this. Or you could remove the filters, since (in this example at least) they don't do anything visible.
Radar WebKit Bug Importer
Comment 4 2021-05-27 20:29:09 PDT
Roland Soos
Comment 5 2021-05-27 23:04:16 PDT
Thank you Simon, you are right. We dropped those filters and used filter="drop-shadow(...)" on the path and everything is the same. What is the tool what you used to find that it takes 500ms to render that SVG? Is it a tool in Safari(Mac) what I could use during remote debug of the real device?
Simon Fraser (smfr)
Comment 6 2021-05-28 09:45:35 PDT
I used some internal instrumentation, but I think attaching with Web Inspector and collecting a timeline recording would show you some long paints.
Simon Fraser (smfr)
Comment 7 2021-05-28 13:05:24 PDT
Created attachment 430045 [details] Long paints in timeline
Note You need to log in before you can comment on or make changes to this bug.