[html5] r3038 - [] (0) Define the ordering of 'load' events in more pedantic detail.

whatwg at whatwg.org whatwg at whatwg.org
Thu Apr 30 00:02:43 PDT 2009


Author: ianh
Date: 2009-04-30 00:02:42 -0700 (Thu, 30 Apr 2009)
New Revision: 3038

Modified:
   index
   source
Log:
[] (0) Define the ordering of 'load' events in more pedantic detail.

Modified: index
===================================================================
--- index	2009-04-30 06:33:03 UTC (rev 3037)
+++ index	2009-04-30 07:02:42 UTC (rev 3038)
@@ -4995,14 +4995,14 @@
 
     </ol></li>
 
-   <li><p>When the resource is available, <a href=#queue-a-task>queue a task</a>
-   that uses the resource as appropriate. If the resource can be
-   processed incrementally, as, for instance, with a progressively
-   interlaced JPEG or an HTML file, multiple tasks may be queued to
-   process the data as it is downloaded. The <a href=#task-source>task source</a>
-   for these tasks is the <a href=#networking-task-source>networking task source</a>.</p>
-   <!-- XXX make sure each use of 'fetch' defines what the appropriate
-   task is -->
+   <li><p>When the resource is available, or if there is an error of
+   some description, <a href=#queue-a-task>queue a task</a> that uses the resource
+   as appropriate. If the resource can be processed incrementally, as,
+   for instance, with a progressively interlaced JPEG or an HTML file,
+   additional tasks may be queued to process the data as it is
+   downloaded. The <a href=#task-source>task source</a> for these tasks is the
+   <a href=#networking-task-source>networking task source</a>.</p> <!-- XXX make sure each
+   use of 'fetch' defines what the appropriate task is -->
 
   </ol><p class=note>The <a href=#application-cache>application cache</a> processing model
   introduces some <a href=#changesToNetworkingModel>changes to the
@@ -10056,20 +10056,30 @@
   followed and 404 responses must cause the external resource to not
   be applied.)</p>
 
+  <!-- similar text in various places -->
+  <p>Fetching external resources must <a href=#delay-the-load-event>delay the load
+  event</a> of the element's document until the <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> (defined
+  below) has been run.</p>
+
   <!-- the next paragraph is similar to text in the <style> section -->
-  <p>Once a resource <em>and any subresources it uses</em> have been
-  <a href=#fetch title=fetch>fetched</a>, if the loads were successful,
-  the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
-  event</a> called <code title=event-load><a href=#event-load>load</a></code> at the
-  <code><a href=#the-link-element>link</a></code> element. If the resource or one of its
-  subresources fails to completely load for any reason (e.g. DNS
-  error, HTTP 404 response, the connection being prematurely closed,
-  unsupported Content-Type), the user agent must instead <a href=#queue-a-task>queue a
-  task</a> to <a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-error><a href=#event-error>error</a></code> at the <code><a href=#the-link-element>link</a></code>
+  <p>The <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, if the loads were successful,
+  <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> called
+  <code title=event-load><a href=#event-load>load</a></code> at the <code><a href=#the-link-element>link</a></code>
+  element; otherwise, if the resource or one of its subresources
+  failed to completely load for any reason (e.g. DNS error, HTTP 404
+  response, a connection being prematurely closed, unsupported
+  Content-Type), it must instead <a href=#queue-a-task>queue a task</a> to
+  <a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-error><a href=#event-error>error</a></code> at the <code><a href=#the-link-element>link</a></code>
   element. Non-network errors in processing the resource or its
   subresources (e.g. CSS parse errors, PNG decoding errors) are not
   failures for the purposes of this paragraph.</p>
 
+  <p>The <a href=#task-source>task source</a> for these tasks is the <a href=#dom-manipulation-task-source>DOM
+  manipulation task source</a>.</p>
+
   <hr><p>Interactive user agents should provide users with a means to
   <a href=#following-hyperlinks title="following hyperlinks">follow the hyperlinks</a>
   created using the <code><a href=#the-link-element>link</a></code> element, somewhere within their
@@ -11043,8 +11053,13 @@
   event</a> called <code title=event-error><a href=#event-error>error</a></code> at the
   <code><a href=#the-style-element>style</a></code> element. Non-network errors in the processing of
   the element's contents or its subresources (e.g. CSS parse errors)
-  are not failures for the purposes of this paragraph.</p>
+  are not failures for the purposes of this paragraph. The
+  <code><a href=#the-style-element>style</a></code> element must <a href=#delay-the-load-event>delay the load event</a> of
+  the element's document until one of these <a href=#concept-task title=concept-task>tasks</a> has been queued.</p>
 
+  <p>The <a href=#task-source>task source</a> for these tasks is the <a href=#dom-manipulation-task-source>DOM
+  manipulation task source</a>.</p>
+
   </div>
 
   <p class=note>This specification does not specify a style system,
@@ -11474,7 +11489,13 @@
 
     </dl></li>
 
-  </ol><p><dfn id=when-a-script-completes-loading>When a script completes loading</dfn>: If the
+  </ol><!-- similar text in various places --><p>Fetching an external script must <a href=#delay-the-load-event>delay the load
+  event</a> of the element's document until the <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> (defined
+  below) has been run.</p>
+
+  <p><dfn id=when-a-script-completes-loading>When a script completes loading</dfn>: If the
   <code><a href=#script>script</a></code> element was added to one of the lists mentioned
   above and the document is still being parsed, then the parser
   handles it. Otherwise, the UA must run the following steps as the
@@ -11577,10 +11598,7 @@
 
     </ol></dd>
 
-  </dl><p>Fetching an external script must <a href=#delay-the-load-event>delay the load
-  event</a> of the element's document.</p>
-
-  <p><dfn id=executing-a-script-block title="executing a script block">Executing a script
+  </dl><p><dfn id=executing-a-script-block title="executing a script block">Executing a script
   block</dfn>: When the steps above require that the script block be
   executed, the user agent must act as follows:</p>
 
@@ -16881,8 +16899,11 @@
   the <i>base URI of the element</i> is the same as <a href="#the-document's-address">the
   document's address</a>.</p>
 
+  <!-- same text in <input type=image> section and similar text elsewhere -->
   <p>Fetching the image must <a href=#delay-the-load-event>delay the load event</a> of the
-  element's document.</p>
+  element's document until the <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> (defined below) has been run.</p>
 
   <p class=warning>This, unfortunately, can be used to perform a
   rudimentary port scan of the user's local network (especially in
@@ -16953,6 +16974,9 @@
   to <a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-error><a href=#event-error>error</a></code> on the <code><a href=#the-img-element>img</a></code>
   element.</p>
 
+  <p>The <a href=#task-source>task source</a> for these tasks is the <a href=#dom-manipulation-task-source>DOM
+  manipulation task source</a>.</p>
+
   <hr><p>What an <code><a href=#the-img-element>img</a></code> element represents depends on the <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute and the <code title=attr-img-alt><a href=#attr-img-alt>alt</a></code> attribute.</p>
 
   <dl class=switch><dt>If the <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute is set
@@ -18669,14 +18693,26 @@
   content</a>, the user agent must <a href=#resolve-a-url title="resolve a
   url">resolve</a> the value of the attribute, relative to the
   element, and if that is successful, should <a href=#fetch>fetch</a> the
-  resulting <a href=#absolute-url>absolute URL</a>, find and instantiate an
-  appropriate <a href=#plugin>plugin</a> based on the <a href=#concept-embed-type title=concept-embed-type>content's type</a>, and hand that
-  <a href=#plugin>plugin</a> the content of the resource, replacing any
+  resulting <a href=#absolute-url>absolute URL</a>. The <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 find
+  and instantiate an appropriate <a href=#plugin>plugin</a> based on the
+  <a href=#concept-embed-type title=concept-embed-type>content's type</a>, and hand
+  that <a href=#plugin>plugin</a> the content of the resource, replacing any
   previously instantiated plugin for the element. <!-- Note that this
   doesn't happen when the base URL changes. --></p>
 
   <p>Fetching the resource must <a href=#delay-the-load-event>delay the load event</a> of
   the element's document.</p>
+  <!-- if we add load/error events, then replace the previous
+  paragraph with the text one: -->
+  <!-- similar text in various places -->
+  <!--<p>Fetching the resource must <span>delay the load event</span>
+  of the element's document until the final <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> has been
+  run.</p>-->
 
   <p>The <dfn id=concept-embed-type title=concept-embed-type>type of the content</dfn>
   being embedded is defined as follows:</p>
@@ -18904,19 +18940,25 @@
       <p>If that is successful, <a href=#fetch>fetch</a> the resulting
       <a href=#absolute-url>absolute URL</a>.</p>
 
-      <p>The fetching of the resource must <a href=#delay-the-load-event>delay the load
-      event</a> of the element's document.</p>
+      <!-- similar text in various places -->
+      <p>Fetching the resource must <a href=#delay-the-load-event>delay the load event</a>
+      of the element's document until the <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>
+      (defined next) has been run.</p>
 
      </li>
 
      <li><p>If the resource is not yet available (e.g. because the
      resource was not available in the cache, so that loading the
      resource required making a request over the network), then jump
-     to the last step in the overall set of steps (fallback). When the
-     resource becomes available, or if the load fails, restart this
-     algorithm from this step. Resources can load incrementally; user
-     agents may opt to consider a resource "available" whenever enough
-     data has been obtained to begin processing the resource.</li>
+     to the last step in the overall set of steps (fallback). The
+     <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 is available must restart this algorithm from
+     this step. Resources can load incrementally; user agents may opt
+     to consider a resource "available" whenever enough data has been
+     obtained to begin processing the resource.</li>
 
      <li><p>If the load failed (e.g. the <a href=#url>URL</a> could not be
      <a href=#resolve-a-url title="resolve a url">resolved</a>, there was an HTTP
@@ -31772,8 +31814,10 @@
    <code title=attr-input-src><a href=#attr-input-src>src</a></code> attribute is set or
    changed.</li> <!-- XXX define changed -->
 
-  </ul><p>Fetching the image must <a href=#delay-the-load-event>delay the load event</a> of the
-  element's document.</p>
+  </ul><!-- same text in <img> section and similar text elsewhere --><p>Fetching the image must <a href=#delay-the-load-event>delay the load event</a> of the
+  element's document until the <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> (defined below) has been run.</p>
 
   <p>If the image was successfully obtained, with no network errors,
   and the image's type is a supported image type, and the image is a

Modified: source
===================================================================
--- source	2009-04-30 06:33:03 UTC (rev 3037)
+++ source	2009-04-30 07:02:42 UTC (rev 3038)
@@ -4710,14 +4710,14 @@
 
    </li>
 
-   <li><p>When the resource is available, <span>queue a task</span>
-   that uses the resource as appropriate. If the resource can be
-   processed incrementally, as, for instance, with a progressively
-   interlaced JPEG or an HTML file, multiple tasks may be queued to
-   process the data as it is downloaded. The <span>task source</span>
-   for these tasks is the <span>networking task source</span>.</p>
-   <!-- XXX make sure each use of 'fetch' defines what the appropriate
-   task is -->
+   <li><p>When the resource is available, or if there is an error of
+   some description, <span>queue a task</span> that uses the resource
+   as appropriate. If the resource can be processed incrementally, as,
+   for instance, with a progressively interlaced JPEG or an HTML file,
+   additional tasks may be queued to process the data as it is
+   downloaded. The <span>task source</span> for these tasks is the
+   <span>networking task source</span>.</p> <!-- XXX make sure each
+   use of 'fetch' defines what the appropriate task is -->
 
   </ol>
 
@@ -10546,21 +10546,34 @@
   followed and 404 responses must cause the external resource to not
   be applied.)</p>
 
+  <!-- similar text in various places -->
+  <p>Fetching external resources must <span>delay the load
+  event</span> of the element's document until 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> (defined
+  below) has been run.</p>
+
   <!-- the next paragraph is similar to text in the <style> section -->
-  <p>Once a resource <em>and any subresources it uses</em> have been
-  <span title="fetch">fetched</span>, if the loads were successful,
-  the user agent must <span>queue a task</span> to <span>fire a simple
-  event</span> called <code title="event-load">load</code> at the
-  <code>link</code> element. If the resource or one of its
-  subresources fails to completely load for any reason (e.g. DNS
-  error, HTTP 404 response, the connection being prematurely closed,
-  unsupported Content-Type), the user agent must instead <span>queue a
-  task</span> to <span>fire a simple event</span> called <code
+  <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 loads were successful,
+  <span>queue a task</span> to <span>fire a simple event</span> called
+  <code title="event-load">load</code> at the <code>link</code>
+  element; otherwise, if the resource or one of its subresources
+  failed to completely load for any reason (e.g. DNS error, HTTP 404
+  response, a connection being prematurely closed, unsupported
+  Content-Type), it must instead <span>queue a task</span> to
+  <span>fire a simple event</span> called <code
   title="event-error">error</code> at the <code>link</code>
   element. Non-network errors in processing the resource or its
   subresources (e.g. CSS parse errors, PNG decoding errors) are not
   failures for the purposes of this paragraph.</p>
 
+  <p>The <span>task source</span> for these tasks is the <span>DOM
+  manipulation task source</span>.</p>
+
   <hr>
 
   <p>Interactive user agents should provide users with a means to
@@ -11693,8 +11706,14 @@
   event</span> called <code title="event-error">error</code> at the
   <code>style</code> element. Non-network errors in the processing of
   the element's contents or its subresources (e.g. CSS parse errors)
-  are not failures for the purposes of this paragraph.</p>
+  are not failures for the purposes of this paragraph. The
+  <code>style</code> element must <span>delay the load event</span> of
+  the element's document until one of these <span
+  title="concept-task">tasks</span> has been queued.</p>
 
+  <p>The <span>task source</span> for these tasks is the <span>DOM
+  manipulation task source</span>.</p>
+
   </div>
 
   <p class="note">This specification does not specify a style system,
@@ -12203,6 +12222,14 @@
 
   </ol>
 
+  <!-- similar text in various places -->
+  <p>Fetching an external script must <span>delay the load
+  event</span> of the element's document until 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> (defined
+  below) has been run.</p>
+
   <p><dfn>When a script completes loading</dfn>: If the
   <code>script</code> element was added to one of the lists mentioned
   above and the document is still being parsed, then the parser
@@ -12323,9 +12350,6 @@
 
   </dl>
 
-  <p>Fetching an external script must <span>delay the load
-  event</span> of the element's document.</p>
-
   <p><dfn title="executing a script block">Executing a script
   block</dfn>: When the steps above require that the script block be
   executed, the user agent must act as follows:</p>
@@ -18113,8 +18137,12 @@
   the <i>base URI of the element</i> is the same as <span>the
   document's address</span>.</p>
 
+  <!-- same text in <input type=image> section and similar text elsewhere -->
   <p>Fetching the image must <span>delay the load event</span> of the
-  element's document.</p>
+  element's document until 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> (defined below) has been run.</p>
 
   <p class="warning">This, unfortunately, can be used to perform a
   rudimentary port scan of the user's local network (especially in
@@ -18192,6 +18220,9 @@
   title="event-error">error</code> on the <code>img</code>
   element.</p>
 
+  <p>The <span>task source</span> for these tasks is the <span>DOM
+  manipulation task source</span>.</p>
+
   <hr>
 
   <p>What an <code>img</code> element represents depends on the <code
@@ -20050,15 +20081,27 @@
   content</span>, the user agent must <span title="resolve a
   url">resolve</span> the value of the attribute, relative to the
   element, and if that is successful, should <span>fetch</span> the
-  resulting <span>absolute URL</span>, find and instantiate an
-  appropriate <span>plugin</span> based on the <span
-  title="concept-embed-type">content's type</span>, and hand that
-  <span>plugin</span> the content of the resource, replacing any
+  resulting <span>absolute URL</span>. 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 find
+  and instantiate an appropriate <span>plugin</span> based on the
+  <span title="concept-embed-type">content's type</span>, and hand
+  that <span>plugin</span> the content of the resource, replacing any
   previously instantiated plugin for the element. <!-- Note that this
   doesn't happen when the base URL changes. --></p>
 
   <p>Fetching the resource must <span>delay the load event</span> of
   the element's document.</p>
+  <!-- if we add load/error events, then replace the previous
+  paragraph with the text one: -->
+  <!-- similar text in various places -->
+  <!--<p>Fetching the resource must <span>delay the load event</span>
+  of the element's document until the final <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> has been
+  run.</p>-->
 
   <p>The <dfn title="concept-embed-type">type of the content</dfn>
   being embedded is defined as follows:</p>
@@ -20315,19 +20358,26 @@
       <p>If that is successful, <span>fetch</span> the resulting
       <span>absolute URL</span>.</p>
 
-      <p>The fetching of the resource must <span>delay the load
-      event</span> of the element's document.</p>
+      <!-- similar text in various places -->
+      <p>Fetching the resource must <span>delay the load event</span>
+      of the element's document until 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>
+      (defined next) has been run.</p>
 
      </li>
 
      <li><p>If the resource is not yet available (e.g. because the
      resource was not available in the cache, so that loading the
      resource required making a request over the network), then jump
-     to the last step in the overall set of steps (fallback). When the
-     resource becomes available, or if the load fails, restart this
-     algorithm from this step. Resources can load incrementally; user
-     agents may opt to consider a resource "available" whenever enough
-     data has been obtained to begin processing the resource.</p></li>
+     to the last step in the overall set of steps (fallback). 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 is available must restart this algorithm from
+     this step. Resources can load incrementally; user agents may opt
+     to consider a resource "available" whenever enough data has been
+     obtained to begin processing the resource.</p></li>
 
      <li><p>If the load failed (e.g. the <span>URL</span> could not be
      <span title="resolve a url">resolved</span>, there was an HTTP
@@ -35439,8 +35489,12 @@
 
   </ul>
 
+  <!-- same text in <img> section and similar text elsewhere -->
   <p>Fetching the image must <span>delay the load event</span> of the
-  element's document.</p>
+  element's document until 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> (defined below) has been run.</p>
 
   <p>If the image was successfully obtained, with no network errors,
   and the image's type is a supported image type, and the image is a




More information about the Commit-Watchers mailing list