Re: [whatwg/dom] Don't allow adopting DocumentFragment of a template element (#744)

> If I insert a node that has an attached `ShadowRoot` into a different document, it wouldn't be adopted? I suspect you didn't mean to say that.

Obviously, we should adopt `ShadowRoot` if its host is adopted. What we don't want to allow is adopting `ShadowRoot` without adopting its host.

> I suppose what we need to do is that when you adopt a node that has a host, that needs to be handled in a special way.

That might be a neat idea to handle both document fragment types. But really, the only place we need a check is https://dom.spec.whatwg.org/#dom-document-adoptnode because all other public DOM APIs would adopt a node either throws on `ShadowRoot` or takes the children of `DocumentFragment` so there is no danger of adopting a node.

On a completely unrelated note, I wish DOM / HTML spec had spec assertions like ECMA. That would clarify a lot of subtle conditions like this.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/744#issuecomment-482392288

Received on Friday, 12 April 2019 00:43:07 UTC