Re: [CSSWG] Resolutions 2008-03-04 and 2008-03-11

Brad Kemper:
> On Mar 11, 2008, at 9:49 AM, fantasai wrote:
>
>>   RESOLVED: White space is allowed in functional pseudos just after (
>>   and just before ). Preliminary conclusion on whitespace inside 2n+1
>>   is no white space allowed; this may be modified if feedback from  
>> web
>>   designers indicates it will be a usability problem.

It would be a little inconsistent to use different syntax  
restrictions for the arithmetic selectors and the arithmetic pseudo  
function used as a property value. On the other hand they differ,  
'calc()' does not support the variable n, ':nth-child()' does not  
support lengths. Also ':nth-child()' etc. probably will mostly be  
used with 'odd' and 'even'.

I think the reasoning for the limitations were reusability of the  
tokenizer as used for property values where numbers and units can  
already appear, but wouldn't it be more straightforward to use the  
same tokenizer as for the argument of 'calc()'?

> I would have preferred to be able to put space on either or both  
> sides of the plus sign (...),

Me too.

> I personally wouldn't expect there to ever be space between the "2"  
> and the "n".

I would, if "2n" was expandable to "2*n": "2 * n", "2* n", "2 *n", "2  
n".

David Baron proposed this earlier:

   Legal Examples:
     :nth-child( 3n + 1 )
     :nth-child( +3n - 2 )
     :nth-child( -n+ 6)
     :nth-child( +6 )
   Illegal Examples:
     :nth-child(3 n)
     :nth-child(+ 2n)
     :nth-child(+ 2)

Imagine making the addition (including its operator symbol) implied,  
just like the multiplication. Which of the following should be legal?

   :nth-child(3n1)     -> :nth-child(3n+1)
   :nth-child(3n 1)    -> :nth-child(3n+1)
   :nth-child(3n +1)   -> :nth-child(3n+1)
   :nth-child(3n -1)   -> :nth-child(3n-1)
   :nth-child(+3n 1)   -> :nth-child(3n+1)
   :nth-child(+3n +1)  -> :nth-child(3n+1)
   :nth-child(+3n -1)  -> :nth-child(3n-1)
   :nth-child(-3n 1)   -> :nth-child(-3n+1)
   :nth-child(-3n +1)  -> :nth-child(-3n+1)
   :nth-child(-3n -1)  -> :nth-child(-3n-1)
   :nth-child(3n + -1) -> :nth-child(3n-1)
   :nth-child(3n+ -1)  -> :nth-child(3n-1)
   :nth-child(3n +-1)  -> :nth-child(3n-1)
   :nth-child(3n+-1)   -> :nth-child(3n-1)

Received on Wednesday, 12 March 2008 10:59:25 UTC