WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 268058
268152
requestIdleCallback intermittently fails to invoke callbacks
https://bugs.webkit.org/show_bug.cgi?id=268152
Summary
requestIdleCallback intermittently fails to invoke callbacks
Daniel
Reported
2024-01-26 05:24:38 PST
I set the severity to major since it would be *very bad* if a broken requestIdleCallback got shipped in the next stable safari version, web devs would have to deal with the fallout of this broken version being in the wild for years to come. ---- First of all: AMAZING that Safari is finally getting requestIdleCallback (referring to
https://bugs.webkit.org/show_bug.cgi?id=260369
). However, it unfortunately doesn't seem to work as expected. It's quite glitchy and sometimes never fires, even when the browser is obviously completely idle. In Safari Technology Preview (Release 187 (Safari 17.4, WebKit 19619.0.1.2)) where it's enabled by default, it doesn't seem to work at all sometimes (or is *very* spotty). To illustrate this example, creating a totally blank index.html file and then running requestIdleCallback inside it would be expected to fire immediately, like it does in Firefox and Chrome. In Safari however it seems to sometimes fire after a minute, even after disabling all browser extensions (see attached video). As for a real world example: If you go to
https://singular-society.com/search?q
= all but the first 8 images are loaded using requestIdleCallback. This is to increase performance when scrolling down as it was previously terrible and after some profiling loading ~20 images per product card turned out to be the culprit, with the easiest solution being to defer loading the images until the browser is idle. If you visit the page in chrome and scroll down ~20 images, you will notice that the loading of the images is delayed a bit to keep the browser smooth but they still load really quickly. If you visit it in safari technology preview, the images don't load at all for minutes (seems to only sometimes happen. Try: after a fresh browser start, first go to singular-society.com and then click on the search icon and then press enter, then scroll down a bit). (See also attached video) Let me know if you need more help reproducing this.
Attachments
A real world example that shows how image loading is delayed too far, due to requestIdleCallback being buggy
(70.37 MB, video/mp4)
2024-01-26 05:25 PST
,
Daniel
no flags
Details
Video showing how requestIdleCallback fires after a minute on an empty page, should fire directly
(99.49 MB, video/mp4)
2024-01-26 05:27 PST
,
Daniel
no flags
Details
Reduction
(339 bytes, text/html)
2024-03-28 16:12 PDT
,
Ryosuke Niwa
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Daniel
Comment 1
2024-01-26 05:25:47 PST
Created
attachment 469556
[details]
A real world example that shows how image loading is delayed too far, due to requestIdleCallback being buggy
Daniel
Comment 2
2024-01-26 05:27:15 PST
Created
attachment 469557
[details]
Video showing how requestIdleCallback fires after a minute on an empty page, should fire directly
Radar WebKit Bug Importer
Comment 3
2024-01-29 14:00:33 PST
<
rdar://problem/121880350
>
Ryosuke Niwa
Comment 4
2024-03-28 16:12:37 PDT
Created
attachment 470650
[details]
Reduction Reproduction steps: 1. Open idle.html 2. Move the cursor out of the browser window Result: "idle3" doesn't get logged until some cursor movement is triggered on the browser window.
Ryosuke Niwa
Comment 5
2024-03-29 21:42:39 PDT
Fixing this as a part of the
bug 268058
. *** This bug has been marked as a duplicate of
bug 268058
***
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