From 00794099b37667a20621f3c6fe211a1de4cb562a Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 28 Oct 2025 15:48:01 -0400 Subject: [PATCH 1/7] Add "webtransport" request mode. --- fetch.bs | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/fetch.bs b/fetch.bs index 8d19ae84d..567638330 100755 --- a/fetch.bs +++ b/fetch.bs @@ -183,7 +183,7 @@ exposes most of the networking functionality at a fairly low level of abstractio

This specification uses terminology from ABNF, Encoding, HTML, HTTP, MIME Sniffing, Streams, -URL, Web IDL, and WebSockets. +URL, Web IDL, WebSockets, and WebTransport. [[!ABNF]] [[!ENCODING]] [[!HTML]] @@ -193,6 +193,7 @@ exposes most of the networking functionality at a fairly low level of abstractio [[!URL]] [[!WEBIDL]] [[!WEBSOCKETS]] +[[!WEBTRANSPORT]]

ABNF means ABNF as augmented by HTTP (in particular the addition of #) and RFC 7405. [[!RFC7405]] @@ -1889,7 +1890,7 @@ not always relevant and might require different behavior. navigator.sendBeacon(), {{EventSource}}, HTML's <a ping=""> and <area ping="">, fetch(), fetchLater(), {{XMLHttpRequest}}, - {{WebSocket}}, Cache API + {{WebSocket}}, {{WebTransport}}, Cache API "object" object-src @@ -2045,8 +2046,8 @@ during fetching. It provides a convenient way for standard

A request has an associated mode, which is "same-origin", "cors", "no-cors", -"navigate", or "websocket". Unless stated otherwise, it is -"no-cors". +"navigate", "websocket", or "webtransport". +Unless stated otherwise, it is "no-cors".

@@ -2071,6 +2072,9 @@ during fetching. It provides a convenient way for standard
"websocket"
This is a special mode used only when establishing a WebSocket connection. + +
"webtransport" +
This is a special mode used only by {{WebTransport/WebTransport(url, options)}}.

Even though the default request mode is "no-cors", @@ -3581,7 +3585,7 @@ given a request request, run these steps: with request.

  • If request's response tainting is "cors" or - request's mode is "websocket", then + request's mode is either "websocket" or "webtransport", then append (`Origin`, serializedOrigin) to request's header list. @@ -4841,7 +4845,7 @@ steps:

    request's current URL's scheme is "data"
    request's mode is - "navigate" or "websocket" + "navigate", "websocket" or "webtransport"
    1. Set request's @@ -6424,6 +6428,11 @@ optional boolean forceNewConnection (default false), run these steps: obtaining a WebSocket connection, given request's current URL. +

      "webtransport" +

      Let connection be the result of + obtaining a WebTransport connection, given + networkPartitionKey, and request. +

      Otherwise

      Let connection be the result of obtaining a connection, given networkPartitionKey, @@ -8325,8 +8334,9 @@ enum RequestPriority { "high", "low", "auto" };

      "serviceworker" is omitted from RequestDestination as it cannot be observed from JavaScript. Implementations -will still need to support it as a destination. "websocket" is -omitted from RequestMode as it cannot be used nor observed from JavaScript. +will still need to support it as a destination. "websocket" and +"webtransport" are omitted from RequestMode as they cannot be +used or observed from JavaScript.

      A {{Request}} object has an associated request (a request). @@ -9794,6 +9804,18 @@ requests — and do not use `Vary`. establish a WebSocket connection directly, but both are now defined in WebSockets. [[WEBSOCKETS]] +

      WebTransport

      + +

      As part of establishing a connection, the {{WebTransport}} object initiates a special kind of +fetch (using a request whose mode is +"webtransport") which allows it to share in many fetch policy decisions, such +HTTP Strict Transport Security (HSTS). Ultimately this results in fetch calling into +WebTransport which in turn obtains a connection. +[[WEBTRANSPORT]][[HSTS]] + +

      WebTransport needs to wrap the obtain a connection +algorithm to add features unique to WebTransport, like +{{WebTransportOptions/serverCertificateHashes}}. [[WEBTRANSPORT]]

      Using fetch in other standards

      From 7ea55a356d90a30ef8718251716a2f58b09c15cb Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 18 Nov 2025 09:40:39 -0500 Subject: [PATCH 2/7] add link --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index 567638330..4940f47d8 100755 --- a/fetch.bs +++ b/fetch.bs @@ -6430,7 +6430,7 @@ optional boolean forceNewConnection (default false), run these steps:
      "webtransport"

      Let connection be the result of - obtaining a WebTransport connection, given + obtaining a WebTransport connection, given networkPartitionKey, and request.

      Otherwise From 5706533014f3483023c829bfea48684631df30aa Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 18 Nov 2025 09:48:03 -0500 Subject: [PATCH 3/7] remove section explaining WebTransport --- fetch.bs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/fetch.bs b/fetch.bs index 4940f47d8..010d9e5b7 100755 --- a/fetch.bs +++ b/fetch.bs @@ -9804,18 +9804,6 @@ requests — and do not use `Vary`. establish a WebSocket connection directly, but both are now defined in WebSockets. [[WEBSOCKETS]] -

      WebTransport

      - -

      As part of establishing a connection, the {{WebTransport}} object initiates a special kind of -fetch (using a request whose mode is -"webtransport") which allows it to share in many fetch policy decisions, such -HTTP Strict Transport Security (HSTS). Ultimately this results in fetch calling into -WebTransport which in turn obtains a connection. -[[WEBTRANSPORT]][[HSTS]] - -

      WebTransport needs to wrap the obtain a connection -algorithm to add features unique to WebTransport, like -{{WebTransportOptions/serverCertificateHashes}}. [[WEBTRANSPORT]]

      Using fetch in other standards

      From 73fa8d21a0cf4a898fd5e93a8364171c55237fdf Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 18 Nov 2025 09:49:41 -0500 Subject: [PATCH 4/7] leave out link for now to satisfy bikeshed --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index 010d9e5b7..b277307a6 100755 --- a/fetch.bs +++ b/fetch.bs @@ -6430,7 +6430,7 @@ optional boolean forceNewConnection (default false), run these steps:
      "webtransport"

      Let connection be the result of - obtaining a WebTransport connection, given + obtaining a WebTransport connection, given networkPartitionKey, and request.

      Otherwise From 644231d217945f0afbae5c46f36369b6a4e58781 Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 18 Nov 2025 13:55:03 -0500 Subject: [PATCH 5/7] excess comma Co-authored-by: Anne van Kesteren --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index b277307a6..6232c86d6 100755 --- a/fetch.bs +++ b/fetch.bs @@ -6431,7 +6431,7 @@ optional boolean forceNewConnection (default false), run these steps:
      "webtransport"

      Let connection be the result of obtaining a WebTransport connection, given - networkPartitionKey, and request. + networkPartitionKey and request.

      Otherwise

      Let connection be the result of From 578b6b04695dc6b6f705fe10bd21b7e12322398f Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 18 Nov 2025 14:47:11 -0500 Subject: [PATCH 6/7] Apply suggestion from @jan-ivar Add link to webtransport --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index 6232c86d6..16f348713 100755 --- a/fetch.bs +++ b/fetch.bs @@ -6430,7 +6430,7 @@ optional boolean forceNewConnection (default false), run these steps:

      "webtransport"

      Let connection be the result of - obtaining a WebTransport connection, given + obtaining a WebTransport connection, given networkPartitionKey and request.

      Otherwise From 224407efe825b41f517e080fb732f8ef33e1775f Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 19 Nov 2025 09:55:49 +0100 Subject: [PATCH 7/7] Update fetch.bs --- fetch.bs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fetch.bs b/fetch.bs index 16f348713..0d70e4f9c 100755 --- a/fetch.bs +++ b/fetch.bs @@ -6429,9 +6429,8 @@ optional boolean forceNewConnection (default false), run these steps: request's current URL.
      "webtransport" -

      Let connection be the result of - obtaining a WebTransport connection, given - networkPartitionKey and request. +

      Let connection be the result of obtaining a WebTransport connection, + given networkPartitionKey and request.

      Otherwise

      Let connection be the result of