<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>202655</bug_id>
          
          <creation_ts>2019-10-07 14:36:18 -0700</creation_ts>
          <short_desc>iOS Safari: timestamps can be identical for consecutive rAF callbacks</short_desc>
          <delta_ts>2025-09-13 17:35:27 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>Safari 12</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nolan Lawson">nolan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</cc>
    
    <cc>dino</cc>
    
    <cc>graouts</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1577518</commentid>
    <comment_count>0</comment_count>
      <attachid>380363</attachid>
    <who name="Nolan Lawson">nolan</who>
    <bug_when>2019-10-07 14:36:18 -0700</bug_when>
    <thetext>Created attachment 380363
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 &gt;0ms apart), but on iOS Safari it&apos;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)  &lt;-- 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&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1577521</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-10-07 14:52:00 -0700</bug_when>
    <thetext>&lt;rdar://problem/56051818&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2141638</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-09-08 10:02:10 -0700</bug_when>
    <thetext>@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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2142809</commentid>
    <comment_count>3</comment_count>
    <who name="Nolan Lawson">nolan</who>
    <bug_when>2025-09-13 17:27:41 -0700</bug_when>
    <thetext>@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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2142810</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-09-13 17:35:27 -0700</bug_when>
    <thetext>(In reply to Nolan Lawson from comment #3)
&gt; @Ahmad I moved my repro to a Codepen [1] and agree that I cannot repro on
&gt; iOS Safari 18.6.2. FWIW I also could not repro in Safari Technology Preview
&gt; 227 or GNOME Web 46.5.
&gt; 
&gt; [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.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>380363</attachid>
            <date>2019-10-07 14:36:18 -0700</date>
            <delta_ts>2019-10-07 14:36:18 -0700</delta_ts>
            <desc>Repro HTML page</desc>
            <filename>index.html</filename>
            <type>text/html</type>
            <size>843</size>
            <attacher name="Nolan Lawson">nolan</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KPGhlYWQ+CiAgPG1ldGEgY2hhcnNldD0i
VVRGLTgiPgogIDxtZXRhIG5hbWU9InZpZXdwb3J0IiBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lk
dGgiPgogIDx0aXRsZT5UZXN0IHJBRiB0aW1pbmc8L3RpdGxlPgo8L2hlYWQ+Cjxib2R5Pgo8aDE+
VGVzdCByQUYgdGltaW5nPC9oMT4KPHByZSBpZD0iZGlzcGxheSI+PC9wcmU+CjxzY3JpcHQ+CiAg
d2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ2xvYWQnLCBmdW5jdGlvbiAoKSB7CiAgICB2YXIgdGlt
ZXN0YW1wcyA9IFtdCgogICAgZnVuY3Rpb24gb25SYWYgKHRzKSB7CiAgICAgIHRpbWVzdGFtcHMu
cHVzaCh0cykKICAgICAgaWYgKHRpbWVzdGFtcHMubGVuZ3RoIDwgMzApIHsKICAgICAgICByZXF1
ZXN0QW5pbWF0aW9uRnJhbWUob25SYWYpCiAgICAgIH0gZWxzZSB7CiAgICAgICAgc2hvd1Jlc3Vs
dHMoKQ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