Re: [selectors4] An+B nits

On 22/02/2014 16:39, Brad Kemper wrote:
> In the An+B micro syntax section [1], I noted the following issues:
>
> • Example 35 uses '-n', but only later is it explained that an 'n'
> without a number before it is the same as 1n (thus '-n' means the same
> as '-1n'). For example 35, it would be more clear at that point if it
> was written as '-1n+6'. It would also be helpful IMO if there was also
> an example there using a negative n that resulted in a list of more than
> one item, such as:
>
> –4n+10   /* represents the 6th and 2nd elements in the list */
>
> By the way, would that be the right order of the results in the CSSOM,
> or do they get sorted?
>
> • the spec says that a negative 'n' is allowed, but it does not make it
> clear how to write that. The text above examples 38 and 39 imply that
> the minus sign can just replace the plus sign, but I think there should
> be prose to that effect, such as in the opening paragraph of the syntax
> section. Is it valid to also add a negative, as in '5n + -1'? I think
> the grammar section says no, but I am not sure.
>
> 1) http://dev.w3.org/csswg/selectors4/#anb


I believe the plan is to remove that section and reference CSS Syntax 
instead: http://dev.w3.org/csswg/css-syntax/#anb

Pseudo-classes can be though of as boolean tests. The sign of A in 
:nth-child(An+B) does not affect the order of Selector API results. (By 
the way, is that order specified at all?)

-- 
Simon Sapin

Received on Saturday, 22 February 2014 16:50:18 UTC