W3C home > Mailing lists > Public > www-style@w3.org > July 2015

Re: [selectors] Need to clearly define matching for :first-child, :nth-*, etc

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 15 Jul 2015 12:44:39 -0700
Message-ID: <CAAWBYDBeqF3BG8W5hr9q_HOUyM40f-C9-MKz15OWNa78GL8xsg@mail.gmail.com>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Cc: www-style list <www-style@w3.org>
On Wed, Jul 15, 2015 at 11:57 AM, Daniel Glazman
<daniel.glazman@disruptive-innovations.com> wrote:
> On 15/07/2015 20:12, Boris Zbarsky wrote:
>> There is some confusion about how things should work when an element has
>> no parent and hence no concept of siblings.
>> The language in the spec is vague enough that different people are
>> interpreting it different ways.  It would be good to clarify things here
>> by explicitly defining the sibling list of an element for purposes of
>> this stuff or something; right now there is no definition that I can find.
> I think we had that discussion when I originally added :nth-child() to
> a draft of Selectors 3 eons ago. The consensus was that the functional
> pseudo-class does not match if there is no parent IIRC. We considered
> another definition of nth sibling counting the nth nextSibling element
> from the earliest predecessor element but ditched it.

We explicitly decided the opposite some time ago, and Selectors 4
reflects that, replacing all mentions of parent/child with "sibling".

Received on Wednesday, 15 July 2015 19:45:26 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:18 UTC