Closed dontcallmedom closed 1 year ago
which have no reason to expose these handlers, since the events is never fired to these interfaces.
Coincidently, they are fired on body
(in Gecko). This is the same in WebKit, thought we only really care about them on Window and Body. It's actually also fine that they are fired on SVGSVGElement
, but I haven't tested that.
For consistency (and because, well, the web is weird like this), I think it's fine keeping them on the (erroneously and terribly misleading-named) WindowEventHandlers
mixin.
well, I meant that the spec never instructs to fire the event to any interface but the relevant global object (i.e. Window). So if the event is also meant to be fired on body, that should be spec'd.
Yes, I agree about that (that event behavior should be noted, but not specified): Somewhere in HTML (or DOM) the eventing behavior for WindowEventHandlers
is specified. In theory, "fire an event" handles all this automatically, by matching event handler names to "onwhatever" attributes across the various objects listed above.
Let me see if I can find it...
although if I understand https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers-on-elements,-document-objects,-and-window-objects:event-handlers-6 correctly, this means the gamepad events should be added as event handler content attributes and the associated table.
Yes, they should be in the table.... then I think this algorithm comes into play:
https://html.spec.whatwg.org/#determining-the-target-of-an-event-handler
When setting the attribute. If I'm reading correctly, the event target is determined there?
(just spotted your comment above where you landed at the same place)
@dontcallmedom, I'll file a bug an HTML and send a PR...
144 (cc @saschanaz ) added the
ongamepadconnected
andongamepaddiscconnected
toWindowEventHandlers
, but that mixin is also included inHTMLBodyElement
,HTMLFrameSetElement
,SVGSVGElement
which have no reason to expose these handlers, since the events is never fired to these interfaces.I guess this should be replaced by a partial on
Window
directly?