HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2695Add more text about rationale for data-*='' attributes.2009-01-23 01:01
@@ -7129,31 +7129,57 @@ background: transparent">blue&lt;/span>.&lt;/p></pre>
 
 
 
   <h5><dfn>Embedding custom non-visible data</dfn></h5>
 
   <p>A <dfn>custom data attribute</dfn> is an attribute whose name
   starts with the string "<dfn
   title="attr-data-*"><code>data-</code></dfn>", has at least one
   character after the hyphen, is <span>XML-compatible</span>, has no
   namespace, and contains no characters in the range U+0041 .. U+005A
-  (LATIN CAPITAL LETTER A LATIN CAPITAL LETTER Z).</p>
+  (LATIN CAPITAL LETTER A .. LATIN CAPITAL LETTER Z).</p>
 
   <p class="note">All attributes in <span>HTML documents</span> get
   lowercased automatically, so the restriction on uppercase letters
   doesn't affect such documents.</p>
 
   <p><span title="custom data attribute">Custom data attributes</span>
   are intended to store custom data private to the page or
   application, for which there are no more appropriate attributes or
   elements.</p>
 
+  <p>These attributes are not intended for use by software that is
+  independent of the site that uses the attributes.</p>
+
+  <div class="example">
+
+   <p>For instance, a site about music could annotate list items
+   representing tracks in an album with custom data attributes
+   containing the length of each track. This information could then be
+   used by the site itself to allow the user to sort the list by track
+   length, or to filter the list for tracks of certain lengths.</p>
+
+   <pre>&lt;ol>
+ &lt;li data-length="2m11s">Beyond The Sea&lt;/li>
+ ...
+&lt;/ol></pre>
+
+   <p>It would be inappropriate, however, for the user to use generic
+   software not associated with that music site to search for tracks
+   of a certain length by looking at this data.</p>
+
+   <p>This is because these attributes are intended for use by the
+   site's own scripts, and are not a generic extension mechanism for
+   publicly-usable metadata.</p>
+
+  </div>
+
   <p>Every <span title="HTML elements">HTML element</span> may have
   any number of <span title="custom data attribute">custom data
   attributes</span> specified, with any value.</p>
 
   <p>The <dfn title="dom-dataset"><code>dataset</code></dfn> DOM
   attribute provides convenient accessors for all the <code
   title="attr-data-*">data-*</code> attributes on an element.  On
   getting, the <code title="dom-dataset">dataset</code> DOM attribute
   must return a <code>DOMStringMap</code> object, associated with the
   following algorithms, which expose these attributes on their

|