# HG changeset patch # User L. David Baron # Date 1360288424 28800 # Node ID 139db90ee7b2acebcf0bb2afd5d377c90b57a598 # Parent 37491845e530c8b22a941e4b6e655b48621f37fd [css3-conditional] Describe the AND and NOT tokens closer to the OR and SUPPORTS_SYM tokens, and make sure all the tokens are hyperlinked. Addresses http://lists.w3.org/Archives/Public/www-style/2013Feb/0236.html which is Issue 9 (an editorial issue) in the last call disposition of comments. diff -r 37491845e530 -r 139db90ee7b2 css3-conditional/Overview.html --- a/css3-conditional/Overview.html Thu Feb 07 16:17:08 2013 -0800 +++ b/css3-conditional/Overview.html Thu Feb 07 17:53:44 2013 -0800 @@ -573,15 +573,41 @@ adding:
-@{S}{U}{P}{P}{O}{R}{T}{S} {return SUPPORTS_SYM;}
-{O}{R}                    {return OR;}
+@{S}{U}{P}{P}{O}{R}{T}{S} {return SUPPORTS_SYM;}
+{O}{R}                    {return OR;}
 
-

and the grammar by adding +

This then extends the grammar in the Grammar of CSS 2.1, + using the lexical scanner there, with the additions of AND and + NOT + tokens defined in the Media Queries specification [MEDIAQ] and the OR and SUPPORTS_SYM tokens defined above, + and with declaration, + any, + and unused + productions and the FUNCTION + token taken from the core syntax of CSS defined in section 4.1.1 + (Tokenization) of [CSS21], by adding:

supports_rule
-  : SUPPORTS_SYM S* supports_condition S* SUPPORTS_SYM S* supports_condition S* group_rule_body
   ;
 
@@ -597,8 +623,10 @@
 
 supports_condition_in_parens
-  : ( '(' S* supports_condition S* ')' ) | S* supports_condition S* ')' ) | supports_declaration_condition |
     general_enclosed
@@ -606,43 +634,48 @@
 
 supports_negation
-  : NOT S+ NOT S+ supports_condition_in_parens
   ;
 
 supports_conjunction
   : supports_condition_in_parens ( S+ AND S+ supports_condition_in_parens ( S+ AND S+ supports_condition_in_parens )+
   ;
 
 supports_disjunction
   : supports_condition_in_parens ( S+ OR S+ supports_condition_in_parens ( S+ OR S+ supports_condition_in_parens )+
   ;
 
 supports_declaration_condition
-  : '(' S* declaration ')'
+  : '(' S* declaration ')'
   ;
 
 general_enclosed
-  : ( FUNCTION | '(' ) ( any | unused )* ')'
+  : ( FUNCTION | '(' ) ( any | unused )* ')'
   ;
 
-

in which declaration, any, and - unused are the productions in the core syntax of CSS defined - in section - 4.1.1 (Tokenization) of [CSS21], and the AND and - NOT tokens are defined in the Media Queries specification [MEDIAQ]. -

Implementations must parse ‘@supports’ rules based on the above grammar, and when interpreting the above grammar, must match the production @@ -654,9 +687,11 @@ allows for substantial future extensibility. Any ‘@supports’ rule that does not parse according to the grammar above (that is, a rule that does not match this loose grammar - which includes the general_enclosed production) is invalid. Style sheets - must not use such a rule and processors - must ignore such a rule (including all of its contents). + which includes the general_enclosed production) is + invalid. Style sheets must not use such a rule and + processors must ignore such a rule (including all of its + contents).

Each of these grammar terms is associated with a boolean result, as follows: @@ -768,14 +803,15 @@ } -

To avoid confusion between ‘and’ and ‘or’, the syntax requires that both ‘and’ and ‘or’ be specified - explicitly (rather than, say, using commas or spaces for one of them). - Likewise, to avoid confusion caused by precedence rules, the syntax does - not allow ‘and’, ‘or’, and ‘not’ operators to - be mixed without a layer of parentheses. +

To avoid confusion between ‘and’ and ‘or’, the syntax requires that both + ‘and’ and ‘or’ be specified explicitly (rather than, say, + using commas or spaces for one of them). Likewise, to avoid confusion + caused by precedence rules, the syntax does not allow ‘and’, ‘or’, and ‘not’ operators + to be mixed without a layer of parentheses.

For example, the following rule is not valid: @@ -803,7 +839,8 @@

Furthermore, whitespace is required after a ‘not’ and on both sides of an ‘and’ or ‘or’. + class=css>and’ or ‘or’.

The declaration being tested must always occur within parentheses, when it is the only thing in the expression. @@ -1652,6 +1689,8 @@

  • nested_statement, 3. +
  • OR, 6. +
  • support, 6.1. @@ -1679,6 +1718,9 @@
  • supports_rule, 6. + +
  • SUPPORTS_SYM, 6. diff -r 37491845e530 -r 139db90ee7b2 css3-conditional/Overview.src.html --- a/css3-conditional/Overview.src.html Thu Feb 07 16:17:08 2013 -0800 +++ b/css3-conditional/Overview.src.html Thu Feb 07 17:53:44 2013 -0800 @@ -375,14 +375,29 @@ Grammar of CSS 2.1 ([[!CSS21]], Appendix G) by adding:
    -@{S}{U}{P}{P}{O}{R}{T}{S} {return SUPPORTS_SYM;}
    -{O}{R}                    {return OR;}
    +@{S}{U}{P}{P}{O}{R}{T}{S} {return SUPPORTS_SYM;}
    +{O}{R}                    {return OR;}
     
    -

    and the grammar by adding

    +

    This then extends the grammar in the +Grammar of CSS 2.1, +using the lexical scanner there, with the additions of +AND and +NOT +tokens defined in the Media Queries specification [[!MEDIAQ]] +and the OR and SUPPORTS_SYM tokens defined above, +and with +declaration, +any, +and unused +productions +and the FUNCTION token +taken from the core syntax of CSS defined in +section 4.1.1 (Tokenization) of [[!CSS21]], +by adding:

    supports_rule
    -  : SUPPORTS_SYM S* supports_condition S* group_rule_body
    +  : SUPPORTS_SYM S* supports_condition S* group_rule_body
       ;
     
     supports_condition
    @@ -391,39 +406,31 @@
       ;
     
     supports_condition_in_parens
    -  : ( '(' S* supports_condition S* ')' ) | supports_declaration_condition |
    +  : ( '(' S* supports_condition S* ')' ) | supports_declaration_condition |
         general_enclosed
       ;
     
     supports_negation
    -  : NOT S+ supports_condition_in_parens
    +  : NOT S+ supports_condition_in_parens
       ;
     
     supports_conjunction
    -  : supports_condition_in_parens ( S+ AND S+ supports_condition_in_parens )+
    +  : supports_condition_in_parens ( S+ AND S+ supports_condition_in_parens )+
       ;
     
     supports_disjunction
    -  : supports_condition_in_parens ( S+ OR S+ supports_condition_in_parens )+
    +  : supports_condition_in_parens ( S+ OR S+ supports_condition_in_parens )+
       ;
     
     supports_declaration_condition
    -  : '(' S* declaration ')'
    +  : '(' S* declaration ')'
       ;
     
     general_enclosed
    -  : ( FUNCTION | '(' ) ( any | unused )* ')'
    +  : ( FUNCTION | '(' ) ( any | unused )* ')'
       ;
     
    -

    in which declaration, any, and -unused are the productions in the core syntax of CSS -defined in section -4.1.1 (Tokenization) of [[!CSS21]], -and the AND and NOT tokens are defined in -the Media Queries specification [[!MEDIAQ]].

    -

    Implementations must parse ''@supports'' rules based on the above grammar, @@ -438,7 +445,7 @@ allows for substantial future extensibility. Any ''@supports'' rule that does not parse according to the grammar above (that is, a rule that does not match this loose grammar - which includes the general_enclosed production) + which includes the general_enclosed production) is invalid. Style sheets must not use such a rule and processors must ignore such a rule (including all of its contents).