Skip to content

Commit b4da01a

Browse files
authored
Resource Timing integration
When response is a network error or body is fully read, finalize and report the response. Depends on whatwg/fetch#1185. Also see w3c/resource-timing#261 and w3c/resource-timing#252.
1 parent 7647033 commit b4da01a

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

xhr.bs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,10 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
954954
</ol>
955955
</ol>
956956

957+
<p>To <dfn>report timing</dfn> for an {{XMLHttpRequest}} object <var>xhr</var>,
958+
<a for=/>finalize and report timing</a> with <var>xhr</var>'s <a for=XMLHttpRequest>response</a>,
959+
<var>xhr</var>'s <a>relevant global object</a>, and "<code>xmlhttprequest</code>".
960+
957961
<p id=handle-response-end-of-file>To <dfn>handle response end-of-body</dfn> for an
958962
{{XMLHttpRequest}} object <var>xhr</var>, run these steps:
959963

@@ -963,6 +967,8 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
963967
<li><p>If <var>xhr</var>'s <a for=XMLHttpRequest>response</a> is a <a>network error</a>, then
964968
return.
965969

970+
<li><p><a for=/>Report timing</a> for <var>xhr</var>.
971+
966972
<li><p>Let <var>transmitted</var> be <var>xhr</var>'s <a>received bytes</a>'s
967973
<a for="byte sequence">length</a>.
968974

@@ -1001,9 +1007,16 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
10011007
<a for=response>aborted flag</a> is set, run the <a>request error steps</a> for <var>xhr</var>,
10021008
<a event><code>abort</code></a>, and "{{AbortError!!exception}}" {{DOMException}}.
10031009

1004-
<li><p>Otherwise, if <var>xhr</var>'s <a for=XMLHttpRequest>response</a>'s is a
1005-
<a for=/>network error</a>, run the <a>request error steps</a> for <var>xhr</var>,
1006-
<a event><code>error</code></a>, and "{{NetworkError!!exception}}" {{DOMException}}.
1010+
<li>
1011+
<p>Otherwise, if <var>xhr</var>'s <a for=XMLHttpRequest>response</a> is a
1012+
<a for=/>network error</a>, then:
1013+
1014+
<ol>
1015+
<li><p><a for=/>Report timing</a> for <var>xhr</var>.
1016+
1017+
<li><p>Run the <a>request error steps</a> for <var>xhr</var>,
1018+
<a event><code>error</code></a>, and "{{NetworkError!!exception}}" {{DOMException}}.
1019+
</ol>
10071020
</ol>
10081021

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

0 commit comments

Comments
 (0)