Re: [w3c/webcomponents] Add Scoped CustomElementRegsitry explainer (#865)

caridy commented on this pull request.



> +export class MyElement extends HTMLElement {
+  constructor() {
+    this.attachShadow({mode: 'open', registry});
+  }
+}
+```
+
+### Scoped element creation APIs
+
+Element creation APIs, like `createElement()` and `innerHTML` can be grouped into global API (those on Document or Window) and scoped APIs (those on HTMLElement and ShadowRoot). The scoped APIs have an associated Node that can be used to look up a CustomElementRegistry and thus a scoped definition.
+
+In order to support scoped registries we add new scoped APIs, that were previously only available on `Document`, to `ShadowRoot`:
+
+* `createElement()`
+* `createElementNS()`
+* `importNode()`

what about `adoptNode`?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/pull/865#pullrequestreview-364306203

Received on Tuesday, 25 February 2020 17:29:35 UTC