[html5] r7636 - [giow] (0) Progress events for <img>. Affected topics: DOM APIs, HTML
whatwg at whatwg.org
whatwg at whatwg.org
Thu Jan 3 16:49:52 PST 2013
Author: ianh
Date: 2013-01-03 16:49:51 -0800 (Thu, 03 Jan 2013)
New Revision: 7636
Modified:
complete.html
index
source
Log:
[giow] (0) Progress events for <img>.
Affected topics: DOM APIs, HTML
Modified: complete.html
===================================================================
--- complete.html 2013-01-03 23:38:00 UTC (rev 7635)
+++ complete.html 2013-01-04 00:49:51 UTC (rev 7636)
@@ -248,7 +248,7 @@
<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
- <h2 class="no-num no-toc">Living Standard — Last Updated 3 January 2013</h2>
+ <h2 class="no-num no-toc">Living Standard — Last Updated 4 January 2013</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
@@ -4181,17 +4181,21 @@
<dd>
- <p>This specification references the XMLHttpRequest specification
- to define how the two specifications interact. The terms
- <dfn id=document-response-entity-body>document response entity body</dfn>,
- <dfn id=xmlhttprequest-base-url><code>XMLHttpRequest</code> base URL</dfn>,
- <dfn id=xmlhttprequest-origin><code>XMLHttpRequest</code> origin</dfn>, and
- <dfn id=xmlhttprequest-referrer-source><code>XMLHttpRequest</code> referrer source</dfn> are defined
- in that specification. <a href=#refsXHR>[XHR]</a></p>
+ <p>This specification references the XMLHttpRequest specification to define how the two
+ specifications interact and to use its <code><a href=#progressevent>ProgressEvent</a></code> features. The following
+ features and terms are defined in the XMLHttpRequest specification: <a href=#refsXHR>[XHR]</a></p>
- </dd>
+ <ul class=brief><li><dfn id=document-response-entity-body>Document response entity body</dfn>
+ <li><dfn id=xmlhttprequest-base-url><code>XMLHttpRequest</code> base URL</dfn>
+ <li><dfn id=xmlhttprequest-origin><code>XMLHttpRequest</code> origin</dfn>
+ <li><dfn id=xmlhttprequest-referrer-source><code>XMLHttpRequest</code> referrer source</dfn>
+ <li><dfn id=progressevent><code>ProgressEvent</code></dfn>
+ <li><dfn id=fire-a-progress-event title="fire a progress event">Fire a progress event named <var title="">e</var></dfn>
+ </ul></dd>
+
+
<!--TOPIC:HTML-->
<dt>Media Queries</dt>
@@ -23909,6 +23913,13 @@
<li>
+ <p><a href=#fire-a-progress-event>Fire a progress event</a> named <code title=event-loadstart>loadstart</code> at
+ the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ </li>
+
+ <li>
+
<p>Do a <a href=#potentially-cors-enabled-fetch>potentially CORS-enabled fetch</a><!--FETCH--> of
the <a href=#absolute-url>absolute URL</a> that resulted from the earlier step,
with the <i>mode</i> being the state of the element's <code title=attr-img-crossorigin><a href=#attr-img-crossorigin>crossorigin</a></code> content attribute,
@@ -23941,31 +23952,80 @@
source</a> while the image is being <a href=#fetch title=fetch>fetched</a> must set the <code><a href=#the-img-element>img</a></code> element's
state to <a href=#img-inc title=img-inc>partially available</a>.</p>
- <p id=img-load>If the resource is in a supported image format,
- then each <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the <a href=#networking-task-source>networking task
- source</a> while the image is being <a href=#fetch title=fetch>fetched</a> must update the presentation of the
- image appropriately (e.g. if the image is a progressive JPEG, each
- packet can improve the resolution of the image); furthermore, the
- last <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the <a href=#networking-task-source>networking task
- source</a> once the resource has been <a href=#fetch title=fetch>fetched</a> must act as appropriate given the
- following alternatives:</p>
+ <p id=img-load>If the resource is in a supported image format, then each <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the
+ <a href=#networking-task-source>networking task source</a> while the image is being <a href=#fetch title=fetch>fetched</a>
+ must update the presentation of the image appropriately (e.g. if the image is a progressive
+ JPEG, each packet can improve the resolution of the image). In addition, if the resource is
+ <a href=#cors-same-origin>CORS-same-origin</a>, each such <a href=#concept-task title=concept-task>task</a> must <a href=#fire-a-progress-event>fire
+ a progress event</a> named <code title=event-progress>progress</code> at the
+ <code><a href=#the-img-element>img</a></code> element.</p>
+ <p>Furthermore, the last <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a
+ task">queued</a> by the <a href=#networking-task-source>networking task source</a> once the resource has been <a href=#fetch title=fetch>fetched</a> must additionally run the steps for the matching entry in the
+ following list:</p>
+
<dl class=switch><dt>If the download was successful and the user agent was able to determine the image's width and height</dt>
- <dd>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-all title=img-all>completely available</a> state, update the
- presentation of the image appropriately, add the image to the
- <a href=#list-of-available-images>list of available images</a> using the key <var title="">key</var>, and <a href=#fire-a-simple-event>fire a simple event</a> named
- <code title=event-load>load</code> at the <code><a href=#the-img-element>img</a></code>
- element.</dd>
+ <dd>
+ <ol><li><p>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-all title=img-all>completely
+ available</a> state.</p>
+
+ <li><p>Add the image to the <a href=#list-of-available-images>list of available images</a> using the key <var title="">key</var>.</li>
+
+ <li>
+
+ <p>If the resource is <a href=#cors-same-origin>CORS-same-origin</a>: <a href=#fire-a-progress-event>fire a progress event</a>
+ named <code title=event-load>load</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ <p>If the resource is <a href=#cors-cross-origin>CORS-cross-origin</a>: <a href=#fire-a-simple-event>fire a simple event</a> named
+ <code title=event-load>load</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ </li>
+
+ <li>
+
+ <p>If the resource is <a href=#cors-same-origin>CORS-same-origin</a>: <a href=#fire-a-progress-event>fire a progress event</a>
+ named <code title=event-load>loadend</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ <p>If the resource is <a href=#cors-cross-origin>CORS-cross-origin</a>: <a href=#fire-a-simple-event>fire a simple event</a> named
+ <code title=event-load>loadend</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ </li>
+
+ </ol></dd>
+
<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1222 -->
<dt>Otherwise</dt>
- <dd>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state, and <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-error>error</code> at the
- <code><a href=#the-img-element>img</a></code> element.</dd>
+ <dd>
+ <ol><li><p>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a>
+ state.</li>
+
+ <li>
+
+ <p>If the resource is <a href=#cors-same-origin>CORS-same-origin</a>: <a href=#fire-a-progress-event>fire a progress event</a>
+ named <code title=event-load>load</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ <p>If the resource is <a href=#cors-cross-origin>CORS-cross-origin</a>: <a href=#fire-a-simple-event>fire a simple event</a> named
+ <code title=event-load>load</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ </li>
+
+ <li>
+
+ <p>If the resource is <a href=#cors-same-origin>CORS-same-origin</a>: <a href=#fire-a-progress-event>fire a progress event</a>
+ named <code title=event-load>loadend</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ <p>If the resource is <a href=#cors-cross-origin>CORS-cross-origin</a>: <a href=#fire-a-simple-event>fire a simple event</a> named
+ <code title=event-load>loadend</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ </li>
+
+ </ol></dd>
+
</dl><p>On the other hand, if the resource type is
<code><a href=#multipart/x-mixed-replace>multipart/x-mixed-replace</a></code>, then each <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a
task">queued</a> by the <a href=#networking-task-source>networking task source</a>
@@ -23978,15 +24038,17 @@
a simple event</a> named <code title=event-load>load</code>
at the <code><a href=#the-img-element>img</a></code> element.</p>
- <p>Otherwise, either the image data is corrupted in some fatal way
- such that the image dimensions cannot be obtained, or the image
- data is not in a supported file format; the user agent must set
- the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state, abort the <a href=#fetch title=fetch>fetching</a> algorithm, discarding any pending
- <a href=#concept-task title=concept-task>tasks</a> generated by that
- algorithm, and then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
- simple event</a> named <code title=event-error>error</code>
- at the <code><a href=#the-img-element>img</a></code> element.</p>
+ <p class=note>The <code title=event-progress>progress</code> and <code title=event-loadend>loadend</code> events are not fired for
+ <code><a href=#multipart/x-mixed-replace>multipart/x-mixed-replace</a></code> image streams.</p>
+ <p>Otherwise, either the image data is corrupted in some fatal way such that the image
+ dimensions cannot be obtained, or the image data is not in a supported file format; the user
+ agent must set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state,
+ abort the <a href=#fetch title=fetch>fetching</a> algorithm, discarding any pending <a href=#concept-task title=concept-task>tasks</a> generated by that algorithm, and then <a href=#queue-a-task>queue a
+ task</a> to first <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error>error</code> at the <code><a href=#the-img-element>img</a></code> element and then <a href=#fire-a-simple-event>fire a simple
+ event</a> named <code title=event-loadend>loadend</code> at the <code><a href=#the-img-element>img</a></code>
+ element.</p>
+
</li>
</ol><p>While a user agent is running the above algorithm for an element
@@ -70959,7 +71021,7 @@
<td> The user agent has found an update and is fetching it, or is downloading the resources listed by the manifest for the first time.
<td> <code title=event-appcache-progress><a href=#event-appcache-progress>progress</a></code>, <code title=event-appcache-error><a href=#event-appcache-error>error</a></code>, <code title=event-appcache-cached><a href=#event-appcache-cached>cached</a></code>, <code title=event-appcache-updateready><a href=#event-appcache-updateready>updateready</a></code>
<tr><td> <dfn id=event-appcache-progress title=event-appcache-progress><code>progress</code></dfn>
- <td> <code>ProgressEvent</code>
+ <td> <code><a href=#progressevent>ProgressEvent</a></code>
<td> The user agent is downloading resources listed by the manifest.
The event object's <code title=dom-ProgressEvents-total>total</code> attribute returns the total number of files to be downloaded.
The event object's <code title=dom-ProgressEvents-loaded>loaded</code> attribute returns the number of files processed so far.
@@ -72066,7 +72128,7 @@
<li><p>For each <a href=#cache-host>cache host</a> associated with an <a href=#application-cache>application cache</a> in
<var title="">cache group</var>, <a href=#queue-a-post-load-task>queue a post-load task</a> to <a href=#concept-event-fire title=concept-event-fire>fire</a> a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a>
event with the name <code title=event-appcache-progress><a href=#event-appcache-progress>progress</a></code>, which does not
- bubble, which is cancelable, and which uses the <code>ProgressEvent</code> interface, at the
+ bubble, which is cancelable, and which uses the <code><a href=#progressevent>ProgressEvent</a></code> interface, at the
<code><a href=#applicationcache>ApplicationCache</a></code> singleton of the <a href=#cache-host>cache host</a>. The <code title=dom-ProgressEvents-lengthComputable>lengthComputable</code> attribute must be set to
true, the <code title=dom-ProgressEvents-total>total</code> attribute must be set to the
number of files in <var title="">file list</var>, and the <code title=dom-ProgressEvents-loaded>loaded</code> attribute must be set to the number of files in
@@ -72183,7 +72245,7 @@
<li><p>For each <a href=#cache-host>cache host</a> associated with an <a href=#application-cache>application cache</a> in <var title="">cache group</var>, <a href=#queue-a-post-load-task>queue a post-load task</a> to <a href=#concept-event-fire title=concept-event-fire>fire</a> a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a>
event with the name <code title=event-appcache-progress><a href=#event-appcache-progress>progress</a></code>, which does not bubble,
- which is cancelable, and which uses the <code>ProgressEvent</code> interface, at the
+ which is cancelable, and which uses the <code><a href=#progressevent>ProgressEvent</a></code> interface, at the
<code><a href=#applicationcache>ApplicationCache</a></code> singleton of the <a href=#cache-host>cache host</a>. The <code title=dom-ProgressEvents-lengthComputable>lengthComputable</code> attribute must be set to
true, the <code title=dom-ProgressEvents-total>total</code> and the <code title=dom-ProgressEvents-loaded>loaded</code> attributes must be set to the number of files in
<var title="">file list</var>. The default action of these events must be, if the user agent
Modified: index
===================================================================
--- index 2013-01-03 23:38:00 UTC (rev 7635)
+++ index 2013-01-04 00:49:51 UTC (rev 7636)
@@ -248,7 +248,7 @@
<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
- <h2 class="no-num no-toc">Living Standard — Last Updated 3 January 2013</h2>
+ <h2 class="no-num no-toc">Living Standard — Last Updated 4 January 2013</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
@@ -4181,17 +4181,21 @@
<dd>
- <p>This specification references the XMLHttpRequest specification
- to define how the two specifications interact. The terms
- <dfn id=document-response-entity-body>document response entity body</dfn>,
- <dfn id=xmlhttprequest-base-url><code>XMLHttpRequest</code> base URL</dfn>,
- <dfn id=xmlhttprequest-origin><code>XMLHttpRequest</code> origin</dfn>, and
- <dfn id=xmlhttprequest-referrer-source><code>XMLHttpRequest</code> referrer source</dfn> are defined
- in that specification. <a href=#refsXHR>[XHR]</a></p>
+ <p>This specification references the XMLHttpRequest specification to define how the two
+ specifications interact and to use its <code><a href=#progressevent>ProgressEvent</a></code> features. The following
+ features and terms are defined in the XMLHttpRequest specification: <a href=#refsXHR>[XHR]</a></p>
- </dd>
+ <ul class=brief><li><dfn id=document-response-entity-body>Document response entity body</dfn>
+ <li><dfn id=xmlhttprequest-base-url><code>XMLHttpRequest</code> base URL</dfn>
+ <li><dfn id=xmlhttprequest-origin><code>XMLHttpRequest</code> origin</dfn>
+ <li><dfn id=xmlhttprequest-referrer-source><code>XMLHttpRequest</code> referrer source</dfn>
+ <li><dfn id=progressevent><code>ProgressEvent</code></dfn>
+ <li><dfn id=fire-a-progress-event title="fire a progress event">Fire a progress event named <var title="">e</var></dfn>
+ </ul></dd>
+
+
<!--TOPIC:HTML-->
<dt>Media Queries</dt>
@@ -23909,6 +23913,13 @@
<li>
+ <p><a href=#fire-a-progress-event>Fire a progress event</a> named <code title=event-loadstart>loadstart</code> at
+ the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ </li>
+
+ <li>
+
<p>Do a <a href=#potentially-cors-enabled-fetch>potentially CORS-enabled fetch</a><!--FETCH--> of
the <a href=#absolute-url>absolute URL</a> that resulted from the earlier step,
with the <i>mode</i> being the state of the element's <code title=attr-img-crossorigin><a href=#attr-img-crossorigin>crossorigin</a></code> content attribute,
@@ -23941,31 +23952,80 @@
source</a> while the image is being <a href=#fetch title=fetch>fetched</a> must set the <code><a href=#the-img-element>img</a></code> element's
state to <a href=#img-inc title=img-inc>partially available</a>.</p>
- <p id=img-load>If the resource is in a supported image format,
- then each <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the <a href=#networking-task-source>networking task
- source</a> while the image is being <a href=#fetch title=fetch>fetched</a> must update the presentation of the
- image appropriately (e.g. if the image is a progressive JPEG, each
- packet can improve the resolution of the image); furthermore, the
- last <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the <a href=#networking-task-source>networking task
- source</a> once the resource has been <a href=#fetch title=fetch>fetched</a> must act as appropriate given the
- following alternatives:</p>
+ <p id=img-load>If the resource is in a supported image format, then each <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the
+ <a href=#networking-task-source>networking task source</a> while the image is being <a href=#fetch title=fetch>fetched</a>
+ must update the presentation of the image appropriately (e.g. if the image is a progressive
+ JPEG, each packet can improve the resolution of the image). In addition, if the resource is
+ <a href=#cors-same-origin>CORS-same-origin</a>, each such <a href=#concept-task title=concept-task>task</a> must <a href=#fire-a-progress-event>fire
+ a progress event</a> named <code title=event-progress>progress</code> at the
+ <code><a href=#the-img-element>img</a></code> element.</p>
+ <p>Furthermore, the last <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a
+ task">queued</a> by the <a href=#networking-task-source>networking task source</a> once the resource has been <a href=#fetch title=fetch>fetched</a> must additionally run the steps for the matching entry in the
+ following list:</p>
+
<dl class=switch><dt>If the download was successful and the user agent was able to determine the image's width and height</dt>
- <dd>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-all title=img-all>completely available</a> state, update the
- presentation of the image appropriately, add the image to the
- <a href=#list-of-available-images>list of available images</a> using the key <var title="">key</var>, and <a href=#fire-a-simple-event>fire a simple event</a> named
- <code title=event-load>load</code> at the <code><a href=#the-img-element>img</a></code>
- element.</dd>
+ <dd>
+ <ol><li><p>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-all title=img-all>completely
+ available</a> state.</p>
+
+ <li><p>Add the image to the <a href=#list-of-available-images>list of available images</a> using the key <var title="">key</var>.</li>
+
+ <li>
+
+ <p>If the resource is <a href=#cors-same-origin>CORS-same-origin</a>: <a href=#fire-a-progress-event>fire a progress event</a>
+ named <code title=event-load>load</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ <p>If the resource is <a href=#cors-cross-origin>CORS-cross-origin</a>: <a href=#fire-a-simple-event>fire a simple event</a> named
+ <code title=event-load>load</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ </li>
+
+ <li>
+
+ <p>If the resource is <a href=#cors-same-origin>CORS-same-origin</a>: <a href=#fire-a-progress-event>fire a progress event</a>
+ named <code title=event-load>loadend</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ <p>If the resource is <a href=#cors-cross-origin>CORS-cross-origin</a>: <a href=#fire-a-simple-event>fire a simple event</a> named
+ <code title=event-load>loadend</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ </li>
+
+ </ol></dd>
+
<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1222 -->
<dt>Otherwise</dt>
- <dd>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state, and <a href=#fire-a-simple-event>fire a simple
- event</a> named <code title=event-error>error</code> at the
- <code><a href=#the-img-element>img</a></code> element.</dd>
+ <dd>
+ <ol><li><p>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a>
+ state.</li>
+
+ <li>
+
+ <p>If the resource is <a href=#cors-same-origin>CORS-same-origin</a>: <a href=#fire-a-progress-event>fire a progress event</a>
+ named <code title=event-load>load</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ <p>If the resource is <a href=#cors-cross-origin>CORS-cross-origin</a>: <a href=#fire-a-simple-event>fire a simple event</a> named
+ <code title=event-load>load</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ </li>
+
+ <li>
+
+ <p>If the resource is <a href=#cors-same-origin>CORS-same-origin</a>: <a href=#fire-a-progress-event>fire a progress event</a>
+ named <code title=event-load>loadend</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ <p>If the resource is <a href=#cors-cross-origin>CORS-cross-origin</a>: <a href=#fire-a-simple-event>fire a simple event</a> named
+ <code title=event-load>loadend</code> at the <code><a href=#the-img-element>img</a></code> element.</p>
+
+ </li>
+
+ </ol></dd>
+
</dl><p>On the other hand, if the resource type is
<code><a href=#multipart/x-mixed-replace>multipart/x-mixed-replace</a></code>, then each <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a
task">queued</a> by the <a href=#networking-task-source>networking task source</a>
@@ -23978,15 +24038,17 @@
a simple event</a> named <code title=event-load>load</code>
at the <code><a href=#the-img-element>img</a></code> element.</p>
- <p>Otherwise, either the image data is corrupted in some fatal way
- such that the image dimensions cannot be obtained, or the image
- data is not in a supported file format; the user agent must set
- the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state, abort the <a href=#fetch title=fetch>fetching</a> algorithm, discarding any pending
- <a href=#concept-task title=concept-task>tasks</a> generated by that
- algorithm, and then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
- simple event</a> named <code title=event-error>error</code>
- at the <code><a href=#the-img-element>img</a></code> element.</p>
+ <p class=note>The <code title=event-progress>progress</code> and <code title=event-loadend>loadend</code> events are not fired for
+ <code><a href=#multipart/x-mixed-replace>multipart/x-mixed-replace</a></code> image streams.</p>
+ <p>Otherwise, either the image data is corrupted in some fatal way such that the image
+ dimensions cannot be obtained, or the image data is not in a supported file format; the user
+ agent must set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state,
+ abort the <a href=#fetch title=fetch>fetching</a> algorithm, discarding any pending <a href=#concept-task title=concept-task>tasks</a> generated by that algorithm, and then <a href=#queue-a-task>queue a
+ task</a> to first <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error>error</code> at the <code><a href=#the-img-element>img</a></code> element and then <a href=#fire-a-simple-event>fire a simple
+ event</a> named <code title=event-loadend>loadend</code> at the <code><a href=#the-img-element>img</a></code>
+ element.</p>
+
</li>
</ol><p>While a user agent is running the above algorithm for an element
@@ -70959,7 +71021,7 @@
<td> The user agent has found an update and is fetching it, or is downloading the resources listed by the manifest for the first time.
<td> <code title=event-appcache-progress><a href=#event-appcache-progress>progress</a></code>, <code title=event-appcache-error><a href=#event-appcache-error>error</a></code>, <code title=event-appcache-cached><a href=#event-appcache-cached>cached</a></code>, <code title=event-appcache-updateready><a href=#event-appcache-updateready>updateready</a></code>
<tr><td> <dfn id=event-appcache-progress title=event-appcache-progress><code>progress</code></dfn>
- <td> <code>ProgressEvent</code>
+ <td> <code><a href=#progressevent>ProgressEvent</a></code>
<td> The user agent is downloading resources listed by the manifest.
The event object's <code title=dom-ProgressEvents-total>total</code> attribute returns the total number of files to be downloaded.
The event object's <code title=dom-ProgressEvents-loaded>loaded</code> attribute returns the number of files processed so far.
@@ -72066,7 +72128,7 @@
<li><p>For each <a href=#cache-host>cache host</a> associated with an <a href=#application-cache>application cache</a> in
<var title="">cache group</var>, <a href=#queue-a-post-load-task>queue a post-load task</a> to <a href=#concept-event-fire title=concept-event-fire>fire</a> a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a>
event with the name <code title=event-appcache-progress><a href=#event-appcache-progress>progress</a></code>, which does not
- bubble, which is cancelable, and which uses the <code>ProgressEvent</code> interface, at the
+ bubble, which is cancelable, and which uses the <code><a href=#progressevent>ProgressEvent</a></code> interface, at the
<code><a href=#applicationcache>ApplicationCache</a></code> singleton of the <a href=#cache-host>cache host</a>. The <code title=dom-ProgressEvents-lengthComputable>lengthComputable</code> attribute must be set to
true, the <code title=dom-ProgressEvents-total>total</code> attribute must be set to the
number of files in <var title="">file list</var>, and the <code title=dom-ProgressEvents-loaded>loaded</code> attribute must be set to the number of files in
@@ -72183,7 +72245,7 @@
<li><p>For each <a href=#cache-host>cache host</a> associated with an <a href=#application-cache>application cache</a> in <var title="">cache group</var>, <a href=#queue-a-post-load-task>queue a post-load task</a> to <a href=#concept-event-fire title=concept-event-fire>fire</a> a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a>
event with the name <code title=event-appcache-progress><a href=#event-appcache-progress>progress</a></code>, which does not bubble,
- which is cancelable, and which uses the <code>ProgressEvent</code> interface, at the
+ which is cancelable, and which uses the <code><a href=#progressevent>ProgressEvent</a></code> interface, at the
<code><a href=#applicationcache>ApplicationCache</a></code> singleton of the <a href=#cache-host>cache host</a>. The <code title=dom-ProgressEvents-lengthComputable>lengthComputable</code> attribute must be set to
true, the <code title=dom-ProgressEvents-total>total</code> and the <code title=dom-ProgressEvents-loaded>loaded</code> attributes must be set to the number of files in
<var title="">file list</var>. The default action of these events must be, if the user agent
Modified: source
===================================================================
--- source 2013-01-03 23:38:00 UTC (rev 7635)
+++ source 2013-01-04 00:49:51 UTC (rev 7636)
@@ -3100,14 +3100,23 @@
<dd>
- <p>This specification references the XMLHttpRequest specification
- to define how the two specifications interact. The terms
- <dfn>document response entity body</dfn>,
- <dfn><code>XMLHttpRequest</code> base URL</dfn>,
- <dfn><code>XMLHttpRequest</code> origin</dfn>, and
- <dfn><code>XMLHttpRequest</code> referrer source</dfn> are defined
- in that specification. <a href="#refsXHR">[XHR]</a></p>
+ <p>This specification references the XMLHttpRequest specification to define how the two
+ specifications interact and to use its <code>ProgressEvent</code> features. The following
+ features and terms are defined in the XMLHttpRequest specification: <a
+ href="#refsXHR">[XHR]</a></p>
+ <ul class="brief">
+
+ <li><dfn>Document response entity body</dfn>
+ <li><dfn><code>XMLHttpRequest</code> base URL</dfn>
+ <li><dfn><code>XMLHttpRequest</code> origin</dfn>
+ <li><dfn><code>XMLHttpRequest</code> referrer source</dfn>
+
+ <li><dfn><code>ProgressEvent</code></dfn>
+ <li><dfn title="fire a progress event">Fire a progress event named <var title="">e</var></dfn>
+
+ </ul>
+
</dd>
@@ -25392,6 +25401,13 @@
<li>
+ <p><span>Fire a progress event</span> named <code title="event-loadstart">loadstart</code> at
+ the <code>img</code> element.</p>
+
+ </li>
+
+ <li>
+
<p>Do a <span>potentially CORS-enabled fetch</span><!--FETCH--> of
the <span>absolute URL</span> that resulted from the earlier step,
with the <i>mode</i> being the state of the element's <code
@@ -25429,40 +25445,93 @@
title="fetch">fetched</span> must set the <code>img</code> element's
state to <span title="img-inc">partially available</span>.</p>
- <p id="img-load">If the resource is in a supported image format,
- then each <span title="concept-task">task</span> that is <span
- title="queue a task">queued</span> by the <span>networking task
- source</span> while the image is being <span
- title="fetch">fetched</span> must update the presentation of the
- image appropriately (e.g. if the image is a progressive JPEG, each
- packet can improve the resolution of the image); furthermore, the
- last <span title="concept-task">task</span> that is <span
- title="queue a task">queued</span> by the <span>networking task
- source</span> once the resource has been <span
- title="fetch">fetched</span> must act as appropriate given the
- following alternatives:</p>
+ <p id="img-load">If the resource is in a supported image format, then each <span
+ title="concept-task">task</span> that is <span title="queue a task">queued</span> by the
+ <span>networking task source</span> while the image is being <span title="fetch">fetched</span>
+ must update the presentation of the image appropriately (e.g. if the image is a progressive
+ JPEG, each packet can improve the resolution of the image). In addition, if the resource is
+ <span>CORS-same-origin</span>, each such <span title="concept-task">task</span> must <span>fire
+ a progress event</span> named <code title="event-progress">progress</code> at the
+ <code>img</code> element.</p>
+ <p>Furthermore, the last <span title="concept-task">task</span> that is <span title="queue a
+ task">queued</span> by the <span>networking task source</span> once the resource has been <span
+ title="fetch">fetched</span> must additionally run the steps for the matching entry in the
+ following list:</p>
+
<dl class="switch">
<dt>If the download was successful and the user agent was able to determine the image's width and height</dt>
- <dd>Set the <code>img</code> element to the <span
- title="img-all">completely available</span> state, update the
- presentation of the image appropriately, add the image to the
- <span>list of available images</span> using the key <var
- title="">key</var>, and <span>fire a simple event</span> named
- <code title="event-load">load</code> at the <code>img</code>
- element.</dd>
+ <dd>
+ <ol>
+
+ <li><p>Set the <code>img</code> element to the <span title="img-all">completely
+ available</span> state.</p>
+
+ <li><p>Add the image to the <span>list of available images</span> using the key <var
+ title="">key</var>.</p></li>
+
+ <li>
+
+ <p>If the resource is <span>CORS-same-origin</span>: <span>fire a progress event</span>
+ named <code title="event-load">load</code> at the <code>img</code> element.</p>
+
+ <p>If the resource is <span>CORS-cross-origin</span>: <span>fire a simple event</span> named
+ <code title="event-load">load</code> at the <code>img</code> element.</p>
+
+ </li>
+
+ <li>
+
+ <p>If the resource is <span>CORS-same-origin</span>: <span>fire a progress event</span>
+ named <code title="event-load">loadend</code> at the <code>img</code> element.</p>
+
+ <p>If the resource is <span>CORS-cross-origin</span>: <span>fire a simple event</span> named
+ <code title="event-load">loadend</code> at the <code>img</code> element.</p>
+
+ </li>
+
+ </ol>
+
+ </dd>
+
<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1222 -->
<dt>Otherwise</dt>
- <dd>Set the <code>img</code> element to the <span
- title="img-error">broken</span> state, and <span>fire a simple
- event</span> named <code title="event-error">error</code> at the
- <code>img</code> element.</dd>
+ <dd>
+ <ol>
+
+ <li><p>Set the <code>img</code> element to the <span title="img-error">broken</span>
+ state.</p></li>
+
+ <li>
+
+ <p>If the resource is <span>CORS-same-origin</span>: <span>fire a progress event</span>
+ named <code title="event-load">load</code> at the <code>img</code> element.</p>
+
+ <p>If the resource is <span>CORS-cross-origin</span>: <span>fire a simple event</span> named
+ <code title="event-load">load</code> at the <code>img</code> element.</p>
+
+ </li>
+
+ <li>
+
+ <p>If the resource is <span>CORS-same-origin</span>: <span>fire a progress event</span>
+ named <code title="event-load">loadend</code> at the <code>img</code> element.</p>
+
+ <p>If the resource is <span>CORS-cross-origin</span>: <span>fire a simple event</span> named
+ <code title="event-load">loadend</code> at the <code>img</code> element.</p>
+
+ </li>
+
+ </ol>
+
+ </dd>
+
</dl>
<p>On the other hand, if the resource type is
@@ -25478,17 +25547,20 @@
a simple event</span> named <code title="event-load">load</code>
at the <code>img</code> element.</p>
- <p>Otherwise, either the image data is corrupted in some fatal way
- such that the image dimensions cannot be obtained, or the image
- data is not in a supported file format; the user agent must set
- the <code>img</code> element to the <span
- title="img-error">broken</span> state, abort the <span
- title="fetch">fetching</span> algorithm, discarding any pending
- <span title="concept-task">tasks</span> generated by that
- algorithm, and then <span>queue a task</span> to <span>fire a
- simple event</span> named <code title="event-error">error</code>
- at the <code>img</code> element.</p>
+ <p class="note">The <code title="event-progress">progress</code> and <code
+ title="event-loadend">loadend</code> events are not fired for
+ <code>multipart/x-mixed-replace</code> image streams.</p>
+ <p>Otherwise, either the image data is corrupted in some fatal way such that the image
+ dimensions cannot be obtained, or the image data is not in a supported file format; the user
+ agent must set the <code>img</code> element to the <span title="img-error">broken</span> state,
+ abort the <span title="fetch">fetching</span> algorithm, discarding any pending <span
+ title="concept-task">tasks</span> generated by that algorithm, and then <span>queue a
+ task</span> to first <span>fire a simple event</span> named <code
+ title="event-error">error</code> at the <code>img</code> element and then <span>fire a simple
+ event</span> named <code title="event-loadend">loadend</code> at the <code>img</code>
+ element.</p>
+
</li>
</ol>
More information about the Commit-Watchers
mailing list