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

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".

~TJ

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