Re: [whatwg/dom] Add Scoped Custom Element Registries (PR #1341)

@foolip commented on this pull request.

Editorial review done.

> @@ -6499,6 +6678,26 @@ null), and boolean <var>synchronousCustomElements</var> (default false):
  <li><p>Return <var>result</var>.
 </ol>
 
+<p>To <dfn>create an element internal</dfn> given a <a for=/>document</a> <var>document</var>, an

I actually am not sure what effect the `noexport` attribute has, but it's used elsewhere in DOM for spec-internal stuff, so:

```suggestion
<p>To <dfn noexport>create an element internal</dfn> given a <a for=/>document</a> <var>document</var>, an
```

Also, I first thought this might be related to `ElementInternals`, so a name like "internal create element steps" or "inner create element steps" would help avoid that. Not a big deal though.

>  
     <ol>
      <li><p>Let <var>C</var> be <var>definition</var>'s
      <a for="custom element definition">constructor</a>.
 
-     <li><p>Set <var>result</var> to the result of <a>constructing</a> <var>C</var>, with no
-     arguments.
-
-     <li><p>Assert: <var>result</var>'s <a for=Element>custom element state</a> and
-     <a for=Element>custom element definition</a> are initialized.
+     <li><p><a for=map>Set</a> the <a>surrounding agent</a>'s

It's very hard to follow the diff here inside "create an element", so for any other reviews, I think the main things are:

- Refactoring to use a "creating an element internal" helper, which takes the registry as an argument.
- A bunch of steps nested one more level under "Run these steps while catching any exceptions", ending with the added "Set result’s custom element registry to registry."

Basically searching for "registry" within the steps shows the interesting stuff.

And I can't find anything wrong :)

> @@ -7118,8 +7322,8 @@ are:
 <div algorithm>
 <p>To <dfn id=concept-attach-a-shadow-root>attach a shadow root</dfn>, given an
 <a for=/>element</a> <var>element</var>, a string <var>mode</var>, a boolean <var>clonable</var>,
-a boolean <var>serializable</var>, a boolean <var>delegatesFocus</var>, and a string
-<var>slotAssignment</var>:
+a boolean <var>serializable</var>, a boolean <var>delegatesFocus</var>, a string
+<var>slotAssignment</var>, and null or a {{CustomElementRegistry}} object <var>registry</var>:

If you like this style, here it is again:

```suggestion
<var>slotAssignment</var>, and a {{CustomElementRegistry}}-or-null <var>registry</var>:
```

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

Message ID: <whatwg/dom/pull/1341/review/2704236429@github.com>

Received on Thursday, 20 March 2025 22:17:22 UTC