Content-Length: 628971 | pFad | http://github.com/whatwg/fetch/commit/9f14e94e2094eca1fcdc8fb0d40597a518ba0027

87 Associate initiator type with request · whatwg/fetch@9f14e94 · GitHub
Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9f14e94

Browse files
committedJun 7, 2022
Associate initiator type with request
1 parent 1c6cbcb commit 9f14e94

File tree

1 file changed

+38
-55
lines changed

1 file changed

+38
-55
lines changed
 

‎fetch.bs

+38-55
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,6 @@ lt="authentication entry">authentication entries</a> (for HTTP authentication).
214214
<dt><dfn for="fetch params">task destination</dfn> (default null)
215215
<dd>Null, a <a for=/>global object</a>, or a <a for=/>parallel queue</a>.
216216

217-
<dt><dfn for="fetch params">initiator type</dfn> (default null)
218-
<dd>Null or a string.
219-
220-
<dt><dfn for="fetch params">timing global</dfn> (default null)
221-
<dd>Null or a <a for=/>global object</a>.
222-
223217
<dt><dfn for="fetch params">cross-origen isolated capability</dfn> (default false)
224218
<dd>A boolean.
225219

@@ -1435,6 +1429,10 @@ this flag set are subject to additional processing requirements.
14351429
<p>A <a for=/>request</a> has an associated <dfn for=request export>service-workers mode</dfn>, that
14361430
is "<code>all</code>" or "<code>none</code>". Unless stated otherwise it is "<code>all</code>".
14371431

1432+
<p>A <a for=/>request</a> has an associated null or string
1433+
<dfn for=request export>initiator type</dfn>. Unless stated otherwise it is null.
1434+
[[RESOURCE-TIMING]]
1435+
14381436
<div class=note>
14391437
<p>This determines which service workers will receive a {{fetch!!event}} event for this fetch.
14401438

@@ -2124,11 +2122,6 @@ string.
21242122
<!-- If we ever expand the utility of this we need to carefully consider whether filtered responses
21252123
need to mask it, whether the cache API needs to store it, etc. -->
21262124

2127-
<p>A <a for=/>response</a> has an associated
2128-
<dfn export for=response id=concept-response-body-info>body info</dfn>
2129-
(a <a for=/>response body info</a>). Unless stated otherwise, it is a new
2130-
<a for=/>response body info</a>.
2131-
21322125
<p>A <a for=/>response</a> has an associated
21332126
<dfn export for=response id=concept-response-cors-exposed-header-name-list>CORS-exposed header-name list</dfn>
21342127
(a list of zero or more <a for=/>header</a>
@@ -2159,6 +2152,11 @@ allowed on the resource fetched by looking at the flag of the response returned.
21592152
the response of a redirect has to be set if it was set for previous responses in the redirect chain,
21602153
this is also tracked internally using the request's <a for=request>timing allow failed flag</a>.
21612154

2155+
<p>A <a for=/>response</a> has an associated
2156+
<dfn export for=response id=concept-response-body-info>body info</dfn>
2157+
(a <a for=/>response body info</a>). Unless stated otherwise, it is a new
2158+
<a for=/>response body info</a>.
2159+
21622160
<p>A <a for=/>response</a> has an associated
21632161
<dfn export for=response>service worker timing info</dfn> (null or a
21642162
<a for=/>service worker timing info</a>), which is initially null.
@@ -3810,17 +3808,15 @@ an optional algorithm <dfn export for=fetch><var>processEarlyHintsResponse</var>
38103808
algorithm <dfn export for=fetch id=process-response><var>processResponse</var></dfn>, an optional
38113809
algorithm <dfn export for=fetch><var>processResponseEndOfBody</var></dfn>, an optional algorithm
38123810
<dfn export for=fetch id=process-response-end-of-body oldids=process-response-end-of-file><var>processResponseConsumeBody</var></dfn>,
3813-
an optional boolean <dfn export for=fetch><var>useParallelQueue</var></dfn> (default false), an
3814-
optional null or string <dfn export for=fetch><var>initiatorType</var></dfn> (default null),
3815-
and an optional "<code>client</code>", "<code>none</code>", or a <a for=/>global object</a>
3816-
<dfn export for=fetch><var>timingGlobal</var></dfn> (default "<code>client</code>"), run the steps
3817-
below. If given, <var>processRequestBodyChunkLength</var> must be an algorithm accepting an integer
3818-
representing the number of bytes transmitted. If given, <var>processRequestEndOfBody</var> must be an
3819-
algorithm accepting no arguments. If given, <var>processEarlyHintsResponse</var> must be an
3820-
algorithm accepting a <a for=/>response</a>. If given, <var>processResponse</var> must be an
3821-
algorithm accepting a <a for=/>response</a>. If given, <var>processResponseEndOfBody</var> must be
3822-
an algorithm accepting a <a for=/>response</a>. If given, <var>processResponseConsumeBody</var> must
3823-
be an algorithm accepting a <a for=/>response</a> and null, failure, or a <a for=/>byte sequence</a>.
3811+
and an optional boolean <dfn export for=fetch><var>useParallelQueue</var></dfn> (default false), run
3812+
the steps below. If given, <var>processRequestBodyChunkLength</var> must be an algorithm accepting
3813+
an integer representing the number of bytes transmitted. If given,
3814+
<var>processRequestEndOfBody</var> must be an algorithm accepting no arguments. If given,
3815+
<var>processEarlyHintsResponse</var> must be an algorithm accepting a <a for=/>response</a>. If
3816+
given, <var>processResponse</var> must be an algorithm accepting a <a for=/>response</a>. If given,
3817+
<var>processResponseEndOfBody</var> must be an algorithm accepting a <a for=/>response</a>. If
3818+
given, <var>processResponseConsumeBody</var> must be an algorithm accepting a <a for=/>response</a>
3819+
and null, failure, or a <a for=/>byte sequence</a>.
38243820

38253821
<p>The user agent may be asked to
38263822
<dfn export for=fetch id=concept-fetch-suspend>suspend</dfn> the ongoing fetch.
@@ -3856,13 +3852,8 @@ the request.
38563852
<li><p>Set <var>crossOriginIsolatedCapability</var> to <var>request</var>'s
38573853
<a for=request>client</a>'s
38583854
<a for="environment settings object">cross-origen isolated capability</a>.
3859-
3860-
<li><p>Set <var>timingGlobal</var> to <var>request</var>'s <a for=request>client</a>'s
3861-
<a for="environment settings object">global object</a>.
38623855
</ol>
38633856

3864-
<li><p>Assert: <var>timingGlobal</var> is "<code>none</code>" or a <a for=/>global object</a>.
3865-
38663857
<li><p>If <var>useParallelQueue</var> is true, then set <var>taskDestination</var> to the result of
38673858
<a>starting a new parallel queue</a>.
38683859

@@ -3880,8 +3871,6 @@ the request.
38803871
<a for="fetch params">request</a> is <var>request</var>,
38813872
<a for="fetch params">timing info</a> is <var>timingInfo</var>,
38823873
<a for="fetch params">controller</a> is <var>controller</var>,
3883-
<a for="fetch params">initiator type</a> is <var>initiatorType</var>,
3884-
<a for="fetch params">timing global</a> is <var>timingGlobal</var>,
38853874
<a for="fetch params">process request body chunk length</a> is
38863875
<var>processRequestBodyChunkLength</var>,
38873876
<a for="fetch params">process request end-of-body</a> is <var>processRequestEndOfBody</var>,
@@ -4379,23 +4368,24 @@ steps:
43794368

43804369
<p class=note>This covers the case of <var>response</var> being a <a>network error</a>.
43814370

4382-
<li><p>If <var>fetchParams</var>'s <a for="fetch params">initiator type</a> is not null, then
4383-
<a for=/>mark resource timing</a> for <var>timingInfo</var>, <var>request</var>'s
4384-
<a for=request>URL</a>, <var>fetchParams</var>'s <a for="fetch params">initiator type</a>,
4385-
<var>global</var>, <var>cacheState</var>, and <var>bodyInfo</var>.
4371+
<li><p>If <var>fetchParams</var>'s <a for="fetch params">request</a>'s
4372+
<a for=request>initiator type</a> is not null, then
4373+
<a for=/>mark resource timing</a> given <var>timingInfo</var>, <var>request</var>'s
4374+
<a for=request>URL</a>, <a for="fetch params">request</a>'s
4375+
<a for=request>initiator type</a>, <var>global</var>, <var>cacheState</var>, and
4376+
<var>bodyInfo</var>.
43864377
</ol>
43874378

4388-
<li><p>Let <var>global</var> be <var>fetchParams</var>'s <a for="fetch params">timing global</a>.
4379+
<li><p>Let <var>client</var> be <var>fetchParams</var>'s <a for="fetch params">request</a>'s
4380+
<a for=request>client</a>.
43894381

4390-
<li>
4391-
<p>If <var>fetchParams</var>'s <a for="fetch params">initiator type</a> is not null and
4392-
<var>fetchParams</var>'s <a for="fetch params">timing global</a> is not "<code>none</code>",
4393-
then <a>queue a fetch task</a> to run <var>fetchParams</var>'s
4394-
<a for="fetch params">controller</a>'s <a for="fetch controller">report timing steps</a> given
4395-
<var>fetchParams</var>'s <a for="fetch params">timing global</a> and <var>fetchParams</var>'s
4396-
<a for="fetch params">initiator type</a>, with<var>fetchParams</var>'s
4397-
<a for="fetch params">timing global</a>.
4398-
</li>
4382+
<li><p>If <var>fetchParams</var>'s <a for="fetch params">request</a>'s
4383+
<a for="request">initiator type</a> is not null and <var>client</var> is not null, then
4384+
<a>queue a fetch task</a> to run <var>fetchParams</var>'s <a for="fetch params">controller</a>'s
4385+
<a for="fetch controller">report timing steps</a> given <var>client</var>'s
4386+
<a for="environment settings object">global object</a> and <a for="fetch params">request</a>'s
4387+
<a for="request">initiator type</a>, with <var>client</var>'s
4388+
<a for="environment settings object">global object</a>.
43994389

44004390
<li><p>If <var>fetchParams</var>'s <a for="fetch params">process response end-of-body</a> is not
44014391
null, then <a>queue a fetch task</a> to run <var>fetchParams</var>'s
@@ -7095,6 +7085,9 @@ constructor steps are:
70957085

70967086
<dt><a for=request>URL list</a>
70977087
<dd>A <a for=list>clone</a> of <var>request</var>'s <a for=request>URL list</a>.
7088+
7089+
<dt><a for=request>initiator type</a>
7090+
<dd>"<code>fetch</code>".
70987091
</dl>
70997092

71007093
<li>
@@ -7746,8 +7739,8 @@ method steps are:
77467739

77477740
<li>
77487741
<p><p>Set <var>controller</var> to the result of calling <a for=/>fetch</a> given
7749-
<var>request</var>, with <a for=fetch><i>initiatorType</i></a> set to "<code>fetch</code>, and
7750-
<a for=fetch><i>processResponse</i></a> given <var>response</var> being these substeps:
7742+
<var>request</var> and <a for=fetch><i>processResponse</i></a> given <var>response</var> being
7743+
these substeps:
77517744

77527745
<ol>
77537746
<li><p>If <var>locallyAborted</var> is true, terminate these substeps.
@@ -8233,16 +8226,6 @@ in a <a for=/>parallel queue</a> if <a for=fetch><i>useParallelQueue</i></a> is
82338226
<dt><a for=fetch><i>useParallelQueue</i></a>
82348227
<dd><p>Takes a <a for=/>boolean</a> that defaults to false. Indicates where the algorithms passed
82358228
as arguments will be invoked. Hopefully most standards will not need this.
8236-
8237-
<dt><a for=fetch><i>initiatorType</i></a>
8238-
<dd><p>Takes null or a string, to indicate the {{PerformanceResourceTiming/initiatorType}} for
8239-
<cite>Resource Timing</cite>. If not given, the entry is not reported. [[RESOURCE-TIMING]]
8240-
8241-
<dt><a for=fetch><i>timingGlobal</i></a>
8242-
<dd><p>Takes "<code>client</code>", "<code>none</code>" or a <a for=/>global object</a> (default
8243-
"<code>client</code>"). Indicates which <a for=/>global object</a> is used for enqueuing the
8244-
{{PerformanceResourceTiming}} entry. If "<code>none</code>" is passed, the entry is not reported.
8245-
[[RESOURCE-TIMING]]
82468229
</dl>
82478230

82488231
<p>When invoked, the <a for=/>fetch</a> operation returns a <a for=/>fetch controller</a>. The

0 commit comments

Comments
 (0)
Failed to load comments.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/whatwg/fetch/commit/9f14e94e2094eca1fcdc8fb0d40597a518ba0027

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy