[css3-conditional] Describe the AND and NOT tokens closer to the OR and SUPPORTS_SYM tokens, and make sure all the tokens are hyperlinked.
authorL. David Baron <dbaron@dbaron.org>
Thu, 07 Feb 2013 17:53:44 -0800
changeset 7393139db90ee7b2
parent 7392 37491845e530
child 7394 e5c75837a624
[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.
css3-conditional/Overview.html
css3-conditional/Overview.src.html
     1.1 --- a/css3-conditional/Overview.html	Thu Feb 07 16:17:08 2013 -0800
     1.2 +++ b/css3-conditional/Overview.html	Thu Feb 07 17:53:44 2013 -0800
     1.3 @@ -573,15 +573,41 @@
     1.4     adding:
     1.5  
     1.6    <pre>
     1.7 -@{S}{U}{P}{P}{O}{R}{T}{S} {return SUPPORTS_SYM;}
     1.8 -{O}{R}                    {return OR;}
     1.9 +@{S}{U}{P}{P}{O}{R}{T}{S} {return <dfn
    1.10 +   id="supports_sym">SUPPORTS_SYM</dfn>;}
    1.11 +{O}{R}                    {return <dfn
    1.12 +   id=or>OR</dfn>;}
    1.13  </pre>
    1.14  
    1.15 -  <p>and the grammar by adding
    1.16 +  <p>This then extends the grammar in the <a
    1.17 +   href="http://www.w3.org/TR/CSS21/grammar.html">Grammar of CSS 2.1</a>,
    1.18 +   using the lexical scanner there, with the additions of <code><a
    1.19 +   href="http://www.w3.org/TR/css3-mediaqueries/#syntax">AND</a></code> and
    1.20 +   <code><a
    1.21 +   href="http://www.w3.org/TR/css3-mediaqueries/#syntax">NOT</a></code>
    1.22 +   tokens defined in the Media Queries specification <a href="#MEDIAQ"
    1.23 +   rel=biblioentry>[MEDIAQ]<!--{{!MEDIAQ}}--></a> and the <a
    1.24 +   href="#or"><code>OR</code></a> and <a
    1.25 +   href="#supports_sym"><code>SUPPORTS_SYM</code></a> tokens defined above,
    1.26 +   and with <code><a
    1.27 +   href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">declaration</a></code>,
    1.28 +   <code><a
    1.29 +   href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">any</a></code>,
    1.30 +   and <code><a
    1.31 +   href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">unused</a></code>
    1.32 +   productions and the <code><a
    1.33 +   href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">FUNCTION</a></code>
    1.34 +   token taken from the core syntax of CSS defined in <a
    1.35 +   href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">section 4.1.1
    1.36 +   (Tokenization)</a> of <a href="#CSS21"
    1.37 +   rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>, by adding:
    1.38  
    1.39    <pre><dfn id="supports_rule">supports_rule</dfn>
    1.40 -  : SUPPORTS_SYM S* <a
    1.41 -   href="#supports_condition"><i>supports_condition</i></a> S* <a
    1.42 +  : <a
    1.43 +   href="#supports_sym"><i>SUPPORTS_SYM</i></a> <a
    1.44 +   href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a
    1.45 +   href="#supports_condition"><i>supports_condition</i></a> <a
    1.46 +   href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a
    1.47     href="#group_rule_body"><i>group_rule_body</i></a>
    1.48    ;
    1.49  
    1.50 @@ -597,8 +623,10 @@
    1.51  
    1.52  <dfn
    1.53     id="supports_condition_in_parens">supports_condition_in_parens</dfn>
    1.54 -  : ( '(' S* <a
    1.55 -   href="#supports_condition"><i>supports_condition</i></a> S* ')' ) | <a
    1.56 +  : ( '(' <a
    1.57 +   href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a
    1.58 +   href="#supports_condition"><i>supports_condition</i></a> <a
    1.59 +   href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* ')' ) | <a
    1.60     href="#supports_declaration_condition"><i>supports_declaration_condition</i></a> |
    1.61      <a
    1.62     href="#general_enclosed"><i>general_enclosed</i></a>
    1.63 @@ -606,43 +634,48 @@
    1.64  
    1.65  <dfn
    1.66     id="supports_negation">supports_negation</dfn>
    1.67 -  : NOT S+ <a
    1.68 +  : <a
    1.69 +   href="http://www.w3.org/TR/css3-mediaqueries/#syntax"><i>NOT</i></a> <a
    1.70 +   href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <a
    1.71     href="#supports_condition_in_parens"><i>supports_condition_in_parens</i></a>
    1.72    ;
    1.73  
    1.74  <dfn
    1.75     id="supports_conjunction">supports_conjunction</dfn>
    1.76    : <a
    1.77 -   href="#supports_condition_in_parens"><i>supports_condition_in_parens</i></a> ( S+ AND S+ <a
    1.78 +   href="#supports_condition_in_parens"><i>supports_condition_in_parens</i></a> ( <a
    1.79 +   href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <a
    1.80 +   href="http://www.w3.org/TR/css3-mediaqueries/#syntax"><i>AND</i></a> <a
    1.81 +   href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <a
    1.82     href="#supports_condition_in_parens"><i>supports_condition_in_parens</i></a> )+
    1.83    ;
    1.84  
    1.85  <dfn
    1.86     id="supports_disjunction">supports_disjunction</dfn>
    1.87    : <a
    1.88 -   href="#supports_condition_in_parens"><i>supports_condition_in_parens</i></a> ( S+ OR S+ <a
    1.89 +   href="#supports_condition_in_parens"><i>supports_condition_in_parens</i></a> ( <a
    1.90 +   href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <a
    1.91 +   href="#or"><i>OR</i></a> <a
    1.92 +   href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <a
    1.93     href="#supports_condition_in_parens"><i>supports_condition_in_parens</i></a> )+
    1.94    ;
    1.95  
    1.96  <dfn
    1.97     id="supports_declaration_condition">supports_declaration_condition</dfn>
    1.98 -  : '(' S* declaration ')'
    1.99 +  : '(' <a
   1.100 +   href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a
   1.101 +   href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>declaration</i></a> ')'
   1.102    ;
   1.103  
   1.104  <dfn
   1.105     id="general_enclosed">general_enclosed</dfn>
   1.106 -  : ( FUNCTION | '(' ) ( any | unused )* ')'
   1.107 +  : ( <a
   1.108 +   href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>FUNCTION</i></a> | '(' ) ( <a
   1.109 +   href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>any</i></a> | <a
   1.110 +   href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>unused</i></a> )* ')'
   1.111    ;
   1.112  </pre>
   1.113  
   1.114 -  <p>in which <code>declaration</code>, <code>any</code>, and
   1.115 -   <code>unused</code> are the productions in the core syntax of CSS defined
   1.116 -   in <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">section
   1.117 -   4.1.1 (Tokenization)</a> of <a href="#CSS21"
   1.118 -   rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>, and the <code>AND</code> and
   1.119 -   <code>NOT</code> tokens are defined in the Media Queries specification <a
   1.120 -   href="#MEDIAQ" rel=biblioentry>[MEDIAQ]<!--{{!MEDIAQ}}--></a>.
   1.121 -
   1.122    <p> Implementations <strong>must</strong> parse ‘<code
   1.123     class=css>@supports</code>’ rules based on the above grammar, and when
   1.124     interpreting the above grammar, <strong>must</strong> match the production
   1.125 @@ -654,9 +687,11 @@
   1.126     allows for substantial future extensibility. Any ‘<code
   1.127     class=css>@supports</code>’ rule that does not parse according to the
   1.128     grammar above (that is, a rule that does not match this loose grammar
   1.129 -   which includes the general_enclosed production) is invalid. Style sheets
   1.130 -   <strong>must not</strong> use such a rule and processors
   1.131 -   <strong>must</strong> ignore such a rule (including all of its contents).
   1.132 +   which includes the <a
   1.133 +   href="#general_enclosed"><code>general_enclosed</code></a> production) is
   1.134 +   invalid. Style sheets <strong>must not</strong> use such a rule and
   1.135 +   processors <strong>must</strong> ignore such a rule (including all of its
   1.136 +   contents).
   1.137  
   1.138    <p>Each of these grammar terms is associated with a boolean result, as
   1.139     follows:
   1.140 @@ -768,14 +803,15 @@
   1.141  }</pre>
   1.142    </div>
   1.143  
   1.144 -  <p>To avoid confusion between ‘<code class=css>and</code>’ and ‘<code
   1.145 -   class=css>or</code>’, the syntax requires that both ‘<code
   1.146 -   class=css>and</code>’ and ‘<code class=css>or</code>’ be specified
   1.147 -   explicitly (rather than, say, using commas or spaces for one of them).
   1.148 -   Likewise, to avoid confusion caused by precedence rules, the syntax does
   1.149 -   not allow ‘<code class=css>and</code>’, ‘<code
   1.150 -   class=css>or</code>’, and ‘<code class=css>not</code>’ operators to
   1.151 -   be mixed without a layer of parentheses.
   1.152 +  <p>To avoid confusion between ‘<code class=css>and</code>’ and ‘<a
   1.153 +   href="#or"><code class=css>or</code></a>’, the syntax requires that both
   1.154 +   ‘<code class=css>and</code>’ and ‘<a href="#or"><code
   1.155 +   class=css>or</code></a>’ be specified explicitly (rather than, say,
   1.156 +   using commas or spaces for one of them). Likewise, to avoid confusion
   1.157 +   caused by precedence rules, the syntax does not allow ‘<code
   1.158 +   class=css>and</code>’, ‘<a href="#or"><code
   1.159 +   class=css>or</code></a>’, and ‘<code class=css>not</code>’ operators
   1.160 +   to be mixed without a layer of parentheses.
   1.161  
   1.162    <div class=example>
   1.163     <p>For example, the following rule is not valid:
   1.164 @@ -803,7 +839,8 @@
   1.165  
   1.166    <p>Furthermore, whitespace is required after a ‘<code
   1.167     class=css>not</code>’ and on both sides of an ‘<code
   1.168 -   class=css>and</code>’ or ‘<code class=css>or</code>’.
   1.169 +   class=css>and</code>’ or ‘<a href="#or"><code
   1.170 +   class=css>or</code></a>’.
   1.171  
   1.172    <p>The declaration being tested must always occur within parentheses, when
   1.173     it is the only thing in the expression.
   1.174 @@ -1652,6 +1689,8 @@
   1.175     <li>nested_statement, <a href="#nested_statement"
   1.176      title="section 3."><strong>3.</strong></a>
   1.177  
   1.178 +   <li>OR, <a href="#or" title="section 6."><strong>6.</strong></a>
   1.179 +
   1.180     <li>support, <a href="#dfn-support"
   1.181      title="section 6.1."><strong>6.1.</strong></a>
   1.182  
   1.183 @@ -1679,6 +1718,9 @@
   1.184  
   1.185     <li>supports_rule, <a href="#supports_rule"
   1.186      title="section 6."><strong>6.</strong></a>
   1.187 +
   1.188 +   <li>SUPPORTS_SYM, <a href="#supports_sym"
   1.189 +    title="section 6."><strong>6.</strong></a>
   1.190    </ul>
   1.191    <!--end-index-->
   1.192  </html>
     2.1 --- a/css3-conditional/Overview.src.html	Thu Feb 07 16:17:08 2013 -0800
     2.2 +++ b/css3-conditional/Overview.src.html	Thu Feb 07 17:53:44 2013 -0800
     2.3 @@ -375,14 +375,29 @@
     2.4  <a href="http://www.w3.org/TR/CSS21/grammar.html">Grammar of CSS 2.1</a>
     2.5  ([[!CSS21]], Appendix G) by adding:
     2.6  <pre>
     2.7 -@{S}{U}{P}{P}{O}{R}{T}{S} {return SUPPORTS_SYM;}
     2.8 -{O}{R}                    {return OR;}
     2.9 +@{S}{U}{P}{P}{O}{R}{T}{S} {return <dfn>SUPPORTS_SYM</dfn>;}
    2.10 +{O}{R}                    {return <dfn>OR</dfn>;}
    2.11  </pre>
    2.12  
    2.13 -<p>and the grammar by adding</p>
    2.14 +<p>This then extends the grammar in the
    2.15 +<a href="http://www.w3.org/TR/CSS21/grammar.html">Grammar of CSS 2.1</a>,
    2.16 +using the lexical scanner there, with the additions of
    2.17 +<code><a href="http://www.w3.org/TR/css3-mediaqueries/#syntax">AND</a></code> and
    2.18 +<code><a href="http://www.w3.org/TR/css3-mediaqueries/#syntax">NOT</a></code>
    2.19 +tokens defined in the Media Queries specification [[!MEDIAQ]]
    2.20 +and the <code>OR</code> and <code>SUPPORTS_SYM</code> tokens defined above,
    2.21 +and with
    2.22 +<code><a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">declaration</a></code>,
    2.23 +<code><a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">any</a></code>,
    2.24 +and <code><a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">unused</a></code>
    2.25 +productions
    2.26 +and the <code><a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">FUNCTION</a></code> token
    2.27 +taken from the core syntax of CSS defined in
    2.28 +<a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">section 4.1.1 (Tokenization)</a> of [[!CSS21]],
    2.29 +by adding:</p>
    2.30  
    2.31  <pre><dfn>supports_rule</dfn>
    2.32 -  : SUPPORTS_SYM S* <i>supports_condition</i> S* <i>group_rule_body</i>
    2.33 +  : <i>SUPPORTS_SYM</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <i>supports_condition</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <i>group_rule_body</i>
    2.34    ;
    2.35  
    2.36  <dfn>supports_condition</dfn>
    2.37 @@ -391,39 +406,31 @@
    2.38    ;
    2.39  
    2.40  <dfn>supports_condition_in_parens</dfn>
    2.41 -  : ( '(' S* <i>supports_condition</i> S* ')' ) | <i>supports_declaration_condition</i> |
    2.42 +  : ( '(' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <i>supports_condition</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* ')' ) | <i>supports_declaration_condition</i> |
    2.43      <i>general_enclosed</i>
    2.44    ;
    2.45  
    2.46  <dfn>supports_negation</dfn>
    2.47 -  : NOT S+ <i>supports_condition_in_parens</i>
    2.48 +  : <a href="http://www.w3.org/TR/css3-mediaqueries/#syntax"><i>NOT</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>supports_condition_in_parens</i>
    2.49    ;
    2.50  
    2.51  <dfn>supports_conjunction</dfn>
    2.52 -  : <i>supports_condition_in_parens</i> ( S+ AND S+ <i>supports_condition_in_parens</i> )+
    2.53 +  : <i>supports_condition_in_parens</i> ( <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <a href="http://www.w3.org/TR/css3-mediaqueries/#syntax"><i>AND</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>supports_condition_in_parens</i> )+
    2.54    ;
    2.55  
    2.56  <dfn>supports_disjunction</dfn>
    2.57 -  : <i>supports_condition_in_parens</i> ( S+ OR S+ <i>supports_condition_in_parens</i> )+
    2.58 +  : <i>supports_condition_in_parens</i> ( <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>OR</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>supports_condition_in_parens</i> )+
    2.59    ;
    2.60  
    2.61  <dfn>supports_declaration_condition</dfn>
    2.62 -  : '(' S* declaration ')'
    2.63 +  : '(' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>declaration</i></a> ')'
    2.64    ;
    2.65  
    2.66  <dfn>general_enclosed</dfn>
    2.67 -  : ( FUNCTION | '(' ) ( any | unused )* ')'
    2.68 +  : ( <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>FUNCTION</i></a> | '(' ) ( <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>any</i></a> | <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>unused</i></a> )* ')'
    2.69    ;
    2.70  </pre>
    2.71  
    2.72 -<p>in which <code>declaration</code>, <code>any</code>, and
    2.73 -<code>unused</code> are the productions in the core syntax of CSS
    2.74 -defined in <a
    2.75 -href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">section
    2.76 -4.1.1 (Tokenization)</a> of [[!CSS21]],
    2.77 -and the <code>AND</code> and <code>NOT</code> tokens are defined in
    2.78 -the Media Queries specification [[!MEDIAQ]].</p>
    2.79 -
    2.80  <p>
    2.81    Implementations <strong>must</strong> parse ''@supports'' rules
    2.82    based on the above grammar,
    2.83 @@ -438,7 +445,7 @@
    2.84    allows for substantial future extensibility.
    2.85    Any ''@supports'' rule that does not parse according to the grammar above
    2.86    (that is, a rule that does not match this loose grammar
    2.87 -  which includes the general_enclosed production)
    2.88 +  which includes the <code>general_enclosed</code> production)
    2.89    is invalid.
    2.90    Style sheets <strong>must not</strong> use such a rule and
    2.91    processors <strong>must</strong> ignore such a rule (including all of its contents).