-
Notifications
You must be signed in to change notification settings - Fork 337
Set registry on null registry element on adopt instead of on insert #1423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
450c6bb
Remove registry restoration on insert but do it in adopt
7243117
Address comments
7c59103
Address comments
a57411c
Restore keep custom element registry and check it during adoption
25892f2
nits
annevk 9821f8a
more nits
annevk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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: | ||
|
|
||
| <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 | ||
|
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>. | ||
|
|
||
|
|
@@ -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> | ||
|
|
||
|
|
@@ -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>. | ||
|
|
@@ -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>, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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>: | ||
|
|
@@ -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> | ||
|
|
@@ -11074,6 +11070,7 @@ James Graham, | |
| James Greene, | ||
| James M Snell, | ||
| James Robinson, | ||
| Jayson Chen, | ||
| Jeffrey Yasskin, | ||
| Jens Lindström, | ||
| Jeremy Davis<!-- jeremydavis519; GitHub -->, | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.