RE: @media all minified?

see wrote:
> see wrote:
> >
> > hi,
> > I have a question regarding a "minified" serialization of e.g.
> >
> >     @media all {a {color: red }}
> >
> > I guess the following would not be the equivalent:
> >
> >     @mediaall{a{color:red}}
> >
> > as there is no space between @media and all and if
> tokenizing this it
> > would lead to a single token ``@mediaall`` and not
> ``@media`` followed
> > by ``all`` (from the spec: ATKEYWORD     @{ident})?
> >
> > I think it has to be:
> >     @media all{a{color:red}}
> >
> > Safari nevertheless seems to acknowledge both, other browsers (IE7,
> > FF3) do not.
>
> 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?
>

The CSS2.1 section on generic tokenization (4.1.1) specifies that an ATKEYWORD is @{ident} and the ident is a greedy pattern match -- nmstart followed by as many nmchar as possible.

The specific tokenizer for CSS2.1 (G.2 Lexical scanner) specifies it differently; but then again it does NOT specify a match for a generic @-rule.

Hence, my interpretation and HP's implementation will match @mediaall as an ATKEYWORD rather than a MEDIA_SYM.

- Jacob

Received on Wednesday, 9 July 2008 16:13:51 UTC