Skip to content

Commit

Permalink
Merge branch 'whatwg:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
guohuideng2024 authored Jan 21, 2025
2 parents 94ecd4c + 07662d3 commit c8a0981
Show file tree
Hide file tree
Showing 2 changed files with 9,317 additions and 39 deletions.
79 changes: 40 additions & 39 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Group: WHATWG
H1: Fetch
Shortname: fetch
Text Macro: TWITTER fetchstandard
Text Macro: LATESTRD 2024-06
Text Macro: LATESTRD 2024-12
Abstract: The Fetch standard defines requests, responses, and the process that binds them: fetching.
Translation: ja https://triple-underscore.github.io/Fetch-ja.html
Translation: zh-Hans https://htmlspecs.com/fetch/
Expand Down Expand Up @@ -2780,7 +2780,6 @@ functionality.

<p>If this operation succeeds, return the <a for=/>set</a> of <a for=/>IP addresses</a> and any
additional <a>implementation-defined</a> information.
</li>

<li><p>Return failure.
</ol>
Expand Down Expand Up @@ -4150,7 +4149,6 @@ true, and it's always for nested navigations. Otherwise, <var>response</var> is
<dt>"<a for="embedder policy value"><code>require-corp</code></a>"
<dd><p>Set <var>policy</var> to `<code>same-origin</code>`.
</dl>
</li>

<li>
<p>Switch on <var>policy</var>:
Expand Down Expand Up @@ -4316,6 +4314,8 @@ the response. [[!HTTP-CACHING]]

<li><p>Let <var>crossOriginIsolatedCapability</var> be false.

<li><p><a>Populate request from client</a> given <var>request</var>.

<li>
<p>If <var>request</var>'s <a for=request>client</a> is non-null, then:

Expand Down Expand Up @@ -4361,16 +4361,6 @@ the response. [[!HTTP-CACHING]]
<var>request</var>'s <a for=request>body</a> to <var>request</var>'s <a for=request>body</a>
<a for="byte sequence">as a body</a>.

<li><p>If <var>request</var>'s <a for=request>window</a> is "<code>client</code>", then set
<var>request</var>'s <a for=request>window</a> to <var>request</var>'s <a for=request>client</a>,
if <var>request</var>'s <a for=request>client</a>'s
<a for="environment settings object">global object</a> is a {{Window}} object; otherwise
"<code>no-window</code>".

<li><p>If <var>request</var>'s <a for=request>origin</a> is "<code>client</code>", then set
<var>request</var>'s <a for=request>origin</a> to <var>request</var>'s <a for=request>client</a>'s
<a for="environment settings object">origin</a>.

<li>
<p>If all of the following conditions are true:

Expand Down Expand Up @@ -4411,20 +4401,6 @@ the response. [[!HTTP-CACHING]]
<a for="fetch params">preloaded response candidate</a> is null, then set <var>fetchParams</var>'s
<a for="fetch params">preloaded response candidate</a> to "<code>pending</code>".
</ol>
</li>

<li>
<p>If <var>request</var>'s <a for=request>policy container</a> is "<code>client</code>", then:

<ol>
<li><p>If <var>request</var>'s <a for=request>client</a> is non-null, then set
<var>request</var>'s <a for=request>policy container</a> to a
<a lt="clone a policy container">clone</a> of <var>request</var>'s <a for=request>client</a>'s
<a for="environment settings object">policy container</a>. [[!HTML]]

<li><p>Otherwise, set <var>request</var>'s <a for=request>policy container</a> to a new
<a for=/>policy container</a>.
</ol>

<li>
<p>If <var>request</var>'s <a for=request>header list</a>
Expand Down Expand Up @@ -4496,6 +4472,35 @@ the response. [[!HTTP-CACHING]]
</ol>
</div>

<div algorithm>
<p>To <dfn>populate request from client</dfn> given a <a for=/>request</a> <var>request</var>:

<ol>
<li><p>If <var>request</var>'s <a for=request>window</a> is "<code>client</code>", then: set
<var>request</var>'s <a for=request>window</a> to <var>request</var>'s <a for=request>client</a>
if <var>request</var>'s <a for=request>client</a>'s
<a for="environment settings object">global object</a> is a {{Window}} object; otherwise
"<code>no-window</code>".

<li><p>If <var>request</var>'s <a for=request>origin</a> is "<code>client</code>", then set
<var>request</var>'s <a for=request>origin</a> to <var>request</var>'s <a for=request>client</a>'s
<a for="environment settings object">origin</a>.

<li>
<p>If <var>request</var>'s <a for=request>policy container</a> is "<code>client</code>":

<ol>
<li><p>If <var>request</var>'s <a for=request>client</a> is non-null, then set
<var>request</var>'s <a for=request>policy container</a> to a
<a lt="clone a policy container">clone</a> of <var>request</var>'s <a for=request>client</a>'s
<a for="environment settings object">policy container</a>. [[!HTML]]

<li><p>Otherwise, set <var>request</var>'s <a for=request>policy container</a> to a new
<a for=/>policy container</a>.
</ol>
</ol>
</div>


<h3 id=main-fetch>Main fetch</h3>

Expand Down Expand Up @@ -4912,7 +4917,6 @@ steps:
<li><p><a>Queue a fetch task</a> to run <var>processResponseEndOfBodyTask</var> with
<var>fetchParams</var>'s <a for="fetch params">task destination</a>.
</ol>
</li>

<li><p>If <var>fetchParams</var>'s <a for="fetch params">process response</a> is non-null, then
<a>queue a fetch task</a> to run <var>fetchParams</var>'s
Expand Down Expand Up @@ -7470,8 +7474,6 @@ running <a for=Body>consume body</a> with <a>this</a> and the following steps gi
<li><p>Let <var>entries</var> be the result of <a lt="urlencoded parser">parsing</a>
<var>bytes</var>.

<li><p>If <var>entries</var> is failure, then <a>throw</a> a {{TypeError}}.

<li><p>Return a new {{FormData}} object whose <a for=FormData>entry list</a> is
<var>entries</var>.
</ol>
Expand Down Expand Up @@ -8039,7 +8041,6 @@ constructor steps are:
<li><p>Set <a>this</a>'s <a for=Request>headers</a>'s <a for=Headers>guard</a> to
"<code>request-no-cors</code>".
</ol>
</li>

<li>
<p>If <var>init</var> <a for=map>is not empty</a>, then:
Expand All @@ -8064,7 +8065,6 @@ constructor steps are:
<li><p>Otherwise, <a for=Headers>fill</a> <a>this</a>'s <a for=Request>headers</a> with
<var>headers</var>.
</ol>
</li>

<li><p>Let <var>inputBody</var> be <var>input</var>'s <a for=Request>request</a>'s
<a for=request>body</a> if <var>input</var> is a {{Request}} object; otherwise null.
Expand Down Expand Up @@ -8333,8 +8333,8 @@ enum ResponseType { "basic", "cors", "default", "error", "opaque", "opaqueredire
<li><p>If <var>init</var>["{{ResponseInit/status}}"] is not in the range 200 to 599, inclusive,
then <a>throw</a> a {{RangeError}}.

<li><p>If <var>init</var>["{{ResponseInit/statusText}}"] does not match the
<a spec=http1>reason-phrase</a> token production, then <a>throw</a> a {{TypeError}}.
<li><p>If <var>init</var>["{{ResponseInit/statusText}}"] is not the empty string and does not match
the <a>reason-phrase</a> token production, then <a>throw</a> a {{TypeError}}.

<li><p>Set <var>response</var>'s <a for=Response>response</a>'s <a for=response>status</a> to
<var>init</var>["{{ResponseInit/status}}"].
Expand Down Expand Up @@ -8858,7 +8858,7 @@ resource — for non-<a>CORS requests</a> as well as <a>CORS
requests</a> — and do not use `<code>Vary</code>`.


<h3 class=no-num id=websocket-protocol oldids=websocket-connections,websocket-opening-handshake,fail-the-websocket-connection,the-websocket-connection-is-established>WebSockets</h2>
<h3 class=no-num id=websocket-protocol oldids=websocket-connections,websocket-opening-handshake,fail-the-websocket-connection,the-websocket-connection-is-established>WebSockets</h3>

<p>As part of establishing a connection, the {{WebSocket}} object initiates a special kind of
<a for=/>fetch</a> (using a <a for=/>request</a> whose <a for=request>mode</a> is
Expand Down Expand Up @@ -9022,7 +9022,7 @@ particular at what stage you would like to receive a callback:
<li><p>Otherwise, parse <var>contents</var> considering the metadata from <var>response</var>,
and perform your own operations on it.
</ol>
</li>
</ol>
</div>
</dd>

Expand Down Expand Up @@ -9072,7 +9072,7 @@ particular at what stage you would like to receive a callback:
<a for=response>body</a>'s <a for=body>stream</a>, and process in an appropriate way for the
MIME type identified by <a>extracting a MIME type</a> from <var>response</var>'s <a for=response>headers list</a>.
</ol>
</li>
</ol>
</div>
</dd>

Expand Down Expand Up @@ -9132,14 +9132,14 @@ Alexey Proskuryakov,
Andreas Kling,
Andrés Gutiérrez,
Andrew Sutherland,
Andrew Williams,<!-- recvfrom; GitHub -->
Andrew Williams<!-- recvfrom; GitHub -->,
Ángel González,
Anssi Kostiainen,
Arkadiusz Michalski,
Arne Johannessen,
Artem Skoretskiy,
Arthur Barstow,
Arthur Sonzogni, <!-- ArthurSonzogni; GitHub -->
Arthur Sonzogni<!-- ArthurSonzogni; GitHub -->,
Asanka Herath,
Axel Rauschmayer,
Ben Kelly,
Expand Down Expand Up @@ -9178,6 +9178,7 @@ Ehsan Akhgari,
Emily Stark,
Eric Lawrence,
Eric Orth,
Feng Yu<!-- F3n67u; GitHub -->,
François Marier,
Frank Ellerman,
Frederick Hirsch,
Expand Down
Loading

0 comments on commit c8a0981

Please sign in to comment.