WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WORKSFORME
202655
iOS Safari: timestamps can be identical for consecutive rAF callbacks
https://bugs.webkit.org/show_bug.cgi?id=202655
Summary
iOS Safari: timestamps can be identical for consecutive rAF callbacks
Nolan Lawson
Reported
2019-10-07 14:36:18 PDT
Created
attachment 380363
[details]
Repro HTML page Consider a web page trying to measure framerate by using the timestamps passed in to requestAnimationFrame callbacks. Per the event loop spec (
https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model
) it seems that the timestamps should typically be ~16ms apart (and certainly >0ms apart), but on iOS Safari it's possible for them to be 0ms apart. Here is a sample page to demonstrate:
https://bl.ocks.org/nolanlawson/raw/99773cc8edc4115e6ba156a503dd2c41/
You might have to refresh the page a few times to reproduce, but often there will be one rAF callback whose timestamp is exactly the same as the previous one, e.g.: 12 24 (+12) 34 (+10) 34 (+0) <-- exactly the same as the last one 43 (+9) So far this seems only reproducible on iOS Safari. I can repro on both iOS 12.4 and 13.0 (using a real iPhone for the first and a simulator for the second). I'm not sure if the issue is with the timestamp or if the rAF callbacks are truly firing on the same turn of the event loop.
Attachments
Repro HTML page
(843 bytes, text/html)
2019-10-07 14:36 PDT
,
Nolan Lawson
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2019-10-07 14:52:00 PDT
<
rdar://problem/56051818
>
Ahmad Saleem
Comment 2
2025-09-08 10:02:10 PDT
@Nolan - is it still reproducing for you? I tried to reproduce by refreshing test page multiple times on iOS 26 Beta with latest build and I am unable to reproduce (+0) case.
Nolan Lawson
Comment 3
2025-09-13 17:27:41 PDT
@Ahmad I moved my repro to a Codepen [1] and agree that I cannot repro on iOS Safari 18.6.2. FWIW I also could not repro in Safari Technology Preview 227 or GNOME Web 46.5. [1]:
https://codepen.io/nolanlawson-the-selector/pen/GgpbBRW?editors=1010
Ahmad Saleem
Comment 4
2025-09-13 17:35:27 PDT
(In reply to Nolan Lawson from
comment #3
)
> @Ahmad I moved my repro to a Codepen [1] and agree that I cannot repro on > iOS Safari 18.6.2. FWIW I also could not repro in Safari Technology Preview > 227 or GNOME Web 46.5. > > [1]:
https://codepen.io/nolanlawson-the-selector/pen/GgpbBRW?editors=1010
Thanks for confirming Nolan, please keep on filing bug and CC me, happy to look at them. :-) Will keep this repo in mind as well.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug