Skip to content

Which interfaces should have event handler attributes? #1097

Open
@foolip

Description

@foolip

Filing an issue to continue the discussion in #785 (comment). 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions