Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ impl Rule for PreferAddEventListener {
}
}

// Can refer to the following sources for the list of event handler names, compare
// this array against any new `onx` functions introduced in browsers:
// - https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes#list_of_global_event_handler_attributes
// - https://github.com/mdn/browser-compat-data/blob/d5d5f2e21ef3f798784d1f5f75bde7c7f10f250e/api/Element.json
// - https://github.com/microsoft/TypeScript-DOM-lib-generator/blob/f915ac0c987300d75af41bfe4a34bb29a0fb941f/baselines/dom.generated.d.ts
//
// Please avoid adding new events that are not implemented in at least two major browser engines!
// Last updated: Nov 2025
const DOM_EVENT_TYPE_NAMES: phf::Set<&'static str> = phf::phf_set![
"AnimationEnd",
"AnimationIteration",
Expand Down Expand Up @@ -104,18 +112,21 @@ const DOM_EVENT_TYPE_NAMES: phf::Set<&'static str> = phf::phf_set![
"activate",
"afterblur",
"afterprint",
"animationEnd",
"animationStart",
"animationcancel",
"animationend",
"animationiteration",
"animationstart",
"appinstalled",
"auxclick",
"beforeblur",
"beforecopy",
"beforecut",
"beforeinput",
"beforeinstallprompt",
"beforematch",
"beforepaste",
"beforeprint",
"beforetoggle",
"beforeunload",
"blur",
"cancel",
Expand All @@ -129,9 +140,12 @@ const DOM_EVENT_TYPE_NAMES: phf::Set<&'static str> = phf::phf_set![
"compositionupdate",
"connect",
"consolemessage",
"contextlost",
"contextmenu",
"contextrestored",
"controllerchange",
"copy",
"cuechange",
"cut",
"dblclick",
"deactivate",
Expand All @@ -157,6 +171,7 @@ const DOM_EVENT_TYPE_NAMES: phf::Set<&'static str> = phf::phf_set![
"focusin",
"focusout",
"foreignfetch",
"formdata",
"fullscreenchange",
"gotpointercapture",
"hashchange",
Expand Down Expand Up @@ -208,6 +223,7 @@ const DOM_EVENT_TYPE_NAMES: phf::Set<&'static str> = phf::phf_set![
"pointermove",
"pointerout",
"pointerover",
"pointerrawupdate",
"pointerup",
"popstate",
"progress",
Expand All @@ -219,14 +235,17 @@ const DOM_EVENT_TYPE_NAMES: phf::Set<&'static str> = phf::phf_set![
"responsive",
"rightclick",
"scroll",
"scrollend",
"search",
"securitypolicyviolation",
"seeked",
"seeking",
"select",
"selectionchange",
"selectstart",
"show",
"sizechanged",
"slotchange",
"sourceclosed",
"sourceended",
"sourceopen",
Expand All @@ -236,15 +255,18 @@ const DOM_EVENT_TYPE_NAMES: phf::Set<&'static str> = phf::phf_set![
"submit",
"suspend",
"text",
"textInput",
"textinput",
"textInput",
"timeupdate",
"toggle",
"touchcancel",
"touchend",
"touchmove",
"touchstart",
"transitioncancel",
"transitionend",
"transitionrun",
"transitionstart",
"unload",
"unresponsive",
"update",
Expand Down
Loading