Re: [WICG/webcomponents] [Scoped registry] Clarify relationship with shadow roots (PR #965)

@sashafirsov commented on this pull request.



> +### Note on light DOM custom elements
+
+Custom elements that use light DOM (i.e. that don't call `this.attachShadow()`) may be scoped, but they must be scoped within a shadow root. For example:
+
+```html
+<body>
+  <shadow-element>
+    #shadow-root (registry=myCustomRegistry)
+      <light-element>
+        <div>Light DOM</div>
+      </light-element>
+  </shadow-element>
+</body>
+```
+
+In the above example, `<light-element>` is scoped within the shadow root of its containing `<shadow-element>`, whereas `<shadow-element>` is defined at the global document level.

Declarative Shadow DOM has its sibling and evolution as [Declarative Custom Element](https://github.com/w3c/webcomponents-cg/issues/32)  which could use shadow but also could live without, both in a baking now, not yet a proposal but already have POCs.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/pull/965#discussion_r943095726
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/pull/965/review/1069176815@github.com>

Received on Thursday, 11 August 2022 04:59:02 UTC