W3C home > Mailing lists > Public > www-validator-cvs@w3.org > September 2013

[Bug 23188] Validator / test suite CSS media query bugs

From: <bugzilla@jessica.w3.org>
Date: Tue, 10 Sep 2013 11:17:03 +0000
To: www-validator-cvs@w3.org
Message-ID: <bug-23188-169-xRlPp8wCLz@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=23188

--- Comment #2 from Michael[tm] Smith <mike@w3.org> ---
(In reply to Michael[tm] Smith from comment #1)
> (In reply to Mark Rogers from comment #0)
> > 2) Validator.nu (and media-queries/012-novalid.html) expects "screen and
> > (min-width: 400px)and (max-width: 600px)" to fail due to missing whitespace
> > before the 'and'. My reading of the spec is that whitespace (the S*
> > production) is optional:
> > http://www.w3.org/TR/css3-mediaqueries/#syntax
> 
> Yeah, agreed. The BNF there says:
> 
> media_query
>  : [ONLY | NOT]? S* media_type S* [ AND S* expression ]*
>  | expression [ AND S* expression ]*
>  ;
> expression
>  : '(' S* media_feature S* [ ':' S* expr ]? ')' S*
>  ;

Actually, I'm wrong. We should pretty much never use any documents in
http://www.w3.org/TR/ as the latest authority for requirements. The TR drafts
for most Web-platform technologies are almost always out of date. In this case
it's been pointed out to me that the latest media-queries spec is at
http://dev.w3.org/csswg/mediaqueries4/

And if you look at http://dev.w3.org/csswg/mediaqueries4/#syntax you'll see
that says:

media_query
 : [ONLY S+ | NOT S+]? media_type [ S+ AND S+ expression ]* S*
 | expression [ S+ AND S+ expression ]* S*
 ;

So the whitespace around "and" is now (again) required, both before "and" and
after it.

So the existing validator behavior (still) conforms to the latest media-queries
spec for this case, and the media-queries/012-novalid.html document is in the
test suite is till not valid.


> 
> ...which seems to clearly define the whitespace before the "and" as optional
> everywhere, as well as the whitespace after the "and" (right?).
> 
> > (The media query from the test failure passes in jigsaw.w3.org)
> 
> Yeah. Though I note that the following doesn't pass on jigsaw.w3.org:
> 
>   @media screen and (min-width: 400px) and(max-width: 600px) {}
> 
> ...I guess because jigsaw expects whitespace after the "and" there.
>  
> > PS Have a few more like this - I'll probably report them over the next few
> > weeks.
> 
> Please do keep 'em coming. In the mean time, I'll try to fix these two.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 10 September 2013 11:17:09 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:55 UTC