Skip to content

Commit

Permalink
correct shadow root registry inheritance and constructor map
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Dec 18, 2024
1 parent 399551f commit af64359
Showing 1 changed file with 36 additions and 16 deletions.
52 changes: 36 additions & 16 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2843,12 +2843,22 @@ before a <var>child</var>, with an optional <i>suppress observers flag</i>, run
<a>upgrade an element</a> algorithm.
</ol>

<li><p>If <var>inclusiveDescendant</var> is <a>connected</a> and is a <a for=/>shadow root</a>
whose <a for=ShadowRoot>custom element registry</a> is null, then set
<var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a> to the result of
<b>looking up a custom element registry</b> given <var>inclusiveDescendant</var>'s
<a for=tree>parent</a>.
<!-- XXX xref -->
<li>
<p>Otherwise, if all of the following are true:

<ul class=brief>
<li><var>inclusiveDescendant</var> is <a>connected</a>,
<li><var>inclusiveDescendant</var> is a <a for=/>shadow root</a>,
<li><var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a> is null,
and
<li><var>inclusiveDescendant</var>'s <a for=ShadowRoot>keep custom element registry null</a>
is false,
</ul>

<p>then set <var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a> to
the result of <b>looking up a custom element registry</b> given
<var>inclusiveDescendant</var>'s <a for=DocumentFragment>host</a>.
<!-- XXX xref -->
</ol>
</ol>

Expand Down Expand Up @@ -6092,22 +6102,23 @@ enum SlotAssignmentMode { "manual", "named" };
<p>{{ShadowRoot}} <a for=/>nodes</a> are simply known as
<dfn export id=concept-shadow-root lt="shadow root">shadow roots</dfn>.

<p><a for=/>Shadow roots</a>'s associated <a for=DocumentFragment>host</a> is never null.</p>
<!-- If we ever change this, e.g., add a ShadowRoot object constructor, that would have serious
consequences for innerHTML. -->

<p><a for=/>Shadow roots</a> have an associated <dfn for=ShadowRoot>mode</dfn> ("<code>open</code>"
or "<code>closed</code>").</p>

<p><a for=/>Shadow roots</a> have an associated <dfn export for=ShadowRoot>delegates focus</dfn>.
It is initially set to false.</p>
<p><a for=/>Shadow roots</a> have an associated <dfn export for=ShadowRoot>delegates focus</dfn>
(a boolean). It is initially set to false.</p>

<p><a for=/>Shadow roots</a> have an associated
<dfn export for=ShadowRoot>available to element internals</dfn>. It is initially set to false.</p>
<dfn export for=ShadowRoot>available to element internals</dfn> (a boolean). It is initially set to
false.</p>

<p><a for=/>Shadow roots</a> have an associated <dfn export for=ShadowRoot>declarative</dfn>
(a boolean). It is initially set to false.</p>

<p><a for=/>Shadow roots</a>'s associated <a for=DocumentFragment>host</a> is never null.</p>
<!-- If we ever change this, e.g., add a ShadowRoot object constructor, that would have serious
consequences for innerHTML. -->

<p><a for=/>Shadow roots</a> have an associated <dfn for=ShadowRoot>slot assignment</dfn>
("<code>manual</code>" or "<code>named</code>").

Expand All @@ -6120,6 +6131,15 @@ It is initially set to false.</p>
<p><a for=/>Shadow roots</a> have an associated <dfn for=ShadowRoot>custom element registry</dfn>
(null or a {{CustomElementRegistry}} object).</p>

<p><a for=/>Shadow roots</a> have an associated
<dfn for=ShadowRoot>keep custom element registry null</dfn> (a boolean). It is initially false.

<p class=note>This can only ever be true in combination with declarative shadow roots. And it only
matters for as long as the <a for=/>shadow root</a>'s <a for=ShadowRoot>custom element registry</a>
is null.

<hr>

<p>A <a for=/>shadow root</a>'s <a>get the parent</a> algorithm, given an <var>event</var>, returns
null if <var>event</var>'s <a>composed flag</a> is unset and <a for=/>shadow root</a> is the
<a for=tree>root</a> of <var>event</var>'s <a for=Event>path</a>'s first struct's
Expand Down Expand Up @@ -6312,7 +6332,7 @@ dictionary ShadowRootInit {
"<code>precustomized</code>", or "<code>custom</code>".

<dt><dfn export id=concept-element-custom-element-definition for=Element>custom element definition</dfn>
<dd>Null or a <b for=/>custom element definition</b>.
<dd>Null or a <b>custom element definition</b>.
<!-- XXX xref -->

<dt><dfn export id=concept-element-is-value for=Element><code>is</code> value</dfn>
Expand Down Expand Up @@ -6461,7 +6481,7 @@ null), boolean <var>synchronousCustomElements</var> (default false), and null or
<li><p>Let <var>C</var> be <var>definition</var>'s
<a for="custom element definition">constructor</a>.

<li><p><a for=map>Set</a> <var>registry</var>'s <a>relevant global object</a>'s
<li><p><a for=map>Set</a> the <a>surrounding agent</a>'s
<b>active custom element constructor map</b>[<var>C</var>] to <var>registry</var>.
<!-- XXX xref -->

Expand Down Expand Up @@ -6517,7 +6537,7 @@ null), boolean <var>synchronousCustomElements</var> (default false), and null or
</ol>

<li>
<p><a for=map>Remove</a> <var>registry</var>'s <a>relevant global object</a>'s
<p><a for=map>Remove</a> the <a>surrounding agent</a>'s
<b>active custom element constructor map</b>[<var>C</var>].
<!-- XXX xref -->

Expand Down

0 comments on commit af64359

Please sign in to comment.