Skip to content

Commit

Permalink
Editorial: add <div algorithm> wrappers to Fetching
Browse files Browse the repository at this point in the history
Related to: #1526.

Co-authored-by: Anne van Kesteren <[email protected]>
  • Loading branch information
dlrobertson and annevk authored Jan 13, 2023
1 parent 4500d3a commit a824dd3
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4096,6 +4096,7 @@ a <a for=/>request</a> and one or more algorithms to run at various points durin
<a for=/>response</a> is passed to the last two algorithms listed below. The first two algorithms
can be used to capture uploads.

<div algorithm="fetch">
<p>To <dfn export id=concept-fetch>fetch</dfn>, given a <a for=/>request</a> <var>request</var>, an
optional algorithm
<dfn export for=fetch id=process-request-body><var>processRequestBodyChunkLength</var></dfn>, an
Expand Down Expand Up @@ -4310,10 +4311,12 @@ the response. [[!HTTP-CACHING]]

<li><p>Return <var>fetchParams</var>'s <a for="fetch params">controller</a>.
</ol>
</div>


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

<div algorithm>
<p>To <dfn id=concept-main-fetch>main fetch</dfn>, given a <a for=/>fetch params</a>
<var>fetchParams</var> and an optional boolean <var>recursive</var> (default false), run these
steps:
Expand Down Expand Up @@ -4611,9 +4614,11 @@ steps:
<li><p>Otherwise, run <a>fetch response handover</a> given <var>fetchParams</var> and
<var>response</var>.
</ol>
</div>

<hr>

<div algorithm>
<p>The <dfn id=fetch-finale>fetch response handover</dfn>, given a <a for=/>fetch params</a>
<var>fetchParams</var> and a <a for=/>response</a> <var>response</var>, run these steps:

Expand Down Expand Up @@ -4678,9 +4683,9 @@ steps:
<var>response</var>'s <a for=response>status</a>.

<li><p>If <var>fetchParams</var>'s <a for="fetch params">request</a>'s
<a for=request>initiator type</a> is non-null, then
<a for=/>mark resource timing</a> given <var>timingInfo</var>, <var>request</var>'s
<a for=request>URL</a>, <a for="fetch params">request</a>'s
<a for=request>initiator type</a> is non-null, then <a for=/>mark resource timing</a> given
<var>timingInfo</var>, <var>fetchParams</var>'s <a for="fetch params">request</a>'s
<a for=request>URL</a>, <var>fetchParams</var>'s <a for="fetch params">request</a>'s
<a for=request>initiator type</a>, <var>global</var>, <var>cacheState</var>,
<var>bodyInfo</var>, and <var>responseStatus</var>.
</ol>
Expand Down Expand Up @@ -4763,9 +4768,12 @@ steps:
<a for="fetch params">task destination</a>.
</ol>
</ol>
</div>


<h3 id=scheme-fetch oldids=basic-fetch>Scheme fetch</h3>

<div algorithm>
<p>To <dfn id=concept-scheme-fetch oldids=concept-basic-fetch>scheme fetch</dfn>, given a
<a for=/>fetch params</a> <var>fetchParams</var>:

Expand Down Expand Up @@ -4854,10 +4862,12 @@ steps:

<li><p>Return a <a for=/>network error</a>.
</ol>
</div>


<h3 id=http-fetch>HTTP fetch</h3>

<div algorithm>
<p>To <dfn export id=concept-http-fetch>HTTP fetch</dfn>, given a <a for=/>fetch params</a>
<var>fetchParams</var> and an optional boolean <var>makeCORSPreflight</var> (default false), run
these steps:
Expand Down Expand Up @@ -5064,10 +5074,12 @@ these steps:
<a for=response>body</a>'s <a for=body>stream</a> is still being enqueued to after
returning.</span>
</ol>
</div>


<h3 id=http-redirect-fetch>HTTP-redirect fetch</h3>

<div algorithm>
<p>To <dfn export id=concept-http-redirect-fetch>HTTP-redirect fetch</dfn>, given a
<a for=/>fetch params</a> <var>fetchParams</var> and a <a for=/>response</a> <var>response</var>,
run these steps:
Expand Down Expand Up @@ -5172,10 +5184,12 @@ run these steps:
<p class=note>This has to invoke <a>main fetch</a> to get <var>request</var>'s
<a for=request>response tainting</a> correct.
</ol>
</div>


<h3 id=http-network-or-cache-fetch>HTTP-network-or-cache fetch</h3>

<div algorithm>
<p>To <dfn id=concept-http-network-or-cache-fetch>HTTP-network-or-cache fetch</dfn>, given a
<a for=/>fetch params</a> <var>fetchParams</var>, an optional boolean
<var>isAuthenticationFetch</var> (default false), and an optional boolean
Expand Down Expand Up @@ -5698,10 +5712,12 @@ run these steps:
<a for=response>body</a>'s <a for=body>stream</a> is still being enqueued to after
returning.</span>
</ol>
</div>


<h3 id=http-network-fetch>HTTP-network fetch</h3>

<div algorithm>
<p>To <dfn id=concept-http-network-fetch>HTTP-network fetch</dfn>, given a <a for=/>fetch params</a>
<var>fetchParams</var>, an optional boolean <var>includeCredentials</var> (default false), and an
optional boolean <var>forceNewConnection</var> (default false), run these steps:
Expand Down Expand Up @@ -5942,7 +5958,7 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
<a href=https://httpwg.org/specs/rfc6265.html#privacy-considerations>section 7</a> of
[[!COOKIES]]), then run the "set-cookie-string" parsing algorithm (see
<a href=https://httpwg.org/specs/rfc6265.html#set-cookie>section 5.2</a> of [[!COOKIES]]) on the
<a for=header>value</a> of each <var>header</var> whose <a for=header>name</a> is a
<a for=header>value</a> of each <a for=/>header</a> whose <a for=header>name</a> is a
<a>byte-case-insensitive</a> match for `<code>Set-Cookie</code>` in <var>response</var>'s
<a for=response>header list</a>, if any, and <var>request</var>'s <a for=request>current URL</a>.

Expand Down Expand Up @@ -6046,6 +6062,7 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
<a for=response>body</a>'s <a for=body>stream</a> is still being enqueued to after
returning.</span>
</ol>
</div>


<h3 id=cors-preflight-fetch>CORS-preflight fetch</h3>
Expand All @@ -6055,6 +6072,7 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
populates the <a>CORS-preflight cache</a> to minimize the number of these
<a lt="CORS-preflight fetch">fetches</a>.

<div algorithm>
<p>To <dfn id=cors-preflight-fetch-0>CORS-preflight fetch</dfn>, given a <a for=/>request</a>
<var>request</var>, run these steps:

Expand Down Expand Up @@ -6183,6 +6201,7 @@ populates the <a>CORS-preflight cache</a> to minimize the number of these

<li><p>Otherwise, return a <a>network error</a>.
</ol>
</div>


<h3 id=cors-preflight-cache>CORS-preflight cache</h3>
Expand All @@ -6209,6 +6228,7 @@ populates the <a>CORS-preflight cache</a> to minimize the number of these
<a for="cache entry">max-age</a> field have passed since storing the entry. <a>Cache entries</a> may
be removed before that moment arrives.

<div algorithm>
<p>To <dfn id=concept-cache-create-entry>create a new cache entry</dfn>, given <var>request</var>,
<var>max-age</var>, <var>method</var>, and <var>headerName</var>, run these steps:

Expand Down Expand Up @@ -6243,6 +6263,7 @@ be removed before that moment arrives.

<li><p><a for=list>Append</a> <var>entry</var> to the user agent's <a>CORS-preflight cache</a>.
</ol>
</div>

<p>To <dfn id=concept-cache-clear>clear cache entries</dfn>, given a <var>request</var>,
<a for=list>remove</a> any <a>cache entries</a> in the user agent's <a>CORS-preflight cache</a>
Expand Down Expand Up @@ -6289,6 +6310,7 @@ agent's <a>CORS-preflight cache</a> for which there is a <a>cache entry match</a

<h3 id=cors-check>CORS check</h3>

<div algorithm>
<p>To perform a <dfn id=concept-cors-check>CORS check</dfn> for a <var>request</var> and
<var>response</var>, run these steps:

Expand Down Expand Up @@ -6319,10 +6341,12 @@ agent's <a>CORS-preflight cache</a> for which there is a <a>cache entry match</a

<li><p>Return failure.
</ol>
</div>


<h3 id=tao-check>TAO check</h3>

<div algorithm>
<p>To perform a <dfn id=concept-tao-check>TAO check</dfn> for a <var>request</var> and
<var>response</var>, run these steps:

Expand Down Expand Up @@ -6355,6 +6379,7 @@ agent's <a>CORS-preflight cache</a> for which there is a <a>cache entry match</a

<li><p>Return failure.
</ol>
</div>



Expand Down

0 comments on commit a824dd3

Please sign in to comment.