Skip to content

Commit 846b864

Browse files
committed
WIP: Resource Timing integration
When response is a network error or body is fully read, finalize and report the response. Depends on whatwg/fetch#1185 See: w3c/resource-timing#261 and w3c/resource-timing#252
1 parent afd98f1 commit 846b864

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

xhr.bs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,11 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
960960
</ol>
961961
</ol>
962962

963+
<p id=report-xhr-timing>To <dfn>report timing</dfn> for an {{XMLHttpRequest}} object <var>xhr</var>,
964+
<a href="https://github.com/whatwg/fetch/pull/1185">finalize and report timing</a> for
965+
<var>xhr</var>'s <a for=XMLHttpRequest>response</a>, <var>xhr</var>'s <a>relevant global object</a>
966+
and "xmlhttprequest".
967+
963968
<p id=handle-response-end-of-file>To <dfn>handle response end-of-body</dfn> for an
964969
{{XMLHttpRequest}} object <var>xhr</var>, run these steps:
965970

@@ -969,6 +974,8 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
969974
<li><p>If <var>xhr</var>'s <a for=XMLHttpRequest>response</a> is a <a>network error</a>, then
970975
return.
971976

977+
<li><p><a for=/>Report timing</a> for <var>xhr</var>.
978+
972979
<li><p>Let <var>transmitted</var> be <var>xhr</var>'s <a>received bytes</a>'s
973980
<a for="byte sequence">length</a>.
974981

@@ -1008,8 +1015,13 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
10081015
<a event><code>abort</code></a>, and "{{AbortError!!exception}}" {{DOMException}}.
10091016

10101017
<li><p>Otherwise, if <var>xhr</var>'s <a for=XMLHttpRequest>response</a>'s is a
1011-
<a for=/>network error</a>, run the <a>request error steps</a> for <var>xhr</var>,
1012-
<a event><code>error</code></a>, and "{{NetworkError!!exception}}" {{DOMException}}.
1018+
<a for=/>network error</a>, then perform the following steps:
1019+
<ol>
1020+
<li><p><a for=/>Report timing</a> for <var>xhr</var>.
1021+
1022+
<li><p>Run the <a>request error steps</a> for <var>xhr</var>,
1023+
<a event><code>error</code></a>, and "{{NetworkError!!exception}}" {{DOMException}}.
1024+
</ol>
10131025
</ol>
10141026

10151027
<p>The <dfn>request error steps</dfn> for an {{XMLHttpRequest}} object <var>xhr</var>,

0 commit comments

Comments
 (0)