You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, I need to assert or put a guard clause to get correct typing inside a command event handler. Please update the type mapping under GlobalEventHandlersEventMap.
I don't think this is an issue with the DOM lib generator itself. GlobalEventHandlersEventMap is generated from upstream WebRef data, and oncommand is defined as a generic EventHandler in the IDL.
If the command event should be typed as CommandEvent, the upstream WebRef data/spec mapping would likely need to be fixed first.
I'm not completely sure yet whether the upstream mapping is actually incorrect, though, so I think that should be verified before treating this as a generator issue.
At least according to the WHATWG spec (https://html.spec.whatwg.org/multipage/indices.html#events-2) oncommand (the command event) fires a CommandEvent. If it didn't, you wouldn't be able to access ev.command which is arguably one of the most important properties of the fired event.
Would https://github.com/w3c/webref be the place to file an issue then? Or would it be even further upstream from there?
t least according to the WHATWG spec (html.spec.whatwg.org/multipage/indices.html#events-2) oncommand (the command event) fires a CommandEvent. If it didn't, you wouldn't be able to access ev.command which is arguably one of the most important properties of the fired event.
Would w3c/webref be the place to file an issue then? Or would it be even further upstream from there?
Not sure, but you can check there and make sure the isssue is from there
Maybe the CommandEvent is not recognized by this generator and it falls back to Event? At the very least, it does seem like I've filed this in the right place.
Activity
Bashamega commentedon Sep 19, 2026
Hello Jason P. Cochrane (@jpc-ae),
I don't think this is an issue with the DOM lib generator itself.
GlobalEventHandlersEventMapis generated from upstream WebRef data, andoncommandis defined as a genericEventHandlerin the IDL.If the
commandevent should be typed asCommandEvent, the upstream WebRef data/spec mapping would likely need to be fixed first.I'm not completely sure yet whether the upstream mapping is actually incorrect, though, so I think that should be verified before treating this as a generator issue.
jpc-ae commentedon Sep 19, 2026
At least according to the WHATWG spec (https://html.spec.whatwg.org/multipage/indices.html#events-2) oncommand (the command event) fires a
CommandEvent. If it didn't, you wouldn't be able to accessev.commandwhich is arguably one of the most important properties of the fired event.Would https://github.com/w3c/webref be the place to file an issue then? Or would it be even further upstream from there?
Bashamega commentedon Sep 19, 2026
Not sure, but you can check there and make sure the isssue is from there
jpc-ae commentedon Sep 19, 2026
Hmm, as far as I can find, upstream is correct. Unless I'm looking in the wrong place? https://github.com/w3c/webref/blob/a0506ac035dfcb3c1e6c0be9127be0b28f15a534/ed/events/html.json#L638
Bashamega commentedon Sep 19, 2026
You are looking at the right place i am not sure
jpc-ae commentedon Sep 19, 2026
Maybe the CommandEvent is not recognized by this generator and it falls back to Event? At the very least, it does seem like I've filed this in the right place.