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

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23188

Michael[tm] Smith <mike@w3.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mike@w3.org

--- Comment #1 from Michael[tm] Smith <mike@w3.org> ---
(In reply to Mark Rogers from comment #0)
> There are a couple of test suite problems related to white space in CSS
> media queries:
> 
> 1) Validator.nu (and media-queries/018-novalid.html) expects media='screen
> and (device-aspect-ratio: 16 / 9)' to be a failure due to whitespace in "16
> / 9". My reading of the spec is that whitespace is allowed in the ratio:
> http://www.w3.org/TR/css3-mediaqueries/#aspect-ratio
> (The media query from the test failure passes in jigsaw.w3.org)

Yeah, the current spec does say:

http://www.w3.org/TR/css3-mediaqueries/#values
"The <ratio> value is a positive (not zero or negative) <integer> followed by
optional whitespace, followed by a solidus (‘/’), followed by optional
whitespace, followed by a positive <integer>."

So we'll need to update the media-queries checker in the validator to match
that.

At the time the media-queries checker was implemented in the validator, the
spec said, "The value consists of two positive integers separated by a ‘/’."
(nothing about whitespace).

But that was a long time ago:
http://www.w3.org/TR/2007/CR-css3-mediaqueries-20070606/#device-aspect-ratio

So it's likely there are other places where we're not up to date with the
current spec.

Anyway, I'll fix the <ratio> case as soon as possible.


> 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*
 ;

...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 07:17:32 UTC