Skip to content

Commit

Permalink
Fix speculative script fetching to be based on connectedness
Browse files Browse the repository at this point in the history
Using "inserted into the document" is not correct, as that's not what governs (regular) script fetching.
  • Loading branch information
domfarolino authored Mar 4, 2024
1 parent a0a7218 commit 98702cd
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -62555,16 +62555,15 @@ o............A....e

<p>For performance reasons, user agents may start fetching the classic script or module graph
(as defined above) as soon as the <code data-x="attr-script-src">src</code> attribute is set,
instead, in the hope that <var>el</var> will be inserted into the document (and that the
<code data-x="attr-script-crossorigin">crossorigin</code> attribute won't change value in the
meantime). Either way, once <var>el</var> is <span data-x="node is inserted into a
document">inserted into the document</span>, the load must have started as described in this
step. If the UA performs such prefetching, but <var>el</var> is never inserted in the
document, or the <code data-x="attr-script-src">src</code> attribute is dynamically
changed,<!-- or the base URL is dynamically changed,--> or the <code
data-x="attr-script-crossorigin">crossorigin</code> attribute is dynamically changed, then
the user agent will not execute the script so obtained, and the fetching process will have
been effectively wasted.</p>
instead, in the hope that <var>el</var> will become connected (and that the <code
data-x="attr-script-crossorigin">crossorigin</code> attribute won't change value in the
meantime). Either way, once <var>el</var> <span>becomes connected</span>, the load must have
started as described in this step. If the UA performs such prefetching, but <var>el</var>
never becomes connected, or the <code data-x="attr-script-src">src</code> attribute is
dynamically changed, <!-- or the base URL is dynamically changed,--> or the <code
data-x="attr-script-crossorigin">crossorigin</code> attribute is dynamically changed, then the
user agent will not execute the script so obtained, and the fetching process will have been
effectively wasted.</p>
</li>
</ol>
</li>
Expand Down

0 comments on commit 98702cd

Please sign in to comment.