-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
What is the issue with the HTML Standard?
The investigation of #9864 uncovered an issue where "mark as ready" could be invoked early for inline scripts, making it ambiguous how to handle "steps to run when the result is ready"
The problem was resolved in #10272 by delaying the handler which marks the resource as complete, queuing the operation as a task rather than execute it immediately.
It seems the exact same issue exists for script modules!
The problematic text is in "4.12.1.1 Processing model", section "To prepare the script element given a script element el:"
Step 33.11, case "module", means that "mark as ready" (defined in step 34.10) runs immediately if the script has already been loaded. (This is an edge case that can happen if a document includes the same module multiple times.)
In this case, the assert in step 35.1 would fail (see #8534), and it's unclear how to handle "steps to run when the result is ready" which could be set in steps 35.2-5
The equivalent step for inline scripts, 34.2 case "module", specifies that "mark as ready" should be queued as an element task instead.