Skip to content

DOM: change how adoption works for DocumentFragment - #2925

Closed
annevk wants to merge 2 commits into
jsdom:masterfrom
annevk:annevk/adoption
Closed

annevk wants to merge 2 commits into
jsdom:masterfrom
annevk:annevk/adoption

Conversation

@annevk

@annevk annevk commented Mar 27, 2020

Copy link
Copy Markdown

See whatwg/dom#819 for context.


if (oldDocument !== newDocument) {
for (const inclusiveDescendant of shadowIncludingInclusiveDescendantsIterator(node)) {
if (!doItAnyway && DocumentFragment.isImpl(inclusiveDescendant) && inclusiveDescendant === node && node._host) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Suggested change
if (!doItAnyway && DocumentFragment.isImpl(inclusiveDescendant) && inclusiveDescendant === node && node._host) {
if (!forceDocumentFragmentAdoption && DocumentFragment.isImpl(inclusiveDescendant) && inclusiveDescendant === node && node._host) {


// https://dom.spec.whatwg.org/#concept-node-adopt
_adoptNode(node) {
_adoptNode(node, doItAnyway = false) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Suggested change
_adoptNode(node, doItAnyway = false) {
_adoptNode(node, forceDocumentFragmentAdoption = false) {

_adoptingSteps() {
const doc = this._appropriateTemplateContentsOwnerDocument(this._ownerDocument);
doc._adoptNode(this._templateContents);
doc._adoptNode(this._templateContents, /* doItAnyway= */ true);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Suggested change
doc._adoptNode(this._templateContents, /* doItAnyway= */ true);
doc._adoptNode(this._templateContents, /* forceDocumentFragmentAdoption= */ true);

@ExE-Boss ExE-Boss Apr 29, 2020 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There should be a space between forceDocumentFragmentAdoption and = to match how this is done in other files.

Suggested change
doc._adoptNode(this._templateContents, /* doItAnyway= */ true);
doc._adoptNode(this._templateContents, /* forceDocumentFragmentAdoption = */ true);

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.

@ExE-Boss, we've already discussed how unsolicited reviews are not welcome. They are especially unwelcome when they are on the PRs of contributors, instead of core members; we do not want the jsdom project to be a place where submitting a PR means you get random people coming by and critiquing your work, disconnected from the project maintainers.

@annevk

annevk commented Apr 28, 2020

Copy link
Copy Markdown
Author

@domenic if you could associate this with web-platform-tests/wpt#22504 somehow to see what's still missing that'd be great.

@annevk
annevk marked this pull request as ready for review April 28, 2020 06:32
@annevk

annevk commented Oct 18, 2022

Copy link
Copy Markdown
Author

@domenic ping on the above? I forgot about this for a bit, but I believe it's still something that needs to be done.

@domenic
domenic deleted the branch jsdom:master November 26, 2023 11:36
@domenic domenic closed this Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants