Re: [css3-conditional] Where () are ok inside @supports?

On Tue, Aug 9, 2011 at 7:23 PM, Alan Gresley <alan@css-class.com> wrote:
> On 10/08/2011 10:28 AM, L. David Baron wrote:
>>
>> I asked Vitor Menezes, an intern this summer at Mozilla, to work on
>> implementing @supports (as @-moz-supports).  He pointed out the
>> following problem with the grammar: The grammar currently *attempts*
>> to avoid allowing nesting extra sets of parentheses, e.g., to allow
>>   @supports (display:block) and (display:inline)
>> but disallow:
>>   @supports (display:block) and ((display:inline))
>> but it fails to do that in one case, which is that it allows double
>> (but not more) parentheses around the argument to "not".
>>
>> On reflection, I think forbidding doubling of parentheses is a bad
>> idea because it makes it harder for people to test things by
>> commenting them out.  In other words, since an author may want to
>> experiment with:
>>   @supports not ((display:block) and (display:inline))
>> by changing it to:
>>   @supports not ((display:block) /*and (display:inline)*/)
>> it should be legal to write:
>>   @supports not ((display:block))
>
>
> I never liked this form of nesting. It does not occur in CSS3 mediaqueries
> nor any other syntax that has statements with blocks. I believe that several
> arguments appearing between blocks are better separated by commas or
> keywords, like shown below for the ease of commenting parts out but more so
> to hunt down parsing errors.
>
>    @supports not (display:block and display:inline)
>
>    @supports not (display:block , display:inline)

Neither of these work, as the property values may include commas or
the keyword "and".  You absolutely must enclose the declarations in
parens (or some other delimiter that cannot be mistaken for part of a
value).

~TJ

Received on Wednesday, 10 August 2011 02:30:40 UTC