Skip to content

Commit 49bff76

Browse files
Add "json" destination for JSON modules
This is needed for whatwg/html#9486. Tests: web-platform-tests/wpt#41665.
1 parent aa6f53e commit 49bff76

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

fetch.bs

+15-7
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,7 @@ the empty string,
17491749
"<code>frame</code>",
17501750
"<code>iframe</code>",
17511751
"<code>image</code>",
1752+
"<code>json</code>",
17521753
"<code>manifest</code>",
17531754
"<code>object</code>",
17541755
"<code>paintworklet</code>",
@@ -1768,7 +1769,7 @@ and "<code>webidentity</code>" as fetches with those destinations skip service w
17681769
<!-- Dependencies:
17691770
* CSP: https://w3c.github.io/webappsec-csp/#effective-directive-for-a-request
17701771
* Mixed Content
1771-
* Preload: https://w3c.github.io/preload/#processing
1772+
* Preload: https://html.spec.whatwg.org/multipage/links.html#link-type-preload
17721773
* HTML -->
17731774

17741775
<p>A <a for=/>request</a>'s <a for=request>destination</a> is
@@ -1793,7 +1794,7 @@ not always relevant and might require different behavior.
17931794
<th>CSP directive
17941795
<th>Features
17951796
<tr>
1796-
<td rowspan=20>""
1797+
<td rowspan=21>""
17971798
<td>"<code>report</code>"
17981799
<td rowspan=2>&mdash;
17991800
<td>CSP, NEL reports.
@@ -1864,10 +1865,14 @@ not always relevant and might require different behavior.
18641865
<td>"<code>worker</code>"
18651866
<td><code>child-src</code>, <code>script-src</code>, <code>worker-src</code>
18661867
<td><code>Worker</code>
1868+
<tr>
1869+
<td>"<code>json</code>"
1870+
<td><code>connect-src</code>
1871+
<td><code>import "..." with { type: "json" }</code>
18671872
<tr>
18681873
<td>"<code>style</code>"
18691874
<td><code>style-src</code>
1870-
<td>HTML's <code>&lt;link rel=stylesheet></code>, CSS' <code>@import</code>
1875+
<td>HTML's <code>&lt;link rel=stylesheet></code>, CSS' <code>@import</code>, <code>import "..." with { type: "css" }</code>
18711876
<tr>
18721877
<td>"<code>track</code>"
18731878
<td><code>media-src</code>
@@ -2197,9 +2202,9 @@ bookkeeping details by the <a for=/>fetch</a> algorithm.
21972202

21982203
<p>A <dfn export>subresource request</dfn> is a <a for=/>request</a>
21992204
whose <a for=request>destination</a> is "<code>audio</code>", "<code>audioworklet</code>",
2200-
"<code>font</code>", "<code>image</code>", "<code>manifest</code>", "<code>paintworklet</code>",
2201-
"<code>script</code>", "<code>style</code>", "<code>track</code>", "<code>video</code>",
2202-
"<code>xslt</code>", or the empty string.
2205+
"<code>font</code>", "<code>image</code>", "<code>json</code>" "<code>manifest</code>",
2206+
"<code>paintworklet</code>", "<code>script</code>", "<code>style</code>", "<code>track</code>",
2207+
"<code>video</code>", "<code>xslt</code>", or the empty string.
22032208

22042209
<p>A <dfn export>non-subresource request</dfn> is a <a for=/>request</a>
22052210
whose <a for=request>destination</a> is "<code>document</code>", "<code>embed</code>",
@@ -4381,6 +4386,9 @@ the response. [[!HTTP-CACHING]]
43814386
<dt>"<code>image</code>"
43824387
<dd>`<code>image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5</code>`
43834388

4389+
<dt>"<code>json</code>"
4390+
<dd>`<code>application/json,*/*;q=0.5</code>`
4391+
43844392
<dt>"<code>style</code>"
43854393
<dd>`<code>text/css,*/*;q=0.1</code>`
43864394
</dl>
@@ -7404,7 +7412,7 @@ dictionary RequestInit {
74047412
any window; // can only be set to null
74057413
};
74067414

7407-
enum RequestDestination { "", "audio", "audioworklet", "document", "embed", "font", "frame", "iframe", "image", "manifest", "object", "paintworklet", "report", "script", "sharedworker", "style", "track", "video", "worker", "xslt" };
7415+
enum RequestDestination { "", "audio", "audioworklet", "document", "embed", "font", "frame", "iframe", "image", "json", "manifest", "object", "paintworklet", "report", "script", "sharedworker", "style", "track", "video", "worker", "xslt" };
74087416
enum RequestMode { "navigate", "same-origin", "no-cors", "cors" };
74097417
enum RequestCredentials { "omit", "same-origin", "include" };
74107418
enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" };

0 commit comments

Comments
 (0)