-
Notifications
You must be signed in to change notification settings - Fork 12.8k
className is only included in HTMLElement, not Element #3220
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
Comments
Spec agrees: http://www.w3.org/TR/2015/WD-dom-20150428/#element |
Tangentially, another colleague pointed out to me that the same problem exists with |
The problem is, SVG elements has a different definition of http://www.w3.org/TR/SVG/single-page.html#types-InterfaceSVGStylable
So it seems in I also discussed this issue here #424 (comment) . |
Confirmed the current IE spec (from which the dom contents are generated) puts the |
@zhengbli looks like an IE spec issue. |
Looked into WebIDL spec and found that overriding of interface members is explicitly allowed:
Maybe it is desirable for TS to be aligned to this behavior, or sometimes it is awkward to translate WebIDL interfaces to TS ones. Oh, it seems the situation of
Update: |
It does seem like for practical purposes at least, (On the other hand, I think |
Surprisingly even SVG2 spec uses DOM2. |
@saschanaz It looks like a bug of SVG2 spec for me, because the same spec references DOM4 in another place:
Additionally, there is no multiple DOM implementaions with different levels in browsers, and the following expressions are both true:
Update: In latest SVG2 draft, So maybe we can just remove |
@Arnavion pointed out to me that a recent update moved
classList
fromHTMLElement
up intoElement
, which is great.However,
className
appears to still be only inHTMLElement
. Is there a reason why? MDN at least seems to indicate that both should be common to Element.It'd be great if this were moved up as well, as we currently need to cast when writing class manipulation APIs that should have no problem supporting
Element
(bothHTMLElement
andSVGElement
). Given how these declarations are auto-generated though, I'm not sure what that would require.The text was updated successfully, but these errors were encountered: