1717
1818 < h1 > CSS Conditional Rules Module Level 3</ h1 >
1919
20- < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 24 November
20+ < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 25 November
2121 2011</ h2 >
2222
2323 < dl >
2424 < dt > This version:
2525
26- < dd > < a href ="http://www.w3.org/TR/2011/ED-css3-conditional-20111124 / ">
27- http://www.w3.org/TR/2011/ED-css3-conditional-20111124 /</ a >
26+ < dd > < a href ="http://www.w3.org/TR/2011/ED-css3-conditional-20111125 / ">
27+ http://www.w3.org/TR/2011/ED-css3-conditional-20111125 /</ a >
2828
2929 < dt > Latest version:
3030
@@ -564,7 +564,11 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the
564564
565565supports_condition
566566 : supports_negation | supports_conjunction | supports_disjunction |
567- supports_declaration_condition
567+ supports_condition_in_parens
568+ ;
569+
570+ supports_condition_in_parens
571+ : ( '(' supports_condition ')' S* ) | supports_declaration_condition
568572 ;
569573
570574supports_negation
@@ -579,10 +583,6 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the
579583 : supports_condition_in_parens ( 'or' S* supports_condition_in_parens )+
580584 ;
581585
582- supports_condition_in_parens
583- : ( '(' supports_condition ')' S* ) | supports_declaration_condition
584- ;
585-
586586supports_declaration_condition
587587 : '(' S* core_declaration ')' S*
588588 ;</ pre >
@@ -598,16 +598,6 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the
598598 not</ strong > use such a rule and processors < strong > must</ strong > ignore
599599 such a rule.
600600
601- < p class =issue > The grammar above attempted to prevent nesting of extra
602- parentheses; however, discussion in the working group has led to the
603- conclusion that this was a bad idea, and therefore it should be changed to
604- allow arbitrary nesting of extra parentheses (which, for example, makes it
605- easier to comment things out). There was also discussion of allowing the
606- toplevel parentheses around a declaration to be omitted, though opinion
607- tended towards thinking this was a bad idea. See < a
608- href ="http://lists.w3.org/Archives/Public/www-style/2011Aug/thread.html#msg247 "> thread</ a >
609- on www-style.
610-
611601 < p class =note > Note that this means that declarations that meet the
612602 forward-compatible syntax for declarations are permitted (and support for
613603 them is then tested by the ‘< code class =css > @supports</ code > ’
@@ -629,6 +619,12 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the
629619
630620 < dd > The result is the result of the single child term.
631621
622+ < dt > supports_condition_in_parens
623+
624+ < dd > The result is the result of the single
625+ < code > supports_condition</ code > or
626+ < code > supports_declaration_condition</ code > child term.
627+
632628 < dt > supports_negation
633629
634630 < dd > The result is the < em > negation</ em > of the result of the
@@ -646,12 +642,6 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the
646642 < code > supports_condition_in_parens</ code > child terms is true; otherwise
647643 it is false.
648644
649- < dt > supports_condition_in_parens
650-
651- < dd > The result is the result of the single
652- < code > supports_condition</ code > or
653- < code > supports_declaration_condition</ code > child term.
654-
655645 < dt > supports_declaration_condition
656646
657647 < dd > The result is whether the CSS processor < a
@@ -751,6 +741,37 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the
751741}</ pre >
752742 </ div >
753743
744+ < p > The declaration being tested must always occur within parentheses, when
745+ it is the only thing in the expression.
746+
747+ < p >
748+
749+ < div class =example >
750+ < p > For example, the following rule is not valid:
751+
752+ < pre class =illegal-example > @supports display: flexbox {
753+ // ...
754+ }</ pre >
755+
756+ < p > Instead, authors must write:</ p >
757+
758+ < pre > @supports (display: flexbox) {
759+ // ...
760+ }</ pre >
761+ </ div >
762+
763+ < p > The syntax allows extra parentheses when they are not needed. This
764+ flexibility is sometimes useful for authors (for example, when commenting
765+ out parts of an expression) and may also be useful for authoring tools.
766+
767+ < div class =example >
768+ < p > For example, authors may write:</ p >
769+
770+ < pre > @supports ((display: flexbox)) {
771+ // ...
772+ }</ pre >
773+ </ div >
774+
754775 < h3 id =support-definition > < span class =secno > 6.1. </ span > Definition of
755776 support</ h3 >
756777
0 commit comments