Skip to content

Commit 0f3e00d

Browse files
authored
Add "webtransport" request mode
This helps WebTransport to better integrate with Fetch in a way similar to WebSockets (though not identical).
1 parent 0e72db8 commit 0f3e00d

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

fetch.bs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ exposes most of the networking functionality at a fairly low level of abstractio
183183

184184
<p>This specification uses terminology from <cite>ABNF</cite>, <cite>Encoding</cite>,
185185
<cite>HTML</cite>, <cite>HTTP</cite>, <cite>MIME Sniffing</cite>, <cite>Streams</cite>,
186-
<cite>URL</cite>, <cite>Web IDL</cite>, and <cite>WebSockets</cite>.
186+
<cite>URL</cite>, <cite>Web IDL</cite>, <cite>WebSockets</cite>, and <cite>WebTransport</cite>.
187187
[[!ABNF]]
188188
[[!ENCODING]]
189189
[[!HTML]]
@@ -193,6 +193,7 @@ exposes most of the networking functionality at a fairly low level of abstractio
193193
[[!URL]]
194194
[[!WEBIDL]]
195195
[[!WEBSOCKETS]]
196+
[[!WEBTRANSPORT]]
196197

197198
<p><dfn>ABNF</dfn> means ABNF as augmented by HTTP (in particular the addition of <code>#</code>)
198199
and RFC 7405. [[!RFC7405]]
@@ -1889,7 +1890,7 @@ not always relevant and might require different behavior.
18891890
<td><code>navigator.sendBeacon()</code>, {{EventSource}},
18901891
HTML's <code>&lt;a ping=""></code> and <code>&lt;area ping=""></code>,
18911892
<a method><code>fetch()</code></a>, <a method><code>fetchLater()</code></a>, {{XMLHttpRequest}},
1892-
{{WebSocket}}, Cache API
1893+
{{WebSocket}}, {{WebTransport}}, Cache API
18931894
<tr>
18941895
<td>"<code>object</code>"
18951896
<td><code>object-src</code>
@@ -2045,8 +2046,8 @@ during <a lt=fetch for=/>fetching</a>. It provides a convenient way for standard
20452046
<p>A <a for=/>request</a> has an associated
20462047
<dfn export for=request id=concept-request-mode>mode</dfn>, which is
20472048
"<code>same-origin</code>", "<code>cors</code>", "<code>no-cors</code>",
2048-
"<code>navigate</code>", or "<code>websocket</code>". Unless stated otherwise, it is
2049-
"<code>no-cors</code>".
2049+
"<code>navigate</code>", "<code>websocket</code>", or "<code>webtransport</code>".
2050+
Unless stated otherwise, it is "<code>no-cors</code>".
20502051

20512052
<div class=note>
20522053
<dl>
@@ -2071,6 +2072,9 @@ during <a lt=fetch for=/>fetching</a>. It provides a convenient way for standard
20712072
<dt>"<code>websocket</code>"
20722073
<dd>This is a special mode used only when
20732074
<a spec=websockets lt="establish a WebSocket connection">establishing a WebSocket connection</a>.
2075+
2076+
<dt>"<code>webtransport</code>"
2077+
<dd>This is a special mode used only by {{WebTransport/WebTransport(url, options)}}.
20742078
</dl>
20752079

20762080
<p>Even though the default <a for=/>request</a> <a for=request>mode</a> is "<code>no-cors</code>",
@@ -3581,7 +3585,7 @@ given a <a for=/>request</a> <var>request</var>, run these steps:
35813585
with <var>request</var>.
35823586

35833587
<li><p>If <var>request</var>'s <a for=request>response tainting</a> is "<code>cors</code>" or
3584-
<var>request</var>'s <a for=request>mode</a> is "<code>websocket</code>", then
3588+
<var>request</var>'s <a for=request>mode</a> is either "<code>websocket</code>" or "<code>webtransport</code>", then
35853589
<a for="header list">append</a> (`<code>Origin</code>`, <var>serializedOrigin</var>) to
35863590
<var>request</var>'s <a for=request>header list</a>.
35873591

@@ -4841,7 +4845,7 @@ steps:
48414845
<dt><var>request</var>'s <a for=request>current URL</a>'s <a for=url>scheme</a> is
48424846
"<code>data</code>"
48434847
<dt><var>request</var>'s <a for=request>mode</a> is
4844-
"<code>navigate</code>" or "<code>websocket</code>"
4848+
"<code>navigate</code>", "<code>websocket</code>" or "<code>webtransport</code>"
48454849
<dd>
48464850
<ol>
48474851
<li><p>Set <var>request</var>'s
@@ -6424,6 +6428,10 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
64246428
<a lt="obtain a WebSocket connection">obtaining a WebSocket connection</a>, given
64256429
<var>request</var>'s <a for=request>current URL</a>.
64266430

6431+
<dt>"<code>webtransport</code>"
6432+
<dd><p>Let <var>connection</var> be the result of <a>obtaining a WebTransport connection</a>,
6433+
given <var>networkPartitionKey</var> and <var>request</var>.
6434+
64276435
<dt>Otherwise
64286436
<dd><p>Let <var>connection</var> be the result of
64296437
<a lt="obtain a connection">obtaining a connection</a>, given <var>networkPartitionKey</var>,
@@ -8325,8 +8333,9 @@ enum RequestPriority { "high", "low", "auto" };
83258333

83268334
<p class=note>"<code>serviceworker</code>" is omitted from
83278335
<a enum><code>RequestDestination</code></a> as it cannot be observed from JavaScript. Implementations
8328-
will still need to support it as a <a for=request>destination</a>. "<code>websocket</code>" is
8329-
omitted from <a enum><code>RequestMode</code></a> as it cannot be used nor observed from JavaScript.
8336+
will still need to support it as a <a for=request>destination</a>. "<code>websocket</code>" and
8337+
"<code>webtransport</code>" are omitted from <a enum><code>RequestMode</code></a> as they cannot be
8338+
used or observed from JavaScript.
83308339

83318340
<p>A {{Request}} object has an associated
83328341
<dfn id=concept-request-request for=Request export>request</dfn> (a <a for=/>request</a>).

0 commit comments

Comments
 (0)