RESOLVED FIXED291217
REGRESSION(292977@main): [Win] nested tasks are not dispatched
https://bugs.webkit.org/show_bug.cgi?id=291217
Summary REGRESSION(292977@main): [Win] nested tasks are not dispatched
Yury Semikhatsky
Reported 2025-04-07 12:19:02 PDT
After https://commits.webkit.org/292977@main nested tasks on main thread are not dispatched. Try inserting the following code somewhere in the UI process, e.g. in `WebPageInspectorController` constructor. `step 2 callback` is printed, but `step 3 callback` is not. ``` fprintf(stderr, "step 1\n"); RunLoop::main().dispatch([] { fprintf(stderr, "step 2 callback\n"); RunLoop::main().dispatchAfter(Seconds(0.1), [] { fprintf(stderr, "step 3 callback\n"); }); }); ``` It broke Playwright screencast and video recording functionality.
Attachments
test patch for MiniBrowser (734 bytes, patch)
2025-04-07 14:19 PDT, Fujii Hironori
no flags
Fujii Hironori
Comment 1 2025-04-07 14:19:06 PDT
The run loop of UI process main thread is run by the application, not by WTF::RunLoop::run. https://github.com/WebKit/WebKit/blob/2bebfdc1ea6d02362f3b549004940f2ef8ea28e2/Tools/MiniBrowser/win/WinMain.cpp#L81-L91 I think we should revert 292977@main.
Fujii Hironori
Comment 2 2025-04-07 14:19:51 PDT
Created attachment 474861 [details] test patch for MiniBrowser
Ian Grunert
Comment 3 2025-04-07 14:33:01 PDT
Yeah, this used to work because the main thread's run loop and the WTF run loop both processed the WM_TIMER messages. Agree we should revert for now. We might be able to do something similar to PlayStation's MiniBrowser and use the WTF run loop in MiniBrowser, but I'd rather revert and we can land that later.
Fujii Hironori
Comment 4 2025-04-07 14:47:06 PDT
(In reply to Ian Grunert from comment #3) > Agree we should revert for now. We might be able to do something similar to > PlayStation's MiniBrowser and use the WTF run loop in MiniBrowser, but I'd > rather revert and we can land that later. The run loop is a bit customized. https://github.com/WebKit/WebKit/blob/2bebfdc1ea6d02362f3b549004940f2ef8ea28e2/Tools/MiniBrowser/win/WinMain.cpp#L85-L86 Another customize is needed if we add a modeless dialog. https://learn.microsoft.com/en-us/windows/win32/dlgbox/using-dialog-boxes#creating-a-modeless-dialog-box
Fujii Hironori
Comment 5 2025-04-07 14:47:16 PDT
Radar WebKit Bug Importer
Comment 6 2025-04-07 14:48:15 PDT
Note You need to log in before you can comment on or make changes to this bug.