-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Parser-blocking script can greatly delay the appearance of meaningful content. The proposal is to add a new feature, sync-script, which is enabled by default (default allowlist is *).
When disabled, a script that would block parsing until its completion would not be run. The decision on whether a script will block parsing is made in step 24 of preparing a script in the HTML spec. This feature, when disabled, would prevent execution for the second and fifth clauses (where the element becomes the "pending parser-blocking script"), and the sixth clause when the element is flagged as parser-inserted.
This could be specified as a new step somewhere before step 24 (around step 11 perhaps):
If the element's node document is not allowed to use the sync-script feature, and the element does not have a defer attribute, and the element has been flagged as "parser-inserted", and the element does not have an async attribute, then return. The script is not executed.