WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
297939
Race condition between module script execution and FrameLoader's document completion check.
https://bugs.webkit.org/show_bug.cgi?id=297939
Summary
Race condition between module script execution and FrameLoader's document com...
Basuke Suzuki
Reported
2025-08-26 17:22:56 PDT
When module scripts access document.readyState during their execution, they incorrectly receive "complete" when they should receive "interactive" according to the HTML specification. DESCRIPTION: Module scripts should execute after DOMContentLoaded but before the load event, at which point document.readyState should be "interactive". However, due to a race condition between JavaScript execution and FrameLoader's readyState control, module scripts see the state as "complete". STEPS TO REPRODUCE: 1. Load a page with a module script that checks document.readyState 2. The module script will see "complete" instead of "interactive" Test case: load-event-timing.html EXPECTED RESULTS: Module scripts should see document.readyState as "interactive" during their execution phase. ACTUAL RESULTS: Module scripts see document.readyState as "complete". Reproducibility is sometimes because it doesn’t happen when script module is simple and there’s no other classic inline script. This tells the fact that this must be dependent on the surrounding situation.
Attachments
Add attachment
proposed patch, testcase, etc.
Basuke Suzuki
Comment 1
2025-08-26 17:24:34 PDT
rdar://159112160
Basuke Suzuki
Comment 2
2025-08-26 17:29:32 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/49910
EWS
Comment 3
2025-08-28 15:17:53 PDT
Committed
299282@main
(f1e55dd8fe6f): <
https://commits.webkit.org/299282@main
> Reviewed commits have been landed. Closing PR #49910 and removing active labels.
Basuke Suzuki
Comment 4
2025-10-10 09:45:22 PDT
This was reverted on
https://commits.webkit.org/301215@main
Basuke Suzuki
Comment 5
2025-10-10 10:07:02 PDT
<
rdar://problem/162211435
>
Basuke Suzuki
Comment 6
2025-10-10 10:07:17 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/52127
EWS
Comment 7
2025-10-10 21:22:00 PDT
Committed
301345@main
(85e09b241c12): <
https://commits.webkit.org/301345@main
> Reviewed commits have been landed. Closing PR #52127 and removing active labels.
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