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
getAttribute() doesn't return null for not existing attributes #46
Labels
breaking change
Some thing that requires a version bump due to breaking changes
bug
Something isn't working
spec:DOM-Level-2
https://www.w3.org/TR/DOM-Level-2-Core/
Milestone
Comments
domekomi
changed the title
getAttribute() doesn
getAttribute() doesn't return null for not existing attributes
May 4, 2020
karfau
added
documentation
Improvements or additions to documentation
help-wanted
External contributions welcome
needs investigation
Information is missing and needs to be researched
labels
Jan 21, 2021
karfau
added
breaking change
Some thing that requires a version bump due to breaking changes
bug
Something isn't working
spec:DOM-Level-2
https://www.w3.org/TR/DOM-Level-2-Core/
and removed
documentation
Improvements or additions to documentation
help-wanted
External contributions welcome
needs investigation
Information is missing and needs to be researched
labels
Aug 23, 2021
Also have this problem |
karfau
pushed a commit
that referenced
this issue
Feb 25, 2023
BREAKING CHANGE: `Element.getAttribute` and `Element.getAttributeNS` return `null` if the attribute doesn't exist closes #46 https://dom.spec.whatwg.org/#dom-element-getattribute
karfau
added a commit
that referenced
this issue
Mar 19, 2023
Reopening this since I'm still working on it in #482 |
karfau
added a commit
that referenced
this issue
Apr 2, 2023
karfau
added a commit
that referenced
this issue
Apr 2, 2023
karfau
added a commit
that referenced
this issue
Jun 9, 2023
- proper order in finding attributes (only affects duplicate attributes, which can only be created manually and anyways produce invalid XML) - properly remove item from previous last index (was not iterated over but the reference was kept) - set `ownerElement` to `null` even when `ownerElement.ownerDocument` is not set (which is an edge case which doesn't happen when parsing XML) - throw `DOMException` when there is no matching attribute - add test coverage - add doc comments regarding differences to the specification that still exist: - no named property indices support - add validation of qualified names in `Element` API which can throw `DOMException` as declared in the specs - always initialize required properties with `null` in `Attr` constructor BREAKING CHANGES: Mainly not throwing when removing an attribute that doesn't exist and other behavior that was different from the specification. closes #46 see #477
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking change
Some thing that requires a version bump due to breaking changes
bug
Something isn't working
spec:DOM-Level-2
https://www.w3.org/TR/DOM-Level-2-Core/
getAttribute()
and related methods don't return null for not existing attributes.Methods below should be fixed to return null.
The text was updated successfully, but these errors were encountered: