Bug 236780 - [frame-rate] animations with frameRate set to a value higher than 60 change the timing of requestAnimationFrame callbacks
Summary: [frame-rate] animations with frameRate set to a value higher than 60 change t...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-02-17 06:40 PST by Antoine Quint
Modified: 2022-02-17 06:48 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2022-02-17 06:40:51 PST
When we added support for the frameRate property in bug 234202, we also changed the timing for requestAnimationFrame callbacks. Indeed, if an animation is set to have a frameRate higher than 60, for instance 120 on a Pro Motion device, then the requestAnimationFrame() callbacks will fire when that animation is sampled.
Comment 1 Antoine Quint 2022-02-17 06:47:58 PST
So I think there are two options here:

1. we believe that requestAnimationFrame callbacks should fire when page rendering is updated and the current behavior is correct

2. we believe that requestAnimationFrame callbacks should only ever fire at a 60Hz interval

I think within a given page, option 1 is fine. If the page is opting into running animations at a higher frame rate than 60Hz, then it should be prepared to deal with requestAnimationFrame callbacks at 60Hz.

Things might get trickier in pages with multiple frames, with the parent frame updating rendering at 120fps.

I think from a spec point of view, authors should not be concerned with animations runnings at a fluctuating frame rate. In fact, we already change the frame rate with low power mode and both Firefox and Chrome can run requestAnimationFrame at 120fps.

From a web compatibility point of view, things might be different.
Comment 2 Radar WebKit Bug Importer 2022-02-17 06:48:21 PST
<rdar://problem/89084018>