W3C home > Mailing lists > Public > public-html-commits@w3.org > January 2010

html5/md Overview.html,1.21,1.22

From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 18 Jan 2010 10:35:59 +0000
To: public-html-commits@w3.org
Message-Id: <E1NWoxj-0003NZ-TF@lionel-hutz.w3.org>
Update of /sources/public/html5/md
In directory hutz:/tmp/cvs-serv12975

Modified Files:
	Overview.html 
Log Message:
Change how itemref='' is processed to prevent infinite loops in the algorithms that handle microdata. (whatwg r4607)

Index: Overview.html
===================================================================
RCS file: /sources/public/html5/md/Overview.html,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- Overview.html	18 Jan 2010 07:30:57 -0000	1.21
+++ Overview.html	18 Jan 2010 10:35:57 -0000	1.22
@@ -949,7 +949,39 @@
   specified, must have a value that is an <span>unordered set of
   unique space-separated tokens</span> consisting of <span title="concept-ID">IDs</span> of elements in the same document; for
   each one, the element's nearest ancestor element with an <code title="attr-itemscope"><a href="#attr-itemscope">itemscope</a></code> attribute specified, if any,
-  must not be the element with the referencing <code title="attr-itemref"><a href="#attr-itemref">itemref</a></code> attribute specified.<p>The <code title="attr-itemref"><a href="#attr-itemref">itemref</a></code> attribute must not
+  must not be the element with the referencing <code title="attr-itemref"><a href="#attr-itemref">itemref</a></code> attribute specified, and the
+  element must not be <a href="#part-of-an-itemref-loop">part of an <code title="attr-itemref">itemref</code> loop</a>.<p>An element <var title="">e</var> is <dfn id="part-of-an-itemref-loop">part of an <code title="attr-itemref">itemref</code> loop</dfn> if the following
+  algorithm terminates in a failure state:<ol><li><p>Let <var title="">visited</var> be an empty list.</li>
+
+   <li><p>Let <var title="">pending</var> be a list containing only
+   the element <var title="">e</var>.</li>
+
+   <li>
+
+    <p>While <var title="">pending</var> is not empty, run the
+    following substeps:</p>
+
+    <ol><li><p>Let <var title="">current</var> be an element in <var title="">pending</var>, and remove that element from <var title="">pending</var>.</li>
+
+     <li><p>If <var title="">current</var> is in <var title="">visited</var>, terminate this algorithm in the failure
+     state.</li>
+
+     <li><p>Add <var title="">current</var> to <var title="">visited</var>.</li>
+
+     <li><p>If <var title="">current</var> has an <code title="attr-itemscope"><a href="#attr-itemscope">itemscope</a></code> attribute but no <code title="attr-itemprop"><a href="#names:-the-itemprop-attribute">itemprop</a></code> attribute, and <var title="">current</var> is not <var title="">e</var>, then skip
+     the remainder of these substeps for this value of <var title="">current</var>.</li>
+
+     <li><p>If <var title="">current</var> has an <code title="attr-itemscope"><a href="#attr-itemscope">itemscope</a></code> attribute and an <code title="attr-itemref"><a href="#attr-itemref">itemref</a></code> attribute, <span title="split
+     a string on spaces">split the value of that <code title="attr-itemref"><a href="#attr-itemref">itemref</a></code> attribute on
+     spaces</span>. For each resulting token <var title="">ID</var>,
+     if there is an element in the document with the <span title="concept-ID">ID</span> <var title="">ID</var>, then add the
+     first such element to <var title="">pending</var>.</li>
+
+     <li><p>Add all the children elements of <var title="">current</var> to <var title="">pending</var>.</li>
+
+    </ol></li>
+
+  </ol><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.<h3 id="names:-the-itemprop-attribute"><span class="secno">4.3 </span>Names: the <dfn title="attr-itemprop"><code>itemprop</code></dfn> attribute</h3><p>Every <span title="HTML elements">HTML element</span> may have an
   <code title="attr-itemprop"><a href="#names:-the-itemprop-attribute">itemprop</a></code> attribute specified, if
   doing so <a href="#the-properties-of-an-item" title="the properties of an item">adds a
@@ -1100,6 +1132,11 @@
   <code>time</code> element.<h3 id="associating-names-with-items"><span class="secno">4.5 </span>Associating names with items</h3><p>To find <dfn id="the-properties-of-an-item">the properties of an item</dfn>, the user agent must
   run the following steps:<ol><li><p>Let <var title="">root</var> be the element with the <code title="attr-itemscope"><a href="#attr-itemscope">itemscope</a></code> attribute.</li>
 
+   <li><p>If <var title="">root</var> is <a href="#part-of-an-itemref-loop">part of an <code title="attr-itemref">itemref</code> loop</a>, then return an
+   empty list as the <a href="#the-properties-of-an-item" title="the properties of an
+   item">properties of the item</a> <var title="">root</var> and
+   abort these steps.</li>
+
    <li><p>Let <var title="">pending</var> be a stack of elements
    initially containing the child elements of <var title="">root</var>, if any. This list will be the one that holds
    the elements that still need to be crawled.</li>
@@ -1110,32 +1147,10 @@
 
    <li><p>If <var title="">root</var> has an <code title="attr-itemref"><a href="#attr-itemref">itemref</a></code> attribute, <span title="split a
    string on spaces">split the value of that <code title="attr-itemref"><a href="#attr-itemref">itemref</a></code> attribute on spaces</span>. For
-   each resulting token, <var title="">ID</var>, if there is an
-   element in the document with the <span title="concept-ID">ID</span>
-   <var title="">ID</var>, then push the first such element onto <var title="">pending</var>.</li>
-
-   <li>
-
-    <p>For each element <var title="">candidate</var> in <var title="">pending</var>, run the following substeps:</p>
-
-    <ol><li><p>Let <var title="">scope</var> be <var title="">candidate</var>'s nearest ancestor element with an <code title="attr-itemscope"><a href="#attr-itemscope">itemscope</a></code> attribute specified, if
-     any, or null otherwise.</li>
-
-     <li><p>If one of the other elements in <var title="">pending</var>
-     is also <var title="">candidate</var>, then remove <var title="">candidate</var> from <var title="">pending</var>
-     (i.e. remove duplicates).</li>
-
-     <li><p>Otherwise, if one of the other elements in <var title="">pending</var> is an ancestor element of <var title="">candidate</var>, and that element is <var title="">scope</var>, then remove <var title="">candidate</var>
-     from <var title="">pending</var> (since <var title="">candidate</var> will be reached anyway as part of
-     processing <var title="">scope</var>).</li>
-
-     <li><p>Otherwise, if one of the other elements in <var title="">pending</var> is an ancestor element of <var title="">candidate</var>, and either <var title="">scope</var> is
-     null or that element also has <var title="">scope</var> as its
-     nearest ancestor element with an <code title="attr-itemscope"><a href="#attr-itemscope">itemscope</a></code> attribute specified, then
-     remove <var title="">candidate</var> from <var title="">pending</var> (since <var title="">candidate</var> will
-     be reached anyway as part of processing <var title="">scope</var>).</li>
-
-    </ol></li>
+   each resulting token <var title="">ID</var>, if there is an element
+   in the document with the <span title="concept-ID">ID</span> <var title="">ID</var> and the first such element is not <a href="#part-of-an-itemref-loop">part of
+   an <code title="attr-itemref">itemref</code> loop</a>, then push
+   the first such element onto <var title="">pending</var>.</li>
 
    <li><p>Sort <var title="">pending</var> in <span>tree
    order</span>.</li>
Received on Monday, 18 January 2010 10:36:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 18 January 2010 10:36:05 GMT