[whatwg/dom] Which interfaces should have event handler attributes? (Issue #1097)

Filing an issue to continue the discussion in https://github.com/whatwg/dom/pull/785#issuecomment-1164539731. This spans many specs, but filing it in DOM since this is where events are defined.

Looking at there there are event handler attributes like `onclick` on the platform today, one might infer the following principle at work: event handler attributes should be present on the interface(s) that an event can fire on, and any additional interfaces that the event can bubble through. Therefore, there are `onclick` attributes on `HTMLElement`, `Document` and `Window`.

I have a few questions around this:
- Should `ShadowRoot` have event handler attributes for all events that can bubble, like `onclick`?
- Why does `GlobalEventHandlers` have attributes for events that don't bubble, like all of the media element events?
- Why do we put event handler attributes on `HTMLElement`+`SVGElement`+`MathMLElement` even when the events can fire on and bubble through plain `Element` instances? `onclick` is an example of this.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1097
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/1097@github.com>

Received on Friday, 22 July 2022 10:28:02 UTC