We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
The Element.getAttributeNames() in happy-dom v16 and v17 does not return the same values as browsers. It is working as expected in happy-dom v15.
Element.getAttributeNames()
To Reproduce
Try the following snippet in a browser console (tested in Firefox 135, Chrome 133 and Safari 18 on macOS):
const element = document.createElement('div'); element.setAttribute('ns1:key', 'value1'); element.setAttribute('ns2:key', 'value1'); element.setAttribute('key1', 'value1'); element.setAttribute('key2', ''); console.log(element.getAttributeNames()); // browser: ['ns1:key', 'ns2:key', 'key1', 'key2'] // happy-dom@17: ['ns2:key', 'key1', 'key2']
I also added a failing test in a fork: titouanmathis@8fba4af.
Expected behavior
happy-dom should return the same attributes as the browser when using the Element.getAttributeNames() method.
Screenshots Not relevant.
Device:
Additional context
Bug encountered in a vitest environment.
The text was updated successfully, but these errors were encountered:
fix: [capricorn86#1728] Update test to match browser behavior (wip)
8fba4af
No branches or pull requests
Describe the bug
The
Element.getAttributeNames()
in happy-dom v16 and v17 does not return the same values as browsers. It is working as expected in happy-dom v15.To Reproduce
Try the following snippet in a browser console (tested in Firefox 135, Chrome 133 and Safari 18 on macOS):
I also added a failing test in a fork: titouanmathis@8fba4af.
Expected behavior
happy-dom should return the same attributes as the browser when using the
Element.getAttributeNames()
method.Screenshots
Not relevant.
Device:
Additional context
Bug encountered in a vitest environment.
The text was updated successfully, but these errors were encountered: