[selectors][css-syntax] Allow comma-separated lists of An+B?

On the surface, it seems fairly trivial to extend pseudo-classes that 
take An+B expressions such that they allow multiple expressions in a 
single pseudo-class. This could be very handy for targeting many 
specific children in a way that cannot be easily written in a single, or 
few, expressions:

     td:nth-of-type(1, 3, 7, 10)

Admittedly, this feature would be used almost exclusively with integers 
rather than entire An+B expressions, but actively restricting the 
microsyntax in lists seems pointless.

There is :matches(), but it requires having to repeat the pseudo-class 
which is not ideal:

     td:matches(
       :nth-of-type(1), :nth-of-type(3),
       :nth-of-type(7), :nth-of-type(10)
     )

This isn't nearly as popular as :matches(), :has(), or :nth-child(An+B 
of sel), but it does come up fairly often. That said I'm curious to know 
what it would take to implement (and justify implementing) such a feature.

-- 
Daniel Tan
NOVALISTIC
<http://NOVALISTIC.com>

Received on Monday, 22 June 2015 17:07:50 UTC