Re: [css3-mediaqueries] "not", "only" and "and" as media_type

On Wednesday 2012-05-23 04:47 +0800, Kang-Hao (Kenny) Lu wrote:
> C. Change the spec: "not", "only" and "and" cannot be media_type.
> 
> == valid ==
> 
> == invalid ==
> and [ and (expr) ]*
> [ not | only ] [ not | only | and ] [ and (expr) ]*
> [ not | only ] [ and (expr) ]*

I would actually propose a slight modification of (C), which I
prefer:

  D. Change the spec:  'not', 'only', 'and', and 'or' cannot be
     media_type.

I think we should reject all four of these keywords (including 'or',
which is not currently in media queries, but which I'd like to put
in it along with extending media queries to allow what @supports
allows, syntax-wise) as reserved words that are not allowed as
media_type.


I also rather dislike (A) since it requires two token lookahead.
When starting a media query, if the first two tokens are IDENT(not)
IDENT(and), then the parser needs to look at the following token to
distinguish the following two valid possibilities:
  @media not and (color), screen { /* 'not' is the media type */ }
  @media not and and (color) { /* 'and' is the media type */ }

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂

Received on Monday, 27 May 2013 09:47:30 UTC