[html5] r7128 - [giow] (2) Try to define img synchronous loading. Affected topics: HTML

whatwg at whatwg.org whatwg at whatwg.org
Mon Jun 11 13:53:30 PDT 2012


Author: ianh
Date: 2012-06-11 13:53:26 -0700 (Mon, 11 Jun 2012)
New Revision: 7128

Modified:
   complete.html
   index
   source
Log:
[giow] (2) Try to define img synchronous loading.
Affected topics: HTML

Modified: complete.html
===================================================================
--- complete.html	2012-06-08 21:50:19 UTC (rev 7127)
+++ complete.html	2012-06-11 20:53:26 UTC (rev 7128)
@@ -240,7 +240,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 8 June 2012</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 11 June 2012</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>
@@ -23732,6 +23732,18 @@
   per CSS inch, and thus if the image data is 300x600, it has an
   intrinsic dimension of 96 CSS pixels by 192 CSS pixels.</p>
 
+  <p>Each <code><a href=#document>Document</a></code> object must have a <dfn id=list-of-available-images>list of
+  available images</dfn>. Each image in this list is identified by a
+  tuple consisting of an <a href=#absolute-url>absolute URL</a>, a <a href=#cors-settings-attribute>CORS
+  settings attribute</a> mode, and, if the mode is not <a href=#attr-crossorigin-none title=attr-crossorigin-none>No CORS</a>, an
+  <a href=#origin>origin</a>. User agents may copy entries from one
+  <code><a href=#document>Document</a></code> object's <a href=#list-of-available-images>list of available images</a>
+  to another at any time (e.g. when the <code><a href=#document>Document</a></code> is
+  created, user agents can add to it all the images that are loaded in
+  other <code><a href=#document>Document</a></code>s), but must not change the keys of
+  entries copied in this way when doing so. User agents may also
+  remove images from such lists at any time (e.g. to save memory).</p>
+
   <p>When the user agent is to <dfn id=update-the-image-data>update the image data</dfn> of an
   <code><a href=#the-img-element>img</a></code> element, it must run the following steps:</p>
 
@@ -23748,6 +23760,47 @@
    <li><p>If the user agent cannot support images, or its support for
    images has been disabled, then abort these steps.</li>
 
+   <li>
+
+
+
+    <p>If the element has a <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code> attribute specified, then
+    let <var title="">selected source</var> and <var title="">selected
+    pixel density</var> be the URL and pixel density that results from
+    <a href=#processing-the-image-candidates>processing the image candidates</a>, respectively.
+
+
+
+    Otherwise, if the element has a <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute specified and its value
+    is not the empty string, let <var title="">selected source</var>
+    be the value of the element's <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute, and <var title="">selected pixel density</var> be 1.0. Otherwise, let <var title="">selected source</var> be null and <var title="">selected
+    pixel density</var> be undefined.</p>
+
+   </li>
+
+   <li><p>Let the <code><a href=#the-img-element>img</a></code> element's <a href=#last-selected-source>last selected
+   source</a> be <var title="">selected source</var> and the
+   <code><a href=#the-img-element>img</a></code> element's <a href=#current-pixel-density>current pixel density</a> be
+   <var title="">selected pixel density</var>.</li>
+
+   <li><p><a href=#resolve-a-url title="resolve a url">Resolve</a> <var title="">selected source</var>, relative to the element. If that is
+   not successful, abort these steps.</li>
+
+   <li><p>Let <var title="">key</var> be a tuple consisting of the
+   resulting <a href=#absolute-url>absolute URL</a>, the <code><a href=#the-img-element>img</a></code> element's
+   <code title=attr-crossorigin>crossorigin</code> attribute's mode,
+   and, if that mode is not <a href=#attr-crossorigin-none title=attr-crossorigin-none>No
+   CORS</a>, the <code><a href=#document>Document</a></code> object's
+   <a href=#origin>origin</a>.</li>
+
+   <li><p>If the <a href=#list-of-available-images>list of available images</a>, contains an
+   entry for <var title="">key</var>, then 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,
+   <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-load>load</code> at the <code><a href=#the-img-element>img</a></code>
+   element, and abort these steps.</li>
+
    <li><p>Asynchronously <a href=#await-a-stable-state>await a stable state</a>, allowing
    the <a href=#concept-task title=concept-task>task</a> that invoked this
    algorithm to continue. The <a href=#synchronous-section>synchronous section</a>
@@ -23759,8 +23812,8 @@
    <li>
 
     <p>⌛ If another instance of this algorithm for this
-    <code><a href=#the-img-element>img</a></code> element was started after this instance, then
-    abort these steps.</p>
+    <code><a href=#the-img-element>img</a></code> element was started after this instance (even if
+    it aborted and is no longer running), then abort these steps.</p>
 
     <p class=note>Only the last instance takes effect, to avoid
     multiple requests when, for example, the
@@ -23775,32 +23828,6 @@
 
    <li>
 
-    <p>⌛
-
-
-
-    If the element has a <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code>
-    attribute specified, then let <var title="">selected source</var>
-    and <var title="">selected pixel density</var> be the URL and
-    pixel density that results from <a href=#processing-the-image-candidates>processing the image
-    candidates</a>, respectively.
-
-
-
-    Otherwise, if the element has a <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute specified and its value
-    is not the empty string, let <var title="">selected source</var>
-    be the value of the element's <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute, and <var title="">selected pixel density</var> be 1.0. Otherwise, let <var title="">selected source</var> be null and <var title="">selected
-    pixel density</var> be undefined.</p>
-
-   </li>
-
-   <li><p>⌛ Let the <code><a href=#the-img-element>img</a></code> element's <a href=#last-selected-source>last
-   selected source</a> be <var title="">selected source</var> and
-   the <code><a href=#the-img-element>img</a></code> element's <a href=#current-pixel-density>current pixel density</a>
-   be <var title="">selected pixel density</var>.</li>
-
-   <li>
-
     <p>⌛ If <var title="">selected source</var> is null, then
     set the element to the <a href=#img-error title=img-error>broken</a>
     state, <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
@@ -23811,13 +23838,9 @@
 
    <li>
 
-    <p>⌛ <a href=#resolve-a-url title="resolve a url">Resolve</a> <var title="">selected source</var>, relative to the element.</p>
-
-    <p>If that is not successful, abort these steps.</p>
-
-    <p>Otherwise, do a <a href=#potentially-cors-enabled-fetch>potentially CORS-enabled fetch</a> of
-    the resulting <a href=#absolute-url>absolute URL</a>, 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,
+    <p>Do a <a href=#potentially-cors-enabled-fetch>potentially CORS-enabled fetch</a> 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,
     the <i title="">origin</i> being the <a href=#origin>origin</a> of the
     <code><a href=#the-img-element>img</a></code> element's <code><a href=#document>Document</a></code>, and the
     <i>default origin behaviour</i> set to <i>taint</i>.</p>
@@ -23859,9 +23882,10 @@
     <dl class=switch><dt>If the download was successful</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, 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>
+     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>
 
      <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1222 -->
 

Modified: index
===================================================================
--- index	2012-06-08 21:50:19 UTC (rev 7127)
+++ index	2012-06-11 20:53:26 UTC (rev 7128)
@@ -240,7 +240,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 8 June 2012</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 11 June 2012</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>
@@ -23732,6 +23732,18 @@
   per CSS inch, and thus if the image data is 300x600, it has an
   intrinsic dimension of 96 CSS pixels by 192 CSS pixels.</p>
 
+  <p>Each <code><a href=#document>Document</a></code> object must have a <dfn id=list-of-available-images>list of
+  available images</dfn>. Each image in this list is identified by a
+  tuple consisting of an <a href=#absolute-url>absolute URL</a>, a <a href=#cors-settings-attribute>CORS
+  settings attribute</a> mode, and, if the mode is not <a href=#attr-crossorigin-none title=attr-crossorigin-none>No CORS</a>, an
+  <a href=#origin>origin</a>. User agents may copy entries from one
+  <code><a href=#document>Document</a></code> object's <a href=#list-of-available-images>list of available images</a>
+  to another at any time (e.g. when the <code><a href=#document>Document</a></code> is
+  created, user agents can add to it all the images that are loaded in
+  other <code><a href=#document>Document</a></code>s), but must not change the keys of
+  entries copied in this way when doing so. User agents may also
+  remove images from such lists at any time (e.g. to save memory).</p>
+
   <p>When the user agent is to <dfn id=update-the-image-data>update the image data</dfn> of an
   <code><a href=#the-img-element>img</a></code> element, it must run the following steps:</p>
 
@@ -23748,6 +23760,47 @@
    <li><p>If the user agent cannot support images, or its support for
    images has been disabled, then abort these steps.</li>
 
+   <li>
+
+
+
+    <p>If the element has a <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code> attribute specified, then
+    let <var title="">selected source</var> and <var title="">selected
+    pixel density</var> be the URL and pixel density that results from
+    <a href=#processing-the-image-candidates>processing the image candidates</a>, respectively.
+
+
+
+    Otherwise, if the element has a <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute specified and its value
+    is not the empty string, let <var title="">selected source</var>
+    be the value of the element's <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute, and <var title="">selected pixel density</var> be 1.0. Otherwise, let <var title="">selected source</var> be null and <var title="">selected
+    pixel density</var> be undefined.</p>
+
+   </li>
+
+   <li><p>Let the <code><a href=#the-img-element>img</a></code> element's <a href=#last-selected-source>last selected
+   source</a> be <var title="">selected source</var> and the
+   <code><a href=#the-img-element>img</a></code> element's <a href=#current-pixel-density>current pixel density</a> be
+   <var title="">selected pixel density</var>.</li>
+
+   <li><p><a href=#resolve-a-url title="resolve a url">Resolve</a> <var title="">selected source</var>, relative to the element. If that is
+   not successful, abort these steps.</li>
+
+   <li><p>Let <var title="">key</var> be a tuple consisting of the
+   resulting <a href=#absolute-url>absolute URL</a>, the <code><a href=#the-img-element>img</a></code> element's
+   <code title=attr-crossorigin>crossorigin</code> attribute's mode,
+   and, if that mode is not <a href=#attr-crossorigin-none title=attr-crossorigin-none>No
+   CORS</a>, the <code><a href=#document>Document</a></code> object's
+   <a href=#origin>origin</a>.</li>
+
+   <li><p>If the <a href=#list-of-available-images>list of available images</a>, contains an
+   entry for <var title="">key</var>, then 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,
+   <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-load>load</code> at the <code><a href=#the-img-element>img</a></code>
+   element, and abort these steps.</li>
+
    <li><p>Asynchronously <a href=#await-a-stable-state>await a stable state</a>, allowing
    the <a href=#concept-task title=concept-task>task</a> that invoked this
    algorithm to continue. The <a href=#synchronous-section>synchronous section</a>
@@ -23759,8 +23812,8 @@
    <li>
 
     <p>⌛ If another instance of this algorithm for this
-    <code><a href=#the-img-element>img</a></code> element was started after this instance, then
-    abort these steps.</p>
+    <code><a href=#the-img-element>img</a></code> element was started after this instance (even if
+    it aborted and is no longer running), then abort these steps.</p>
 
     <p class=note>Only the last instance takes effect, to avoid
     multiple requests when, for example, the
@@ -23775,32 +23828,6 @@
 
    <li>
 
-    <p>⌛
-
-
-
-    If the element has a <code title=attr-img-srcset><a href=#attr-img-srcset>srcset</a></code>
-    attribute specified, then let <var title="">selected source</var>
-    and <var title="">selected pixel density</var> be the URL and
-    pixel density that results from <a href=#processing-the-image-candidates>processing the image
-    candidates</a>, respectively.
-
-
-
-    Otherwise, if the element has a <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute specified and its value
-    is not the empty string, let <var title="">selected source</var>
-    be the value of the element's <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute, and <var title="">selected pixel density</var> be 1.0. Otherwise, let <var title="">selected source</var> be null and <var title="">selected
-    pixel density</var> be undefined.</p>
-
-   </li>
-
-   <li><p>⌛ Let the <code><a href=#the-img-element>img</a></code> element's <a href=#last-selected-source>last
-   selected source</a> be <var title="">selected source</var> and
-   the <code><a href=#the-img-element>img</a></code> element's <a href=#current-pixel-density>current pixel density</a>
-   be <var title="">selected pixel density</var>.</li>
-
-   <li>
-
     <p>⌛ If <var title="">selected source</var> is null, then
     set the element to the <a href=#img-error title=img-error>broken</a>
     state, <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
@@ -23811,13 +23838,9 @@
 
    <li>
 
-    <p>⌛ <a href=#resolve-a-url title="resolve a url">Resolve</a> <var title="">selected source</var>, relative to the element.</p>
-
-    <p>If that is not successful, abort these steps.</p>
-
-    <p>Otherwise, do a <a href=#potentially-cors-enabled-fetch>potentially CORS-enabled fetch</a> of
-    the resulting <a href=#absolute-url>absolute URL</a>, 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,
+    <p>Do a <a href=#potentially-cors-enabled-fetch>potentially CORS-enabled fetch</a> 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,
     the <i title="">origin</i> being the <a href=#origin>origin</a> of the
     <code><a href=#the-img-element>img</a></code> element's <code><a href=#document>Document</a></code>, and the
     <i>default origin behaviour</i> set to <i>taint</i>.</p>
@@ -23859,9 +23882,10 @@
     <dl class=switch><dt>If the download was successful</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, 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>
+     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>
 
      <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1222 -->
 

Modified: source
===================================================================
--- source	2012-06-08 21:50:19 UTC (rev 7127)
+++ source	2012-06-11 20:53:26 UTC (rev 7128)
@@ -25449,6 +25449,19 @@
   per CSS inch, and thus if the image data is 300x600, it has an
   intrinsic dimension of 96 CSS pixels by 192 CSS pixels.</p>
 
+  <p>Each <code>Document</code> object must have a <dfn>list of
+  available images</dfn>. Each image in this list is identified by a
+  tuple consisting of an <span>absolute URL</span>, a <span>CORS
+  settings attribute</span> mode, and, if the mode is not <span
+  title="attr-crossorigin-none">No CORS</span>, an
+  <span>origin</span>. User agents may copy entries from one
+  <code>Document</code> object's <span>list of available images</span>
+  to another at any time (e.g. when the <code>Document</code> is
+  created, user agents can add to it all the images that are loaded in
+  other <code>Document</code>s), but must not change the keys of
+  entries copied in this way when doing so. User agents may also
+  remove images from such lists at any time (e.g. to save memory).</p>
+
   <p>When the user agent is to <dfn>update the image data</dfn> of an
   <code>img</code> element, it must run the following steps:</p>
 
@@ -25469,6 +25482,53 @@
    <li><p>If the user agent cannot support images, or its support for
    images has been disabled, then abort these steps.</p></li>
 
+   <li>
+
+<!--END w3c-html-->
+
+    <p>If the element has a <code
+    title="attr-img-srcset">srcset</code> attribute specified, then
+    let <var title="">selected source</var> and <var title="">selected
+    pixel density</var> be the URL and pixel density that results from
+    <span>processing the image candidates</span>, respectively.
+
+<!--START w3c-html-->
+
+    Otherwise, if the element has a <code
+    title="attr-img-src">src</code> attribute specified and its value
+    is not the empty string, let <var title="">selected source</var>
+    be the value of the element's <code
+    title="attr-img-src">src</code> attribute, and <var
+    title="">selected pixel density</var> be 1.0. Otherwise, let <var
+    title="">selected source</var> be null and <var title="">selected
+    pixel density</var> be undefined.</p>
+
+   </li>
+
+   <li><p>Let the <code>img</code> element's <span>last selected
+   source</span> be <var title="">selected source</var> and the
+   <code>img</code> element's <span>current pixel density</span> be
+   <var title="">selected pixel density</var>.</p></li>
+
+   <li><p><span title="resolve a url">Resolve</span> <var
+   title="">selected source</var>, relative to the element. If that is
+   not successful, abort these steps.</p></li>
+
+   <li><p>Let <var title="">key</var> be a tuple consisting of the
+   resulting <span>absolute URL</span>, the <code>img</code> element's
+   <code title="attr-crossorigin">crossorigin</code> attribute's mode,
+   and, if that mode is not <span title="attr-crossorigin-none">No
+   CORS</span>, the <code>Document</code> object's
+   <span>origin</span>.</p></li>
+
+   <li><p>If the <span>list of available images</span>, contains an
+   entry for <var title="">key</var>, then set the <code>img</code>
+   element to the <span title="img-all">completely available</span>
+   state, update the presentation of the image appropriately,
+   <span>queue a task</span> to <span>fire a simple event</span> named
+   <code title="event-load">load</code> at the <code>img</code>
+   element, and abort these steps.</p></li>
+
    <li><p>Asynchronously <span>await a stable state</span>, allowing
    the <span title="concept-task">task</span> that invoked this
    algorithm to continue. The <span>synchronous section</span>
@@ -25480,8 +25540,8 @@
    <li>
 
     <p>&#x231B; If another instance of this algorithm for this
-    <code>img</code> element was started after this instance, then
-    abort these steps.</p>
+    <code>img</code> element was started after this instance (even if
+    it aborted and is no longer running), then abort these steps.</p>
 
     <p class="note">Only the last instance takes effect, to avoid
     multiple requests when, for example, the
@@ -25496,36 +25556,6 @@
 
    <li>
 
-    <p>&#x231B;
-
-<!--END w3c-html-->
-
-    If the element has a <code title="attr-img-srcset">srcset</code>
-    attribute specified, then let <var title="">selected source</var>
-    and <var title="">selected pixel density</var> be the URL and
-    pixel density that results from <span>processing the image
-    candidates</span>, respectively.
-
-<!--START w3c-html-->
-
-    Otherwise, if the element has a <code
-    title="attr-img-src">src</code> attribute specified and its value
-    is not the empty string, let <var title="">selected source</var>
-    be the value of the element's <code
-    title="attr-img-src">src</code> attribute, and <var
-    title="">selected pixel density</var> be 1.0. Otherwise, let <var
-    title="">selected source</var> be null and <var title="">selected
-    pixel density</var> be undefined.</p>
-
-   </li>
-
-   <li><p>&#x231B; Let the <code>img</code> element's <span>last
-   selected source</span> be <var title="">selected source</var> and
-   the <code>img</code> element's <span>current pixel density</span>
-   be <var title="">selected pixel density</var>.</p></li>
-
-   <li>
-
     <p>&#x231B; If <var title="">selected source</var> is null, then
     set the element to the <span title="img-error">broken</span>
     state, <span>queue a task</span> to <span>fire a simple
@@ -25536,14 +25566,9 @@
 
    <li>
 
-    <p>&#x231B; <span title="resolve a url">Resolve</span> <var
-    title="">selected source</var>, relative to the element.</p>
-
-    <p>If that is not successful, abort these steps.</p>
-
-    <p>Otherwise, do a <span>potentially CORS-enabled fetch</span> of
-    the resulting <span>absolute URL</span>, with the <i>mode</i>
-    being the state of the element's <code
+    <p>Do a <span>potentially CORS-enabled fetch</span> 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
     title="attr-img-crossorigin">crossorigin</code> content attribute,
     the <i title="">origin</i> being the <span>origin</span> of the
     <code>img</code> element's <code>Document</code>, and the
@@ -25597,9 +25622,11 @@
 
      <dd>Set the <code>img</code> element to the <span
      title="img-all">completely available</span> state, update the
-     presentation of the image appropriately, and <span>fire a simple
-     event</span> named <code title="event-load">load</code> at the
-     <code>img</code> element.</dd>
+     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>
 
      <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1222 -->
 




More information about the Commit-Watchers mailing list