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

html5/spec Overview.html,1.1864,1.1865

From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 23 Jan 2009 01:01:12 +0000
To: public-html-commits@w3.org
Message-Id: <E1LQAQ5-00048H-0k@lionel-hutz.w3.org>

Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv15857

Modified Files:
Log Message:
Add more text about rationale for data-*='' attributes. (whatwg r2695)

Index: Overview.html
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.1864
retrieving revision 1.1865
diff -u -d -r1.1864 -r1.1865
--- Overview.html	23 Jan 2009 00:38:20 -0000	1.1864
+++ Overview.html	23 Jan 2009 01:01:10 -0000	1.1865
@@ -5746,12 +5746,34 @@
   starts with the string "<dfn id=attr-data title=attr-data-*><code>data-</code></dfn>", has at least one
   character after the hyphen, is <a href=#xml-compatible>XML-compatible</a>, has no
   namespace, and contains no characters in the range U+0041 .. U+005A
-  (LATIN CAPITAL LETTER A LATIN CAPITAL LETTER Z).<p class=note>All attributes in <a href=#html-documents>HTML documents</a> get
+  (LATIN CAPITAL LETTER A .. LATIN CAPITAL LETTER Z).<p class=note>All attributes in <a href=#html-documents>HTML documents</a> get
   lowercased automatically, so the restriction on uppercase letters
   doesn't affect such documents.<p><a href=#custom-data-attribute title="custom data attribute">Custom data attributes</a>
   are intended to store custom data private to the page or
   application, for which there are no more appropriate attributes or
-  elements.<p>Every <a href=#html-elements title="HTML elements">HTML element</a> may have
+  elements.<p>These attributes are not intended for use by software that is
+  independent of the site that uses the attributes.<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&gt;
+ &lt;li data-length="2m11s"&gt;Beyond The Sea&lt;/li&gt;
+ ...
+   <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 <a href=#html-elements title="HTML elements">HTML element</a> may have
   any number of <a href=#custom-data-attribute title="custom data attribute">custom data
   attributes</a> specified, with any value.<p>The <dfn id=dom-dataset title=dom-dataset><code>dataset</code></dfn> DOM
   attribute provides convenient accessors for all the <code title=attr-data-*><a href=#attr-data>data-*</a></code> attributes on an element.  On
Received on Friday, 23 January 2009 01:01:22 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:09:20 UTC