dom
dom copied to clipboard
`Element`'s `toggleAttribute` should have an `-NS` counterpart.
toggleAttribute seems to be the only attribute-modifying method of Element that doesn't have an -NS counterpart - maybe it should be added for completeness? I have a branch with spec updates here I could turn into a PR if there's interest.
I figured this was intentional because the concept of boolean presence vs absence content attributes is HTML-specific, not an XML thing, no?
(I’d actually find this addition useful given the namespace-agnostic versions behave unsoundly when you don’t know whether other code is managing attrs with non-null namespaces, but am curious whether the omission may have been deliberate.)
It was added in https://github.com/whatwg/dom/pull/656 and I have to say I regret not pushing back on using "qualified name" there. That definitely feels like an oversight. Ideally all new APIs that aim to do tree manipulation operate on local name and namespace only. (Potentially with namespace hidden from the API surface, depending on the needs.)