Re: computedStyle of cloneNode

On Tue, May 3, 2016 at 12:57 PM, Shane Stephens <> 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