Bug 242312 - requestAnimationFrame is not called after a certain WKWebView magnification
Summary: requestAnimationFrame is not called after a certain WKWebView magnification
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: Safari 15
Hardware: Mac (Apple Silicon) macOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-07-04 06:08 PDT by Felix Franz
Modified: 2022-07-08 14:56 PDT (History)
9 users (show)

See Also:


Attachments
Xcode project showing the issue (57.96 KB, application/zip)
2022-07-04 06:08 PDT, Felix Franz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Franz 2022-07-04 06:08:34 PDT
Created attachment 460651 [details]
Xcode project showing the issue

In our application (MacOS-application using WKWebView), we have an issue where after a certain magnification requestAnimationFrame-handlers are not called anymore (or very very rarely). 

I tried to strip down the issue and was able to reproduce it in a simple Cocoa-Application using a WKWebView which displays a web page. 

Steps to reproduce:

* build and open the attached Xcode project
* you see some elements and a red cell with an updating number in it 
* Click on the "zoom in"-button (and make sure you see the updating number)
* Starting from a magnification of 3 (you can see the magnification in the lower right corner) the number stops updating
* zoom out again and it starts again. 


the requestAnimationFrame handler is set in the viewer.html. If I use a simpler web page (only a one html with the same, or using a iframe it works as expected).
Comment 1 Radar WebKit Bug Importer 2022-07-05 09:47:55 PDT
<rdar://problem/96447352>
Comment 2 Smoley 2022-07-08 14:32:20 PDT
Thanks for filing, this does not reproduce for me on macOS 12.5 beta 5 (21G5063a). I stopped zooming in around 25. Are you able to reproduce this on that build?
Comment 3 Simon Fraser (smfr) 2022-07-08 14:44:39 PDT
I can reproduce. You have to scroll sideways a little to get into the state where it stops animating.
Comment 4 Simon Fraser (smfr) 2022-07-08 14:56:41 PDT
The visibleRect passed to `FrameView::updateScriptedAnimationsAndTimersThrottlingState` is wrong.

We should just change this code to use an internal IntersectionObserver.