From 8226ff4bf74efc2b6fd157cd926d1de3cadd2995 Mon Sep 17 00:00:00 2001 From: Jayson Chen Date: Tue, 18 Nov 2025 17:22:53 -0800 Subject: [PATCH 1/3] Allow the creation of null registry element and shadowroot --- dom.bs | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/dom.bs b/dom.bs index 70e029a6..a9a0db61 100644 --- a/dom.bs +++ b/dom.bs @@ -5475,7 +5475,7 @@ interface Document : Node { interface XMLDocument : Document {}; dictionary ElementCreationOptions { - CustomElementRegistry customElementRegistry; + CustomElementRegistry? customElementRegistry; DOMString is; }; @@ -5847,7 +5847,8 @@ method steps are to return the result of running the dictionary options and a document document:
    -
  1. Let registry be null. +

  2. Let registry be the result of looking up a custom element registry + given document.

  3. Let is be null. @@ -5858,9 +5859,10 @@ dictionary options and a document document:

  4. If options["{{ElementCreationOptions/customElementRegistry}}"] exists, then set registry to it. -

  5. If registry's is scoped is false and - registry is not document's custom element registry, - then throw a "{{NotSupportedError!!exception}}" {{DOMException}}. +

  6. If registry is not null and registry's + is scoped is false and registry is not + document's custom element registry, then throw a + "{{NotSupportedError!!exception}}" {{DOMException}}.

  7. If options["{{ElementCreationOptions/is}}"] exists, then set is to it. @@ -5869,9 +5871,6 @@ dictionary options and a document document: "{{NotSupportedError!!exception}}" {{DOMException}}.

-
  • If registry is null, then set registry to the result of - looking up a custom element registry given document. -

  • Return registry and is. @@ -6672,7 +6671,7 @@ dictionary ShadowRootInit { SlotAssignmentMode slotAssignment = "named"; boolean clonable = false; boolean serializable = false; - CustomElementRegistry? customElementRegistry = null; + CustomElementRegistry? customElementRegistry; }; @@ -7604,17 +7603,12 @@ are:

  • Let registry be this's node document's custom element registry. -

  • -

    If init["{{ShadowRootInit/customElementRegistry}}"] is non-null: +

  • Set registry to init["{{ShadowRootInit/customElementRegistry}}"]. -

      -
    1. Set registry to init["{{ShadowRootInit/customElementRegistry}}"]. - -

    2. If registry's is scoped is false and - registry is not this's node document's - custom element registry, then throw a - "{{NotSupportedError!!exception}}" {{DOMException}}. -

    +
  • If registry is not null and registry's + is scoped is false and registry is not this's + node document's custom element registry, then throw a + "{{NotSupportedError!!exception}}" {{DOMException}}.

  • Run attach a shadow root with this, init["{{ShadowRootInit/mode}}"], init["{{ShadowRootInit/clonable}}"], From 8e910926b798bbfcbc5daad7617e35d304e023f0 Mon Sep 17 00:00:00 2001 From: Jayson Chen Date: Wed, 19 Nov 2025 14:08:03 -0800 Subject: [PATCH 2/3] Address nit --- dom.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dom.bs b/dom.bs index a9a0db61..42c13ca6 100644 --- a/dom.bs +++ b/dom.bs @@ -5859,8 +5859,8 @@ dictionary options and a document document:

  • If options["{{ElementCreationOptions/customElementRegistry}}"] exists, then set registry to it. -

  • If registry is not null and registry's - is scoped is false and registry is not +

  • If registry is non-null, and registry's + is scoped is false, and registry is not document's custom element registry, then throw a "{{NotSupportedError!!exception}}" {{DOMException}}. @@ -7605,8 +7605,8 @@ are:

  • Set registry to init["{{ShadowRootInit/customElementRegistry}}"]. -

  • If registry is not null and registry's - is scoped is false and registry is not this's +

  • If registry is non-null, and registry's + is scoped is false, and registry is not this's node document's custom element registry, then throw a "{{NotSupportedError!!exception}}" {{DOMException}}. From f2788895bca209ddadddf8ab3bd65669531fb4eb Mon Sep 17 00:00:00 2001 From: Jayson Chen Date: Thu, 20 Nov 2025 16:35:50 -0800 Subject: [PATCH 3/3] Condition on custom element registry exist in attachShadow --- dom.bs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dom.bs b/dom.bs index 42c13ca6..13224c96 100644 --- a/dom.bs +++ b/dom.bs @@ -7603,7 +7603,8 @@ are:

  • Let registry be this's node document's custom element registry. -

  • Set registry to init["{{ShadowRootInit/customElementRegistry}}"]. +

  • If init["{{ShadowRootInit/customElementRegistry}}"] exists, then + set registry to it.

  • If registry is non-null, and registry's is scoped is false, and registry is not this's