Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use appropriate fetch destination for JSON&CSS modules #9486

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion source
Original file line number Diff line number Diff line change
Expand Up @@ -27285,6 +27285,9 @@ document.body.appendChild(wbr);</code></pre>
<li><p><var>destination</var> is "<code data-x="">font</code>" and
<var>mimeTypeRecord</var> is a <span>font MIME type</span>;</p></li>

<li><p><var>destination</var> is "<code data-x="">json</code>" and
<var>mimeTypeRecord</var> is a <span>JSON MIME type</span></p>;</li>

<li><p><var>destination</var> is "<code data-x="">style</code>" and
<var>mimeTypeRecord</var>'s <span data-x="MIME type essence">essence</span> is
<code>text/css</code>; or</p></li>
Expand Down Expand Up @@ -104122,11 +104125,14 @@ document.querySelector("button").addEventListener("click", bound);

<li><p>Let <var>request</var> be a new <span data-x="concept-request">request</span> whose
<span data-x="concept-request-url">URL</span> is <var>url</var>, <span
data-x="concept-request-destination">destination</span> is <var>destination</var>, <span
data-x="concept-request-mode">mode</span> is "<code data-x="">cors</code>", <span
data-x="concept-request-referrer">referrer</span> is <var>referrer</var>, and <span
data-x="concept-request-client">client</span> is <var>fetchClient</var>.</p></li>

<li><p>Set <var>request</var>'s <span data-x="concept-request-destination">destination</span> to
the result of running the <span>fetch destination from module type</span> steps given
<var>destination</var> and <var>moduleType</var>.</p></li>

<!--
"serviceworker" being included here is not redundant with the Service Worker spec's own
same-origin check, because the request's mode also affects the Origin and Sec-Fetch-Mode
Expand Down Expand Up @@ -104541,6 +104547,20 @@ document.querySelector("button").addEventListener("click", bound);
<li><p>Return true.</p></li>
</ol>

<p>The <dfn>fetch destination from module type</dfn> steps, given a <span
data-x="concept-request-destination">destination</span> <var>defaultDestination</var> and a
<span>string</span> <var>moduleType</var>, are as follows:</p>

<ol>
<li>If <var>moduleType</var> is "<code data-x="">json</code>", then return "<code
data-x="">json</code>".</li>

<li>If <var>moduleType</var> is "<code data-x="">css</code>", then return "<code
data-x="">style</code>".</li>

<li>Return <var>defaultDestination</var>.</li>
</ol>

<h5 id="calling-scripts">Calling scripts</h5>

<p>To <dfn export>run a classic script</dfn> given a <span>classic script</span> <var>script</var>
Expand Down