Bug 260478 - [WPE][GTK] Enable requestIdleCallback
Summary: [WPE][GTK] Enable requestIdleCallback
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-21 12:26 PDT by Michael Catanzaro
Modified: 2023-08-21 14:01 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2023-08-21 12:26:49 PDT
We need to enable requestIdleCallback, as in bug #260369. Ryosuke has left us this hint:

"""
You need to implement these functions: RunLoopObserver::schedule, RunLoopObserver::invalidate, and RunLoopObserver::isScheduled():

https://github.com/WebKit/WebKit/blob/main/Source/WebCore/platform/RunLoopObserver.cpp
"""

Unfortunately, looking at RunLoopObserverCF, I can't think of any way to map this to GMainContext, so it's probably not possible. We shouldn't try to modify GMainContext unless there are no other options. This requires further investigation.

--------------------------------------------

We should also think about the problem I describe here: https://bugs.webkit.org/show_bug.cgi?id=164193#c18, i.e. we need to make sure web content cannot perform a denial of service that would prevent WebKit from running WebKit's own callbacks.
Comment 1 Ryosuke Niwa 2023-08-21 14:01:22 PDT
FWIW, the feature may work out of box right now because of the code I added to WindowEventLoop:
https://github.com/WebKit/WebKit/blob/main/Source/WebCore/dom/WindowEventLoop.cpp#L189

Might be worth testing to see if you can enable the feature anyway without implementing RunLoopObserver.