Skip to content

Commit

Permalink
Distinguish upload from other progress events and reword from HTTP to…
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Nov 11, 2013
1 parent 740a409 commit 8af96dd
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 42 deletions.
66 changes: 45 additions & 21 deletions Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h2 class="no-num no-toc" id="toc">Table of Contents</h2>
<li><a href="#interface-formdata"><span class="secno">5 </span>Interface <code title="">FormData</code></a></li>
<li><a href="#interface-progressevent"><span class="secno">6 </span>Interface <code title="">ProgressEvent</code></a>
<ol class="toc">
<li><a href="#firing-events-using-the-progressevent-interface-for-http"><span class="secno">6.1 </span>Firing events using the <code title="">ProgressEvent</code> interface for HTTP</a></li>
<li><a href="#firing-events-using-the-progressevent-interface-for-fetch"><span class="secno">6.1 </span>Firing events using the <code title="">ProgressEvent</code> interface for Fetch</a></li>
<li><a href="#firing-events-using-the-progressevent-interface-for-other-contexts"><span class="secno">6.2 </span>Firing events using the <code title="">ProgressEvent</code> interface for other contexts</a></li>
<li><a href="#suggested-names-for-events-using-the-progressevent-interface"><span class="secno">6.3 </span>Suggested names for events using the <code title="">ProgressEvent</code> interface</a></li>
<li><a href="#security-considerations"><span class="secno">6.4 </span>Security Considerations</a></li>
Expand Down Expand Up @@ -1066,7 +1066,7 @@ <h4 id="the-send()-method"><span class="secno">4.5.6 </span>The <code title="">s
<li><p><a href="#concept-event-fire-progress" title="concept-event-fire-progress">Fire a progress event</a> named <code title="event-xhr-loadstart"><a href="#event-xhr-loadstart">loadstart</a></code>.

<li><p>If the <a href="#upload-complete-flag">upload complete flag</a> is unset,
<a href="#concept-event-fire-progress" title="concept-event-fire-progress">fire a progress event</a> named <code title="event-xhr-loadstart"><a href="#event-xhr-loadstart">loadstart</a></code>
<a href="#concept-event-fire-upload-progress" title="concept-event-fire-upload-progress">fire an upload progress event</a> named <code title="event-xhr-loadstart"><a href="#event-xhr-loadstart">loadstart</a></code>
on the <code><a href="#xmlhttprequestupload">XMLHttpRequestUpload</a></code> object.

<li><p>Return the <code title="dom-XMLHttpRequest-send"><a href="#dom-xmlhttprequest-send">send()</a></code>
Expand Down Expand Up @@ -1142,7 +1142,7 @@ <h4 id="the-send()-method"><span class="secno">4.5.6 </span>The <code title="">s

<p>To <a class="external" href="http://fetch.spec.whatwg.org/#process-request-body">process request body</a> for
<var title="">request</var>,
<a href="#concept-event-fire-progress" title="concept-event-fire-progress">fire a progress event</a> named
<a href="#concept-event-fire-upload-progress" title="concept-event-fire-upload-progress">fire an upload progress event</a> named
<code title="event-xhr-progress"><a href="#event-xhr-progress">progress</a></code> on the
<code><a href="#xmlhttprequestupload">XMLHttpRequestUpload</a></code> object.
<!-- upload complete flag can never be set here I hope -->
Expand All @@ -1153,13 +1153,13 @@ <h4 id="the-send()-method"><span class="secno">4.5.6 </span>The <code title="">s
<ol>
<li><p>Set the <a href="#upload-complete-flag">upload complete flag</a>.

<li><p><a href="#concept-event-fire-progress" title="concept-event-fire-progress">Fire a progress event</a> named <code title="event-xhr-progress"><a href="#event-xhr-progress">progress</a></code>
<li><p><a href="#concept-event-fire-upload-progress" title="concept-event-fire-upload-progress">Fire an upload progress event</a> named <code title="event-xhr-progress"><a href="#event-xhr-progress">progress</a></code>
on the <code><a href="#xmlhttprequestupload">XMLHttpRequestUpload</a></code> object.

<li><p><a href="#concept-event-fire-progress" title="concept-event-fire-progress">Fire a progress event</a> named <code title="event-xhr-load"><a href="#event-xhr-load">load</a></code>
<li><p><a href="#concept-event-fire-upload-progress" title="concept-event-fire-upload-progress">Fire an upload progress event</a> named <code title="event-xhr-load"><a href="#event-xhr-load">load</a></code>
on the <code><a href="#xmlhttprequestupload">XMLHttpRequestUpload</a></code> object.

<li><p><a href="#concept-event-fire-progress" title="concept-event-fire-progress">Fire a progress event</a> named <code title="event-xhr-loadend"><a href="#event-xhr-loadend">loadend</a></code>
<li><p><a href="#concept-event-fire-upload-progress" title="concept-event-fire-upload-progress">Fire an upload progress event</a> named <code title="event-xhr-loadend"><a href="#event-xhr-loadend">loadend</a></code>
on the <code><a href="#xmlhttprequestupload">XMLHttpRequestUpload</a></code> object.
</ol>
<!-- upload complete flag can never be set here I hope -->
Expand Down Expand Up @@ -1294,13 +1294,13 @@ <h4 id="the-send()-method"><span class="secno">4.5.6 </span>The <code title="">s
<ol>
<li><p>Set the <a href="#upload-complete-flag">upload complete flag</a>.

<li><p><a href="#concept-event-fire-progress" title="concept-event-fire-progress">Fire a progress event</a> named
<li><p><a href="#concept-event-fire-upload-progress" title="concept-event-fire-upload-progress">Fire an upload progress event</a> named
<code title="event-xhr-progress"><a href="#event-xhr-progress">progress</a></code> on the <code><a href="#xmlhttprequestupload">XMLHttpRequestUpload</a></code> object.

<li><p><a href="#concept-event-fire-progress" title="concept-event-fire-progress">Fire a progress event</a> named
<li><p><a href="#concept-event-fire-upload-progress" title="concept-event-fire-upload-progress">Fire an upload progress event</a> named
<var title="">event</var> on the <code><a href="#xmlhttprequestupload">XMLHttpRequestUpload</a></code> object.

<li><p><a href="#concept-event-fire-progress" title="concept-event-fire-progress">Fire a progress event</a> named
<li><p><a href="#concept-event-fire-upload-progress" title="concept-event-fire-upload-progress">Fire an upload progress event</a> named
<code title="event-xhr-loadend"><a href="#event-xhr-loadend">loadend</a></code> on the <code><a href="#xmlhttprequestupload">XMLHttpRequestUpload</a></code> object.
</ol>

Expand Down Expand Up @@ -2130,7 +2130,29 @@ <h2 id="interface-progressevent"><span class="secno">6 </span>Interface <code ti
the attributes must be initialized to 0.


<h3 id="firing-events-using-the-progressevent-interface-for-http"><span class="secno">6.1 </span>Firing events using the <code title="">ProgressEvent</code> interface for HTTP</h3>
<h3 id="firing-events-using-the-progressevent-interface-for-fetch"><span class="secno">6.1 </span>Firing events using the <code title="">ProgressEvent</code> interface for Fetch</h3>

<p>To
<dfn id="concept-event-fire-upload-progress" title="concept-event-fire-upload-progress">fire an upload progress event named <var>e</var></dfn>
means to
<a class="external" href="http://dom.spec.whatwg.org/#concept-event-fire" title="concept-event-fire">fire an event named <var>e</var></a>
with an <a class="external" href="http://dom.spec.whatwg.org/#concept-event" title="concept-event">event</a>
using the <code><a href="#progressevent">ProgressEvent</a></code> interface that also meets these
conditions:

<ul>
<li>Initialize the <code title="dom-ProgressEvent-loaded"><a href="#dom-progressevent-loaded">loaded</a></code>
attribute to the length of
<a class="external" href="http://fetch.spec.whatwg.org/#concept-request" title="concept-request">request</a>'s
<a class="external" href="http://fetch.spec.whatwg.org/#concept-request-body" title="concept-request-body">body</a>.
<li>If the length of
<a class="external" href="http://fetch.spec.whatwg.org/#concept-request" title="concept-request">response</a>'s
<a class="external" href="http://fetch.spec.whatwg.org/#concept-request-body" title="concept-request-body">body</a> is known through the
<code class="external" title="http-content-length"><a href="http://tools.ietf.org/html/rfc2616/#section-14.13">Content-Length</a></code> header,
set the <code title="dom-ProgressEvent-lengthComputable"><a href="#dom-progressevent-lengthcomputable">lengthComputable</a></code> attribute
value to true and the <code title="dom-ProgressEvent-total"><a href="#dom-progressevent-total">total</a></code> attribute value to
the length.
</ul>

<p>To
<dfn id="concept-event-fire-progress" title="concept-event-fire-progress">fire a progress event named <var>e</var></dfn>
Expand All @@ -2142,15 +2164,16 @@ <h3 id="firing-events-using-the-progressevent-interface-for-http"><span class="s

<ul>
<li>Initialize the <code title="dom-ProgressEvent-loaded"><a href="#dom-progressevent-loaded">loaded</a></code>
attribute to the number of HTTP
<a class="external" href="http://tools.ietf.org/html/rfc2616/#section-7.2">entity body</a> bytes transferred.
<li>If the length of the HTTP
<a class="external" href="http://tools.ietf.org/html/rfc2616/#section-7.2">entity body</a> is known through the
<code class="external" title="http-content-length"><a href="http://tools.ietf.org/html/rfc2616/#section-14.13">Content-Length</a></code>
header, initialize the
<code title="dom-ProgressEvent-lengthComputable"><a href="#dom-progressevent-lengthcomputable">lengthComputable</a></code>
attribute to true and initialize the
<code title="dom-ProgressEvent-total"><a href="#dom-progressevent-total">total</a></code> attribute to the length.
attribute to the length of
<a class="external" href="http://fetch.spec.whatwg.org/#concept-response" title="concept-response">response</a>'s
<a class="external" href="http://fetch.spec.whatwg.org/#concept-response-body" title="concept-response-body">body</a>.
<li>If the length of
<a class="external" href="http://fetch.spec.whatwg.org/#concept-response" title="concept-response">response</a>'s
<a class="external" href="http://fetch.spec.whatwg.org/#concept-response-body" title="concept-response-body">body</a> is known through the
<code class="external" title="http-content-length"><a href="http://tools.ietf.org/html/rfc2616/#section-14.13">Content-Length</a></code> header,
set the <code title="dom-ProgressEvent-lengthComputable"><a href="#dom-progressevent-lengthcomputable">lengthComputable</a></code> attribute
value to true and the <code title="dom-ProgressEvent-total"><a href="#dom-progressevent-total">total</a></code> attribute value to
the length.
</ul>


Expand Down Expand Up @@ -2235,8 +2258,9 @@ <h3 id="suggested-names-for-events-using-the-progressevent-interface"><span clas

<h3 id="security-considerations"><span class="secno">6.4 </span>Security Considerations</h3>

<p>For cross-origin requests some kind of opt-in, e.g. Fetch, has to be used before
<a class="external" href="http://dom.spec.whatwg.org/#concept-event" title="concept-event">events</a> using the
<p>For cross-origin requests some kind of opt-in, e.g. the
<a class="external" href="http://fetch.spec.whatwg.org/#cors-protocol">CORS protocol</a> defined in the Fetch Standard, has to be
used before <a class="external" href="http://dom.spec.whatwg.org/#concept-event" title="concept-event">events</a> using the
<code><a href="#progressevent">ProgressEvent</a></code> interface are
<a class="external" href="http://dom.spec.whatwg.org/#concept-event-dispatch" title="concept-event-dispatch">dispatched</a>
as information (e.g. size) would be revealed that cannot be obtained
Expand Down
66 changes: 45 additions & 21 deletions Overview.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ <h4>The <code title>send()</code> method</h4>
<li><p><span title=concept-event-fire-progress>Fire a progress event</span> named <code title="event-xhr-loadstart">loadstart</code>.

<li><p>If the <span>upload complete flag</span> is unset,
<span title=concept-event-fire-progress>fire a progress event</span> named <code title="event-xhr-loadstart">loadstart</code>
<span title=concept-event-fire-upload-progress>fire an upload progress event</span> named <code title="event-xhr-loadstart">loadstart</code>
on the <code>XMLHttpRequestUpload</code> object.

<li><p>Return the <code title="dom-XMLHttpRequest-send">send()</code>
Expand Down Expand Up @@ -1097,7 +1097,7 @@ <h4>The <code title>send()</code> method</h4>

<p>To <span data-anolis-spec=fetch>process request body</span> for
<var title>request</var>,
<span title=concept-event-fire-progress>fire a progress event</span> named
<span title=concept-event-fire-upload-progress>fire an upload progress event</span> named
<code title="event-xhr-progress">progress</code> on the
<code>XMLHttpRequestUpload</code> object.
<!-- upload complete flag can never be set here I hope -->
Expand All @@ -1108,13 +1108,13 @@ <h4>The <code title>send()</code> method</h4>
<ol>
<li><p>Set the <span>upload complete flag</span>.

<li><p><span title=concept-event-fire-progress>Fire a progress event</span> named <code title=event-xhr-progress>progress</code>
<li><p><span title=concept-event-fire-upload-progress>Fire an upload progress event</span> named <code title=event-xhr-progress>progress</code>
on the <code>XMLHttpRequestUpload</code> object.

<li><p><span title=concept-event-fire-progress>Fire a progress event</span> named <code title="event-xhr-load">load</code>
<li><p><span title=concept-event-fire-upload-progress>Fire an upload progress event</span> named <code title="event-xhr-load">load</code>
on the <code>XMLHttpRequestUpload</code> object.

<li><p><span title=concept-event-fire-progress>Fire a progress event</span> named <code title="event-xhr-loadend">loadend</code>
<li><p><span title=concept-event-fire-upload-progress>Fire an upload progress event</span> named <code title="event-xhr-loadend">loadend</code>
on the <code>XMLHttpRequestUpload</code> object.
</ol>
<!-- upload complete flag can never be set here I hope -->
Expand Down Expand Up @@ -1249,13 +1249,13 @@ <h4>The <code title>send()</code> method</h4>
<ol>
<li><p>Set the <span>upload complete flag</span>.

<li><p><span title=concept-event-fire-progress>Fire a progress event</span> named
<li><p><span title=concept-event-fire-upload-progress>Fire an upload progress event</span> named
<code title=event-xhr-progress>progress</code> on the <code>XMLHttpRequestUpload</code> object.

<li><p><span title=concept-event-fire-progress>Fire a progress event</span> named
<li><p><span title=concept-event-fire-upload-progress>Fire an upload progress event</span> named
<var title>event</var> on the <code>XMLHttpRequestUpload</code> object.

<li><p><span title=concept-event-fire-progress>Fire a progress event</span> named
<li><p><span title=concept-event-fire-upload-progress>Fire an upload progress event</span> named
<code title="event-xhr-loadend">loadend</code> on the <code>XMLHttpRequestUpload</code> object.
</ol>

Expand Down Expand Up @@ -2085,10 +2085,10 @@ <h2>Interface <code title="">ProgressEvent</code></h2>
the attributes must be initialized to 0.


<h3>Firing events using the <code title="">ProgressEvent</code> interface for HTTP</h3>
<h3>Firing events using the <code title="">ProgressEvent</code> interface for Fetch</h3>

<p>To
<dfn id=concept-event-fire-progress title=concept-event-fire-progress>fire a progress event named <var>e</var></dfn>
<dfn title=concept-event-fire-upload-progress>fire an upload progress event named <var>e</var></dfn>
means to
<span data-anolis-spec=dom title=concept-event-fire>fire an event named <var>e</var></span>
with an <span data-anolis-spec=dom title=concept-event>event</span>
Expand All @@ -2097,15 +2097,38 @@ <h3>Firing events using the <code title="">ProgressEvent</code> interface for HT

<ul>
<li>Initialize the <code title=dom-ProgressEvent-loaded>loaded</code>
attribute to the number of HTTP
<span data-anolis-spec=http>entity body</span> bytes transferred.
<li>If the length of the HTTP
<span data-anolis-spec=http>entity body</span> is known through the
<code data-anolis-spec=http title=http-content-length>Content-Length</code>
header, initialize the
<code title=dom-ProgressEvent-lengthComputable>lengthComputable</code>
attribute to true and initialize the
<code title=dom-ProgressEvent-total>total</code> attribute to the length.
attribute to the length of
<span data-anolis-spec=fetch title=concept-request>request</span>'s
<span data-anolis-spec=fetch title=concept-request-body>body</span>.
<li>If the length of
<span data-anolis-spec=fetch title=concept-request>response</span>'s
<span data-anolis-spec=fetch title=concept-request-body>body</span> is known through the
<code data-anolis-spec=http title=http-content-length>Content-Length</code> header,
set the <code title=dom-ProgressEvent-lengthComputable>lengthComputable</code> attribute
value to true and the <code title=dom-ProgressEvent-total>total</code> attribute value to
the length.
</ul>

<p>To
<dfn title=concept-event-fire-progress>fire a progress event named <var>e</var></dfn>
means to
<span data-anolis-spec=dom title=concept-event-fire>fire an event named <var>e</var></span>
with an <span data-anolis-spec=dom title=concept-event>event</span>
using the <code>ProgressEvent</code> interface that also meets these
conditions:

<ul>
<li>Initialize the <code title=dom-ProgressEvent-loaded>loaded</code>
attribute to the length of
<span data-anolis-spec=fetch title=concept-response>response</span>'s
<span data-anolis-spec=fetch title=concept-response-body>body</span>.
<li>If the length of
<span data-anolis-spec=fetch title=concept-response>response</span>'s
<span data-anolis-spec=fetch title=concept-response-body>body</span> is known through the
<code data-anolis-spec=http title=http-content-length>Content-Length</code> header,
set the <code title=dom-ProgressEvent-lengthComputable>lengthComputable</code> attribute
value to true and the <code title=dom-ProgressEvent-total>total</code> attribute value to
the length.
</ul>


Expand Down Expand Up @@ -2190,8 +2213,9 @@ <h3>Suggested names for events using the <code title="">ProgressEvent</code> int

<h3>Security Considerations</h3>

<p>For cross-origin requests some kind of opt-in, e.g. Fetch, has to be used before
<span data-anolis-spec=dom title=concept-event>events</span> using the
<p>For cross-origin requests some kind of opt-in, e.g. the
<span data-anolis-spec=fetch>CORS protocol</span> defined in the Fetch Standard, has to be
used before <span data-anolis-spec=dom title=concept-event>events</span> using the
<code>ProgressEvent</code> interface are
<span data-anolis-spec=dom title=concept-event-dispatch>dispatched</span>
as information (e.g. size) would be revealed that cannot be obtained
Expand Down

0 comments on commit 8af96dd

Please sign in to comment.