Skip to content

Commit e8e499e

Browse files
authored
Report <a> ping, <a> download, and script loading to Resource Timing
1 parent dd5b482 commit e8e499e

File tree

1 file changed

+39
-12
lines changed

1 file changed

+39
-12
lines changed

source

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,6 +2492,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
24922492
<li><dfn data-x="serialize-a-response-url-for-reporting" data-x-href="https://fetch.spec.whatwg.org/#serialize-a-response-url-for-reporting">serialize a response URL for reporting</dfn></li>
24932493
<li><dfn data-x="body safely extract" data-x-href="https://fetch.spec.whatwg.org/#bodyinit-safely-extract">safely extracting a body</dfn></li>
24942494
<li><dfn data-x-href="https://fetch.spec.whatwg.org/#process-response-end-of-body">processResponseConsumeBody</dfn></li>
2495+
<li><dfn data-x-href="https://fetch.spec.whatwg.org/#fetch-processresponseendofbody">processResponseEndOfBody</dfn></li>
24952496
<li>
24962497
<dfn data-x="concept-response"
24972498
data-x-href="https://fetch.spec.whatwg.org/#concept-response">response</dfn> and its
@@ -24202,12 +24203,14 @@ document.body.appendChild(wbr);</code></pre>
2420224203
<li><p>Optionally, return. (For example, the user agent might wish to ignore any or
2420324204
all ping URLs in accordance with the user's expressed preferences.)</p></li>
2420424205

24206+
<li><p>Let <var>settingsObject</var> be the element's <span>node document</span>'s
24207+
<span>relevant settings object</span>.</p></li>
24208+
2420524209
<li><p>Let <var>request</var> be a new <span data-x="concept-request">request</span> whose
2420624210
<span data-x="concept-request-url">URL</span> is <var>ping URL</var>, <span
2420724211
data-x="concept-request-method">method</span> is `<code data-x="">POST</code>`, <span
2420824212
data-x="concept-request-body">body</span> is `<code data-x="">PING</code>`, <span
24209-
data-x="concept-request-client">client</span> is the <span>environment settings object</span> of
24210-
the <code>Document</code> containing the <span>hyperlink</span>, <span
24213+
data-x="concept-request-client">client</span> is <var>settingsObject</var>, <span
2421124214
data-x="concept-request-destination">destination</span> is the empty string,
2421224215
<span data-x="concept-request-credentials-mode">credentials mode</span> is "<code
2421324216
data-x="">include</code>", <span data-x="concept-request-referrer">referrer</span> is "<code
@@ -24239,7 +24242,12 @@ document.body.appendChild(wbr);</code></pre>
2423924242
</dl>
2424024243
</li>
2424124244

24242-
<!--FETCH--><li><p><span data-x="concept-fetch">Fetch</span> <var>request</var>.</p></li>
24245+
<li><p><span data-x="concept-fetch">Fetch</span> <var>request</var>, with <i
24246+
data-x="processResponseEndOfBody">processResponseEndOfBody</i> given <span
24247+
data-x="concept-response">response</span> <var>res</var> set to <span>finalize and report
24248+
timing</span> with <var>res</var>, <var>settingsObject</var>'s <span
24249+
data-x="concept-settings-object-global">global object</span>, and "<code
24250+
data-x="">ping</code>".</p></li>
2424324251
</ol>
2424424252

2424524253
<p>This may be done <span>in parallel</span> with the primary fetch, and is independent of the
@@ -91856,13 +91864,18 @@ document.querySelector("button").addEventListener("click", bound);
9185691864
remaining steps.</p>
9185791865

9185891866
<p>Otherwise, <span data-x="concept-fetch">fetch</span> <var>request</var>. Return from this
91859-
algorithm, and run the remaining steps as part of the fetch's <span>process response</span> for
91860-
the <span data-x="concept-response">response</span> <var>response</var>.</p>
91867+
algorithm, and run the remaining steps as part of the fetch's <i
91868+
data-x="processResponseConsumeBody">processResponseConsumeBody</i> given <span
91869+
data-x="concept-response">response</span> <var>response</var>.</p>
9186191870

9186291871
<p class="note"><var>response</var> can be either <span>CORS-same-origin</span> or
9186391872
<span>CORS-cross-origin</span>. This only affects how error reporting happens.</p>
9186491873
</li>
9186591874

91875+
<li><p><span>Finalize and report timing</span> with <var>response</var>, <var>settings
91876+
object</var>'s <span data-x="concept-settings-object-global">global object</span>, and "<code
91877+
data-x="">script</code>".</p></li>
91878+
9186691879
<li><p>Set <var>response</var> to <var>response</var>'s <span>unsafe response</span>.</p></li>
9186791880

9186891881
<li>
@@ -91925,10 +91938,15 @@ document.querySelector("button").addEventListener("click", bound);
9192591938
remaining steps.</p>
9192691939

9192791940
<p>Otherwise, <span data-x="concept-fetch">fetch</span> <var>request</var>. Return from this
91928-
algorithm, and run the remaining steps as part of the fetch's <span>process response</span> for
91929-
the <span data-x="concept-response">response</span> <var>response</var>.</p>
91941+
algorithm, and run the remaining steps as part of the fetch's <i
91942+
data-x="processResponseConsumeBody">processResponseConsumeBody</i> given <span
91943+
data-x="concept-response">response</span> <var>response</var>.<p>
9193091944
</li>
9193191945

91946+
<li><p><span>Finalize and report timing</span> with <var>response</var>, <var>fetch client
91947+
settings object</var>'s <span data-x="concept-settings-object-global">global object</span>, and
91948+
"<code data-x="">other</code>".</p></li>
91949+
9193291950
<li><p>Set <var>response</var> to <var>response</var>'s <span>unsafe response</span>.</p></li>
9193391951

9193491952
<li>
@@ -91944,7 +91962,6 @@ document.querySelector("button").addEventListener("click", bound);
9194491962

9194591963
<p>then asynchronously complete this algorithm with null, and return.</p>
9194691964
</li>
91947-
9194891965
<li>
9194991966
<p>If both of the following conditions are met:</p>
9195091967

@@ -92002,6 +92019,10 @@ document.querySelector("button").addEventListener("click", bound);
9200292019
also finish their work synchronously.</p>
9200392020
</li>
9200492021

92022+
<li><p><span>Finalize and report timing</span> with <var>response</var>, <var>settings
92023+
object</var>'s <span data-x="concept-settings-object-global">global object</span>, and "<code
92024+
data-x="">other</code>".</p></li>
92025+
9200592026
<li><p>Set <var>response</var> to <var>response</var>'s <span>unsafe response</span>.</p></li>
9200692027

9200792028
<li>
@@ -92196,8 +92217,9 @@ document.querySelector("button").addEventListener("click", bound);
9219692217
"<code data-x="">fetching</code>".</p></li>
9219792218

9219892219
<li>
92199-
<p><span data-x="concept-fetch">Fetch</span> <var>request</var>. To <span>process
92200-
response</span> for the <span data-x="concept-response">response</span> <var>response</var>:</p>
92220+
<p><span data-x="concept-fetch">Fetch</span> <var>request</var>, with <i
92221+
data-x="processResponseConsumeBody">processResponseConsumeBody</i> set to the following steps
92222+
given <span data-x="concept-response">response</span> <var>response</var>:</p>
9220192223

9220292224
<ol>
9220392225
<li><p>Set <var>moduleResponsesMap</var>[<var>requestURL</var>] to
@@ -92602,12 +92624,17 @@ document.querySelector("button").addEventListener("click", bound);
9260292624
data-x="concept-response">response</span> <var>response</var>, run the remaining steps.</p>
9260392625

9260492626
<p>Otherwise, <span data-x="concept-fetch">fetch</span> <var>request</var>. Return from this
92605-
algorithm, and run the remaining steps as part of the fetch's <span>process response</span> for
92606-
the <span data-x="concept-response">response</span> <var>response</var>.</p>
92627+
algorithm, and run the remaining steps as part of the fetch's <i
92628+
data-x="processResponseConsumeBody">processResponseConsumeBody</i> given <span
92629+
data-x="concept-response">response</span> <var>response</var>.</p>
9260792630

9260892631
<p class="note"><var>response</var> is always <span>CORS-same-origin</span>.</p>
9260992632
</li>
9261092633

92634+
<li><p><span>Finalize and report timing</span> with <var>response</var>, <var>fetch client
92635+
settings object</var>'s <span data-x="concept-settings-object-global">global object</span>, and
92636+
"<code data-x="">other</code>".</p></li>
92637+
9261192638
<li>
9261292639
<p>If either of the following conditions are met:</p>
9261392640

0 commit comments

Comments
 (0)