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: Øyvind Stenhaug <oyvinds@opera.com>
Date: Wed, 20 Mar 2013 19:24:44 +0100
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: "Henrik Andersson" <henke@henke37.cjb.net>, "Boris Zbarsky" <bzbarsky@mit.edu>, "www-style list" <www-style@w3.org>
Message-ID: <op.wt9b3inmbunlto@oyvinds-desktop>
On Wed, 20 Mar 2013 17:03:20 +0100, Tab Atkins Jr. <jackalmage@gmail.com>  
wrote:

> On Wed, Mar 20, 2013 at 6:16 AM, Øyvind Stenhaug <oyvinds@opera.com>  
> wrote:
>> That's why I think it would be confusing to have :first-child etc match
>> something that isn't a child in this sense. Also, as has been pointed  
>> out
>> already, the current definition has been around for a long time. So I  
>> tend
>> to think that it should be kept, at the very least for the non-fragment  
>> case
>> (it's not clear to me what exactly the concrete use-cases for fragments
>> would be).
>
> "Been around for a long time" is only relevant if we think people
> would be confused, or think there are backwards-compat issues.  I
> don't think either is true here.

I would mainly be skeptical about having it match roots in regular  
(non-fragment) documents. The number of cases where the selector starts  
with a universal :first-child (and doesn't continue with "+html") is  
probably low, but I wouldn't bet on it being zero.

Changing for DocumentFragments seems like the way to go.

-- 
Øyvind Stenhaug
Opera Software ASA
Received on Wednesday, 20 March 2013 18:25:18 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:07 GMT