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

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

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Fri, 27 Apr 2012 12:18:41 +0200
Message-ID: <4F9A7281.6010301@kozea.fr>
To: Vasily Stepanov <vasily.stepanov@gmail.com>
CC: "www-style@w3.org" <www-style@w3.org>
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:


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

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:14 UTC