W3C home > Mailing lists > Public > www-style@w3.org > May 2016

Re: computedStyle of cloneNode

From: Rune Lillesveen <rune@opera.com>
Date: Tue, 3 May 2016 13:13:45 +0200
Message-ID: <CANz6XvSrTMmvB1O66Tv1bCcsRvoV4s3h8Q2AO6sEWFW-KGedmw@mail.gmail.com>
To: Shane Stephens <shans@google.com>
Cc: "L. David Baron" <dbaron@dbaron.org>, www-style list <www-style@w3.org>
On Tue, May 3, 2016 at 12:57 PM, Shane Stephens <shans@google.com> wrote:
> I'm not sure it makes sense to match rules on out-of-document elements at
> all. Some rules (like nth-child) are conditional and may match once the
> element is inserted (plus there's inheritance), so any computed style is not
> guaranteed to be correct. I'd rather specify that elements must be in the
> tree to match rules, and either provide no style or provide initial values
> only for out-of-document elements.

I didn't understand what you meant by :nth-child and the computed
style not being correct. :nth-child would never match detached
elements which do not have a parent element, the same way document
root elements never match :nth-child. Descendants would match as

> I don't think there are any compatibility issues for open web content as our
> behavior here is quite divergent.

No, probably not. I don't know if there are any obvious use cases here.

Rune Lillesveen
Received on Tuesday, 3 May 2016 11:14:14 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:59 UTC