Re: [whatwg/dom] Update element adoption logic for scoped registry (PR #1437)

@annevk commented on this pull request.



> @@ -4936,7 +4936,8 @@ and an optional <a for=/>document</a> <dfn export for="clone a node"><var>docume
    <var>fallbackRegistry</var>.
 
    <li><p>If <var>registry</var> <a>is a global custom element registry</a>, then set
-   <var>registry</var> to <var>document</var>'s <a>effective global custom element registry</a>.
+   <var>registry</var> to <var>document</var>'s <a for=Document>custom element registry</a>

```suggestion
   <var>registry</var> to <var>document</var>'s <a for=Document>custom element registry</a>'s
```
(might have to rewrap)

> -       <a for=CustomElementRegistry>is scoped</a> is false, then set
-       <var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a> to
-       <var>document</var>'s <a>effective global custom element registry</a>.
+       <li>
+        <p>If <var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a> is null
+        and <var>inclusiveDescendant</var>'s <a for=Element>keep custom element registry null</a>
+        is false; or <var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a>'s
+        <a for=CustomElementRegistry>is scoped</a> is false:
+
+        <ol>
+         <li><p>Let <var>registry</var> be null.
+
+         <li><p>If <var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a> is
+         non-null, <var>inclusiveDescendant</var>'s <a for=tree>parent</a> is null, or
+         <var>inclusiveDescendant</var>'s <a for=tree>parent</a> is a {{DocumentFragment}} but not
+         a {{ShadowRoot}}, then set <var>registry</var> to <var>document</var>'s

```suggestion
         a {{ShadowRoot}} <a for=/>node</a>, then set <var>registry</var> to <var>document</var>'s
```
I might actually want to define exclusive DocumentFragment for this. Similar to what we have for Text nodes.

> @@ -6745,6 +6763,9 @@ developers to pass a {{ShadowRoot}} node instead of a dictionary to {{Element/at
  <dt><dfn export for=Element>custom element registry</dfn>
  <dd>Null or a {{CustomElementRegistry}} object.
 
+ <dt><dfn export id=concept-element-keep-custom-elemenet-registry-null for=Element>keep custom element registry null</dfn>

```suggestion
 <dt><dfn export for=Element>keep custom element registry null</dfn>
```
We don't do hardcoded IDs for new concepts. Use the generated ID.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1437#pullrequestreview-3634964082
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/pull/1437/review/3634964082@github.com>

Received on Wednesday, 7 January 2026 13:48:50 UTC