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(jruby): create_element should not set the doc's default ns #3463

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

flavorjones
Copy link
Member

What problem is this PR intended to solve?

The namespace should be nil by default, and must be set explicitly or when the node is parented.

Fixes #3457

Have you included adequate test coverage?

Yes.

Does this change affect the behavior of either the C or the Java implementations?

Just the Java implementation, to match CRuby behavior.

The ns should be set explicitly or when the node is parented.

Fixes #3457
@flavorjones flavorjones force-pushed the flavorjones-3457-jruby-ns-create-element branch from 8a4033e to ad5960d Compare March 10, 2025 01:56
}
element = document.createElementNS(namespace_uri, node_name);

element = document.createElementNS(null, node_name);
setNode(context.runtime, element);
Copy link
Contributor

@johnnyshields johnnyshields Mar 11, 2025

Choose a reason for hiding this comment

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

Can remove:

    Element element;
    String node_name = rubyStringToString(name);

Then do:

    setNode(context.runtime, document.createElementNS(null, node_name));

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.

[bug] JRuby: reparenting a node does not apply the parent's default namespace
2 participants