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

Inconsistency in getAttribute and setAttribute regarding invalid attribute names #3733

Closed
DemiMarie opened this issue Jun 3, 2018 · 1 comment

Comments

@DemiMarie
Copy link

Currently,

<div #x=y></div>

parses successfully. The #x attribute of the resulting DOM node can be successfully queried using getAttribute — but trying to modify it with setAttribute throws.

It may not be possible to change this, but it is still a poor API, and such documents have no serialization as XML. Perhaps a deprecation warning could be logged when getAttribute is called with such a name?

@domenic
Copy link
Member

domenic commented Jun 4, 2018

Fixing setAttribute is tracked by whatwg/dom#449, which is a bit stalled. Since setAttribute is defined in DOM, let's use that issue tracker instead of this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants