Re: [selectors] Matching of :first-child and the like for elements whose parent is not an element

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 UTC