Skip to content

Commit f156ec0

Browse files
ja-y-sonannevk
andauthored
Allow the creation of null registry elements and shadow roots
Tests: - web-platform-tests/wpt#56108 - web-platform-tests/wpt#56176 Helps with #1413. Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
1 parent 918ebc0 commit f156ec0

1 file changed

Lines changed: 25 additions & 24 deletions

File tree

dom.bs

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5475,7 +5475,7 @@ interface Document : Node {
54755475
interface XMLDocument : Document {};
54765476

54775477
dictionary ElementCreationOptions {
5478-
CustomElementRegistry customElementRegistry;
5478+
CustomElementRegistry? customElementRegistry;
54795479
DOMString is;
54805480
};
54815481

@@ -5847,31 +5847,36 @@ method steps are to return the result of running the
58475847
dictionary <var>options</var> and a <a for=/>document</a> <var>document</var>:
58485848

58495849
<ol>
5850-
<li><p>Let <var>registry</var> be null.
5850+
<li><p>Let <var>registry</var> be the result of <a for=/>looking up a custom element registry</a>
5851+
given <var>document</var>.
58515852

58525853
<li><p>Let <var>is</var> be null.
58535854

58545855
<li>
58555856
<p>If <var>options</var> is a dictionary:
58565857

58575858
<ol>
5858-
<li><p>If <var>options</var>["{{ElementCreationOptions/customElementRegistry}}"]
5859-
<a for=map>exists</a>, then set <var>registry</var> to it.
5860-
5861-
<li><p>If <var>registry</var>'s <a for=CustomElementRegistry>is scoped</a> is false and
5862-
<var>registry</var> is not <var>document</var>'s <a for=Document>custom element registry</a>,
5863-
then <a>throw</a> a "{{NotSupportedError!!exception}}" {{DOMException}}.
5864-
58655859
<li><p>If <var>options</var>["{{ElementCreationOptions/is}}"] <a for=map>exists</a>, then set
58665860
<var>is</var> to it.
58675861

5868-
<li><p>If <var>registry</var> is non-null and <var>is</var> is non-null, then <a>throw</a> a
5862+
<li>
5863+
<p>If <var>options</var>["{{ElementCreationOptions/customElementRegistry}}"]
5864+
<a for=map>exists</a>:
5865+
5866+
<ol>
5867+
<li><p>If <var>is</var> is non-null, then <a>throw</a> a "{{NotSupportedError!!exception}}"
5868+
{{DOMException}}.
5869+
5870+
<li><p>Set <var>registry</var> to
5871+
<var>options</var>["{{ElementCreationOptions/customElementRegistry}}"].
5872+
</ol>
5873+
5874+
<li><p>If <var>registry</var> is non-null, <var>registry</var>'s
5875+
<a for=CustomElementRegistry>is scoped</a> is false, and <var>registry</var> is not
5876+
<var>document</var>'s <a for=Document>custom element registry</a>, then <a>throw</a> a
58695877
"{{NotSupportedError!!exception}}" {{DOMException}}.
58705878
</ol>
58715879

5872-
<li><p>If <var>registry</var> is null, then set <var>registry</var> to the result of
5873-
<a for=/>looking up a custom element registry</a> given <var>document</var>.
5874-
58755880
<li><p>Return <var>registry</var> and <var>is</var>.
58765881
</ol>
58775882

@@ -6672,7 +6677,7 @@ dictionary ShadowRootInit {
66726677
SlotAssignmentMode slotAssignment = "named";
66736678
boolean clonable = false;
66746679
boolean serializable = false;
6675-
CustomElementRegistry? customElementRegistry = null;
6680+
CustomElementRegistry? customElementRegistry;
66766681
};
66776682
</pre>
66786683

@@ -7604,17 +7609,13 @@ are:
76047609
<li><p>Let <var>registry</var> be <a>this</a>'s <a>node document</a>'s
76057610
<a for=Document>custom element registry</a>.
76067611

7607-
<li>
7608-
<p>If <var>init</var>["{{ShadowRootInit/customElementRegistry}}"] is non-null:
7609-
7610-
<ol>
7611-
<li><p>Set <var>registry</var> to <var>init</var>["{{ShadowRootInit/customElementRegistry}}"].
7612+
<li><p>If <var>init</var>["{{ShadowRootInit/customElementRegistry}}"] <a for=map>exists</a>, then
7613+
set <var>registry</var> to it.
76127614

7613-
<li><p>If <var>registry</var>'s <a for=CustomElementRegistry>is scoped</a> is false and
7614-
<var>registry</var> is not <a>this</a>'s <a>node document</a>'s
7615-
<a for=Document>custom element registry</a>, then <a>throw</a> a
7616-
"{{NotSupportedError!!exception}}" {{DOMException}}.
7617-
</ol>
7615+
<li><p>If <var>registry</var> is non-null, <var>registry</var>'s
7616+
<a for=CustomElementRegistry>is scoped</a> is false, and <var>registry</var> is not <a>this</a>'s
7617+
<a>node document</a>'s <a for=Document>custom element registry</a>, then <a>throw</a> a
7618+
"{{NotSupportedError!!exception}}" {{DOMException}}.
76187619

76197620
<li><p>Run <a>attach a shadow root</a> with <a>this</a>,
76207621
<var>init</var>["{{ShadowRootInit/mode}}"], <var>init</var>["{{ShadowRootInit/clonable}}"],

0 commit comments

Comments
 (0)