Skip to content

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));

@flavorjones flavorjones added this to the v1.19.0 milestone Jul 11, 2025
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

3 participants