[html5] r2695 - [e] (0) Add more text about rationale for data-*='' attributes.
whatwg at whatwg.org
whatwg at whatwg.org
Thu Jan 22 17:01:05 PST 2009
Author: ianh
Date: 2009-01-22 17:01:04 -0800 (Thu, 22 Jan 2009)
New Revision: 2695
Modified:
index
source
Log:
[e] (0) Add more text about rationale for data-*='' attributes.
Modified: index
===================================================================
--- index 2009-01-23 00:38:14 UTC (rev 2694)
+++ index 2009-01-23 01:01:04 UTC (rev 2695)
@@ -7022,7 +7022,7 @@
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>
+ (LATIN CAPITAL LETTER A .. LATIN CAPITAL LETTER Z).</p>
<p class=note>All attributes in <a href=#html-documents>HTML documents</a> get
lowercased automatically, so the restriction on uppercase letters
@@ -7033,6 +7033,32 @@
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><ol>
+ <li data-length="2m11s">Beyond The Sea</li>
+ ...
+</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 <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>
Modified: source
===================================================================
--- source 2009-01-23 00:38:14 UTC (rev 2694)
+++ source 2009-01-23 01:01:04 UTC (rev 2695)
@@ -7136,7 +7136,7 @@
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
@@ -7147,6 +7147,32 @@
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><ol>
+ <li data-length="2m11s">Beyond The Sea</li>
+ ...
+</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>
More information about the Commit-Watchers
mailing list