Skip to content

Fix GH-12850: DOMNameSpaceNode parent not unset when namespace gets unlinked #12897

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

Closed
wants to merge 1 commit into from

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Dec 7, 2023

The problem is that the namespace nodes are exposed as fake nodes because of their different underlying data structure, which means that the parent link isn't actually updated when it gets removed; and we don't have a simple way of tracking it.

So just perform a check for the node type and check whether the namespace declaration associated with the fake node is still in existence.

Note that the namespace nodes are created when query() executes, so just before the foreach loops. Hence we are able to test that the node can be fetched but the parent is already unset upon first time the object is read.

@nielsdos nielsdos marked this pull request as draft December 7, 2023 23:42
…s unlinked

The problem is that the namespace nodes are exposed as fake nodes
because of their different underlying data structure, which means that
the parent link isn't actually updated when it gets removed; and we
don't have a simple way of tracking it.

So just perform a check for the node type and check whether the
namespace declaration associated with the fake node is still in
existence.
@nielsdos nielsdos marked this pull request as ready for review December 8, 2023 17:44
@nielsdos nielsdos linked an issue Dec 8, 2023 that may be closed by this pull request
@nielsdos nielsdos marked this pull request as draft December 8, 2023 19:23
@nielsdos
Copy link
Member Author

The fix is insufficient. The only way to fix all of this mess is by fixing spec compliance, so postponing for that RFC.

@nielsdos nielsdos closed this Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOMNameSpaceNode parent not unset when namespace gets unlinked.
1 participant