microdata; hixie: Be less draconian in the error handling for loops in microdata. Be clearer about whether %s get double-escaped in the RDF conversion. (whatwg r4980)

microdata; hixie: Be less draconian in the error handling for loops in
microdata. Be clearer about whether %s get double-escaped in the RDF
conversion. (whatwg r4980)

http://dev.w3.org/cvsweb/html5/md/Overview.html?r1=1.60&r2=1.61&f=h
http://html5.org/tools/web-apps-tracker?from=4979&to=4980

===================================================================
RCS file: /sources/public/html5/md/Overview.html,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- Overview.html 4 Apr 2010 22:43:29 -0000 1.60
+++ Overview.html 7 Apr 2010 00:00:21 -0000 1.61
@@ -285,7 +285,7 @@
    <h1>HTML Microdata</h1>
    <h2 class="no-num no-toc" id="generatedID"></h2>
 
-   <h2 class="no-num no-toc" id="editor-s-draft-4-april-2010">Editor's Draft 4 April 2010</h2>
+   <h2 class="no-num no-toc" id="editor-s-draft-6-april-2010">Editor's Draft 6 April 2010</h2>
    <dl><dt>Latest Published Version:</dt>
     <dd><a href="http://www.w3.org/TR/microdata/">http://www.w3.org/TR/microdata/</a></dd>
     <dt>Latest Editor's Draft:</dt>
@@ -381,7 +381,7 @@
   specification's progress along the W3C Recommendation
   track.
 
-  This specification is the 4 April 2010 Editor's Draft.
+  This specification is the 6 April 2010 Editor's Draft.
   </p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- relationship to other work (required) --><p>The contents of this specification are also part of <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/">a
   specification</a> published by the <a href="http://www.whatwg.org/">WHATWG</a>, which is available under a
   license that permits reuse of the specification text.</p><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- context and rationale (required) --><!-- (this text is from the RDFa+HTML spec --><p>This specification is an extension to the HTML5 language. All
@@ -1195,18 +1195,14 @@
   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>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:<ol><li><p>If <var title="">root</var> is in <var title="">memory</var>, then the algorithm fails; abort these
-   steps.</li>
-
-   <li><p><a href="#collect-all-the-elements-in-the-item">Collect all the elements in the item</a> <var title="">root</var>, and let <var title="">results</var> be the
-   result.</li>
-
-   <li><p>If <var title="">root</var> is in <var title="">results</var>, then the algorithm fails; abort these
+  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.<ol><li><p>If <var title="">root</var> is in <var title="">memory</var>, then the algorithm fails; abort these
    steps.</li>
 
-   <li><p>If any elements are listed in <var title="">results</var>
-   more than once, then the algorithm fails; abort these
-   steps.</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>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
@@ -1218,16 +1214,19 @@
 
    <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 this
-   instance of the algorithm fails as well; abort these steps. (If it
-   succeeds, the return value is discarded.)</li>
+   <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>.</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:<ol><li><p>Let <var title="">results</var> and <var title="">pending</var> be empty lists of elements.</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.<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>
@@ -1242,15 +1241,20 @@
    <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>Add <var title="">current</var> to <var title="">results</var>.</li>
+   <li><p>If <var title="">current</var> is already in <var title="">results</var>, increment <var title="">errors</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> and <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><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 <var title="">results</var>.</li>
+   <li><p>Return <var title="">results</var> and <var title="">errors</var>.</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
   its element does not have an <code title="attr-itemprop"><a href="#names:-the-itemprop-attribute">itemprop</a></code> attribute.<p>An <a href="#concept-item" title="concept-item">item</a> is a <dfn id="used-microdata-items" title="used
@@ -1263,7 +1267,8 @@
   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>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>, fails.<p class="note">The algorithms in this section are especially
+  empty list as the value of <var title="">memory</var>, either fails
+  or returns an error count other than zero.<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.<div class="example">
@@ -1311,30 +1316,7 @@
     <dd>The mailbox.
     <dt>license
     <dd><code title="">http://www.opensource.org/licenses/mit-license.php</code>
-   </dl></div><div class="example">
-
-   <p>In the following invalid example, the items are all empty,
-   because the <code title="attr-itemref"><a href="#attr-itemref">itemref</a></code> attribute on
-   the inner nested item indirectly references the same element twice
-   in the same item:</p>
-
-   <pre class="bad">&lt;!-- invalid example - do not copy --&gt;
-&lt;div itemscope&gt;
- &lt;span itemprop="example"&gt;This is &lt;em&gt;not&lt;/em&gt; a property of the
- &lt;code&gt;div&lt;/code&gt; element.&lt;/span&gt;
- &lt;p itemprop="demo" itemscope itemref="test thing"&gt; &lt;!-- "thing" is a descendant
-                   of "test", which leads to it being included twice, which is invalid --&gt;
-  &lt;span itemprop="sample"&gt;This isn't part of anything either.&lt;/span&gt;
- &lt;/p&gt;
-&lt;/div&gt;
-&lt;p id="test"&gt;
- &lt;span id="thing"&gt;(this element is referenced twice by the
- &lt;code&gt;p&lt;/code&gt; above, causing all the items that involve that
- &lt;code&gt;itemref=""&lt;/code&gt; attribute to act as if they had no
- properties.)&lt;/span&gt;
-&lt;/p&gt;</pre>
-
-  </div><h2 id="microdata-dom-api"><span class="secno">4 </span>Microdata DOM API</h2><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><pre class="idl">[Supplemental] interface <span>HTMLDocument</span> { <!--WARNING: ALSO DUPLICATED IN HTMLDocument SECTION-->
+   </dl></div><h2 id="microdata-dom-api"><span class="secno">4 </span>Microdata DOM API</h2><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><pre class="idl">[Supplemental] interface <span>HTMLDocument</span> { <!--WARNING: ALSO DUPLICATED IN HTMLDocument SECTION-->
   NodeList <a href="#dom-document-getitems" title="dom-document-getItems">getItems</a>(in optional DOMString typeNames); // <span>microdata</span>
 };
 
@@ -1871,11 +1853,19 @@
            &lt;ifragment&gt; production of the IRI syntax being
            %-escaped. <a href="#refsRFC3987">[RFC3987]</a></li>
 
-           <li><p>Let <var title="">predicate</var> be the
-           concatenation of the string "<code title="">http://www.w3.org/1999/xhtml/microdata#</code>"
-           and <var title="">s</var>, with any characters in <var title="">s</var> that are not valid in the &lt;ifragment&gt;
-           production of the IRI syntax being %-escaped. <a href="#refsRFC3987">[RFC3987]</a></li> <!-- this ensures
-           you can't use a URL to get the same effect -->
+           <li>
+
+            <p>Let <var title="">predicate</var> be the concatenation
+            of the string "<code title="">http://www.w3.org/1999/xhtml/microdata#</code>"
+            and <var title="">s</var>, with any characters in <var title="">s</var> that are not valid in the &lt;ifragment&gt;
+            production of the IRI syntax being %-escaped, but without
+            double-escaping existing %-escapes. <a href="#refsRFC3987">[RFC3987]</a></p> <!-- this ensures
+            you can't use a URL to get the same effect -->
+
+            <p class="example">For example if the string <var title="">s</var> is "<code title="">http://example.com/a#:q%20r</code>", the
+            resulting <var title="">predicate</var> would be "<code title="">http://www.w3.org/1999/xhtml/microdata#http://example.com/a%23:q%20r</code>".</p>
+
+           </li>
 
           </ol></dd>

Received on Wednesday, 7 April 2010 00:01:04 UTC