Re: [css3-mediaqueries] Malformed media query error handling

Le 27/04/2012 11:54, Vasily Stepanov a écrit :
>> >  It is my understanding that for your example the stylesheet parser will find
>> >  @media, read until the end of the block and produce an at-rule. Only then
>> >  the "head" of the at-rule (a list of zero tokens) is parsed as an empty
>> >  media query.
>> >
>> >  Regards,
>> >  --
>> >  Simon Sapin
> Which means you follow CSS21 spec and IGNORE css3-mediaqueries spec.
> That's what I've been talking about;)


I don’t think there is a conflict here.

This is the part of Media Queries that you quoted:

> User agents are to handle unexpected tokens encountered while parsing
> a media query by reading until the end of the media query, while
> observing the rules for matching pairs of (), [], {}, "", and '', and
> correctly handling escapes.

Note "until the end of the media query".

When used in an @media rule, where the media query starts and ends is 
determined the stylesheet syntax.

Another example:

@media ({foo}) { bar }

In this case {foo} is still part of the "head" of the at-rule, according 
to the CSS core grammar:

http://www.w3.org/TR/CSS21/syndata.html#tokenization

The rules for matching pairs of () [] and {} are consistent in CSS and 
media queries.

-- 
Simon Sapin

Received on Friday, 27 April 2012 10:19:12 UTC