-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Glint types <math> as Element. It should be the more specific MathMlElement.
This is an issue in some cases. E.g. Element does not implement ElementCSSInlineStyle, which MathMlElement does. This breaks usage of ember-style-modifier on <math> elements as documented by this failing test: jelhan/ember-style-modifier#237
There is already a special handing for SVGElement in Glint:
glint/packages/template/-private/dsl/types.d.ts
Lines 7 to 17 in 01b8deb
| /** | |
| * Given a tag name, returns an appropriate `Element` subtype. | |
| * NOTE: This will return a union for elements that exist both in HTML and SVG. Technically, this will be too permissive. | |
| */ | |
| export type ElementForTagName<Name extends string> = Name extends keyof HTMLElementTagNameMap | |
| ? Name extends keyof SVGElementTagNameMap | |
| ? HTMLElementTagNameMap[Name] & SVGElementTagNameMap[Name] | |
| : HTMLElementTagNameMap[Name] | |
| : Name extends keyof SVGElementTagNameMap | |
| ? SVGElementTagNameMap[Name] | |
| : Element; |
MathMlElement as well.boris-petrovNullVoxPopuli
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status