[html5] r2097 - [] (0) More thoroughly make the <img> processing model work with the new fetchin [...]

whatwg at whatwg.org whatwg at whatwg.org
Thu Aug 21 03:25:14 PDT 2008


Author: ianh
Date: 2008-08-21 03:25:12 -0700 (Thu, 21 Aug 2008)
New Revision: 2097

Modified:
   index
   source
Log:
[] (0) More thoroughly make the <img> processing model work with the new fetching and event loop definitions.

Modified: index
===================================================================
--- index	2008-08-21 10:06:12 UTC (rev 2096)
+++ index	2008-08-21 10:25:12 UTC (rev 2097)
@@ -16056,16 +16056,16 @@
    title=origin>cross-origin</a> access control policies that mitigate this
    attack.
 
-  <p>Once the resource has been fetched, if the image is a valid and
-   supported image, then the image is said to be <i>available</i>; the user
-   agent must <a href="#firing4">fire a <code title=event-load>load</code>
-   event</a> on the <code><a href="#img">img</a></code> element (this happens
-   after <code title=dom-img-complete><a href="#complete">complete</a></code>
-   starts returning true). If the fetching process fails without a response
-   from the remote server, or it completes but the image is not a valid or
-   supported image, the user agent must <a href="#firing5">fire an <code
-   title=event-error>error</code> event</a> on the <code><a
-   href="#img">img</a></code> element.
+  <p>If the image's type is a supported image type, and the image is a valid
+   image of that type, then the image is said to be <i>available</i> (this
+   affects exactly what the element represents, as defined below). This can
+   be true even before the image is completely downloaded, if the user agent
+   supports incremental rendering of images; in such cases, each <a
+   href="#tasks" title=concept-task>task</a> that is <a href="#queue"
+   title="queue a task">queued</a> by the <a href="#networking">networking
+   task source</a> while the image is being <a href="#fetch"
+   title=fetch>fetched</a> must update the presentation of the image
+   appropriately.
 
   <p>Whether the image is fetched successfully or not (e.g. whether the
    response code was a 2xx code or equivalent) must be ignored when
@@ -16094,6 +16094,20 @@
   <p>This specification does not specify which image types are to be
    supported.
 
+  <p>The <a href="#tasks" title=concept-task>task</a> that is <a
+   href="#queue" title="queue a task">queued</a> by the <a
+   href="#networking">networking task source</a> once the resource has been
+   <a href="#fetch" title=fetch>fetched</a>, must, if the download was
+   successful and the image is <i>available</i>, <a href="#queue">queue a
+   task</a> to <a href="#firing4">fire a <code title=event-load>load</code>
+   event</a> on the <code><a href="#img">img</a></code> element (this happens
+   after <code title=dom-img-complete><a href="#complete">complete</a></code>
+   starts returning true); and otherwise, if the fetching process fails
+   without a response from the remote server, or completes but the image is
+   not a valid or supported image, <a href="#queue">queue a task</a> to <a
+   href="#firing5">fire an <code title=event-error>error</code> event</a> on
+   the <code><a href="#img">img</a></code> element.
+
   <hr>
 
   <p>What an <code><a href="#img">img</a></code> element represents depends
@@ -16109,9 +16123,9 @@
     <p>The image is either decorative or supplemental to the rest of the
      content, redundant with some other information in the document.</p>
 
-    <p>If the image is available and the user agent is configured to display
-     that image, then the element represents the image specified by the <code
-     title=attr-img-src><a href="#src">src</a></code> attribute.</p>
+    <p>If the image is <i>available</i> and the user agent is configured to
+     display that image, then the element represents the image specified by
+     the <code title=attr-img-src><a href="#src">src</a></code> attribute.</p>
 
     <p>Otherwise, the element represents nothing, and may be omitted
      completely from the rendering. User agents may provide the user with a
@@ -16134,14 +16148,15 @@
      title="">{}</code>"), then even the kind of image being shown is not
      known.</p>
 
-    <p>If the image is available, the element represents the image specified
-     by the <code title=attr-img-src><a href="#src">src</a></code> attribute.</p>
+    <p>If the image is <i>available</i>, the element represents the image
+     specified by the <code title=attr-img-src><a href="#src">src</a></code>
+     attribute.</p>
 
-    <p>If the image is not available or if the user agent is not configured
-     to display the image, then the user agent should display some sort of
-     indicator that the image is not being rendered, and, if possible,
-     provide to the user the information regarding the kind of image that is
-     (as derived from the <code title=attr-img-alt><a
+    <p>If the image is not <i>available</i> or if the user agent is not
+     configured to display the image, then the user agent should display some
+     sort of indicator that the image is not being rendered, and, if
+     possible, provide to the user the information regarding the kind of
+     image that is (as derived from the <code title=attr-img-alt><a
      href="#alt0">alt</a></code> attribute).</p>
 
    <dt>If the <code title=attr-img-src><a href="#src">src</a></code>
@@ -16155,9 +16170,9 @@
      title=attr-img-alt><a href="#alt0">alt</a></code> attribute gives a
      textual equivalent or replacement for the image.</p>
 
-    <p>If the image is available and the user agent is configured to display
-     that image, then the element represents the image specified by the <code
-     title=attr-img-src><a href="#src">src</a></code> attribute.</p>
+    <p>If the image is <i>available</i> and the user agent is configured to
+     display that image, then the element represents the image specified by
+     the <code title=attr-img-src><a href="#src">src</a></code> attribute.</p>
 
     <p>Otherwise, the element represents the text given by the <code
      title=attr-img-alt><a href="#alt0">alt</a></code> attribute. User agents
@@ -16171,12 +16186,13 @@
    <dd>
     <p>The image's role in the document is unknown.</p>
 
-    <p>If the image is available, the element represents the image specified
-     by the <code title=attr-img-src><a href="#src">src</a></code> attribute.</p>
+    <p>If the image is <i>available</i>, the element represents the image
+     specified by the <code title=attr-img-src><a href="#src">src</a></code>
+     attribute.</p>
 
-    <p>If the image is not available or if the user agent is not configured
-     to display the image, then the user agent may display some sort of
-     indicator that the image is not being rendered.</p>
+    <p>If the image is not <i>available</i> or if the user agent is not
+     configured to display the image, then the user agent may display some
+     sort of indicator that the image is not being rendered.</p>
 
    <dt>If the <code title=attr-img-src><a href="#src">src</a></code>
     attribute is not set and the <code title=attr-img-alt><a
@@ -16258,9 +16274,9 @@
    title=dom-img-height><code>height</code></dfn> must return the rendered
    width and height of the image, in CSS pixels, if the image is being
    rendered, and is being rendered to a visual medium; or else the intrinsic
-   with and height of the image, in CSS pixels, if the image is available but
-   not being rendered to a visual medium; or else 0, if the image is not
-   available or its dimensions are not known. <a
+   with and height of the image, in CSS pixels, if the image is
+   <i>available</i> but not being rendered to a visual medium; or else 0, if
+   the image is not <i>available</i> or its dimensions are not known. <a
    href="#refsCSS21">[CSS21]</a>
 
   <p>The DOM attribute <dfn id=complete
@@ -16612,9 +16628,9 @@
 at least that would look good on the cover of a blue book.</p></pre>
 
    <p>This example shows how the alternative text should be written such that
-    if the image isn't available, and the text is used instead, the text
-    flows seamlessly into the surrounding text, as if the image had never
-    been there in the first place.</p>
+    if the image isn't <i>available</i>, and the text is used instead, the
+    text flows seamlessly into the surrounding text, as if the image had
+    never been there in the first place.</p>
   </div>
 
   <h6 id=text-that><span class=secno>4.7.2.1.4. </span>Text that has been

Modified: source
===================================================================
--- source	2008-08-21 10:06:12 UTC (rev 2096)
+++ source	2008-08-21 10:25:12 UTC (rev 2097)
@@ -13541,16 +13541,16 @@
   <span title="origin">cross-origin</span> access control policies
   that mitigate this attack.</p>
 
-  <p>Once the resource has been fetched, if the image is a valid and
-  supported image, then the image is said to be <i>available</i>; the
-  user agent must <span>fire a <code title="event-load">load</code>
-  event</span> on the <code>img</code> element (this happens after
-  <code title="dom-img-complete">complete</code> starts returning
-  true). If the fetching process fails without a response from the
-  remote server, or it completes but the image is not a valid or
-  supported image, the user agent must <span>fire an <code
-  title="event-error">error</code> event</span> on the
-  <code>img</code> element.</p>
+  <p>If the image's type is a supported image type, and the image is a
+  valid image of that type, then the image is said to be
+  <i>available</i> (this affects exactly what the element represents,
+  as defined below). This can be true even before the image is
+  completely downloaded, if the user agent supports incremental
+  rendering of images; in such cases, 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.</p>
 
   <p>Whether the image is fetched successfully or not (e.g. whether
   the response code was a 2xx code or equivalent) must be ignored when
@@ -13579,6 +13579,20 @@
   <p>This specification does not specify which image types are to be
   supported.</p>
 
+  <p>The <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, if the download was successful
+  and the image is <i>available</i>, <span>queue a task</span> to
+  <span>fire a <code title="event-load">load</code> event</span> on
+  the <code>img</code> element (this happens after <code
+  title="dom-img-complete">complete</code> starts returning true); and
+  otherwise, if the fetching process fails without a response from the
+  remote server, or completes but the image is not a valid or
+  supported image, <span>queue a task</span> to <span>fire an <code
+  title="event-error">error</code> event</span> on the
+  <code>img</code> element.</p>
+
   <hr>
 
   <p>What an <code>img</code> element represents depends on the <code
@@ -13597,7 +13611,7 @@
     the content, redundant with some other information in the
     document.</p>
 
-    <p>If the image is available and the user agent is configured to
+    <p>If the image is <i>available</i> and the user agent is configured to
     display that image, then the element represents the image
     specified by the <code title="attr-img-src">src</code>
     attribute.</p>
@@ -13626,11 +13640,11 @@
     title="">{}</code>"), then even the kind of image being shown is
     not known.</p>
 
-    <p>If the image is available, the element represents the image
+    <p>If the image is <i>available</i>, the element represents the image
     specified by the <code title="attr-img-src">src</code>
     attribute.</p>
 
-    <p>If the image is not available or if the user agent is not
+    <p>If the image is not <i>available</i> or if the user agent is not
     configured to display the image, then the user agent should
     display some sort of indicator that the image is not being
     rendered, and, if possible, provide to the user the information
@@ -13650,7 +13664,7 @@
     title="attr-img-alt">alt</code> attribute gives a textual
     equivalent or replacement for the image.</p>
 
-    <p>If the image is available and the user agent is configured to
+    <p>If the image is <i>available</i> and the user agent is configured to
     display that image, then the element represents the image
     specified by the <code title="attr-img-src">src</code>
     attribute.</p>
@@ -13669,11 +13683,11 @@
 
     <p>The image's role in the document is unknown.</p>
 
-    <p>If the image is available, the element represents the image
+    <p>If the image is <i>available</i>, the element represents the image
     specified by the <code title="attr-img-src">src</code>
     attribute.</p>
 
-    <p>If the image is not available or if the user agent is not
+    <p>If the image is not <i>available</i> or if the user agent is not
     configured to display the image, then the user agent may display
     some sort of indicator that the image is not being rendered.</p>
 
@@ -13769,8 +13783,8 @@
   rendered width and height of the image, in CSS pixels, if the image
   is being rendered, and is being rendered to a visual medium; or else
   the intrinsic with and height of the image, in CSS pixels, if the
-  image is available but not being rendered to a visual medium; or
-  else 0, if the image is not available or its dimensions are not
+  image is <i>available</i> but not being rendered to a visual medium; or
+  else 0, if the image is not <i>available</i> or its dimensions are not
   known. <a href="#refsCSS21">[CSS21]</a></p>
 
   <p>The DOM attribute <dfn
@@ -14147,7 +14161,7 @@
 at least that would look good on the cover of a blue book.</p></pre>
 
    <p>This example shows how the alternative text should be written
-   such that if the image isn't available, and the text is used
+   such that if the image isn't <i>available</i>, and the text is used
    instead, the text flows seamlessly into the surrounding text, as
    if the image had never been there in the first place.</p>
 




More information about the Commit-Watchers mailing list