[dom] `document.importNode` and `document.adoptNode` should throw exceptions when acting upon ShadowRoots (#46)

The `importNode` algorithm relies on a `clone` of `node` however, the Shadow
DOM spec stipulates that cloning a `ShadowRoot` should raise a
`DataCloneError`. Consequently, importing a `ShadowRoot` should
be unsupported.

Additionally, it doesn't make sense for a document to `adopt` a `ShadowRoot` -
the shadow host and `ShadowRoot` should not have different documents.  In this
instance a `HierarchyRequestError` seems to make sense.

See https://github.com/w3c/webcomponents/issues/125

Using `bikeshed`:

Note:  I ran `bikeshed update && bikeshed spec` however the updated `dom.html` had spurious other updates to anchors unrelated to this change - first time using `bikeshed`, have I done something wrong here?
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/dom/pull/46

-- Commit Summary --

  * `document.importNode` and `document.adoptNode` should error when acting upon ShadowRoots

-- File Changes --

    M dom.bs (19)

-- Patch Links --

https://github.com/whatwg/dom/pull/46.patch
https://github.com/whatwg/dom/pull/46.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/46

Received on Thursday, 25 June 2015 18:48:39 UTC