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

Re: [mediaqueries] Doesn't the spec contains an inexistent token in syntax definition?

From: Kenneth Rohde Christiansen <kenneth.r.christiansen@intel.com>
Date: Tue, 30 Oct 2012 18:52:50 +0100
Message-ID: <CAEC208s1behp+W9kL=0HQKuWVn-ed_MozemZJAE=7_QsjB6zCQ@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: François REMY <fremycompany_pub@yahoo.fr>, CSS WG <www-style@w3.org>
So this means that calc() should work in media queries? If so we can
probably look at that for WebKit.

When rewriting the grammar, please consider making "not (media-feature)"
valid.

Cheers
Kenneth


On Tue, Oct 30, 2012 at 6:47 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> On Tue, Oct 30, 2012 at 5:36 PM, François REMY
> <fremycompany_pub@yahoo.fr> wrote:
> > Hi all,
> >
> > While I was trying to explain to the guys over Microsoft Connect that
> > Internet Explorer should support the ‘calc()’ function in media queries
> > arguments (something no browser seems to do right now), I noticed
> there’s a
> > problem with the actual defintion of the syntax of CSS Media Queries.
> > Indeed, the spec uses an "expr" token in its "expression" definition :
> >
> >    media_query
> >     : [ONLY | NOT]? S* media_type S* [ AND S* expression ]*
> >     | expression [ AND S* expression ]*
> >     ;
> >
> >    expression
> >     : '(' S* media_feature S* [ ':' S* expr ]? ')' S*
> >     ;
> >
> > but refers to CSS 2.1 Grammar [1] which doesn't seem to define any 'expr'
> > token at all. However, the "expr" token is defined in the CSS3-Syntax
> spec
> > [2], but this is a WD spec and it is not referenced by the CSSMQ REC.
>
> It's in the non-normative Appendix G grammar, which is specialized for
> 2.1: <http://www.w3.org/TR/CSS21/grammar.html>
>
> (Just in case they then argue back that calc() isn't allowed per that
> grammar: you *obviously* can't literally follow Appendix G, because it
> excludes anything new introduced past 2.1, like the <resolution> type,
> which is obviously valid in MQ.)
>
> In the next few months, as I finish out the Syntax draft, I'll define
> better grammar tokens for these kinds of things to use, and redefine
> the various rule grammars in those terms, so that their grammars can
> look more like CSS property grammar than Lex grammar.  (I'd like to
> avoid requiring people to worry about whitespace when writing
> grammars, for example, as it's commonly gotten wrong.)
>
> ~TJ
>
> --
> ---------------------------------------------------------------------
> Intel Denmark Aps
> Langelinie Alle 35, DK-2100 Copenhagen
> CVR No. 76716919
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
>
Received on Tuesday, 30 October 2012 17:53:44 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:02 GMT