Re: @media all minified?

Bert Bos wrote:
> On Wednesday 09 July 2008 17:06, Boris Zbarsky wrote:
>> see wrote:
>>> just checked the CSS grammar again, the tokenizer is defined here
>>> as:
>>>
>>>     @{M}{E}{D}{I}{A}    {return MEDIA_SYM;}
>>>
>>> Safari seems to be working right here then?
>> If you cannot create @-rules whose name starts with "media", that
>> seems like a bug in the grammar to me.
>>
>> So either there is a bug in webkit here, or a bug in the grammar, but
>> in either case I would not expect "@mediall { ... }" to act like
>> "@media all { ... }".
> 
> There are two grammars in the CSS 2.1 spec: the generic CSS grammar and 
> a grammar that describes just CSS 2.1. To tokenize a CSS file, only the 
> first one is correct.
> 
> The second one is only useful on a file that you already know to be 
> nothing but CSS 2.1. It will not parse CSS3 features, such as 
> @namespace or [foo^=bar] correctly, even though a CSS 2.1 
> implementation is required to parse (and ignore) them.
> 
> Both "@media" and "@mediaall" are ATKEYWORDs in CSS. The former has a 
> defined meaning in level 2 and higher, the latter is not yet defined in 
> CSS. All implementations must therefore skip it, together with the 
> block that follows. If WebKit doesn't do that, it has a bug.

I guess it is a bug. I have not checked other @rules like e.g.
	@namespaceprefix"uri";
which should at least be
	@namespace prefix"uri";

anyway, thanks for clarification.
I guess the spec should change as @{M}{E}{D}{I}{A}    {return 
MEDIA_SYM;} does not really help implementors...

thanks
chris

Received on Wednesday, 9 July 2008 17:00:44 UTC