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: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Tue, 19 Mar 2013 21:07:29 +0100
Message-ID: <5148C581.2050109@disruptive-innovations.com>
To: www-style@w3.org
On 19/03/13 02:53, fantasai wrote:

> On 03/18/2013 12:29 PM, Boris Zbarsky wrote:
>> On 3/18/13 3:26 PM, Tab Atkins Jr. wrote:
>>> fantasai says this was indeed purposeful, and letting them match the
>>> root doesn't really buy you anything in a normal document
>> Agreed;
> I honestly have no idea why it was defined that way, the spec just seems
> rather explicit about defining it that way. I wouldn't be opposed to a
> change here, but am curious if there is any reason, other than the
> semantics of the world "child", the restriction was put in place.
> Maybe Tantek or glazou remember?

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.

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.

Received on Tuesday, 19 March 2013 20:07:53 UTC

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