HTML5 Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/6668

SVNBugCommentTime (UTC)
666814233[Authors] [Conformance Checkers] [Gecko] [Internet Explorer] [Opera] [Webkit] [Tools] Redefine itemtype='' to allow multiple types if they share the same vocabulary. This was by far the most frequently made request at the recent schema.org event2011-10-12 00:13
Index: source
===================================================================
--- source	(revision 6667)
+++ source	(revision 6668)
@@ -10478,7 +10478,7 @@
 
 <!--END w3c-html--><!--MD-->  // <span>microdata</span> <!--WARNING: ALSO DUPLICATED IN MICRODATA SECTION-->
            attribute boolean <span title="dom-itemScope">itemScope</span>;
-           attribute DOMString <span title="dom-itemType">itemType</span>;
+  [PutForwards=<span title="dom-DOMSettableTokenList-value">value</span>] readonly attribute <span>DOMSettableTokenList</span> <span title="dom-itemType">itemType</span>;
            attribute DOMString <span title="dom-itemId">itemId</span>;
   [PutForwards=<span title="dom-DOMSettableTokenList-value">value</span>] readonly attribute <span>DOMSettableTokenList</span> <span title="dom-itemRef">itemRef</span>;
   [PutForwards=<span title="dom-DOMSettableTokenList-value">value</span>] readonly attribute <span>DOMSettableTokenList</span> <span title="dom-itemProp">itemProp</span>;
@@ -64845,12 +64845,23 @@
 
   </div>
 
-  <p>An item can only have one type. The type gives the context for
-  the properties, thus defining a vocabulary: a property named "class"
-  given for an item with the type "http://census.example/person" might
-  refer to the economic class of an individual, while a property named
-  "class" given for an item with the type "http://example.com/school/teacher"
-  might refer to the classroom a teacher has been assigned.</p>
+  <p>The type gives the context for the properties, thus defining a
+  vocabulary: a property named "class" given for an item with the type
+  "http://census.example/person" might refer to the economic class of
+  an individual, while a property named "class" given for an item with
+  the type "http://example.com/school/teacher" might refer to the
+  classroom a teacher has been assigned. Several types can share a
+  vocabulary. For example, the types "<code
+  title="">http://example.org/people/teacher</code>" and "<code
+  title="">http://example.org/people/engineer</code>" could be defined
+  to use the same vocabulary (though maybe some properties would not
+  be especially useful in both cases, e.g. maybe the "<code
+  title="">http://example.org/people/engineer</code>" type might not
+  typically be used with the "<code title="">classroom</code>"
+  property). Multiple types defined to use the same vocabulary can be
+  given for a single item by listing the URLs as a space-separated
+  list in the attribute' value. An item cannot be given two types if
+  they do not use the same vocabulary, however.</p>
 
 
   <h4>Global identifiers for items</h4>
@@ -65018,7 +65029,7 @@
   title="dom-itemScope">element.itemScope</code> IDL attribute set to
   true.</p>
 
-  <p>The type of <span title="concept-item">items</span> can be
+  <p>The type(s) of <span title="concept-item">items</span> can be
   obtained using the <code
   title="dom-itemType">element.itemType</code> IDL attribute on the
   element with the <code title="attr-itemscope">itemscope</code>
@@ -65028,8 +65039,8 @@
 
    <p>This sample shows how the <code
    title="dom-document-getItems">getItems()</code> method can be used
-   to obtain a list of all the top-level microdata items of one type
-   given in the document:</p>
+   to obtain a list of all the top-level microdata items of a
+   particular type given in the document:</p>
 
    <pre>var cats = document.getItems("http://example.com/feline");</pre>
 
@@ -65170,14 +65181,14 @@
   as <span title="concept-item">items</span>.</p>
 
   <p>Each group is known as an <span title="concept-item">item</span>.
-  Each <span title="concept-item">item</span> can have an <span>item
-  type</span>, a <span>global identifier</span> (if the <span>item
-  type</span> <span title="support global identifiers for
-  items">supports global identifiers for its items</span>), and a list
-  of name-value pairs. Each name in the name-value pair is known as a
-  <span title="the properties of an item">property</span>, and each
-  <span title="the properties of an item">property</span> has one or
-  more <span title="concept-property-value">values</span>. Each <span
+  Each <span title="concept-item">item</span> can have <span>item
+  types</span>, a <span>global identifier</span> (if the vocabulary
+  specified by the <span>item types</span> <span>support global
+  identifiers for items</span>), and a list of name-value pairs. Each
+  name in the name-value pair is known as a <span title="the
+  properties of an item">property</span>, and each <span title="the
+  properties of an item">property</span> has one or more <span
+  title="concept-property-value">values</span>. Each <span
   title="concept-property-value">value</span> is either a string or
   itself a group of name-value pairs (an <span
   title="concept-item">item</span>). The names are unordered relative
@@ -65185,14 +65196,16 @@
   have a relative order.</p>
 
   <p>An <span title="concept-item">item</span> is said to be a
-  <dfn>typed item</dfn> when either it has an <span>item type</span>,
-  or it is the <span title="concept-property-value">value</span> of a <span title="the properties of an
-  item">property</span> of a <span>typed item</span>. The
-  <dfn>relevant type</dfn> for a <span>typed item</span> is the <span
-  title="concept-item">item</span>'s <span>item type</span>, if it has
-  one, or else is the <span>relevant type</span> of the <span
+  <dfn>typed item</dfn> when either it has an <span title="item
+  types">item type</span>, or it is the <span
+  title="concept-property-value">value</span> of a <span title="the
+  properties of an item">property</span> of a <span>typed item</span>.
+  The <dfn>relevant types</dfn> for a <span>typed item</span> is the
+  <span title="concept-item">item</span>'s <span>item types</span>, if
+  it has one, or else is the <span>relevant types</span> of the <span
   title="concept-item">item</span> for which it is a <span title="the
-  properties of an item">property</span>'s <span title="concept-property-value">value</span>.</p>
+  properties of an item">property</span>'s <span
+  title="concept-property-value">value</span>.</p>
 
 
 
@@ -65212,42 +65225,47 @@
   <p>Elements with an <code title="attr-itemscope">itemscope</code>
   attribute may have an <dfn
   title="attr-itemtype"><code>itemtype</code></dfn> attribute
-  specified, to give the <span>item type</span> of the <span
+  specified, to give the <span>item types</span> of the <span
   title="concept-item">item</span>.</p>
 
   <p>The <code title="attr-itemtype">itemtype</code> attribute, if
-  specified, must have a value that is a <span>valid URL</span> that
-  is an <span>absolute URL</span>.</p>
+  specified, must have a value that is an <span>unordered set of
+  unique space-separated tokens</span> that are
+  <span>case-sensitive</span>, each of which is a <span>valid
+  URL</span> that is an <span>absolute URL</span>, and all of which
+  are defined to use the same vocabulary.</p>
 
-  <p>The <dfn>item type</dfn> of an <span
-  title="concept-item">item</span> is the value of its element's <code
-  title="attr-itemtype">itemtype</code> attribute, if it has one and
-  its value is not the empty string. If the <code
-  title="attr-itemtype">itemtype</code> attribute is missing or its
-  value is the empty string, the <span
+  <p>The <dfn>item types</dfn> of an <span
+  title="concept-item">item</span> are the <span title="absolute
+  URL">absolute URLs</span> obtained by <span title="split a string on
+  spaces">splitting the element's <code
+  title="attr-itemtype">itemtype</code> attribute's value on
+  spaces</span>. If the <code title="attr-itemtype">itemtype</code>
+  attribute is missing or parsing it in this way finds no tokens that
+  are <span title="absolute URL">absolute URLs</span>, the <span
   title="concept-item">item</span> is said to have no <span>item
-  type</span>.</p>
+  types</span>.</p>
 
-  <p>The <span>item type</span> must be a type defined in an <span
+  <p>The <span>item types</span> must all be types defined in <span
   title="other applicable specifications">applicable
-  specification</span>.</p>
+  specifications</span> and must all be defined to use the same
+  vocabulary.</p>
 
   <div class="impl">
 
-   <p>Except if otherwise specified by that specification, the
-   <span>URL</span> given as the <span>item type</span> should not be
-   automatically dereferenced.</p>
+   <p>Except if otherwise specified by that specification, the <span
+   title="URL">URLs</span> given as the <span>item types</span> should
+   not be automatically dereferenced.</p>
 
-   <p class="note">A specification could define that its <span>item
-   type</span> can be derefenced to provide the user with help
-   information, for example. In fact, vocabulary authors are
-   encouraged to provide useful information at the given
+   <p class="note">A specification could define that its <span
+   title="item types">item type</span> can be derefenced to provide
+   the user with help information, for example. In fact, vocabulary
+   authors are encouraged to provide useful information at the given
    <span>URL</span>.</p>
 
-   <p><span title="item type">Item types</span> are opaque
-   identifiers, and user agents must not dereference unknown <span
-   title="item type">item types</span>, or otherwise deconstruct them,
-   in order to determine how to process <span
+   <p><span>Item types</span> are opaque identifiers, and user agents
+   must not dereference unknown <span>item types</span>, or otherwise
+   deconstruct them, in order to determine how to process <span
    title="concept-item">items</span> that use them.</p>
 
   </div>
@@ -65352,7 +65370,7 @@
 
    <li>If the item is a <span>typed item</span>: a <dfn>defined
    property name</dfn> allowed in this situation according to the
-   specification that defines the <span>relevant type</span> for the
+   specification that defines the <span>relevant types</span> for the
    item, or</li>
 
    <li>If the item is not a <span>typed item</span>: a string that
@@ -65721,7 +65739,7 @@
 partial interface <span>HTMLElement</span> {
   // <span>microdata</span> <!--WARNING: ALSO DUPLICATED IN HTMLElement SECTION-->
            attribute boolean <span title="dom-itemScope">itemScope</span>;
-           attribute DOMString <span title="dom-itemType">itemType</span>;
+  [PutForwards=<span title="dom-DOMSettableTokenList-value">value</span>] readonly attribute <span>DOMSettableTokenList</span> <span title="dom-itemType">itemType</span>;
            attribute DOMString <span title="dom-itemId">itemId</span>;
   [PutForwards=<span title="dom-DOMSettableTokenList-value">value</span>] readonly attribute <span>DOMSettableTokenList</span> <span title="dom-itemRef">itemRef</span>;
   [PutForwards=<span title="dom-DOMSettableTokenList-value">value</span>] readonly attribute <span>DOMSettableTokenList</span> <span title="dom-itemProp">itemProp</span>;
@@ -65782,28 +65800,34 @@
   representing types. When called, the method must return a
   <span>live</span> <code>NodeList</code> object containing all the
   elements in the document, in <span>tree order</span>, that are each
-  <span>top-level microdata items</span> with a <span title="item
-  type">type</span> equal to one of the types specified in that
-  argument, having obtained the types by <span title="split a string
-  on spaces">splitting the string on spaces</span>. If there are no
-  tokens specified in the argument, or if the argument is missing,
-  then the method must return a <code>NodeList</code> containing all
-  the <span>top-level microdata items</span> in the document. When the
-  method is invoked on a <code>Document</code> object again with the
-  same argument, the user agent may return the same object as the
-  object returned by the earlier call. In other cases, a new
-  <code>NodeList</code> object must be returned.</p>
+  <span>top-level microdata items</span> with one of their <span
+  title="item types">types</span> equal to one of the types specified
+  in that argument, having obtained the types by <span title="split a
+  string on spaces">splitting the string on spaces</span>. If there
+  are no tokens specified in the argument, or if the argument is
+  missing, then the method must return a <code>NodeList</code>
+  containing all the <span>top-level microdata items</span> in the
+  document. When the method is invoked on a <code>Document</code>
+  object again with the same argument, the user agent may return the
+  same object as the object returned by the earlier call. In other
+  cases, a new <code>NodeList</code> object must be returned.</p>
 
+  <p class="note">Since a token in the <code
+  title="attr-itemtype">itemtype</code> attribute that is not an
+  <span>absolute URL</span> is not considered to be one of the item's
+  <span>item types</span>, any tokens passed to <code
+  title="dom-document-getItems">getItems()</code> that are not
+  themselves <span title="absolute URL">absolute URLs</span> will not
+  find any items.</p>
+
   <p>The <dfn title="dom-itemScope"><code>itemScope</code></dfn> IDL
   attribute on <span>HTML elements</span> must <span>reflect</span>
   the <code title="attr-itemscope">itemscope</code> content attribute.
   The <dfn title="dom-itemType"><code>itemType</code></dfn> IDL
   attribute on <span>HTML elements</span> must <span>reflect</span>
-  the <code title="attr-itemtype">itemtype</code> content attribute,
-  as if it was a regular string attribute, not a <span>URL</span>
-  string attribute.  The <dfn
-  title="dom-itemId"><code>itemId</code></dfn> IDL attribute on
-  <span>HTML elements</span> must <span>reflect</span> the <code
+  the <code title="attr-itemtype">itemtype</code> content attribute.
+  The <dfn title="dom-itemId"><code>itemId</code></dfn> IDL attribute
+  on <span>HTML elements</span> must <span>reflect</span> the <code
   title="attr-itemid">itemid</code> content attribute. The <dfn
   title="dom-itemProp"><code>itemProp</code></dfn> IDL attribute on
   <span>HTML elements</span> must <span>reflect</span> the <code
@@ -65978,7 +66002,7 @@
 
 <!--START vCard-->
 
-  <p>An item with the <span>item type</span> <dfn
+  <p>An item with the <span title="item types">item type</span> <dfn
   title="md-vcard"><code>http://microformats.org/profile/hcard</code></dfn>
   represents a person's or organization's contact information.</p>
 
@@ -67323,15 +67347,15 @@
   <ol>
 
    <li><p>If none of the nodes in <var title="">nodes</var> are <span
-   title="concept-item">items</span> with the <span>item type</span>
-   <code
+   title="concept-item">items</span> with the <span title="item
+   types">item type</span> <code
    title="md-vcard">http://microformats.org/profile/hcard</code>, then
    there is no vCard. Abort the algorithm, returning nothing.</p></li>
 
    <li><p>Let <var title="">node</var> be the first node in <var
    title="">nodes</var> that is an <span
-   title="concept-item">item</span> with the <span>item type</span>
-   <code
+   title="concept-item">item</span> with the <span title="item
+   types">item type</span> <code
    title="md-vcard">http://microformats.org/profile/hcard</code>.</p></li>
 
    <li><p>Let <var title="">output</var> be an empty string.</p></li>
@@ -67576,7 +67600,7 @@
        <dt>If the property's <span
        title="concept-property-value">value</span> is an <span
        title="concept-item">item</span> <var title="">subitem</var>
-       with the <span>item type</span> <code
+       with the <span title="item types">item type</span> <code
        title="md-vcard">http://microformats.org/profile/hcard</code>
        and <var title="">name</var> is <code
        title="md-vcard-agent">agent</code></dt>
@@ -67902,10 +67926,11 @@
 
   <p class="note">This algorithm can generate invalid vCard output, if
   the input does not conform to the rules described for the <code
-  title="md-vcard">http://microformats.org/profile/hcard</code>
-  <span>item type</span> and <span title="defined property
-  name">defined property names</span>.</p> <!-- of course since vcard
-  doesn't define error handling, this is somewhat problematic. -->
+  title="md-vcard">http://microformats.org/profile/hcard</code> <span
+  title="item types">item type</span> and <span title="defined
+  property name">defined property names</span>.</p> <!-- of course
+  since vcard doesn't define error handling, this is somewhat
+  problematic. -->
 
 
 
@@ -68032,7 +68057,7 @@
 
 <!--START vEvent-->
 
-  <p>An item with the <span>item type</span> <dfn
+  <p>An item with the <span title="item types">item type</span> <dfn
   title="md-vevent"><code>http://microformats.org/profile/hcalendar#vevent</code></dfn>
   represents an event.</p>
 
@@ -68900,7 +68925,7 @@
   output, if the input does not conform to the rules described for the
   <code
   title="md-vevent">http://microformats.org/profile/hcalendar#vevent</code>
-  <span>item type</span> and <span title="defined property
+  <span title="item types">item type</span> and <span title="defined property
   name">defined property names</span>.</p> <!-- of course since
   iCalendar doesn't define error handling, this is somewhat
   problematic. -->
@@ -68942,7 +68967,7 @@
    <pre>function getCalendar(node) {
   // This function assumes the content is valid.
   // It is not a compliant implementation of the algorithm for <span>extracting vEvent data</span>.
-  while (node && (!node.itemScope || !node.itemType == 'http://microformats.org/profile/hcalendar#vevent'))
+  while (node && (!node.itemScope || !node.itemType.contains('http://microformats.org/profile/hcalendar#vevent')))
     node = node.parentNode;
   if (!node) {
     alert('No event data found.');
@@ -69002,7 +69027,7 @@
 
 <!--START work-->
 
-  <p>An item with the <span>item type</span> <dfn
+  <p>An item with the <span title="item types">item type</span> <dfn
   title="md-work"><code>http://n.whatwg.org/work</code></dfn>
   represents a work (e.g. an article, an image, a video, a song,
   etc). This type is primarily intended to allow authors to include
@@ -69173,11 +69198,20 @@
    <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
-   type</span> of <var title="">item</var>.</p></li>
+   <li><p>If the <var title="">item</var> has any <span>item
+   types</span>, add an entry to <var title="">result</var> called
+   "<code title="">type</code>" whose value is an array listing the
+   <span>item types</span> of <var title="">item</var>, in the order
+   they were specified on the <code
+   title="attr-itemtype">itemtype</code> attribute.</p>
 
+   <p class="note">Since only <span title="absolute URL">absolute
+   URLs</span> can be <span>item types</span>, any tokens in the <code
+   title="attr-itemtype">itemtype</code> attribute that are not <span
+   title="absolute URL">absolute URLs</span> are dropped.</li> <!--
+   the array is never empty, though, since if they were all dropped
+   then there would be no item types either -->
+
    <li><p>If the <var title="">item</var> has a <span>global
    identifier</span>, add an entry to <var title="">result</var>
    called "<code title="">id</code>" whose value is the <span>global
@@ -113638,8 +113672,8 @@
     <tr>
      <th> <code title="">itemtype</code>
      <td> <span title="attr-itemtype">HTML elements</span>
-     <td> <span>Item type</span> of a microdata item
-     <td> <span title="absolute URL">Valid absolute URL</span>*
+     <td> <span>Item types</span> of a microdata item
+     <td> <span>Unordered set of unique space-separated tokens</span>, <span>case-sensitive</span>, consisting of <span title="absolute URL">valid absolute URL</span>*
 <!--START w3c-html--><!--MD-->
     <tr>
      <th> <code title="">keytype</code>

|