Skip to content
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

Fix document.cloneNode #514

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Fix document.cloneNode #514

wants to merge 6 commits into from

Conversation

Aierie
Copy link

@Aierie Aierie commented Jul 18, 2022

Node patch affects document too, which means this.ownerDocument.__CE_registry will cause an error because document.ownerDocument is null.

@google-cla
Copy link

google-cla bot commented Jul 18, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Comment on lines 96 to 98
const registry = this.ownerDocument
? this.ownerDocument!.__CE_registry
: (this as Document).__CE_registry;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this could be simplified to (this.ownerDocument ?? this).__CE_registry and kept inline.

Copy link
Author

Choose a reason for hiding this comment

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

Done, thanks

@omnoms
Copy link

omnoms commented Oct 31, 2022

Seems like the pull request failed a test, can this be picked up anew ? We are also facing this issue.

Aierie and others added 3 commits November 1, 2022 11:29
Node patch affects document too, which means `this.ownerDocument.__CE_registry` will cause an error because `document.ownerDocument` is `null`
@justinfagnani
Copy link
Collaborator

Is there a test we can add here?

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.

None yet

4 participants