Skip to content

Commit

Permalink
Actually define the event loop in play for queued tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Oct 15, 2014
1 parent 88b1117 commit 41854af
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 47 deletions.
48 changes: 24 additions & 24 deletions Overview.html
Expand Up @@ -7,7 +7,7 @@

<p><a class="logo" href="//whatwg.org/"><img alt="WHATWG" height="100" src="//resources.whatwg.org/logo-fetch.svg" width="100"></a>
<h1 id="cors">Fetch</h1>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-13-october-2014">Living Standard — Last Updated 13 October 2014</h2>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-15-october-2014">Living Standard — Last Updated 15 October 2014</h2>

<dl>
<dt>Participate:
Expand Down Expand Up @@ -131,8 +131,9 @@ <h2 class="short" id="conformance"><span class="secno">1 </span>Conformance</h2>

<h2 id="terminology"><span class="secno">2 </span>Terminology</h2>

<p>This specification uses terminology from the Encoding and URL Standards.
<p>This specification uses terminology from the Encoding, HTML, and URL Standards.
<a href="#refsENCODING">[ENCODING]</a>
<a href="#refsHTML">[HTML]</a>
<a href="#refsURL">[URL]</a>

<p>A <a class="external" href="https://encoding.spec.whatwg.org/#byte">byte</a> sequence with bytes in the range 0x00 to
Expand Down Expand Up @@ -161,6 +162,15 @@ <h2 id="terminology"><span class="secno">2 </span>Terminology</h2>
<p>To <dfn id="byte-uppercase">byte uppercase</dfn> a byte sequence, subtract each byte it contains, in the
range 0x61 to 0x7A, by 0x20.

<hr>

<p>To <dfn id="queue-a-fetch-task">queue a fetch task</dfn> on <a href="#concept-request" title="concept-request">request</a>
<var title="">request</var> to <var title="">run an operation</var>,
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task">queue a task</a> to <var title="">run an operation</var> on
<var title="">request</var>'s <a href="#concept-request-client" title="concept-request-client">client</a>'s
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop">responsible event loop</a> using the
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#networking-task-source">networking task source</a>.


<h3 id="http"><span class="secno">2.1 </span>HTTP</h3>

Expand Down Expand Up @@ -1050,20 +1060,17 @@ <h2 id="fetching"><span class="secno">4 </span>Fetching</h2>

<p>That is, it either returns a <a href="#concept-response" title="concept-response">response</a> if
<a href="#concept-request" title="concept-request">request</a>'s <a href="#synchronous-flag">synchronous flag</a> is set, or it
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" title="queue a task">queues</a>
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" title="concept-task">tasks</a> annotated
<a href="#queue-a-fetch-task" title="queue a fetch task">queues tasks</a> annotated
<a href="#process-response">process response</a>, <a href="#process-response-body">process response body</a>, and
<a href="#process-response-end-of-file">process response end-of-file</a> for the
<a href="#concept-response" title="concept-response">response</a> on the
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#networking-task-source">networking task source</a>.
<a href="#concept-response" title="concept-response">response</a>.

<p>To capture uploads, if <a href="#concept-request" title="concept-request">request</a>'s
<a href="#synchronous-flag">synchronous flag</a> is unset,
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" title="concept-task">tasks</a> annotated
<a href="#process-request-body">process request body</a> and <a href="#process-request-end-of-file">process request end-of-file</a> for the
<a href="#concept-request" title="concept-request">request</a> can be
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" title="queue a task">queued</a> on the
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#networking-task-source">networking task source</a>.
<a href="#queue-a-fetch-task" title="queue a fetch task">queued</a>.
</div>

<p>To perform a <dfn id="concept-fetch" title="concept-fetch">fetch</dfn> using <var title="">request</var>,
Expand Down Expand Up @@ -1212,25 +1219,21 @@ <h2 id="fetching"><span class="secno">4 </span>Fetching</h2>
non-null and <var title="">request</var>'s <a href="#concept-request-url" title="concept-request-url">url</a>'s
<a class="external" href="https://url.spec.whatwg.org/#concept-url-scheme" title="concept-url-scheme">scheme</a> is
"<code title="">http</code>" or "<code title="">https</code>",
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" title="queue a task">queue</a> a
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" title="concept-task">task</a> to
<a href="#queue-a-fetch-task">queue a fetch task</a> on <var title="">request</var> to
<dfn id="process-request-end-of-file">process request end-of-file</dfn> for <var title="">request</var>.

<li><p><a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" title="queue a task">Queue</a> a
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" title="concept-task">task</a> to
<li><p><a href="#queue-a-fetch-task">Queue a fetch task</a> on <var title="">request</var> to
<dfn id="process-response">process response</dfn> for <var title="">response</var>.

<li>
<p>If <var title="">response</var>'s
<a href="#concept-response-body" title="concept-response-body">body</a> is null, run these substeps:

<ol>
<li><a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" title="queue a task">queue</a> a
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" title="concept-task">task</a> to
<li><a href="#queue-a-fetch-task">Queue a fetch task</a> on <var title="">request</var> to
<dfn id="process-response-body">process response body</dfn> for <var title="">response</var>.

<li><p><a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" title="queue a task">queue</a> a
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" title="concept-task">task</a> to
<li><p><a href="#queue-a-fetch-task">Queue a fetch task</a> on <var title="">request</var> to
<dfn id="process-response-end-of-file">process response end-of-file</dfn> for <var title="">response</var>.
</ol>

Expand All @@ -1244,16 +1247,14 @@ <h2 id="fetching"><span class="secno">4 </span>Fetching</h2>
<var title="">response</var> has no
<a href="#concept-response-termination-reason" title="concept-response-termination-reason">termination reason</a> and
end-of-file has not been pushed,
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" title="queue a task">queue</a> a
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" title="concept-task">task</a> to
<a href="#queue-a-fetch-task">queue a fetch task</a> on <var title="">request</var> to
<a href="#process-response-body">process response body</a> for <var title="">response</var>.

<li>
<p>Once end-of-file has been pushed to <var title="">response</var>'s
<a href="#concept-response-body" title="concept-response-body">body</a> or <var title="">response</var> has a
<a href="#concept-response-termination-reason" title="concept-response-termination-reason">termination reason</a>,
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" title="queue a task">queue</a> a
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" title="concept-task">task</a> to
<a href="#queue-a-fetch-task">queue a fetch task</a> on <var title="">request</var> to
<a href="#process-response-end-of-file">process response end-of-file</a> for <var title="">response</var>.

<p class="note">Ideally FTP/HTTP define this in more detail and this becomes a set of
Expand Down Expand Up @@ -1854,10 +1855,9 @@ <h3 id="http-network-or-cache-fetch"><span class="secno">4.3 </span>HTTP network
<a href="#concept-request-body" title="concept-request-body">body</a> is read from (i.e. is transmitted),
increase <var title="">HTTPRequest</var>'s <a href="#concept-request-body" title="concept-request-body">body</a>'s
<a href="#concept-body-transmitted" title="concept-body-transmitted">transmitted</a> with the amount of
payload body bytes transmitted and then
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" title="queue a task">queue</a> a
<a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" title="concept-task">task</a> to
<dfn id="process-request-body">process request body</dfn> for <var title="">HTTPRequest</var>.
payload body bytes transmitted and then <a href="#queue-a-fetch-task">queue a fetch task</a> on
<var title="">request</var> to <dfn id="process-request-body">process request body</dfn> for
<var title="">HTTPRequest</var>.
<!-- XXX xref "read", "payload body" -->

<p>Use the <a class="external" href="https://html.spec.whatwg.org/multipage/webappapis.html#networking-task-source">networking task source</a>.
Expand Down
46 changes: 23 additions & 23 deletions Overview.src.html
Expand Up @@ -86,8 +86,9 @@ <h2 class="short">Conformance</h2>

<h2>Terminology</h2>

<p>This specification uses terminology from the Encoding and URL Standards.
<p>This specification uses terminology from the Encoding, HTML, and URL Standards.
<span data-anolis-ref>ENCODING</span>
<span data-anolis-ref>HTML</span>
<span data-anolis-ref>URL</span>

<p>A <span data-anolis-spec=encoding>byte</span> sequence with bytes in the range 0x00 to
Expand Down Expand Up @@ -116,6 +117,15 @@ <h2>Terminology</h2>
<p>To <dfn>byte uppercase</dfn> a byte sequence, subtract each byte it contains, in the
range 0x61 to 0x7A, by 0x20.

<hr>

<p>To <dfn>queue a fetch task</dfn> on <span title=concept-request>request</span>
<var title>request</var> to <var title>run an operation</var>,
<span data-anolis-spec=html>queue a task</span> to <var title>run an operation</var> on
<var title>request</var>'s <span title=concept-request-client>client</span>'s
<span data-anolis-spec=html>responsible event loop</span> using the
<span data-anolis-spec=html>networking task source</span>.


<h3>HTTP</h3>

Expand Down Expand Up @@ -1005,20 +1015,17 @@ <h2>Fetching</h2>

<p>That is, it either returns a <span title=concept-response>response</span> if
<span title=concept-request>request</span>'s <span>synchronous flag</span> is set, or it
<span data-anolis-spec=html title="queue a task">queues</span>
<span data-anolis-spec=html title=concept-task>tasks</span> annotated
<span title="queue a fetch task">queues tasks</span> annotated
<span>process response</span>, <span>process response body</span>, and
<span>process response end-of-file</span> for the
<span title=concept-response>response</span> on the
<span data-anolis-spec=html>networking task source</span>.
<span title=concept-response>response</span>.

<p>To capture uploads, if <span title=concept-request>request</span>'s
<span>synchronous flag</span> is unset,
<span data-anolis-spec=html title=concept-task>tasks</span> annotated
<span>process request body</span> and <span>process request end-of-file</span> for the
<span title=concept-request>request</span> can be
<span data-anolis-spec=html title="queue a task">queued</span> on the
<span data-anolis-spec=html>networking task source</span>.
<span title="queue a fetch task">queued</span>.
</div>

<p>To perform a <dfn title=concept-fetch>fetch</dfn> using <var title>request</var>,
Expand Down Expand Up @@ -1167,25 +1174,21 @@ <h2>Fetching</h2>
non-null and <var title>request</var>'s <span title=concept-request-url>url</span>'s
<span data-anolis-spec=url title=concept-url-scheme>scheme</span> is
"<code title>http</code>" or "<code title>https</code>",
<span data-anolis-spec=html title="queue a task">queue</span> a
<span data-anolis-spec=html title=concept-task>task</span> to
<span>queue a fetch task</span> on <var title>request</var> to
<dfn>process request end-of-file</dfn> for <var title>request</var>.

<li><p><span data-anolis-spec=html title="queue a task">Queue</span> a
<span data-anolis-spec=html title=concept-task>task</span> to
<li><p><span>Queue a fetch task</span> on <var title>request</var> to
<dfn>process response</dfn> for <var title>response</var>.

<li>
<p>If <var title>response</var>'s
<span title=concept-response-body>body</span> is null, run these substeps:

<ol>
<li><span data-anolis-spec=html title="queue a task">queue</span> a
<span data-anolis-spec=html title=concept-task>task</span> to
<li><span>Queue a fetch task</span> on <var title>request</var> to
<dfn>process response body</dfn> for <var title>response</var>.

<li><p><span data-anolis-spec=html title="queue a task">queue</span> a
<span data-anolis-spec=html title=concept-task>task</span> to
<li><p><span>Queue a fetch task</span> on <var title>request</var> to
<dfn>process response end-of-file</dfn> for <var title>response</var>.
</ol>

Expand All @@ -1199,16 +1202,14 @@ <h2>Fetching</h2>
<var title>response</var> has no
<span title=concept-response-termination-reason>termination reason</span> and
end-of-file has not been pushed,
<span data-anolis-spec=html title="queue a task">queue</span> a
<span data-anolis-spec=html title=concept-task>task</span> to
<span>queue a fetch task</span> on <var title>request</var> to
<span>process response body</span> for <var title>response</var>.

<li>
<p>Once end-of-file has been pushed to <var title>response</var>'s
<span title=concept-response-body>body</span> or <var title>response</var> has a
<span title=concept-response-termination-reason>termination reason</span>,
<span data-anolis-spec=html title="queue a task">queue</span> a
<span data-anolis-spec=html title=concept-task>task</span> to
<span>queue a fetch task</span> on <var title>request</var> to
<span>process response end-of-file</span> for <var title>response</var>.

<p class=note>Ideally FTP/HTTP define this in more detail and this becomes a set of
Expand Down Expand Up @@ -1809,10 +1810,9 @@ <h3>HTTP network or cache fetch</h3>
<span title=concept-request-body>body</span> is read from (i.e. is transmitted),
increase <var title>HTTPRequest</var>'s <span title=concept-request-body>body</span>'s
<span title=concept-body-transmitted>transmitted</span> with the amount of
payload body bytes transmitted and then
<span data-anolis-spec=html title="queue a task">queue</span> a
<span data-anolis-spec=html title=concept-task>task</span> to
<dfn>process request body</dfn> for <var title>HTTPRequest</var>.
payload body bytes transmitted and then <span>queue a fetch task</span> on
<var title>request</var> to <dfn>process request body</dfn> for
<var title>HTTPRequest</var>.
<!-- XXX xref "read", "payload body" -->

<p>Use the <span data-anolis-spec=html>networking task source</span>.
Expand Down

0 comments on commit 41854af

Please sign in to comment.