csswg/css-variables Overview.html,1.24,1.25 Overview.src.html,1.23,1.24

Update of /sources/public/csswg/css-variables
In directory hutz:/tmp/cvs-serv24382

Modified Files:
	Overview.html Overview.src.html 
Log Message:
First attempt at defining the syntax of a data property.

Index: Overview.html
===================================================================
RCS file: /sources/public/csswg/css-variables/Overview.html,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- Overview.html	8 Nov 2011 23:22:27 -0000	1.24
+++ Overview.html	10 Nov 2011 22:27:54 -0000	1.25
@@ -22,14 +22,14 @@
 
    <h1>CSS Variables Module Level 1</h1>
 
-   <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 8 November
+   <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 10 November
     2011</h2>
 
    <dl>
     <dt>This version:
 
     <dd><a
-     href="http://www.w3.org/TR/2011/ED-css-variables-20111108/">http://dev.w3.org/csswg/css-variables/</a>
+     href="http://www.w3.org/TR/2011/ED-css-variables-20111110/">http://dev.w3.org/csswg/css-variables/</a>
      <!--<dt>Latest version:
 		<dd><a href="http://www.w3.org/TR/css-variables/">http://www.w3.org/TR/css-variables/</a>-->
      
@@ -242,8 +242,7 @@
     <tr>
      <th>Values:
 
-     <td>
-      <div class=issue>Figure this out - restricted or wide-open</div>
+     <td>see prose
 
     <tr>
      <th>Initial:
@@ -273,16 +272,47 @@
   </table>
 
   <p><em>Any</em> property name starting with the prefix "data-" is a <a
-   href="#data-property"><i>data property</i></a>. <span class=issue>Spec
-   what values a data property can have.</span> Data properties are defined
-   to be valid but meaningless as they are meant solely for allowing authors
-   to pass custom data around their page, similar to the <a
+   href="#data-property"><i>data property</i></a>. Data properties are
+   defined to be valid but meaningless as they are meant solely for allowing
+   authors to pass custom data around their page, similar to the <a
    href="http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#embedding-custom-non-visible-data-with-the-data-*-attributes">custom
    data attributes</a> in HTML. Other specifications and user agents must not
    assign a particular meaning to data properties or attach a specific effect
    to them beyond the bare minimum that comes from them being valid
    properties.
 
+  <p>The valid possible values of a data property are almost completely
+   unrestricted. A data property can contain anything that is valid according
+   to the <code>value</code> production in the <a
+   href="http://www.w3.org/TR/CSS2/syndata.html#tokenization">CSS Core
+   Grammar</a>. The values do not have to correspond to any existing CSS
+   values, as they are not evaluated except to replace variables occuring
+   within them until they are actually referenced in a normal property with a
+   variable.
+
+  <p>This specification reserves the use of all function tokens starting with
+   the prefix "data" within data properties. Authors must not use any such
+   functions except as defined in this specification or future updates. If a
+   data property contains such a function, it must match the grammar defined
+   in this specification or future updates; the use of such a function that
+   does not follow the grammar, or that utilizes such a function that is not
+   yet defined, makes the data property invalid and it must be ignored.
+
+  <div class=example>
+   <p>For example, even though this spec doesn't define a &lsquo;<code
+    class=css>data-inherit()</code>&rsquo; function, that name is reserved by
+    default and cannot be used. Similarly, the &lsquo;<code
+    class=css>data()</code>&rsquo; function <em>is</em> defined by this spec,
+    so any use of it must match the definition in the spec. The following
+    property declarations are thus invalid:</p>
+
+   <pre>
+:root { 
+  data-foo: data-inherit(bar); /* Use of reserved, but undefined, function. */
+  data-foo: data(bar, baz, qux); /* Invalid use of data() function. */
+}</pre>
+  </div>
+
   <p>For each <a href="#data-property"><i>data property</i></a>, there is an
    associated variable with the same name save for the "data-" prefix. For
    example, a data property named "data-foo" is associated with the variable
@@ -468,9 +498,6 @@
    function is replaced by the value of the referenced <a
    href="#data-property"><i>data property</i></a>.
 
-  <p class=issue>What about variable variables? Should &lsquo;<code
-   class=css>data(data(foo))</code>&rsquo; be valid? (Probably not.)
-
   <p>A variable can be used anywhere a value is expected in CSS. Variables
    can not be used as property names, selectors, or anything else besides
    property values - doing so either produces an invalid value or, in some
@@ -895,7 +922,7 @@
     <tr>
      <th><span class=property>data-*</span>
 
-     <td>Figure this out - restricted or wide-open
+     <td>see prose
 
      <td>invalid (a keyword, but see prose)
 

Index: Overview.src.html
===================================================================
RCS file: /sources/public/csswg/css-variables/Overview.src.html,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- Overview.src.html	30 Oct 2011 23:04:11 -0000	1.23
+++ Overview.src.html	10 Nov 2011 22:27:54 -0000	1.24
@@ -93,7 +93,7 @@
 			<td><dfn id='data-property' title='data property|data properties'>data-*</dfn>
 		<tr>
 			<th>Values:
-			<td><div class='issue'>Figure this out - restricted or wide-open</div>
+			<td>see prose
 		<tr>
 			<th>Initial:
 			<td>invalid (a keyword, but see prose)
@@ -111,7 +111,21 @@
 			<td>all
 	</table>
 
-	<p><em>Any</em> property name starting with the prefix "data-" is a <i>data property</i>.  <span class='issue'>Spec what values a data property can have.</span>  Data properties are defined to be valid but meaningless as they are meant solely for allowing authors to pass custom data around their page, similar to the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#embedding-custom-non-visible-data-with-the-data-*-attributes">custom data attributes</a> in HTML.  Other specifications and user agents must not assign a particular meaning to data properties or attach a specific effect to them beyond the bare minimum that comes from them being valid properties.</p>
+	<p><em>Any</em> property name starting with the prefix "data-" is a <i>data property</i>.  Data properties are defined to be valid but meaningless as they are meant solely for allowing authors to pass custom data around their page, similar to the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#embedding-custom-non-visible-data-with-the-data-*-attributes">custom data attributes</a> in HTML.  Other specifications and user agents must not assign a particular meaning to data properties or attach a specific effect to them beyond the bare minimum that comes from them being valid properties.</p>
+
+	<p>The valid possible values of a data property are almost completely unrestricted.  A data property can contain anything that is valid according to the <code>value</code> production in the <a href="http://www.w3.org/TR/CSS2/syndata.html#tokenization">CSS Core Grammar</a>.  The values do not have to correspond to any existing CSS values, as they are not evaluated except to replace variables occuring within them until they are actually referenced in a normal property with a variable.</p>
+
+	<p>This specification reserves the use of all function tokens starting with the prefix "data" within data properties.  Authors must not use any such functions except as defined in this specification or future updates.  If a data property contains such a function, it must match the grammar defined in this specification or future updates; the use of such a function that does not follow the grammar, or that utilizes such a function that is not yet defined, makes the data property invalid and it must be ignored.</p>
+
+	<div class='example'>
+		<p>For example, even though this spec doesn't define a ''data-inherit()'' function, that name is reserved by default and cannot be used.  Similarly, the ''data()'' function <em>is</em> defined by this spec, so any use of it must match the definition in the spec.  The following property declarations are thus invalid:</p>
+
+		<pre>
+:root { 
+  data-foo: data-inherit(bar); /* Use of reserved, but undefined, function. */
+  data-foo: data(bar, baz, qux); /* Invalid use of data() function. */
+}</pre>
+	</div>
 
 	<p>For each <i>data property</i>, there is an associated variable with the same name save for the "data-" prefix.  For example, a data property named "data-foo" is associated with the variable named "foo".  See the next chapter for details on how to use variables.</p>
 
@@ -216,8 +230,6 @@
 
 	<p>The ''data()'' function references the <i>data property</i> with the name obtained by prepending "data-" to the function's argument.  <span class='note'>Note that all possible <i>data properties</i> exist; if one with the given name has not yet been defined in the document, it simply takes its initial value.</span>  When a property resolves its computed value, a ''data()'' function is replaced by the value of the referenced <i>data property</i>.</p>
 
-	<p class='issue'>What about variable variables?  Should ''data(data(foo))'' be valid? (Probably not.)</p>
-
 	<p>A variable can be used anywhere a value is expected in CSS.  Variables can not be used as property names, selectors, or anything else besides property values - doing so either produces an invalid value or, in some situations like the attribute value of an attribute selector, a valid value that nonetheless has no relation to the variable of that name.</p>
 
 	<p>A variable is substituted for its value in the property value at computed-value time.  If a declaration, once all variables are substituted in, is invalid, the declaration is <i>invalid at computed-value time</i>.</p>

Received on Thursday, 10 November 2011 22:28:03 UTC