- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Mon, 18 Mar 2013 12:26:07 -0700
- To: Boris Zbarsky <bzbarsky@mit.edu>
- Cc: www-style list <www-style@w3.org>
On Mon, Mar 18, 2013 at 11:48 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote: > 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... fantasai says this was indeed purposeful, and letting them match the root doesn't really buy you anything in a normal document, but your documentFragment usecase is compelling. I think we should change to at least allow it in that case. I suspect it's compat-friendly to allow it to match a normal root as well. ~TJ
Received on Monday, 18 March 2013 19:26:54 UTC