Inline module scripts with no dependencies should be executed after a full task
Categories
(Core :: DOM: Core & HTML, defect, P4)
Tracking
()
Tracking | Status | |
---|---|---|
firefox141 | --- | fixed |
People
(Reporter: d, Assigned: allstars.chh)
References
Details
Attachments
(3 files)
See test at https://github.com/web-platform-tests/wpt/pull/45660 and spec discussion at https://github.com/whatwg/html/pull/10272.
It appears Gecko instead runs them immediately.
Chrome and Safari run them after a full task. If you believe that's a good idea, please let me know and we can start a spec discussion. I don't think Gecko's behavior is very good though because it's impossible to spec cleanly, given the existence of top-level await.
Comment 1•1 year ago
|
||
jonco, smaug, who should look at this?
Reporter | ||
Comment 2•1 year ago
|
||
The latest plan is to run them after a full task. The spec and tests PR have been updated.
Comment 3•1 year ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #1)
jonco, smaug, who should look at this?
jonco :)
Updated•1 year ago
|
Comment 4•1 year ago
•
|
||
Yoshi, could you look into this at some point?
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Updated•25 days ago
|
Assignee | ||
Comment 5•25 days ago
|
||
Refactors execution behavior to run asynchronously for inline scripts that are
not generated by the parser.
spec:
https://html.spec.whatwg.org/#prepare-the-script-element
Step 32. If el does not have a src content attribute:
2. type: "module"
...
3. Fetch an inline module script graph, given source text, base URL, settings object, options, and with the following steps given result:
1. Queue an element task on the networking task source given el to perform the following steps:
1. Mark as ready el given result.
Step 33. If ... el's type is "module":
3. Otherwise, if el is not parser-inserted:
3.2.1 Execute the script element scripts[0].
Assignee | ||
Comment 6•25 days ago
|
||
According to the spec, non-parser-inserted inline module scripts should
execute in order.
https://html.spec.whatwg.org/#prepare-the-script-element
Step 33. If ... el's type is "module":
...
3. Otherwise, if el is not parser-inserted:
1. Let scripts be el's preparation-time document's list of scripts that will execute in order as soon as possible.
2. Append el to scripts.
Assignee | ||
Comment 7•25 days ago
|
||
Comment 9•24 days ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/02f1cb7eab5e
https://hg.mozilla.org/mozilla-central/rev/e50478c15f92
https://hg.mozilla.org/mozilla-central/rev/897e20364ff9
Updated•19 days ago
|
Description
•