HTML Standard Tracker


File a bug

SVNBugCommentTime (UTC)
4140[Gecko] [Internet Explorer] [Opera] [Webkit] Microdata: Rename .content to .itemValue and make it more useful.2009-10-14 11:35
@@ -5831,21 +5831,21 @@
   <pre class="idl">interface <dfn>HTMLPropertyCollection</dfn> {
   readonly attribute unsigned long <span title="dom-HTMLPropertyCollection-length">length</span>;
   readonly attribute <span>DOMStringList</span> <span title="dom-HTMLPropertyCollection-names">names</span>;
   caller getter <span>HTMLElement</span> <span title="dom-HTMLPropertyCollection-item">item</span>(in unsigned long index);
   caller getter <span>PropertyNodeList</span> <span title="dom-HTMLPropertyCollection-namedItem">namedItem</span>(in DOMString name);
 typedef sequence&lt;any> <dfn>PropertyValueArray</dfn>;
 interface <dfn>PropertyNodeList</dfn> : <span>NodeList</span> {
-  readonly attribute <span>PropertyValueArray</span> <span title="dom-PropertyNodeList-contents">contents</span>;
+  readonly attribute <span>PropertyValueArray</span> <span title="dom-PropertyNodeList-values">values</span>;
   <dl class="domintro">
    <dt><var title="">collection</var> . <code title="dom-HTMLPropertyCollection-length">length</code></dt>
     <p>Returns the number of elements in the collection.</p>
    <dt><var title="">collection</var> . <code title="dom-HTMLPropertyCollection-names">names</code></dt>
@@ -5861,21 +5861,21 @@ interface <dfn>PropertyNodeList</dfn> : <span>NodeList</span> {
     <p>Returns null if <var title="">index</var> is out of range.</p>
    <dt><var title="">propertyNodeList</var> = <var title="">collection</var> . <code title="dom-HTMLPropertyCollection-item">namedItem</code>(<var title="">name</var>)</dt>
    <dt><var title="">collection</var>[<var title="">name</var>]</dt>
    <dt><var title="">collection</var>(<var title="">name</var>)</dt>
     <p>Returns a <code>PropertyNodeList</code> object containing any elements that add a property named <var title="">name</var>.</p>
-   <dt><var title="">propertyNodeList</var> . <code title="dom-PropertyNodeList-contents">contents</code></dt>
+   <dt><var title="">propertyNodeList</var> . <code title="dom-PropertyNodeList-values">values</code></dt>
     <p>Returns an array of the various values that the relevant elements have.</p>
   <div class="impl">
@@ -5922,26 +5922,26 @@ interface <dfn>PropertyNodeList</dfn> : <span>NodeList</span> {
   order</span>, and the same object must be returned each time a
   particular <var title="">name</var> is queried.</p>
   <p>Members of the <code>PropertyNodeList</code> interface inherited
   from the <code>NodeList</code> interface must behave as they would
   on a <code>NodeList</code> object.</p>
   <p>The <dfn
-  title="dom-PropertyNodeList-contents"><code>contents</code></dfn>
+  title="dom-PropertyNodeList-values"><code>values</code></dfn>
   IDL attribute on the <code>PropertyNodeList</code> object, on
   getting, must return a newly constructed array whose values are the
-  values obtained from the <code title="dom-content">content</code>
-  DOM property of each of the elements represented by the object, in
-  <span>tree order</span>.</p>
+  values obtained from the <code
+  title="dom-itemValue">itemValue</code> DOM property of each of the
+  elements represented by the object, in <span>tree order</span>.</p>
   <p>The <code>DOMTokenList</code> interface represents an interface
   to an underlying string that consists of a <span>set of
   space-separated tokens</span>.</p>
@@ -7632,21 +7632,21 @@ interface <dfn>HTMLDocument</dfn> {
            attribute <span>DOMString</span> <span title="dom-className">className</span>;
   readonly attribute <span>DOMTokenList</span> <span title="dom-classList">classList</span>;
   readonly attribute <span>DOMStringMap</span> <span title="dom-dataset">dataset</span>;
   // <span>microdata</span>
            attribute boolean <span title="dom-itemScope">itemScope</span>;
            attribute DOMString <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-itemProp">itemProp</span>;
   readonly attribute <span>HTMLPropertyCollection</span> <span title="dom-properties">properties</span>;
-           attribute DOMString <span title="dom-content">content</span>;
+           attribute any <span title="dom-itemValue">itemValue</span>;
   // <span>user interaction</span>
            attribute boolean <span title="dom-hidden">hidden</span>;
   void <span title="dom-click">click</span>();
   void <span title="dom-scrollIntoView">scrollIntoView</span>();
   void <span title="dom-scrollIntoView">scrollIntoView</span>(in boolean top);
            attribute long <span title="dom-tabindex">tabIndex</span>;
   void <span title="dom-focus">focus</span>();
   void <span title="dom-blur">blur</span>();
            attribute DOMString <span title="dom-accessKey">accessKey</span>;
@@ -11447,20 +11447,21 @@ gave me some of the songs they wrote. I love sharing my music.&lt;/p>
    <dd><span>Global attributes</span></dd>
    <dd><code title="attr-meta-name">name</code></dd>
    <dd><code title="attr-meta-http-equiv">http-equiv</code></dd>
    <dd><code title="attr-meta-content">content</code></dd>
    <dd><code title="attr-meta-charset">charset</code></dd>
    <dt>DOM interface:</dt>
 <pre class="idl">interface <dfn>HTMLMetaElement</dfn> : <span>HTMLElement</span> {
            attribute DOMString <span title="dom-meta-name">name</span>;
            attribute DOMString <span title="dom-meta-httpEquiv">httpEquiv</span>;
+           attribute DOMString <span title="dom-meta-content">content</span>;
   <p>The <code>meta</code> element <span>represents</span> various
   kinds of metadata that cannot be expressed using the
   <code>title</code>, <code>base</code>, <code>link</code>,
   <code>style</code>, and <code>script</code> elements.</p>
   <p>The <code>meta</code> element can represent document-level
@@ -11516,22 +11517,23 @@ gave me some of the songs they wrote. I love sharing my music.&lt;/p>
   <code title="attr-meta-content">content</code> attribute on the same
   element giving the value. The name specifies what aspect of metadata
   is being set; valid names and the meaning of their values are
   described in the following sections. If a <code>meta</code> element
   has no <code title="attr-meta-content">content</code> attribute,
   then the value part of the metadata name/value pair is the empty
   <div class="impl">
-  <p>The <dfn title="dom-meta-name"><code>name</code></dfn> IDL
-  attribute must <span>reflect</span> the content attribute of the
+  <p>The <dfn title="dom-meta-name"><code>name</code></dfn> and <dfn
+  title="dom-meta-content"><code>content</code></dfn> IDL attributes
+  must <span>reflect</span> the respective content attributes of the
   same name. The IDL attribute <dfn
   title="dom-meta-httpEquiv"><code>httpEquiv</code></dfn> must
   <span>reflect</span> the content attribute <code
   <h5>Standard metadata names</h5>
@@ -49461,50 +49463,50 @@ contradict people?
   title="concept-item">item</span> has been obtained, its properties
   can be extracted using the <code
   title="dom-properties">properties</code> IDL attribute. This
   attribute returns an <code>HTMLPropertyCollection</code>, which can
   be enumerated to go through each element that adds one or more
   properties to the item. It can also be indexed by name, which will
   return an object with a list of the elements that add properties
   with that name.</p>
   <p>Each element that adds a property also has a <code
-  title="dom-content">content</code> IDL attribute that returns its
-  value.
+  title="dom-itemValue">itemValue</code> IDL attribute that returns
+  its value.</p>
   <div class="example">
    <p>This sample gets the first item of type "net.example.user" and
    then pops up an alert using the "name" property from
    that item.</p>
    <pre>var user = document.getItems('net.example.user')[0];
 alert('Hello ' +['name'][0].content + '!');</pre>
   <p>The <code>HTMLPropertyCollection</code> object, when indexed by
   name in this way, actually returns a <code>PropertyNodeList</code>
   object with all the matching properties. The
   <code>PropertyNodeList</code> object can be used to obtained all the
   values at once using <em>its</em> <code
-  title="dom-PropertyNodeList-contents">contents</code> attribute,
-  which returns an array of all the values.</p>
+  title="dom-PropertyNodeList-values">values</code> attribute, which
+  returns an array of all the values.</p>
   <div class="example">
    <p>In an earlier example, a "" item had two
    "com.example.color" values. This script looks up the first such
    item and then lists all its values.</p>
    <pre>var cat = document.getItems('')[0];
-var colors =['com.example.color'].contents;
+var colors =['com.example.color'].values;
 var result;
 if (colors.length == 0) {
   result = 'Color unknown.';
 } else if (colors.length == 1) {
   result = 'Color: ' + colors[0];
 } else {
   result = 'Colors:';
   for (var i = 0; i &lt; colors.length; i += 1)
     result += ' ' + colors[i];
@@ -50001,29 +50003,33 @@ document.body.appendChild(outer);</pre>
     <p>If the element has an <code title="attr-item">item</code>
     attribute, returns an <code>HTMLPropertyCollection</code> object
     with all the element's properties. Otherwise, an empty
     <code>HTMLPropertyCollection</code> object.</p>
-   <dt><var title="">element</var> . <code title="dom-content">content</code> [ = <var title="">value</var> ]</dt>
+   <dt><var title="">element</var> . <code title="dom-itemValue">itemValue</code> [ = <var title="">value</var> ]</dt>
     <p>Returns the element's <span
     <p>Can be set, to change the element's <span
-    title="concept-property-value">value</span>.</p>
+    title="concept-property-value">value</span>. Setting the <span
+    title="concept-property-value">value</span> when the element has
+    no <code title="attr-itemprop">itemprop</code> attribute or when
+    the element's value is an <span title="concept-item">item</span>
+    throws an <code>INVALID_ACCESS_ERR</code> exception.</p>
   <div class="impl">
   <p>The <dfn
   title="">typeNames</var>)</code></dfn> method takes an optional
@@ -50050,25 +50056,38 @@ document.body.appendChild(outer);</pre>
   <p>The <dfn title="dom-properties"><code>properties</code></dfn> IDL
   attribute on <span>HTML elements</span> must return an
   <code>HTMLPropertyCollection</code> rooted at the
   <code>Document</code> node, whose filter matches only elements that
   have <span>property names</span> and are <span title="the properties
   of an item">the properties of the item</span> created by the element
   on which the attribute was invoked, while that element is an <span
   title="concept-item">item</span>, and matches nothing the rest of
   the time.</p>
-  <p>The <dfn title="dom-content"><code>content</code></dfn> IDL
+  <p>The <dfn title="dom-itemValue"><code>itemValue</code></dfn> IDL
   attribute's behavior depends on the element, as follows:</p>
+   <dt>If the element has no <code title="attr-itemprop">itemprop</code> attribute</dt>
+   <dd><p>The attribute must return null on getting and must throw an
+   <code>INVALID_ACCESS_ERR</code> exception on setting.</p>
+   <dt>If the element has an <code title="attr-itemscope">itemscope</code> attribute</dt>
+   <dd><p>The attribute must return the element itself on getting and
+   must throw an <code>INVALID_ACCESS_ERR</code> exception on
+   setting.</p>
    <dt>If the element is a <code>meta</code> element</dt>
    <dd><p>The attribute must act as it would if it was <span
    title="reflect">reflecting</span> the element's <code
    title="attr-meta-content">content</code> content
    <dt>If the element is an <code>audio</code>, <code>embed</code>,
    <code>iframe</code>, <code>img</code>, <code>source</code>, or
@@ -50102,20 +50121,27 @@ document.body.appendChild(outer);</pre>
    title="">datetime</code> content attribute.</p></dd>
    <dd><p>The attribute must act the same as the element's
    <code>textContent</code> attribute.</p></dd>
+  <p>When the <code title="dom-itemValue">itemValue</code> IDL
+  attribute is <span title="reflect">reflecting</span> a content
+  attribute or acting like the element's <code>textContent</code>
+  attribute, the user agent must, on setting, convert the new value to
+  the IDL <code title="">DOMString</code> value before using it
+  according to the mappings described above.</p>
 <!--END html5-->
   <h3>Microdata vocabularies</h3>
 <!--START vocabs--><!--END complete-->
   <h3 class="no-num no-toc">Table of contents</h3>
@@ -53306,21 +53332,21 @@ END:VCARD</pre>
   var stamp = new Date();
   var stampString = '' + stamp.getUTCFullYear() + (stamp.getUTCMonth() + 1) + stamp.getUTCDate() + 'T' +
                          stamp.getUTCHours() + stamp.getUTCMinutes() + stamp.getUTCSeconds() + 'Z';
   var calendar = 'BEGIN:VCALENDAR\r\nPRODID:HTML\r\nVERSION:2.0\r\nBEGIN:VEVENT\r\nDTSTAMP:' + stampString + '\r\n';
   if (node.itemId)
     calendar += 'UID:' + node.itemId + '\r\n';
   for (var propIndex = 0; propIndex &lt;; propIndex += 1) {
     var prop =[propIndex];
-    var value = prop.contents;
+    var value = prop.itemValue;
     var parameters = '';
     if (prop.localName == 'time') {
       value = value.replace(/[:-]/g, '');
       if ( &amp;&amp; prop.time)
         parameters = ';VALUE=DATE';
         parameters = ';VALUE=DATE-TIME';
     } else {
       value = value.replace(/\\/g, '\\n');
       value = value.replace(/;/g, '\\;');