-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
interopImplementations are not interoperable with each otherImplementations are not interoperable with each othertopic: script
Description
Example:
<body onload="console.log('Window load event')">
<script>
// Executed after 1 sec.
setTimeout(() => console.log('loading'), 1000);
// Resolved after 2 sec loading
import('./slow-script-taking-2sec-to-load.js').then(() => console.log('imported'));
</script>
</body>
WPT: web-platform-tests/wpt#25005
- Spec:
Window load event/loading/imported
.- Dynamic imports don't seem to
#delay-the-load-event
. Therefore, Window load event would be fired even while dynamic imports are loading.
- Dynamic imports don't seem to
- Chromium:
loading/Window load event/imported
.- The Window load event is delayed until finishing loading dynamically imported scripts, but not until the
then
callback ofimport()
promise. Just after the load finish, a Window load event is fired and then thethen
callback ofimport()
promise.
- The Window load event is delayed until finishing loading dynamically imported scripts, but not until the
- Firefox and Safari:
loading/imported/Window load event
.- The Window load event seems delayed until the
then
callback ofimport()
promise.
- The Window load event seems delayed until the
Given that all browsers delay the load event, perhaps it's better to make the spec also delay the load event, e.g. by changing https://html.spec.whatwg.org/multipage/webappapis.html#hostimportmoduledynamically(referencingscriptormodule,-specifier,-promisecapability).
Metadata
Metadata
Assignees
Labels
interopImplementations are not interoperable with each otherImplementations are not interoperable with each othertopic: script