Bug 296649

Summary: Make window load event dispatch asynchronous to improve WPT compatibility.
Product: WebKit Reporter: Basuke Suzuki <basuke>
Component: New BugsAssignee: Basuke Suzuki <basuke>
Status: NEW    
Severity: Normal CC: rbuis, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Basuke Suzuki
Reported 2025-07-29 13:56:13 PDT
Currently the event is firing synchronously. This is the reason many wpt tests using promise_test causes TIMEOUT like this code: ``` promise_test(async t => { // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0)); ... ``` When the promise is created, window.onload is already fired and the promise is never resolved and TIMEOUT happens. Most of the tests under `imported/w3c/web-platform-tests/navigation-api/ordering-and-transition/ failed with TIMEOUT because of this.
Attachments
Basuke Suzuki
Comment 1 2025-07-29 13:58:49 PDT
Basuke Suzuki
Comment 2 2025-07-29 14:06:17 PDT
Basuke Suzuki
Comment 3 2025-08-04 07:30:04 PDT
*** Bug 277948 has been marked as a duplicate of this bug. ***
Basuke Suzuki
Comment 4 2025-08-21 12:23:28 PDT
Note You need to log in before you can comment on or make changes to this bug.