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: Set localName as part of Document.createElement #229

Merged
merged 3 commits into from
Apr 26, 2021

Conversation

rrthomas
Copy link
Contributor

This seemed to be missing. Without it, xpath (XPath 1.0) works, but
xpath2 (XPath 2.0) and fontoxpath (XPath 3.x) do not match elements.

This seemed to be missing. Without it, xpath (XPath 1.0) works, but
xpath2 (XPath 2.0) and fontoxpath (XPath 3.x) do not match elements.
@karfau karfau changed the title lib/dom.js: make Document.createElement set the localName fix: Set localName as part of Document.createElement Apr 25, 2021
@karfau karfau added the spec:DOM Living Standard https://dom.spec.whatwg.org/ label Apr 25, 2021
@karfau
Copy link
Member

karfau commented Apr 25, 2021

I just checked, the property Element.localName (and also setting that value as part of Document.createElement) is only specified in the DOM living standard, but Node.localName is already specified in DOM Level 2.

I also checked that we are already and in all cases setting this field as part of Document.createElementNS (so using that method instead could be a workaround, until this PR is merged and released.

@rrthomas Thank you for the PR, are you able to add some minimal test(s) to test/dom/element.test.js that make sure this doesn't break again? (You can add a nested describe with a message of "createElement" and add your tests to it.)

@rrthomas
Copy link
Contributor Author

Thanks for the analysis (I'm not an expert in this area, so didn't venture to go further on my own!). I'll see if I can add a test.

@karfau karfau added this to the next release milestone Apr 26, 2021
@karfau
Copy link
Member

karfau commented Apr 26, 2021

Thank you for your contribution, it will be part of the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:DOM Living Standard https://dom.spec.whatwg.org/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants