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 14:16:53 +0100
To: "Henrik Andersson" <henke@henke37.cjb.net>, "Boris Zbarsky" <bzbarsky@mit.edu>
Cc: www-style@w3.org
Message-ID: <op.wt8xufwbbunlto@oyvinds-desktop>
On Tue, 19 Mar 2013 22:15:34 +0100, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 3/19/13 4:53 PM, Henrik Andersson wrote:
>> If that is true then this should match:
>>
>> * html {
>
> No, because * explicitly matches only elements

Not just *, but in general the concept of a "document tree" in CSS is that  
of a tree of elements, which isn't exactly equivalent to the DOM.

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

-- 
Øyvind Stenhaug
Opera Software ASA
Received on Wednesday, 20 March 2013 13:17:37 GMT

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