[css-variables] Editorial comments

Hi,

Here are a few comments on the 2013-05-16 ED:


In the prose description of what the value of Custom Properties can be: 
add that it can not be empty. In other words, this declaration is 
invalid and ignored:

      var-foo:;

However, per the current ED, this is valid since the value contains a 
whitespace token. Do we want to keep it valid, or should "empty" not 
consider whitespace?

      var-foo: ;


There should be a note that because of the general CSS parsing rules and 
the restrictions on custom property declarations, a variable can not 
contain an unbalanced quote, parenthesis or bracket:

* A opening character causes the parser to not close the declaration 
until it finds the matching closing character.
* An unmatched closing character is an error and causes the declaration 
to be invalid and not set the variable.

Using var() is therefore "safe" with respect to block nesting.


Section 3: The <fallback> grammar in the definition of var() should be 
renamed something like <variable-value> and be used in the Value line of 
custom properties, to avoid repeating the definition and show that the 
syntax is meant to be the same.

In particular, we’ll want to explicitly disallow "top-level" semicolons 
in <fallback> for the same reason we do in custom properties (even when 
it does not terminate the value, eg. in the OM’s setProperty() method.) 
That is, we don’t want computed values that are not serializable in a 
style rule.


      The <fallback> value is identical to the syntax of a
      custom property value: it accepts anything allowed by
      the core syntax of CSS
      (except that, since it's a value in a function rather than
      a value in a declaration, some tokens that were allowed
      in a custom property don't work in a <fallback>
      and vice versa, because they'd close the function early).

Given the above, the part in parenthesis is not necessary anymore.


The two paragraphs before section 3.1 seem to be an introduction to 
var()’s fallback that was just defined. Perhaps they need to be moved 
earlier?

-- 
Simon Sapin

Received on Sunday, 9 June 2013 21:42:25 UTC