Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 44 additions & 47 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2910,17 +2910,13 @@ optional boolean <dfn for="insert"><var>suppressObservers</var></dfn> (default f
<a for=iteration>continue</a>.

<li>
<p>If <var>inclusiveDescendant</var> is an <a for=/>element</a>:
<p>If <var>inclusiveDescendant</var> is an <a for=/>element</a> and
<var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a> is non-null:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this is not a change in behavior, as we can't upgrade elements with a null registry, but was this change intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you meant. Given that we can't upgrade element nor getting a connectedCallback with null registry, I think we can leave this null check as is.


<ol>
<li><p>If <var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a> is
null, then set <var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a> to
the result of <a for=/>looking up a custom element registry</a> given
<var>inclusiveDescendant</var>'s <a for=tree>parent</a>.

<li><p>Otherwise, if <var>inclusiveDescendant</var>'s
<a for=Element>custom element registry</a>'s <a for=CustomElementRegistry>is scoped</a> is
true, <a for=set>append</a> <var>inclusiveDescendant</var>'s <a for=Node>node document</a> to
<li><p>If <var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a>'s
<a for=CustomElementRegistry>is scoped</a> is true, then <a for=set>append</a>
<var>inclusiveDescendant</var>'s <a for=Node>node document</a> to
Comment thread
ja-y-son marked this conversation as resolved.
<var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a>'s
<a for=CustomElementRegistry>scoped document set</a>.

Expand All @@ -2937,25 +2933,13 @@ optional boolean <dfn for="insert"><var>suppressObservers</var></dfn> (default f
<a>upgrade an element</a> algorithm.
</ol>

<li>
<p>Otherwise, if <var>inclusiveDescendant</var> is a <a for=/>shadow root</a>:

<ol>
<li><p>If <var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a> is
null and <var>inclusiveDescendant</var>'s
<a for=ShadowRoot>keep custom element registry null</a> is false, then set
<var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a> to the result
of <a for=/>looking up a custom element registry</a> given <var>inclusiveDescendant</var>'s
<a for=DocumentFragment>host</a>.

<li><p>Otherwise, if <var>inclusiveDescendant</var>'s
<a for=ShadowRoot>custom element registry</a> is non-null and
<var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a>'s
<a for=CustomElementRegistry>is scoped</a> is true, <a for=set>append</a>
<var>inclusiveDescendant</var>'s <a for=Node>node document</a> to
<var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a>'s
<a for=CustomElementRegistry>scoped document set</a>.
</ol>
<li><p>Otherwise, if <var>inclusiveDescendant</var> is a <a for=/>shadow root</a>,
<var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a> is non-null, and
<var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a>'s
<a for=CustomElementRegistry>is scoped</a> is true, then <a for=set>append</a>
<var>inclusiveDescendant</var>'s <a for=Node>node document</a> to
<var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a>'s
<a for=CustomElementRegistry>scoped document set</a>.
</ol>
</ol>

Expand Down Expand Up @@ -6032,8 +6016,8 @@ algorithm is passed <var ignore>node</var> and <var ignore>oldDocument</var>, as
</div>

<div algorithm>
<p>To <dfn export id=concept-node-adopt>adopt</dfn> a <var>node</var> into a <var>document</var>, run
these steps:
<p>To <dfn export id=concept-node-adopt>adopt</dfn> a <a for=/>node</a> <var>node</var> into a
<a for=/>document</a> <var>document</var>:

<ol>
<li><p>Let <var>oldDocument</var> be <var>node</var>'s <a for=Node>node document</a>.
Expand All @@ -6046,17 +6030,27 @@ these steps:

<ol>
<li>
<p>For each <var>inclusiveDescendant</var> in <var>node</var>'s
<a>shadow-including inclusive descendants</a>:
<p>For each <var>inclusiveDescendant</var> of <var>node</var>'s
<a>shadow-including inclusive descendants</a>, in <a>shadow-including tree order</a>:

<ol>
<li><p>Set <var>inclusiveDescendant</var>'s <a for=Node>node document</a> to <var>document</var>.

<li><p>If <var>inclusiveDescendant</var> is a <a for=/>shadow root</a> and
<var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a>
<a>is a global custom element registry</a>, then set <var>inclusiveDescendant</var>'s
<a for=ShadowRoot>custom element registry</a> to <var>document</var>'s
<a>effective global custom element registry</a>.
<li>
<p>If <var>inclusiveDescendant</var> is a <a for=/>shadow root</a> and if any of the following
are true:

<ul>
<li><p><var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a> is null
and <var>inclusiveDescendant</var>'s <a for=ShadowRoot>keep custom element registry null</a>
is false; or

<li><p><var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a>
<a>is a global custom element registry</a>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to "is a global custom element registry" as this was lacking a null check before.

</ul>

<p>then set <var>inclusiveDescendant</var>'s <a for=ShadowRoot>custom element registry</a> to
<var>document</var>'s <a>effective global custom element registry</a>.

<li>
<p>Otherwise, if <var>inclusiveDescendant</var> is an <a for=/>element</a>:
Expand All @@ -6065,21 +6059,23 @@ these steps:
<li><p>Set the <a for=Node>node document</a> of each <a>attribute</a> in
<var>inclusiveDescendant</var>'s <a for=Element>attribute list</a> to <var>document</var>.

<li><p>If <var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a>
<a>is a global custom element registry</a>, 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
or <var>inclusiveDescendant</var>'s <a for=Element>custom element registry</a>'s
<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>.
</ol>
</ol>

<li><p>For each <var>inclusiveDescendant</var> in <var>node</var>'s
<a>shadow-including inclusive descendants</a> that is <a for=Element>custom</a>,
<a>enqueue a custom element callback reaction</a> with <var>inclusiveDescendant</var>, callback
name "<code>adoptedCallback</code>", and « <var>oldDocument</var>, <var>document</var> ».
<li><p>For each <var>inclusiveDescendant</var> of <var>node</var>'s
<a>shadow-including inclusive descendants</a> that is <a for=Element>custom</a>, in
<a>shadow-including tree order</a>: <a>enqueue a custom element callback reaction</a> with
<var>inclusiveDescendant</var>, callback name "<code>adoptedCallback</code>", and
« <var>oldDocument</var>, <var>document</var> ».
<!-- attributeChangedCallback is also old, then new -->

<li><p>For each <var>inclusiveDescendant</var> in <var>node</var>'s
<a>shadow-including inclusive descendants</a>, in <a>shadow-including tree order</a>, run the
<li><p>For each <var>inclusiveDescendant</var> of <var>node</var>'s
<a>shadow-including inclusive descendants</a>, in <a>shadow-including tree order</a>: run the
<a>adopting steps</a> with <var>inclusiveDescendant</var> and <var>oldDocument</var>.
</ol>
</ol>
Expand Down Expand Up @@ -11074,6 +11070,7 @@ James Graham,
James Greene,
James M Snell,
James Robinson,
Jayson Chen,
Jeffrey Yasskin,
Jens Lindström,
Jeremy Davis<!-- jeremydavis519; GitHub -->,
Expand Down