W3C home > Mailing lists > Public > www-style@w3.org > May 2013

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

From: L. David Baron <dbaron@dbaron.org>
Date: Mon, 27 May 2013 17:46:49 +0800
To: "Kang-Hao (Kenny) Lu" <kennyluck@csail.mit.edu>
Cc: WWW Style <www-style@w3.org>
Message-ID: <20130527094649.GA11802@crum.dbaron.org>
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

This archive was generated by hypermail 2.3.1 : Monday, 27 May 2013 09:47:30 UTC