html icon indicating copy to clipboard operation
html copied to clipboard

Definition of all event handler attributes

Open lukewarlow opened this issue 1 year ago • 3 comments

What is the issue with the HTML Standard?

Both Trusted Types and the sanitizer API require a list of event handler attribute for use within their specs. It would be useful if the HTML spec could have a defined list of event handlers that these other specs could rely on.

cc @otherdaniel (idk if I missed something important worth mentioning?)

lukewarlow avatar Jul 24 '24 09:07 lukewarlow

I believe this already exists? https://html.spec.whatwg.org/#event-handlers-on-elements,-document-objects,-and-window-objects

domenic avatar Jul 25 '24 01:07 domenic

I believe this already exists? https://html.spec.whatwg.org/#event-handlers-on-elements,-document-objects,-and-window-objects

The original concern was around the spec language. How would I refer to these in spec text? Like: "If |name| matches any event handler name defined in [=event handlers on elements, document objects, and window objects=], then ..."?

The HTML spec seems to "inherit" some event handlers from other specs. E.g. onanimationstart & friends from CSS. Is there a list of those?

otherdaniel avatar Jul 26 '24 15:07 otherdaniel

The original concern was around the spec language. How would I refer to these in spec text? Like: "If |name| matches any event handler name defined in [=event handlers on elements, document objects, and window objects=], then ..."?

That seems reasonable, although you'd use the syntax <a href="https://html.spec.whatwg.org/#event-handlers-on-elements,-document-objects,-and-window-objects">event handlers on elements, document objects, and window objects</a> perhaps.

The HTML spec seems to "inherit" some event handlers from other specs. E.g. onanimationstart & friends from CSS. Is there a list of those?

That's a larger issue. Ideally these specs should not be monkeypatching HTML. It seems hard to enforce, but perhaps we can work on that?

domenic avatar Jul 27 '24 07:07 domenic