W3C home > Mailing lists > Public > www-style@w3.org > March 2013

[selectors] Matching of :first-child and the like for elements whose parent is not an element

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 18 Mar 2013 14:48:42 -0400
Message-ID: <5147618A.2010401@mit.edu>
To: www-style list <www-style@w3.org>
The selectors spec says, at 
http://dev.w3.org/csswg/selectors4/#the-first-child-pseudo :

   The :first-child pseudo-class represents an element that is the first
   child of some other element.

and similar for other structural pseudo-classes.

On the face of it that means such selectors never match root elements or 
children of document fragments.

Is this restriction purposeful?  It seems like sane structural 
pseudo-class matching (e.g. nth-of-type) might be desirable with 
querySelector on DocumentFragment at the very least...

-Boris
Received on Monday, 18 March 2013 18:49:11 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:07 GMT