[html5] r6277 - [giow] (1) Fix the handling of infinite loops in the various microdata algorithms.

whatwg at whatwg.org whatwg at whatwg.org
Thu Jul 7 14:14:15 PDT 2011


Author: ianh
Date: 2011-07-07 14:14:13 -0700 (Thu, 07 Jul 2011)
New Revision: 6277

Modified:
   complete.html
   index
   source
Log:
[giow] (1) Fix the handling of infinite loops in the various microdata algorithms.

Modified: complete.html
===================================================================
--- complete.html	2011-07-02 00:12:59 UTC (rev 6276)
+++ complete.html	2011-07-07 21:14:13 UTC (rev 6277)
@@ -239,7 +239,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>Web Applications 1.0</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 1 July 2011</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 7 July 2011</h2>
    </hgroup><dl><dt>Multiple-page version:</dt>
     <dd><a href=http://www.whatwg.org/specs/web-apps/current-work/complete/>http://www.whatwg.org/specs/web-apps/current-work/complete/</a></dd>
     <dt>One-page version:</dt>
@@ -56903,7 +56903,15 @@
   <p>The <code title=attr-itemref><a href=#attr-itemref>itemref</a></code> attribute must not
   be specified on elements that do not have an <code title=attr-itemscope><a href=#attr-itemscope>itemscope</a></code> attribute specified.</p>
 
+  <p class=note>The <code title=attr-itemref><a href=#attr-itemref>itemref</a></code>
+  attribute is not part of the microdata data model. It is merely a
+  syntactic construct to aid authors in adding annotations to pages
+  where the data to be annotated does not follow a convenient tree
+  structure. For example, it allows authors to mark up data in a table
+  so that each column defines a separate <a href=#concept-item title=concept-item>item</a>, while keeping the properties in
+  the cells.</p>
 
+
   <h4 id=names:-the-itemprop-attribute><span class=secno>5.2.3 </span>Names: the <dfn title=attr-itemprop><code>itemprop</code></dfn> attribute</h4>
 
   <p>Every <a href=#html-elements title="HTML elements">HTML element</a> may have an
@@ -57092,53 +57100,16 @@
   <h4 id=associating-names-with-items><span class=secno>5.2.5 </span>Associating names with items</h4>
 
   <p>To find <dfn id=the-properties-of-an-item>the properties of an item</dfn> defined by the
-  element <var title="">root</var>, the user agent must try to
-  <a href=#crawl-the-properties>crawl the properties</a> of the element <var title="">root</var>, with an empty list as the value of <var title="">memory</var>: if this fails, then <a href=#the-properties-of-an-item title="the
-  properties of an item">the properties of the item</a> defined by
-  the element <var title="">root</var> is an empty list; otherwise, it
-  is the returned list.</p>
+  element <var title="">root</var>, the user agent must run the
+  following steps. These steps are also used to flag <a href=#microdata-error title="microdata error">microdata errors</a>.</p>
 
-  <p>To <dfn id=crawl-the-properties>crawl the properties</dfn> of an element <var title="">root</var> with a list <var title="">memory</var>, the user
-  agent must run the following steps. These steps either fail or
-  return a list with a count of errors. The count of errors is used as
-  part of the authoring conformance criteria below.</p>
+  <ol><li><p>Let <var title="">results</var>, <var title="">memory</var>, and <var title="">pending</var> be empty lists of elements.</li>
 
-  <ol><li><p>If <var title="">root</var> is in <var title="">memory</var>, then the algorithm fails; abort these
-   steps.</li>
+   <li><p>Add the element <var title="">root</var> to <var title="">memory</var>.</li>
 
-   <li><p><a href=#collect-all-the-elements-in-the-item>Collect all the elements in the item</a> <var title="">root</var>; let <var title="">results</var> be the
-   resulting list of elements, and <var title="">errors</var> be the
-   resulting count of errors.</li>
+   <li><p>Add the child elements of <var title="">root</var>, if any,
+   to <var title="">pending</var>.</li>
 
-   <li><p>Remove any elements from <var title="">results</var> that do
-   not have an <code title=attr-itemprop><a href=#names:-the-itemprop-attribute>itemprop</a></code> attribute
-   specified.</li>
-
-   <li><p>Let <var title="">new memory</var> be a new list consisting
-   of the old list <var title="">memory</var> with the addition of
-   <var title="">root</var>.</li>
-
-   <li><p>For each element in <var title="">results</var> that has an
-   <code title=attr-itemscope><a href=#attr-itemscope>itemscope</a></code> attribute specified,
-   <a href=#crawl-the-properties>crawl the properties</a> of the element, with <var title="">new memory</var> as the memory. If this fails, then remove
-   the element from <var title="">results</var> and increment <var title="">errors</var>. (If it succeeds, the return value is
-   discarded.)</li>
-
-   <li><p>Sort <var title="">results</var> in <a href=#tree-order>tree
-   order</a>.</li>
-
-   <li><p>Return <var title="">results</var> and <var title="">errors</var>.</li>
-
-  </ol><p>To <dfn id=collect-all-the-elements-in-the-item>collect all the elements in the item</dfn> <var title="">root</var>, the user agent must run these steps. They
-  return a list of elements and a count of errors.</p>
-
-  <ol><li><p>Let <var title="">results</var> and <var title="">pending</var> be empty lists of elements.</li>
-
-   <li><p>Let <var title="">errors</var> be zero.</li>
-
-   <li><p>Add all the children elements of <var title="">root</var> to
-   <var title="">pending</var>.</li>
-
    <li><p>If <var title="">root</var> has an <code title=attr-itemref><a href=#attr-itemref>itemref</a></code> attribute, <a href=#split-a-string-on-spaces title="split a
    string on spaces">split the value of that <code title=attr-itemref>itemref</code> attribute on spaces</a>. For
    each resulting token <var title="">ID</var>, if there is an element
@@ -57146,25 +57117,36 @@
    the <a href=#concept-id title=concept-ID>ID</a> <var title="">ID</var>, then
    add the first such element to <var title="">pending</var>.</li>
 
-   <li><p><i>Loop</i>: Remove an element from <var title="">pending</var> and let <var title="">current</var> be that
-   element.</li>
+   <li><p><i>Loop</i>: If <var title="">pending</var> is empty, jump
+   to the step labeled <i>end of loop</i>.</li>
 
-   <li><p>If <var title="">current</var> is already in <var title="">results</var>, increment <var title="">errors</var>.</li>
+   <li><p>Remove an element from <var title="">pending</var> and let
+   <var title="">current</var> be that element.</li>
 
-   <li><p>If <var title="">current</var> is not already in <var title="">results</var> and <var title="">current</var> does not
+   <li><p>If <var title="">current</var> is already in <var title="">memory</var>, there is a <a href=#microdata-error>microdata error</a>;
+   return to the step labeled <i>loop</i>.</li>
+
+   <li><p>Add <var title="">current</var> to <var title="">memory</var>.</li>
+
+   <li><p>If <var title="">current</var> does not
    have an <code title=attr-itemscope><a href=#attr-itemscope>itemscope</a></code> attribute,
    then: add all the child elements of <var title="">current</var> to
    <var title="">pending</var>.</li>
 
-   <li><p>If <var title="">current</var> is not already in <var title="">results</var>, then: add <var title="">current</var> to
-   <var title="">results</var>.</li>
+   <li><p>If <var title="">current</var> has an <code title=attr-itemprop><a href=#names:-the-itemprop-attribute>itemprop</a></code> attribute specified, add it
+   to <var title="">results</var>.</li>
 
-   <li><p><i>End of loop</i>: If <var title="">pending</var> is not
-   empty, return to the step labeled <i>loop</i>.</li>
+   <li><p>Return to the step labeled <i>loop</i>.</li>
 
-   <li><p>Return <var title="">results</var> and <var title="">errors</var>.</li>
+   <li><p><i>End of loop</i>: Sort <var title="">results</var> in
+   <a href=#tree-order>tree order</a>.</li>
 
-  </ol><p>An <a href=#concept-item title=concept-item>item</a> is a <dfn id=top-level-microdata-items title="top-level microdata items">top-level microdata item</dfn> if
+   <li><p>Return <var title="">results</var>.</li>
+
+  </ol><p>A document must not contain any <a href=#concept-item title=concept-item>items</a> for which the algorithm to find
+  <a href=#the-properties-of-an-item>the properties of an item</a> finds any <dfn id=microdata-error title="microdata error">microdata errors</dfn>.</p>
+
+  <p>An <a href=#concept-item title=concept-item>item</a> is a <dfn id=top-level-microdata-items title="top-level microdata items">top-level microdata item</dfn> if
   its element does not have an <code title=attr-itemprop><a href=#names:-the-itemprop-attribute>itemprop</a></code> attribute.</p>
 
   <p>An <a href=#concept-item title=concept-item>item</a> is a <dfn id=used-microdata-items title="used
@@ -57177,20 +57159,17 @@
   <p>All <a href=#concept-item title=concept-item>items</a> in a document must be
   <a href=#used-microdata-items>used microdata items</a>.</p>
 
+  <p>All <code title=attr-itemref><a href=#attr-itemref>itemref</a></code> attributes in a
+  <code><a href=#document>Document</a></code> must be such that there are no cycles in the
+  graph formed from representing each <a href=#concept-item title=concept-item>item</a> in the <code><a href=#document>Document</a></code> as a
+  node in the graph and each <a href=#the-properties-of-an-item title="the properties of an
+  item">property</a> of an item whose <a href=#concept-property-value title=concept-property-value>value</a> is another item as an
+  edge in the graph connecting those two items.</p>
+
   <p>A document must not contain any elements that have an <code title=attr-itemprop><a href=#names:-the-itemprop-attribute>itemprop</a></code> attribute that would not be
   found to be a property of any of the <a href=#concept-item title=concept-item>items</a> in that document were their <a href=#the-properties-of-an-item title="the properties of an item">properties</a> all to be
   determined.</p>
 
-  <p>A document must not contain any <a href=#concept-item title=concept-item>items</a> for which <a href=#crawl-the-properties title="crawl the
-  properties">crawling the properties</a> of the element, with an
-  empty list as the value of <var title="">memory</var>, either fails
-  or returns an error count other than zero.</p>
-
-  <p class=note>The algorithms in this section are especially
-  inefficient, in the interests of keeping them easy to
-  understand. Implementors are strongly encouraged to refactor and
-  optimize them in their user agents.</p>
-
   <div class=example>
 
    <p>In this example, a single license statement is applied to two
@@ -58685,11 +58664,19 @@
 
        <dd>
 
-        <ol><li><p>Let <var title="">value</var> be the result of
-         <a href=#escaping-the-vcard-text-string>escaping the vCard text string</a> obtained from
-         <a href=#extracting-a-vcard>extracting a vCard</a> from the element that
-         represents <var title="">subitem</var>.</li>
+        <ol><li>
 
+          <p>If the user agent is already attempting to <a href=#extracting-a-vcard title="extracting a vCard">extract a vCard</a> from the
+          element that represents <var title="">subitem</var>, then
+          let <var title="">value</var> be the string "<code title="">ERROR</code>".</p>
+
+          <p>Otherwise, let <var title="">value</var> be the result of
+          <a href=#escaping-the-vcard-text-string>escaping the vCard text string</a> obtained from
+          <a href=#extracting-a-vcard>extracting a vCard</a> from the element that
+          represents <var title="">subitem</var>.</p>
+
+         </li>
+
          <li><p>Add a parameter named "<code title="">VALUE</code>"
          whose value is "<code title="">VCARD</code>" to <var title="">parameters</var>.</li>
 
@@ -59976,10 +59963,12 @@
    to JSON.</li>
 
   </ol><p>When the user agent is to <dfn id=get-the-object>get the object</dfn> for an item
-  <var title="">item</var>, it must run the following substeps:</p>
+  <var title="">item</var>, optionally with a list of elements <var title="">memory</var>, it must run the following substeps:</p>
 
   <ol><li><p>Let <var title="">result</var> be an empty object.</li>
 
+   <li><p>Add <var title="">item</var> to <var title="">memory</var>.</li>
+
    <li><p>If the <var title="">item</var> has an <a href=#item-type>item
    type</a>, add an entry to <var title="">result</var> called
    "<code title="">type</code>" whose value is the <a href=#item-type>item
@@ -60003,10 +59992,10 @@
 
     <ol><li><p>Let <var title="">value</var> be the <a href=#concept-property-value title=concept-property-value>property value</a> of <var title="">element</var>.</li>
 
-     <li><p>If <var title="">value</var> is an <a href=#concept-item title=concept-item>item</a>, then <a href=#get-the-object>get the
-     object</a> for <var title="">value</var>, and then replace
-     <var title="">value</var> with the object returned from those
-     steps.</li>
+     <li><p>If <var title="">value</var> is an <a href=#concept-item title=concept-item>item</a>, then: If <var title="">value</var> is in <var title="">memory</var>, then let
+     <var title="">value</var> be the string "<code title="">ERROR</code>". Otherwise, <a href=#get-the-object>get the object</a>
+     for <var title="">value</var>, passing a copy of <var title="">memory</var>, and then replace <var title="">value</var>
+     with the object returned from those steps.</li>
 
      <li>
 
@@ -60169,16 +60158,19 @@
   <var title="">fallback name</var>, it must run the following
   steps:</p>
 
-  <ol><li><p>If there is an entry for <var title="">item</var> in <var title="">memory</var>, then let <var title="">subject</var> be the
-   subject of that entry. Otherwise, if <var title="">item</var> has a
-   <a href=#global-identifier>global identifier</a> and that <a href=#global-identifier>global
-   identifier</a> is an <a href=#absolute-url>absolute URL</a>, let <var title="">subject</var> be that <a href=#global-identifier>global
-   identifier</a>. Otherwise, let <var title="">subject</var> be a
-   new blank node.</li>
+  <ol><li><p>If there is an entry for the item <var title="">item</var>
+   in <var title="">memory</var>, then return the subject of that
+   entry and abort these steps.</li>
 
-   <li><p>Add a mapping from <var title="">item</var> to <var title="">subject</var> in <var title="">memory</var>, if there
-   isn't one already.</li>
+   <li><p>If <var title="">item</var> has a <a href=#global-identifier>global
+   identifier</a> and that <a href=#global-identifier>global identifier</a> is an
+   <a href=#absolute-url>absolute URL</a>, let <var title="">subject</var> be that
+   <a href=#global-identifier>global identifier</a>. Otherwise, let <var title="">subject</var> be a new blank node.</li>
 
+   <li><p>Add a mapping from the item <var title="">item</var> to the
+   subject <var title="">subject</var> in <var title="">memory</var>,
+   if there isn't one already.</li>
+
    <li><p>If <var title="">item</var> has an <a href=#item-type>item type</a>
    and that <a href=#item-type>item type</a> is an <a href=#absolute-url>absolute URL</a>,
    let <var title="">type</var> be that <a href=#item-type>item
@@ -60265,7 +60257,7 @@
 
        <!-- could support <time> here somehow, though we'd have to
        reserialise it, check if the <time> was valid, check if it had a
-       date, a time, a timezone, etc. -->
+       date, a time, a timezone, etc. (<code>time</code>) -->
 
        <li><p>Otherwise, if <var title="">element</var> is not one of
        the <a href=#url-property-elements>URL property elements</a>, let <var title="">value</var> be a plain literal, with the language

Modified: index
===================================================================
--- index	2011-07-02 00:12:59 UTC (rev 6276)
+++ index	2011-07-07 21:14:13 UTC (rev 6277)
@@ -243,7 +243,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 1 July 2011</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 7 July 2011</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>
@@ -56775,7 +56775,15 @@
   <p>The <code title=attr-itemref><a href=#attr-itemref>itemref</a></code> attribute must not
   be specified on elements that do not have an <code title=attr-itemscope><a href=#attr-itemscope>itemscope</a></code> attribute specified.</p>
 
+  <p class=note>The <code title=attr-itemref><a href=#attr-itemref>itemref</a></code>
+  attribute is not part of the microdata data model. It is merely a
+  syntactic construct to aid authors in adding annotations to pages
+  where the data to be annotated does not follow a convenient tree
+  structure. For example, it allows authors to mark up data in a table
+  so that each column defines a separate <a href=#concept-item title=concept-item>item</a>, while keeping the properties in
+  the cells.</p>
 
+
   <h4 id=names:-the-itemprop-attribute><span class=secno>5.2.3 </span>Names: the <dfn title=attr-itemprop><code>itemprop</code></dfn> attribute</h4>
 
   <p>Every <a href=#html-elements title="HTML elements">HTML element</a> may have an
@@ -56964,53 +56972,16 @@
   <h4 id=associating-names-with-items><span class=secno>5.2.5 </span>Associating names with items</h4>
 
   <p>To find <dfn id=the-properties-of-an-item>the properties of an item</dfn> defined by the
-  element <var title="">root</var>, the user agent must try to
-  <a href=#crawl-the-properties>crawl the properties</a> of the element <var title="">root</var>, with an empty list as the value of <var title="">memory</var>: if this fails, then <a href=#the-properties-of-an-item title="the
-  properties of an item">the properties of the item</a> defined by
-  the element <var title="">root</var> is an empty list; otherwise, it
-  is the returned list.</p>
+  element <var title="">root</var>, the user agent must run the
+  following steps. These steps are also used to flag <a href=#microdata-error title="microdata error">microdata errors</a>.</p>
 
-  <p>To <dfn id=crawl-the-properties>crawl the properties</dfn> of an element <var title="">root</var> with a list <var title="">memory</var>, the user
-  agent must run the following steps. These steps either fail or
-  return a list with a count of errors. The count of errors is used as
-  part of the authoring conformance criteria below.</p>
+  <ol><li><p>Let <var title="">results</var>, <var title="">memory</var>, and <var title="">pending</var> be empty lists of elements.</li>
 
-  <ol><li><p>If <var title="">root</var> is in <var title="">memory</var>, then the algorithm fails; abort these
-   steps.</li>
+   <li><p>Add the element <var title="">root</var> to <var title="">memory</var>.</li>
 
-   <li><p><a href=#collect-all-the-elements-in-the-item>Collect all the elements in the item</a> <var title="">root</var>; let <var title="">results</var> be the
-   resulting list of elements, and <var title="">errors</var> be the
-   resulting count of errors.</li>
+   <li><p>Add the child elements of <var title="">root</var>, if any,
+   to <var title="">pending</var>.</li>
 
-   <li><p>Remove any elements from <var title="">results</var> that do
-   not have an <code title=attr-itemprop><a href=#names:-the-itemprop-attribute>itemprop</a></code> attribute
-   specified.</li>
-
-   <li><p>Let <var title="">new memory</var> be a new list consisting
-   of the old list <var title="">memory</var> with the addition of
-   <var title="">root</var>.</li>
-
-   <li><p>For each element in <var title="">results</var> that has an
-   <code title=attr-itemscope><a href=#attr-itemscope>itemscope</a></code> attribute specified,
-   <a href=#crawl-the-properties>crawl the properties</a> of the element, with <var title="">new memory</var> as the memory. If this fails, then remove
-   the element from <var title="">results</var> and increment <var title="">errors</var>. (If it succeeds, the return value is
-   discarded.)</li>
-
-   <li><p>Sort <var title="">results</var> in <a href=#tree-order>tree
-   order</a>.</li>
-
-   <li><p>Return <var title="">results</var> and <var title="">errors</var>.</li>
-
-  </ol><p>To <dfn id=collect-all-the-elements-in-the-item>collect all the elements in the item</dfn> <var title="">root</var>, the user agent must run these steps. They
-  return a list of elements and a count of errors.</p>
-
-  <ol><li><p>Let <var title="">results</var> and <var title="">pending</var> be empty lists of elements.</li>
-
-   <li><p>Let <var title="">errors</var> be zero.</li>
-
-   <li><p>Add all the children elements of <var title="">root</var> to
-   <var title="">pending</var>.</li>
-
    <li><p>If <var title="">root</var> has an <code title=attr-itemref><a href=#attr-itemref>itemref</a></code> attribute, <a href=#split-a-string-on-spaces title="split a
    string on spaces">split the value of that <code title=attr-itemref>itemref</code> attribute on spaces</a>. For
    each resulting token <var title="">ID</var>, if there is an element
@@ -57018,25 +56989,36 @@
    the <a href=#concept-id title=concept-ID>ID</a> <var title="">ID</var>, then
    add the first such element to <var title="">pending</var>.</li>
 
-   <li><p><i>Loop</i>: Remove an element from <var title="">pending</var> and let <var title="">current</var> be that
-   element.</li>
+   <li><p><i>Loop</i>: If <var title="">pending</var> is empty, jump
+   to the step labeled <i>end of loop</i>.</li>
 
-   <li><p>If <var title="">current</var> is already in <var title="">results</var>, increment <var title="">errors</var>.</li>
+   <li><p>Remove an element from <var title="">pending</var> and let
+   <var title="">current</var> be that element.</li>
 
-   <li><p>If <var title="">current</var> is not already in <var title="">results</var> and <var title="">current</var> does not
+   <li><p>If <var title="">current</var> is already in <var title="">memory</var>, there is a <a href=#microdata-error>microdata error</a>;
+   return to the step labeled <i>loop</i>.</li>
+
+   <li><p>Add <var title="">current</var> to <var title="">memory</var>.</li>
+
+   <li><p>If <var title="">current</var> does not
    have an <code title=attr-itemscope><a href=#attr-itemscope>itemscope</a></code> attribute,
    then: add all the child elements of <var title="">current</var> to
    <var title="">pending</var>.</li>
 
-   <li><p>If <var title="">current</var> is not already in <var title="">results</var>, then: add <var title="">current</var> to
-   <var title="">results</var>.</li>
+   <li><p>If <var title="">current</var> has an <code title=attr-itemprop><a href=#names:-the-itemprop-attribute>itemprop</a></code> attribute specified, add it
+   to <var title="">results</var>.</li>
 
-   <li><p><i>End of loop</i>: If <var title="">pending</var> is not
-   empty, return to the step labeled <i>loop</i>.</li>
+   <li><p>Return to the step labeled <i>loop</i>.</li>
 
-   <li><p>Return <var title="">results</var> and <var title="">errors</var>.</li>
+   <li><p><i>End of loop</i>: Sort <var title="">results</var> in
+   <a href=#tree-order>tree order</a>.</li>
 
-  </ol><p>An <a href=#concept-item title=concept-item>item</a> is a <dfn id=top-level-microdata-items title="top-level microdata items">top-level microdata item</dfn> if
+   <li><p>Return <var title="">results</var>.</li>
+
+  </ol><p>A document must not contain any <a href=#concept-item title=concept-item>items</a> for which the algorithm to find
+  <a href=#the-properties-of-an-item>the properties of an item</a> finds any <dfn id=microdata-error title="microdata error">microdata errors</dfn>.</p>
+
+  <p>An <a href=#concept-item title=concept-item>item</a> is a <dfn id=top-level-microdata-items title="top-level microdata items">top-level microdata item</dfn> if
   its element does not have an <code title=attr-itemprop><a href=#names:-the-itemprop-attribute>itemprop</a></code> attribute.</p>
 
   <p>An <a href=#concept-item title=concept-item>item</a> is a <dfn id=used-microdata-items title="used
@@ -57049,20 +57031,17 @@
   <p>All <a href=#concept-item title=concept-item>items</a> in a document must be
   <a href=#used-microdata-items>used microdata items</a>.</p>
 
+  <p>All <code title=attr-itemref><a href=#attr-itemref>itemref</a></code> attributes in a
+  <code><a href=#document>Document</a></code> must be such that there are no cycles in the
+  graph formed from representing each <a href=#concept-item title=concept-item>item</a> in the <code><a href=#document>Document</a></code> as a
+  node in the graph and each <a href=#the-properties-of-an-item title="the properties of an
+  item">property</a> of an item whose <a href=#concept-property-value title=concept-property-value>value</a> is another item as an
+  edge in the graph connecting those two items.</p>
+
   <p>A document must not contain any elements that have an <code title=attr-itemprop><a href=#names:-the-itemprop-attribute>itemprop</a></code> attribute that would not be
   found to be a property of any of the <a href=#concept-item title=concept-item>items</a> in that document were their <a href=#the-properties-of-an-item title="the properties of an item">properties</a> all to be
   determined.</p>
 
-  <p>A document must not contain any <a href=#concept-item title=concept-item>items</a> for which <a href=#crawl-the-properties title="crawl the
-  properties">crawling the properties</a> of the element, with an
-  empty list as the value of <var title="">memory</var>, either fails
-  or returns an error count other than zero.</p>
-
-  <p class=note>The algorithms in this section are especially
-  inefficient, in the interests of keeping them easy to
-  understand. Implementors are strongly encouraged to refactor and
-  optimize them in their user agents.</p>
-
   <div class=example>
 
    <p>In this example, a single license statement is applied to two
@@ -58557,11 +58536,19 @@
 
        <dd>
 
-        <ol><li><p>Let <var title="">value</var> be the result of
-         <a href=#escaping-the-vcard-text-string>escaping the vCard text string</a> obtained from
-         <a href=#extracting-a-vcard>extracting a vCard</a> from the element that
-         represents <var title="">subitem</var>.</li>
+        <ol><li>
 
+          <p>If the user agent is already attempting to <a href=#extracting-a-vcard title="extracting a vCard">extract a vCard</a> from the
+          element that represents <var title="">subitem</var>, then
+          let <var title="">value</var> be the string "<code title="">ERROR</code>".</p>
+
+          <p>Otherwise, let <var title="">value</var> be the result of
+          <a href=#escaping-the-vcard-text-string>escaping the vCard text string</a> obtained from
+          <a href=#extracting-a-vcard>extracting a vCard</a> from the element that
+          represents <var title="">subitem</var>.</p>
+
+         </li>
+
          <li><p>Add a parameter named "<code title="">VALUE</code>"
          whose value is "<code title="">VCARD</code>" to <var title="">parameters</var>.</li>
 
@@ -59848,10 +59835,12 @@
    to JSON.</li>
 
   </ol><p>When the user agent is to <dfn id=get-the-object>get the object</dfn> for an item
-  <var title="">item</var>, it must run the following substeps:</p>
+  <var title="">item</var>, optionally with a list of elements <var title="">memory</var>, it must run the following substeps:</p>
 
   <ol><li><p>Let <var title="">result</var> be an empty object.</li>
 
+   <li><p>Add <var title="">item</var> to <var title="">memory</var>.</li>
+
    <li><p>If the <var title="">item</var> has an <a href=#item-type>item
    type</a>, add an entry to <var title="">result</var> called
    "<code title="">type</code>" whose value is the <a href=#item-type>item
@@ -59875,10 +59864,10 @@
 
     <ol><li><p>Let <var title="">value</var> be the <a href=#concept-property-value title=concept-property-value>property value</a> of <var title="">element</var>.</li>
 
-     <li><p>If <var title="">value</var> is an <a href=#concept-item title=concept-item>item</a>, then <a href=#get-the-object>get the
-     object</a> for <var title="">value</var>, and then replace
-     <var title="">value</var> with the object returned from those
-     steps.</li>
+     <li><p>If <var title="">value</var> is an <a href=#concept-item title=concept-item>item</a>, then: If <var title="">value</var> is in <var title="">memory</var>, then let
+     <var title="">value</var> be the string "<code title="">ERROR</code>". Otherwise, <a href=#get-the-object>get the object</a>
+     for <var title="">value</var>, passing a copy of <var title="">memory</var>, and then replace <var title="">value</var>
+     with the object returned from those steps.</li>
 
      <li>
 
@@ -60041,16 +60030,19 @@
   <var title="">fallback name</var>, it must run the following
   steps:</p>
 
-  <ol><li><p>If there is an entry for <var title="">item</var> in <var title="">memory</var>, then let <var title="">subject</var> be the
-   subject of that entry. Otherwise, if <var title="">item</var> has a
-   <a href=#global-identifier>global identifier</a> and that <a href=#global-identifier>global
-   identifier</a> is an <a href=#absolute-url>absolute URL</a>, let <var title="">subject</var> be that <a href=#global-identifier>global
-   identifier</a>. Otherwise, let <var title="">subject</var> be a
-   new blank node.</li>
+  <ol><li><p>If there is an entry for the item <var title="">item</var>
+   in <var title="">memory</var>, then return the subject of that
+   entry and abort these steps.</li>
 
-   <li><p>Add a mapping from <var title="">item</var> to <var title="">subject</var> in <var title="">memory</var>, if there
-   isn't one already.</li>
+   <li><p>If <var title="">item</var> has a <a href=#global-identifier>global
+   identifier</a> and that <a href=#global-identifier>global identifier</a> is an
+   <a href=#absolute-url>absolute URL</a>, let <var title="">subject</var> be that
+   <a href=#global-identifier>global identifier</a>. Otherwise, let <var title="">subject</var> be a new blank node.</li>
 
+   <li><p>Add a mapping from the item <var title="">item</var> to the
+   subject <var title="">subject</var> in <var title="">memory</var>,
+   if there isn't one already.</li>
+
    <li><p>If <var title="">item</var> has an <a href=#item-type>item type</a>
    and that <a href=#item-type>item type</a> is an <a href=#absolute-url>absolute URL</a>,
    let <var title="">type</var> be that <a href=#item-type>item
@@ -60137,7 +60129,7 @@
 
        <!-- could support <time> here somehow, though we'd have to
        reserialise it, check if the <time> was valid, check if it had a
-       date, a time, a timezone, etc. -->
+       date, a time, a timezone, etc. (<code>time</code>) -->
 
        <li><p>Otherwise, if <var title="">element</var> is not one of
        the <a href=#url-property-elements>URL property elements</a>, let <var title="">value</var> be a plain literal, with the language

Modified: source
===================================================================
--- source	2011-07-02 00:12:59 UTC (rev 6276)
+++ source	2011-07-07 21:14:13 UTC (rev 6277)
@@ -64234,7 +64234,16 @@
   be specified on elements that do not have an <code
   title="attr-itemscope">itemscope</code> attribute specified.</p>
 
+  <p class="note">The <code title="attr-itemref">itemref</code>
+  attribute is not part of the microdata data model. It is merely a
+  syntactic construct to aid authors in adding annotations to pages
+  where the data to be annotated does not follow a convenient tree
+  structure. For example, it allows authors to mark up data in a table
+  so that each column defines a separate <span
+  title="concept-item">item</span>, while keeping the properties in
+  the cells.</p>
 
+
   <h4>Names: the <dfn title="attr-itemprop"><code>itemprop</code></dfn> attribute</h4>
 
   <p>Every <span title="HTML elements">HTML element</span> may have an
@@ -64444,68 +64453,20 @@
   <h4>Associating names with items</h4>
 
   <p>To find <dfn>the properties of an item</dfn> defined by the
-  element <var title="">root</var>, the user agent must try to
-  <span>crawl the properties</span> of the element <var
-  title="">root</var>, with an empty list as the value of <var
-  title="">memory</var>: if this fails, then <span title="the
-  properties of an item">the properties of the item</span> defined by
-  the element <var title="">root</var> is an empty list; otherwise, it
-  is the returned list.</p>
+  element <var title="">root</var>, the user agent must run the
+  following steps. These steps are also used to flag <span
+  title="microdata error">microdata errors</span>.</p>
 
-  <p>To <dfn>crawl the properties</dfn> of an element <var
-  title="">root</var> with a list <var title="">memory</var>, the user
-  agent must run the following steps. These steps either fail or
-  return a list with a count of errors. The count of errors is used as
-  part of the authoring conformance criteria below.</p>
-
   <ol>
 
-   <li><p>If <var title="">root</var> is in <var
-   title="">memory</var>, then the algorithm fails; abort these
-   steps.</p></li>
-
-   <li><p><span>Collect all the elements in the item</span> <var
-   title="">root</var>; let <var title="">results</var> be the
-   resulting list of elements, and <var title="">errors</var> be the
-   resulting count of errors.</p></li>
-
-   <li><p>Remove any elements from <var title="">results</var> that do
-   not have an <code title="attr-itemprop">itemprop</code> attribute
-   specified.</p></li>
-
-   <li><p>Let <var title="">new memory</var> be a new list consisting
-   of the old list <var title="">memory</var> with the addition of
-   <var title="">root</var>.</p></li>
-
-   <li><p>For each element in <var title="">results</var> that has an
-   <code title="attr-itemscope">itemscope</code> attribute specified,
-   <span>crawl the properties</span> of the element, with <var
-   title="">new memory</var> as the memory. If this fails, then remove
-   the element from <var title="">results</var> and increment <var
-   title="">errors</var>. (If it succeeds, the return value is
-   discarded.)</p></li>
-
-   <li><p>Sort <var title="">results</var> in <span>tree
-   order</span>.</p></li>
-
-   <li><p>Return <var title="">results</var> and <var
-   title="">errors</var>.</p></li>
-
-  </ol>
-
-  <p>To <dfn>collect all the elements in the item</dfn> <var
-  title="">root</var>, the user agent must run these steps. They
-  return a list of elements and a count of errors.</p>
-
-  <ol>
-
-   <li><p>Let <var title="">results</var> and <var
+   <li><p>Let <var title="">results</var>, <var title="">memory</var>, and <var
    title="">pending</var> be empty lists of elements.</p></li>
 
-   <li><p>Let <var title="">errors</var> be zero.</p></li>
+   <li><p>Add the element <var title="">root</var> to <var
+   title="">memory</var>.</p></li>
 
-   <li><p>Add all the children elements of <var title="">root</var> to
-   <var title="">pending</var>.</p></li>
+   <li><p>Add the child elements of <var title="">root</var>, if any,
+   to <var title="">pending</var>.</p></li>
 
    <li><p>If <var title="">root</var> has an <code
    title="attr-itemref">itemref</code> attribute, <span title="split a
@@ -64516,32 +64477,42 @@
    the <span title="concept-ID">ID</span> <var title="">ID</var>, then
    add the first such element to <var title="">pending</var>.</p></li>
 
-   <li><p><i>Loop</i>: Remove an element from <var
-   title="">pending</var> and let <var title="">current</var> be that
-   element.</p></li>
+   <li><p><i>Loop</i>: If <var title="">pending</var> is empty, jump
+   to the step labeled <i>end of loop</i>.</p></li>
 
+   <li><p>Remove an element from <var title="">pending</var> and let
+   <var title="">current</var> be that element.</p></li>
+
    <li><p>If <var title="">current</var> is already in <var
-   title="">results</var>, increment <var
-   title="">errors</var>.</p></li>
+   title="">memory</var>, there is a <span>microdata error</span>;
+   return to the step labeled <i>loop</i>.</p></li>
 
-   <li><p>If <var title="">current</var> is not already in <var
-   title="">results</var> and <var title="">current</var> does not
+   <li><p>Add <var title="">current</var> to <var
+   title="">memory</var>.</p></li>
+
+   <li><p>If <var title="">current</var> does not
    have an <code title="attr-itemscope">itemscope</code> attribute,
    then: add all the child elements of <var title="">current</var> to
    <var title="">pending</var>.</p></li>
 
-   <li><p>If <var title="">current</var> is not already in <var
-   title="">results</var>, then: add <var title="">current</var> to
-   <var title="">results</var>.</p></li>
+   <li><p>If <var title="">current</var> has an <code
+   title="attr-itemprop">itemprop</code> attribute specified, add it
+   to <var title="">results</var>.</p></li>
 
-   <li><p><i>End of loop</i>: If <var title="">pending</var> is not
-   empty, return to the step labeled <i>loop</i>.</p></li>
+   <li><p>Return to the step labeled <i>loop</i>.</p></li>
 
-   <li><p>Return <var title="">results</var> and <var
-   title="">errors</var>.</p></li>
+   <li><p><i>End of loop</i>: Sort <var title="">results</var> in
+   <span>tree order</span>.</p></li>
 
+   <li><p>Return <var title="">results</var>.</p></li>
+
   </ol>
 
+  <p>A document must not contain any <span
+  title="concept-item">items</span> for which the algorithm to find
+  <span>the properties of an item</span> finds any <dfn
+  title="microdata error">microdata errors</dfn>.</p>
+
   <p>An <span title="concept-item">item</span> is a <dfn
   title="top-level microdata items">top-level microdata item</dfn> if
   its element does not have an <code
@@ -64559,6 +64530,15 @@
   <p>All <span title="concept-item">items</span> in a document must be
   <span>used microdata items</span>.</p>
 
+  <p>All <code title="attr-itemref">itemref</code> attributes in a
+  <code>Document</code> must be such that there are no cycles in the
+  graph formed from representing each <span
+  title="concept-item">item</span> in the <code>Document</code> as a
+  node in the graph and each <span title="the properties of an
+  item">property</span> of an item whose <span
+  title="concept-property-value">value</span> is another item as an
+  edge in the graph connecting those two items.</p>
+
   <p>A document must not contain any elements that have an <code
   title="attr-itemprop">itemprop</code> attribute that would not be
   found to be a property of any of the <span
@@ -64566,17 +64546,6 @@
   title="the properties of an item">properties</span> all to be
   determined.</p>
 
-  <p>A document must not contain any <span
-  title="concept-item">items</span> for which <span title="crawl the
-  properties">crawling the properties</span> of the element, with an
-  empty list as the value of <var title="">memory</var>, either fails
-  or returns an error count other than zero.</p>
-
-  <p class="note">The algorithms in this section are especially
-  inefficient, in the interests of keeping them easy to
-  understand. Implementors are strongly encouraged to refactor and
-  optimize them in their user agents.</p>
-
   <div class="example">
 
    <p>In this example, a single license statement is applied to two
@@ -66504,11 +66473,21 @@
 
         <ol>
 
-         <li><p>Let <var title="">value</var> be the result of
-         <span>escaping the vCard text string</span> obtained from
-         <span>extracting a vCard</span> from the element that
-         represents <var title="">subitem</var>.</p></li>
+         <li>
 
+          <p>If the user agent is already attempting to <span
+          title="extracting a vCard">extract a vCard</span> from the
+          element that represents <var title="">subitem</var>, then
+          let <var title="">value</var> be the string "<code
+          title="">ERROR</code>".</p>
+
+          <p>Otherwise, let <var title="">value</var> be the result of
+          <span>escaping the vCard text string</span> obtained from
+          <span>extracting a vCard</span> from the element that
+          represents <var title="">subitem</var>.</p>
+
+         </li>
+
          <li><p>Add a parameter named "<code title="">VALUE</code>"
          whose value is "<code title="">VCARD</code>" to <var
          title="">parameters</var>.</p></li>
@@ -68084,12 +68063,16 @@
   </ol>
 
   <p>When the user agent is to <dfn>get the object</dfn> for an item
-  <var title="">item</var>, it must run the following substeps:</p>
+  <var title="">item</var>, optionally with a list of elements <var
+  title="">memory</var>, it must run the following substeps:</p>
 
   <ol>
 
    <li><p>Let <var title="">result</var> be an empty object.</p></li>
 
+   <li><p>Add <var title="">item</var> to <var
+   title="">memory</var>.</p></li>
+
    <li><p>If the <var title="">item</var> has an <span>item
    type</span>, add an entry to <var title="">result</var> called
    "<code title="">type</code>" whose value is the <span>item
@@ -68119,10 +68102,13 @@
      title="">element</var>.</p></li>
 
      <li><p>If <var title="">value</var> is an <span
-     title="concept-item">item</span>, then <span>get the
-     object</span> for <var title="">value</var>, and then replace
-     <var title="">value</var> with the object returned from those
-     steps.</p></li>
+     title="concept-item">item</span>, then: If <var
+     title="">value</var> is in <var title="">memory</var>, then let
+     <var title="">value</var> be the string "<code
+     title="">ERROR</code>". Otherwise, <span>get the object</span>
+     for <var title="">value</var>, passing a copy of <var
+     title="">memory</var>, and then replace <var title="">value</var>
+     with the object returned from those steps.</p></li>
 
      <li>
 
@@ -68341,19 +68327,20 @@
 
   <ol>
 
-   <li><p>If there is an entry for <var title="">item</var> in <var
-   title="">memory</var>, then let <var title="">subject</var> be the
-   subject of that entry. Otherwise, if <var title="">item</var> has a
-   <span>global identifier</span> and that <span>global
-   identifier</span> is an <span>absolute URL</span>, let <var
-   title="">subject</var> be that <span>global
-   identifier</span>. Otherwise, let <var title="">subject</var> be a
-   new blank node.</p></li>
+   <li><p>If there is an entry for the item <var title="">item</var>
+   in <var title="">memory</var>, then return the subject of that
+   entry and abort these steps.</p></li>
 
-   <li><p>Add a mapping from <var title="">item</var> to <var
-   title="">subject</var> in <var title="">memory</var>, if there
-   isn't one already.</p></li>
+   <li><p>If <var title="">item</var> has a <span>global
+   identifier</span> and that <span>global identifier</span> is an
+   <span>absolute URL</span>, let <var title="">subject</var> be that
+   <span>global identifier</span>. Otherwise, let <var
+   title="">subject</var> be a new blank node.</p></li>
 
+   <li><p>Add a mapping from the item <var title="">item</var> to the
+   subject <var title="">subject</var> in <var title="">memory</var>,
+   if there isn't one already.</p></li>
+
    <li><p>If <var title="">item</var> has an <span>item type</span>
    and that <span>item type</span> is an <span>absolute URL</span>,
    let <var title="">type</var> be that <span>item
@@ -68472,7 +68459,7 @@
 
        <!-- could support <time> here somehow, though we'd have to
        reserialise it, check if the <time> was valid, check if it had a
-       date, a time, a timezone, etc. -->
+       date, a time, a timezone, etc. (<code>time</code>) -->
 
        <li><p>Otherwise, if <var title="">element</var> is not one of
        the <span>URL property elements</span>, let <var




More information about the Commit-Watchers mailing list