W3C home > Mailing lists > Public > www-style@w3.org > August 2013

Re: [css-variables][css-conditional] allowing a white space only variable value

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 26 Aug 2013 09:33:23 -0700
Message-ID: <CAAWBYDBRHV7DaCyG0hR3r8g0DiXvDKvHn+wtZquA0XLYOuv+4w@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
Cc: www-style list <www-style@w3.org>
On Sun, Aug 25, 2013 at 10:21 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> I assume we want:
>
>   @supports (var-a: ) { }
>
> to succeed, since "var-a: " is a valid declaration.  However,
> css-conditional-3 has:
>
>   supports_declaration_condition
>     : '(' S* declaration ')'
>     ;
>
> with "declaration" linking to CSS 2.1, where it is defined as:
>
>   declaration : property S* ':' S* value;
>   value       : [ any | block | ATKEYWORD S* ]+;
>   any         : [ IDENT | NUMBER | PERCENTAGE | DIMENSION | STRING
>                 | DELIM | URI | HASH | UNICODE-RANGE | INCLUDES
>                 | DASHMATCH | ':' | FUNCTION S* [any|unused]* ')'
>                 | '(' S* [any|unused]* ')' | '[' S* [any|unused]* ']'
>                 ] S*;
>
> This doesn't allow for a property value that consists only of white space.
>
> On the other hand, http://dev.w3.org/csswg/css-syntax/#consume-a-declaration
> seems to allow a declaration to be parsed that has no tokens at all after
> the ':'.  I guess that's OK as css-variables then defines that no tokens
> after the ':' is invalid?

CSS Conditional's references to the 2.1 grammar are there only because
Syntax wasn't yet even a WD.  It, and anything else that needs
explicit token-grammar stuff, should switch over to Syntax in the
nearish future.

Yes, it's okay that Syntax technically accepts "var-foo:;" but it's
invalid per Variables - it's just a property grammar being more
specific than the generic grammar.

~TJ
Received on Monday, 26 August 2013 16:34:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:33 UTC