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 6 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
24 changes: 8 additions & 16 deletions xhr.bs
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,8 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
otherwise "<code>same-origin</code>".
<dt><a for=request>use-URL-credentials flag</a>
<dd>Set if <a>this</a>'s <a>request URL</a> <a>includes credentials</a>.
<dt><a for=request>initiator type</a>
<dd>"<code>xmlhttprequest</code>".
</dl>

<li><p>Unset <a>this</a>'s <a>upload complete flag</a>.
Expand Down Expand Up @@ -960,14 +962,13 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
<li><p>If <var>processedResponse</var> is false, then set <a>this</a>'s <a>timed out flag</a> and
<a for="fetch controller">terminate</a> <a>this</a>'s <a for=XMLHttpRequest>fetch controller</a>.

<li><p>Call <a>this</a>'s <a for=XMLHttpRequest>fetch controller</a>'s
<a for="fetch controller">report timing</a> given the <a>current global object</a>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a bit more conventional as "Report timing for this's fetch controller given the current global object".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll push a fixup commit.


<li><p>Run <a>handle response end-of-body</a> for <a>this</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 +978,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 +1016,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>, then run the <a>request error steps</a> for <var>xhr</var>,
<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