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

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 UTC