Skip to content

Commit b73221e

Browse files
Differentiate fetch referrer between static and dynamic imports
1 parent c75dae4 commit b73221e

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

source

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93636,7 +93636,7 @@ document.querySelector("button").addEventListener("click", bound);
9363693636
</ol>
9363793637

9363893638
<p>To <dfn>fetch a single imported module script</dfn>, given a <var>settings object</var>, a
93639-
<var>base URL</var>, a <var>destination</var>, some <var>options</var>, a
93639+
<var>base URL</var>, a <var>destination</var>, some <var>options</var>, a <var>referrer</var>, a
9364093640
<var>moduleRequest</var>, and an <var>onComplete</var> algorithm, run these steps.
9364193641
<var>onComplete</var> must be an algorithm accepting null (on failure) or a <span>module
9364293642
script</span> (on success).</p>
@@ -93662,8 +93662,8 @@ document.querySelector("button").addEventListener("click", bound);
9366293662

9366393663
<li><p><span>Fetch a single module script</span> given <var>url</var>, <var>settings
9366493664
object</var>, <var>destination</var>, <var>options</var>, <var>settings object</var>,
93665-
"<code data-x="">client</code>", <var>moduleRequest</var>, with the <var>top-level module
93666-
fetch flag</var> unset, and with <var>onComplete</var>.</p></li>
93665+
<var>referrer</var>, <var>moduleRequest</var>, with the <var>top-level module fetch flag</var>
93666+
unset, and with <var>onComplete</var>.</p></li>
9366793667
</ol>
9366893668

9366993669
<h5 id="creating-scripts">Creating scripts</h5>
@@ -95046,6 +95046,8 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
9504695046
<li><p>Let <var>fetch options</var> be the <span>default classic script fetch
9504795047
options</span>.</p></li>
9504895048

95049+
<li><p>Let <var>fetch referrer</var> be "<code data-x="">client</code>".</p></li>
95050+
9504995051
<li>
9505095052
<p>If <var>referrer</var> is a <span>Script Record</span> or a <span data-x="Cyclic Module
9505195053
Record">Module Record</span>, then:</p>
@@ -95067,6 +95069,15 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
9506795069
<li><p>Assert: Neither <var>base URL</var> nor <var>fetch options</var> is null, as
9506895070
<var>referencing script</var> is a <span>classic script</span> or a <span>JavaScript module
9506995071
script</span>.</p></li>
95072+
95073+
<li>
95074+
<p>If <var>loadState</var> is not undefined, set <var>fetch referrer</var> to <var>base
95075+
URL</var>.</p>
95076+
95077+
<p class="XXX">We check <var>loadState</var> to not propagate the referrer when using dynamic
95078+
imports. <a href="https://github.com/whatwg/html/issues/3744">Issue #3744</a> looks into
95079+
aligning dynamic imports with static imports.</p>
95080+
</li>
9507095081
</ol>
9507195082

9507295083
<div class="example">
@@ -95091,8 +95102,9 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
9509195102

9509295103
<li>
9509395104
<p><span>Fetch a single imported module script</span> given <var>settings object</var>,
95094-
<var>base URL</var>, <var>destination</var>, <var>fetch options</var>, <var>moduleRequest</var>,
95095-
and with the following steps given <var>module script</var>:</p>
95105+
<var>base URL</var>, <var>destination</var>, <var>fetch options</var>, <var>fetch
95106+
referrer</var>, <var>moduleRequest</var>, and with the following steps given <var>module
95107+
script</var>:</p>
9509695108

9509795109
<ol>
9509895110
<li><p>If <var>module script</var> is null, then let <var>completion</var> be Completion {

0 commit comments

Comments
 (0)