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

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

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Wed, 15 Jul 2015 15:00:55 -0400
Message-ID: <55A6ADE7.3070103@mit.edu>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: www-style list <www-style@w3.org>
On 7/15/15 2:47 PM, Tab Atkins Jr. wrote:
> I just pinged Anne to define "sibling list" in DOM, to be the object
> and all of its siblings in tree order.  Then I'll switch Selectors to
> using that term and linkify it.

Sounds good.

> (But seriously, what are people misinterpreting this as? Do they think
> :first-child shouldn't match an element without a parent?

Yes, exactly.  Or more interesting, :nth-child(1).

> Switching away from the "parent/child" language was *explicitly* meant to avoid
> that sort of misinterpretation!)

Yeah, but using "sibling" in a meaning that's different from the normal 
"child of the same parent" meaning is not much better.

Of course the actual names of the selectors don't help either.  Since 
they insist on including the world "child", a spec reader needs a very 
clear indication that they don't _actually_ mean "child" when they say 
"child".  Leaving things underdefined causes people to assume the 
reasonable thing: that "child" means "child".  We can't change the 
selector names, so we have to define things very explicitly...

-Boris
Received on Wednesday, 15 July 2015 19:01:26 UTC

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