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

[css3-syntax] !important vs. ! /**/ important

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Tue, 07 Aug 2012 15:24:21 +0200
Message-ID: <50211705.8050208@kozea.fr>
To: www-style@w3.org
Le 06/08/2012 20:00, Daniel Glazman a écrit :
> Le 06/08/12 19:41, Simon Sapin a écrit :
>> Le 06/08/2012 18:11, Tab Atkins Jr. a écrit :
>>> Ah, true. Hmm, is Selectors the only place that has this issue? I
>>> think so - I believe everywhere else, two tokens being separated
>>> implies that it's okay to put whitespace between them.
>>
>> What about !important ? Is this valid? ! /**/ important
>
> CSS 2.1 grammar says:
>
>   "!"({w}|{comment})*{I}{M}{P}{O}{R}{T}{A}{N}{T}	{return IMPORTANT_SYM;}
>
> So, yes.


This is not the case in the current Syntax3 ED. In 3.6.8:

> delim token with a value of "!"
>   If the next input token is an identifier token with the value
>   "important", …


Note that comments are ignored by the tokenizer, but they can still 
separate whitespace tokens which then become consecutive. Fixing the 
above might need unbounded lookahead, unless the tokenizer changes to 
collapse comment-separated whitespace so that there can not be 
consecutive whitespace tokens.


Regards,
-- 
Simon Sapin
Received on Tuesday, 7 August 2012 13:24:49 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:58 GMT