Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: Refactor for auto-reporting timing from fetch #347

Merged
merged 7 commits into from
Aug 15, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions xhr.bs
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,8 @@ return <a>this</a>'s <a>cross-origin credentials</a>.

<li><p>Set <a>this</a>'s <a for=XMLHttpRequest>fetch controller</a> to the result of
<a for=/ lt=fetch>fetching</a> <var>req</var> with
<a for=fetch><i>timingGlobal</i></a> set to "<code>client</code>",
<a for=fetch><i>initiatorType</i></a> set to "<code>xmlhttprequest</code>",
<a for=fetch><i>processRequestBodyChunkLength</i></a> set to
<var>processRequestBodyChunkLength</var>, <a for=fetch><i>processRequestEndOfBody</i></a> set to
<var>processRequestEndOfBody</var>, and <a for=fetch><i>processResponse</i></a> set to
Expand Down Expand Up @@ -964,10 +966,6 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
</ol>
</ol>

<p>To <dfn>report timing</dfn> for an {{XMLHttpRequest}} object <var>xhr</var>,
<a for=/>finalize and report timing</a> with <var>xhr</var>'s <a for=XMLHttpRequest>response</a>,
<var>xhr</var>'s <a>relevant global object</a>, and "<code>xmlhttprequest</code>".

<p id=handle-response-end-of-file>To <dfn>handle response end-of-body</dfn> for an
{{XMLHttpRequest}} object <var>xhr</var>, run these steps:

Expand All @@ -977,8 +975,6 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
<li><p>If <var>xhr</var>'s <a for=XMLHttpRequest>response</a> is a <a>network error</a>, then
return.

<li><p><a for=/>Report timing</a> for <var>xhr</var>.

<li><p>Let <var>transmitted</var> be <var>xhr</var>'s <a>received bytes</a>'s
<a for="byte sequence">length</a>.

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

<li>
<p>Otherwise, if <var>xhr</var>'s <a for=XMLHttpRequest>response</a> is a
<a for=/>network error</a>, then:

<ol>
<li><p><a for=/>Report timing</a> for <var>xhr</var>.

<li><p>Run the <a>request error steps</a> for <var>xhr</var>,
<a event><code>error</code></a>, and "{{NetworkError!!exception}}" {{DOMException}}.
</ol>
<li><p>Otherwise, if <var>xhr</var>'s <a for=XMLHttpRequest>response</a> is a
<a for=/>network error</a>, thenr run the <a>request error steps</a> for <var>xhr</var>,
noamr marked this conversation as resolved.
Show resolved Hide resolved
<a event><code>error</code></a>, and "{{NetworkError!!exception}}" {{DOMException}}.
</ol>

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