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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 19 Mar 2013 13:27:52 -0700
Message-ID: <CAAWBYDByJ2_W_SPMuUTh76eiE5i7zsLjLUX1bdW8=QyBv9+qsg@mail.gmail.com>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Cc: www-style list <www-style@w3.org>
On Tue, Mar 19, 2013 at 1:07 PM, Daniel Glazman
<daniel.glazman@disruptive-innovations.com> wrote:
> Well. querySelector() just did not exist at all at the time we
> designed :first-child and the first versions of the Selector API spec
> were allowing querySelector() only on the document, not on fragments or
> even any element... I guess at the time it changed to allow it on
> document fragments, we were almost in PR and not in a position to change
> the spec.
> So we need to deal with Boris's request as an errata, and do a s/some
> other element/some other node/ in the prose he quoted.

No real need for errata.  We can just change the definition in
Selectors 4, and SelectorsAPI2 can specify the behavior on

> About not selecting the root of the document, I don't see that
> as a bug since the name of the pseudo is first-*child* after all.

I don't see a meaningful distinction between a root node and a node
without a parent in a DocumentFragment.

Plus, the :*-child pseudos are just unrestricted variants of the other
pseudos like :first-of-type, so trying to draw too much meaning from
the name doesn't seem useful.  We could have called it
:first-among-siblings, but that's a bad name for other reasons.

Received on Tuesday, 19 March 2013 20:28:42 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:27 UTC