[html5] r1021 - /

whatwg at whatwg.org whatwg at whatwg.org
Wed Sep 19 22:00:22 PDT 2007


Author: ianh
Date: 2007-09-19 22:00:22 -0700 (Wed, 19 Sep 2007)
New Revision: 1021

Modified:
   index
   source
Log:
[] (0) Update the template section to handle failures during loads; handle dynamic changes of template trees. Still to do: expansion of strings, definition of how to handle selections.

Modified: index
===================================================================
--- index	2007-09-19 22:55:44 UTC (rev 1020)
+++ index	2007-09-20 05:00:22 UTC (rev 1021)
@@ -22,7 +22,7 @@
 
    <h1 id=html-5>HTML 5</h1>
 
-   <h2 class="no-num no-toc" id=working>Working Draft — 19 September
+   <h2 class="no-num no-toc" id=working>Working Draft — 20 September
     2007</h2>
 
    <p>You can take part in this work. <a
@@ -23333,6 +23333,12 @@
    title=attr-template><a href="#template">template</a></code> attribute is
    set to a usable value, and is unset when the attribute is removed.
 
+  <p class=note>The <code title=dom-originalContent><a
+   href="#originalcontent">originalContent</a></code> DOM attribute can thus
+   be used as an indicator of whether a template is currently being applied,
+   just as the <code title=dom-templateElement><a
+   href="#templateelement">templateElement</a></code> DOM attribute can.
+
   <h5 id=the-template><span class=secno>3.19.6.2. </span>The <code
    title=attr-template><a href="#template">template</a></code> attribute</h5>
 
@@ -23347,10 +23353,18 @@
    <span>scripting disabled</span><!-- XXX
   xref -->) to obtain a DOM. If
    the URI is the same as the URI of the current document<!-- XXX xref -->,
-   then the current document's DOM is assumed to be that parsed DOM. While
-   this loading and parsing is in progress, the element is said to be
+   then the current document's DOM must be assumed to be that parsed DOM.
+   While this loading and parsing is in progress, the element is said to be
    <em>busy loading the template rules or data</em>.
 
+  <p>If the resource specified by the <code title=attr-template><a
+   href="#template">template</a></code> attribute is not the current
+   document<!-- XXX xref --> and does not have an XML MIME type, or if an XML
+   parse error is found while parsing the resource, then the resource cannot
+   be successfully parsed, and the user agent must jump to the <a
+   href="#failed" title=datatemplate-template-failed>failed to parse</a>
+   steps below.
+
   <p>Once the DOM in question has been parsed, assuming that it indeed can be
    parsed and does so successfully, the user agent must wait for no scripts
    to be executing, and as soon as that opportunity
@@ -23377,7 +23391,7 @@
      href="#templateelement">templateElement</a></code> DOM attribute to that
      element.</p>
 
-    <p>Otherwise, jump to the <a href="#fails"
+    <p>Otherwise, jump to the <a href="#failed"
      title=datatemplate-template-failed>failed to parse</a> steps below.</p>
 
    <li>
@@ -23392,9 +23406,12 @@
      title=datatemplate-regen>updating the generated content</a>.
   </ol>
 
-  <p class=big-issue>what if it <dfn id=fails
-   title=datatemplate-template-failed>fails to parse</dfn>, check MIME types,
-   target isn't a datatemplate, etc; kill generated content if any
+  <p>If the resource has <dfn id=failed
+   title=datatemplate-template-failed>failed to parse</dfn>, the user agent
+   must <a href="#firing2">fire a simple event</a> with the name <code
+   title=event-error><a href="#error1">error</a></code> at the element on
+   which the <code title=attr-template><a
+   href="#template">template</a></code> attribute was found.
 
   <p><dfn id=unsetting title=datatemplate-template-unset>Unsetting</dfn>:
    When an <span>HTML element</span> with a <code title=attr-template><a
@@ -23465,6 +23482,14 @@
    this loading and parsing is in progress, the element is said to be
    <em>busy loading the template rules or data</em>.
 
+  <p>If the resource specified by the <code title=attr-ref><a
+   href="#ref">ref</a></code> attribute is not the current
+   document<!-- XXX xref --> and does not have an XML MIME type, or if an XML
+   parse error is found while parsing the resource, then the resource cannot
+   be successfully parsed, and the user agent must jump to the <a
+   href="#failed0" title=datatemplate-ref-failed>failed to parse</a> steps
+   below.
+
   <p>Once the DOM in question has been parsed, assuming that it indeed can be
    parsed and does so successfully, the user agent must wait for no scripts
    to be executing, and as soon as that opportunity
@@ -23484,7 +23509,7 @@
      <code title=dom-refNode><a href="#refnode">refNode</a></code> DOM
      attribute to that element.</p>
 
-    <p>Otherwise, jump to the <a href="#fails0"
+    <p>Otherwise, jump to the <a href="#failed0"
      title=datatemplate-ref-failed>failed to parse</a> steps below.</p>
 
    <li>
@@ -23492,9 +23517,14 @@
      title=datatemplate-regen>updating the generated content</a>.
   </ol>
 
-  <p class=big-issue>what if it <dfn id=fails0
-   title=datatemplate-ref-failed>fails to parse</dfn>, check MIME types, frag
-   ID doesn't match, etc; kill generated content if any
+  <p>If the resource has <dfn id=failed0 title=datatemplate-ref-failed>failed
+   to parse</dfn>, the user agent must <a href="#firing2">fire a simple
+   event</a> with the name <code title=event-error><a
+   href="#error1">error</a></code> at the element on which the <code
+   title=attr-ref><a href="#ref">ref</a></code> attribute was found, and must
+   then jump to the steps below for <a href="#update"
+   title=datatemplate-regen>updating the generated content</a> (the contents
+   of the element will be used instead of the specified resource).
 
   <p><dfn id=unsetting0 title=datatemplate-ref-unset>Unsetting</dfn>: When an
    <span>HTML element</span> with a <code title=attr-ref><a
@@ -23511,7 +23541,9 @@
     <p>If the <code title=attr-ref><a href="#ref">ref</a></code> attribute
      was changed (as opposed to simply removed), then <a href="#setting0"
      title=datatemplate-ref-set>act as if it was now set to its new value</a>
-     (fetching the specified page, etc, as described above).
+     (fetching the specified page, etc, as described above). Otherwise, jump
+     to the steps below for <a href="#update"
+     title=datatemplate-regen>updating the generated content</a>.
   </ol>
 
   <p>The <dfn id=refnode title=dom-refNode><code>refNode</code></dfn> DOM
@@ -23563,6 +23595,29 @@
    user agent must <span>update the generated content</span> of all of that
    node's <a href="#data-tree" title="data tree user">data tree users</a>.
 
+  <p>An element with a non-null <code title=dom-templateElement><a
+   href="#templateelement">templateElement</a></code> is also said to be a
+   <dfn id=template1>template tree user</dfn> of the node identified by the
+   element's <code title=dom-templateElement><a
+   href="#templateelement">templateElement</a></code> attribute, as well as
+   all of that node's children.
+
+  <p>Nodes that have one or more <a href="#template1" title="template tree
+   user">template tree users</a> associated with them (as per the previous
+   paragraph) are themselves termed <dfn id=template2 title="template tree
+   component node">template tree component nodes</dfn>.
+
+  <p>Whenever a <a href="#template2">template tree component node</a> changes
+   its name or value, or has one of its attributes change name or value, or
+   has an attribute added or removed, or has a child added or removed, the
+   user agent must <span>update the generated content</span> of all of that
+   node's <a href="#template1" title="template tree user">template tree
+   users</a>.
+
+  <p class=note>In other words, user agents update the content generated from
+   a template whenever either the backing data changes or the template itself
+   changes.
+
   <h5 id=updating0><span class=secno>3.19.6.6. </span>Updating the generated
    content</h5>
 

Modified: source
===================================================================
--- source	2007-09-19 22:55:44 UTC (rev 1020)
+++ source	2007-09-20 05:00:22 UTC (rev 1021)
@@ -20937,7 +20937,14 @@
   <code title="attr-template">template</code> attribute is set to a
   usable value, and is unset when the attribute is removed.</p>
 
+  <p class="note">The <code
+  title="dom-originalContent">originalContent</code> DOM attribute can
+  thus be used as an indicator of whether a template is currently
+  being applied, just as the <code
+  title="dom-templateElement">templateElement</code> DOM attribute
+  can.</p>
 
+
   <h5>The <code title="attr-template">template</code> attribute</h5>
 
   <p><dfn title="datatemplate-template-set">Setting</dfn>: When an
@@ -20949,10 +20956,18 @@
   context</span>, and with <span>scripting disabled</span><!-- XXX
   xref -->) to obtain a DOM. If the URI is the same as the URI of the
   current document<!-- XXX xref -->, then the current document's DOM
-  is assumed to be that parsed DOM. While this loading and parsing is
-  in progress, the element is said to be <em>busy loading the template
-  rules or data</em>.</p>
+  must be assumed to be that parsed DOM. While this loading and
+  parsing is in progress, the element is said to be <em>busy loading
+  the template rules or data</em>.</p>
 
+  <p>If the resource specified by the <code
+  title="attr-template">template</code> attribute is not the current
+  document<!-- XXX xref --> and does not have an XML MIME type, or if
+  an XML parse error is found while parsing the resource, then the
+  resource cannot be successfully parsed, and the user agent must jump
+  to the <span title="datatemplate-template-failed">failed to
+  parse</span> steps below.</p>
+
   <p>Once the DOM in question has been parsed, assuming that it indeed
   can be parsed and does so successfully, the user agent must wait for
   no scripts to be executing, and as soon as that opportunity
@@ -20998,10 +21013,11 @@
 
   </ol>
 
-  <p class="big-issue">what if it <dfn
-  title="datatemplate-template-failed">fails to parse</dfn>, check
-  MIME types, target isn't a datatemplate, etc; kill generated
-  content if any</p>
+  <p>If the resource has <dfn
+  title="datatemplate-template-failed">failed to parse</dfn>, the user
+  agent must <span>fire a simple event</span> with the name <code
+  title="event-error">error</code> at the element on which the <code
+  title="attr-template">template</code> attribute was found.</p>
 
   <p><dfn title="datatemplate-template-unset">Unsetting</dfn>: When an
   <span>HTML element</span> with a <code
@@ -21073,6 +21089,14 @@
   element is said to be <em>busy loading the template rules or
   data</em>.</p>
 
+  <p>If the resource specified by the <code
+  title="attr-ref">ref</code> attribute is not the current
+  document<!-- XXX xref --> and does not have an XML MIME type, or if
+  an XML parse error is found while parsing the resource, then the
+  resource cannot be successfully parsed, and the user agent must jump
+  to the <span title="datatemplate-ref-failed">failed to parse</span>
+  steps below.</p>
+
   <p>Once the DOM in question has been parsed, assuming that it indeed
   can be parsed and does so successfully, the user agent must wait for
   no scripts to be executing, and as soon as that opportunity
@@ -21106,9 +21130,14 @@
 
   </ol>
 
-  <p class="big-issue">what if it <dfn
-  title="datatemplate-ref-failed">fails to parse</dfn>, check MIME
-  types, frag ID doesn't match, etc; kill generated content if any</p>
+  <p>If the resource has <dfn
+  title="datatemplate-ref-failed">failed to parse</dfn>, the user
+  agent must <span>fire a simple event</span> with the name <code
+  title="event-error">error</code> at the element on which the <code
+  title="attr-ref">ref</code> attribute was found, and must then jump
+  to the steps below for <span title="datatemplate-regen">updating the
+  generated content</span> (the contents of the element will be used
+  instead of the specified resource).</p>
 
   <p><dfn title="datatemplate-ref-unset">Unsetting</dfn>: When an
   <span>HTML element</span> with a <code title="attr-ref">ref</code>
@@ -21125,7 +21154,9 @@
    changed (as opposed to simply removed), then <span
    title="datatemplate-ref-set">act as if it was now set to its new
    value</span> (fetching the specified page, etc, as described
-   above).</p></li>
+   above). Otherwise, jump to the steps below for <span
+   title="datatemplate-regen">updating the generated
+   content</span>.</p></li>
 
   </ol>
 
@@ -21179,9 +21210,31 @@
   or value, or has one of its attributes change name or value, or has
   an attribute added or removed, or has a child added or removed, the
   user agent must <span>update the generated content</span> of all of
-  that node's <span title="data tree user">data tree users</span>.
+  that node's <span title="data tree user">data tree users</span>.</p>
 
+  <p>An element with a non-null <code
+  title="dom-templateElement">templateElement</code> is also said to
+  be a <dfn>template tree user</dfn> of the node identified by the
+  element's <code title="dom-templateElement">templateElement</code>
+  attribute, as well as all of that node's children.</p>
 
+  <p>Nodes that have one or more <span title="template tree
+  user">template tree users</span> associated with them (as per the
+  previous paragraph) are themselves termed <dfn title="template tree
+  component node">template tree component nodes</dfn>.</p>
+
+  <p>Whenever a <span>template tree component node</span> changes its
+  name or value, or has one of its attributes change name or value, or
+  has an attribute added or removed, or has a child added or removed,
+  the user agent must <span>update the generated content</span> of all
+  of that node's <span title="template tree user">template tree
+  users</span>.</p>
+
+  <p class="note">In other words, user agents update the content
+  generated from a template whenever either the backing data changes
+  or the template itself changes.</p>
+
+
   <h5>Updating the generated content</h5>
 
   <p>When the user agent is to <dfn title="datatemplate-regen">update




More information about the Commit-Watchers mailing list