Link rel=modulepreload synchronously fires load
event if script exists in module map
#10166
Labels
load
event if script exists in module map
#10166
What is the issue with the HTML Standard?
Per spec, if a
<link rel=modulepreload as=script>
becomes browsing-context connected, its special fetch and process the linked resource steps are run, which synchronously invoke fetch a modulepreload module script graph with a set of onComplete steps that simply fire a load or error event. This algorithm delegates to fetch a single module script, whose step 6 is:This appears to be able to synchronously invoke script during insertion, which we generally see as a bad thing (i.e., mutation events). Rather, the firing of the load event should probably be done behind a queued task, as we do for
error
events in the error case.The text was updated successfully, but these errors were encountered: