1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * http://www.whatwg.org/specs/web-apps/current-work/#eventhandler
9 * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
10 * Opera Software ASA. You are granted a license to use, reproduce
11 * and create derivative works of this document.
13 [LegacyTreatNonObjectAsNull]
14 callback EventHandlerNonNull = any (Event event);
15 typedef EventHandlerNonNull? EventHandler;
17 [LegacyTreatNonObjectAsNull]
18 callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event);
19 typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler;
21 [LegacyTreatNonObjectAsNull]
22 callback OnErrorEventHandlerNonNull = any ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column, optional any error);
23 typedef OnErrorEventHandlerNonNull? OnErrorEventHandler;
25 interface mixin GlobalEventHandlers {
26 attribute EventHandler onabort;
27 attribute EventHandler onblur;
28 // We think the spec is wrong here. See OnErrorEventHandlerForNodes/Window
30 // attribute OnErrorEventHandler onerror;
31 attribute EventHandler onfocus;
32 attribute EventHandler oncancel;
33 attribute EventHandler onauxclick;
34 attribute EventHandler onbeforeinput;
35 [Pref="dom.element.popover.enabled"]
36 attribute EventHandler onbeforetoggle;
37 attribute EventHandler oncanplay;
38 attribute EventHandler oncanplaythrough;
39 attribute EventHandler onchange;
40 attribute EventHandler onclick;
41 attribute EventHandler onclose;
42 attribute EventHandler oncontextmenu;
43 attribute EventHandler oncopy;
44 attribute EventHandler oncuechange;
45 attribute EventHandler oncut;
46 attribute EventHandler ondblclick;
47 attribute EventHandler ondrag;
48 attribute EventHandler ondragend;
49 attribute EventHandler ondragenter;
50 [Func="Event::IsDragExitEnabled"]
51 attribute EventHandler ondragexit;
52 attribute EventHandler ondragleave;
53 attribute EventHandler ondragover;
54 attribute EventHandler ondragstart;
55 attribute EventHandler ondrop;
56 attribute EventHandler ondurationchange;
57 attribute EventHandler onemptied;
58 attribute EventHandler onended;
59 attribute EventHandler onformdata;
60 attribute EventHandler oninput;
61 attribute EventHandler oninvalid;
62 attribute EventHandler onkeydown;
63 attribute EventHandler onkeypress;
64 attribute EventHandler onkeyup;
65 attribute EventHandler onload;
66 attribute EventHandler onloadeddata;
67 attribute EventHandler onloadedmetadata;
68 attribute EventHandler onloadstart;
69 attribute EventHandler onmousedown;
70 [LegacyLenientThis] attribute EventHandler onmouseenter;
71 [LegacyLenientThis] attribute EventHandler onmouseleave;
72 attribute EventHandler onmousemove;
73 attribute EventHandler onmouseout;
74 attribute EventHandler onmouseover;
75 attribute EventHandler onmouseup;
76 attribute EventHandler onwheel;
77 attribute EventHandler onpaste;
78 attribute EventHandler onpause;
79 attribute EventHandler onplay;
80 attribute EventHandler onplaying;
81 attribute EventHandler onprogress;
82 attribute EventHandler onratechange;
83 attribute EventHandler onreset;
84 attribute EventHandler onresize;
85 attribute EventHandler onscroll;
86 [Pref="apz.scrollend-event.content.enabled"]
87 attribute EventHandler onscrollend;
88 attribute EventHandler onsecuritypolicyviolation;
89 attribute EventHandler onseeked;
90 attribute EventHandler onseeking;
91 attribute EventHandler onselect;
92 attribute EventHandler onslotchange;
93 //(Not implemented)attribute EventHandler onsort;
94 attribute EventHandler onstalled;
95 attribute EventHandler onsubmit;
96 attribute EventHandler onsuspend;
97 attribute EventHandler ontimeupdate;
98 attribute EventHandler onvolumechange;
99 attribute EventHandler onwaiting;
101 attribute EventHandler onselectstart;
102 attribute EventHandler onselectionchange;
104 attribute EventHandler ontoggle;
106 // Pointer events handlers
107 attribute EventHandler onpointercancel;
108 attribute EventHandler onpointerdown;
109 attribute EventHandler onpointerup;
110 attribute EventHandler onpointermove;
111 attribute EventHandler onpointerout;
112 attribute EventHandler onpointerover;
113 attribute EventHandler onpointerenter;
114 attribute EventHandler onpointerleave;
115 attribute EventHandler ongotpointercapture;
116 attribute EventHandler onlostpointercapture;
118 // Mozilla-specific handlers. Unprefixed handlers live in
119 // Document rather than here.
120 [Deprecated="MozfullscreenchangeDeprecatedPrefix"]
121 attribute EventHandler onmozfullscreenchange;
122 [Deprecated="MozfullscreenerrorDeprecatedPrefix"]
123 attribute EventHandler onmozfullscreenerror;
125 // CSS-Animation and CSS-Transition handlers.
126 attribute EventHandler onanimationcancel;
127 attribute EventHandler onanimationend;
128 attribute EventHandler onanimationiteration;
129 attribute EventHandler onanimationstart;
130 attribute EventHandler ontransitioncancel;
131 attribute EventHandler ontransitionend;
132 attribute EventHandler ontransitionrun;
133 attribute EventHandler ontransitionstart;
135 // CSS-Animation and CSS-Transition legacy handlers.
136 // This handler isn't standard.
137 [BinaryName="onwebkitAnimationEnd"]
138 attribute EventHandler onwebkitanimationend;
139 [BinaryName="onwebkitAnimationIteration"]
140 attribute EventHandler onwebkitanimationiteration;
141 [BinaryName="onwebkitAnimationStart"]
142 attribute EventHandler onwebkitanimationstart;
143 [BinaryName="onwebkitTransitionEnd"]
144 attribute EventHandler onwebkittransitionend;
147 interface mixin WindowEventHandlers {
148 attribute EventHandler onafterprint;
149 attribute EventHandler onbeforeprint;
150 attribute OnBeforeUnloadEventHandler onbeforeunload;
151 attribute EventHandler onhashchange;
152 attribute EventHandler onlanguagechange;
153 attribute EventHandler onmessage;
154 attribute EventHandler onmessageerror;
155 attribute EventHandler onoffline;
156 attribute EventHandler ononline;
157 attribute EventHandler onpagehide;
158 attribute EventHandler onpageshow;
159 attribute EventHandler onpopstate;
160 attribute EventHandler onrejectionhandled;
161 attribute EventHandler onstorage;
162 attribute EventHandler onunhandledrejection;
163 attribute EventHandler onunload;
166 // https://w3c.github.io/gamepad/#extensions-to-the-windoweventhandlers-interface-mixin
167 partial interface mixin WindowEventHandlers {
168 attribute EventHandler ongamepadconnected;
169 attribute EventHandler ongamepaddisconnected;
172 // The spec has |attribute OnErrorEventHandler onerror;| on
173 // GlobalEventHandlers, and calls the handler differently depending on
174 // whether an ErrorEvent was fired. We don't do that, and until we do we'll
175 // need to distinguish between onerror on Window or on nodes.
177 interface mixin OnErrorEventHandlerForNodes {
178 attribute EventHandler onerror;
181 interface mixin OnErrorEventHandlerForWindow {
182 attribute OnErrorEventHandler onerror;