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 //(Not implemented)attribute EventHandler oncancel;
33 attribute EventHandler onauxclick;
34 [Pref="dom.input_events.beforeinput.enabled"]
35 attribute EventHandler onbeforeinput;
36 attribute EventHandler oncanplay;
37 attribute EventHandler oncanplaythrough;
38 attribute EventHandler onchange;
39 attribute EventHandler onclick;
40 attribute EventHandler onclose;
41 attribute EventHandler oncontextmenu;
42 attribute EventHandler oncuechange;
43 attribute EventHandler ondblclick;
44 attribute EventHandler ondrag;
45 attribute EventHandler ondragend;
46 attribute EventHandler ondragenter;
47 [Func="Event::IsDragExitEnabled"]
48 attribute EventHandler ondragexit;
49 attribute EventHandler ondragleave;
50 attribute EventHandler ondragover;
51 attribute EventHandler ondragstart;
52 attribute EventHandler ondrop;
53 attribute EventHandler ondurationchange;
54 attribute EventHandler onemptied;
55 attribute EventHandler onended;
56 attribute EventHandler onformdata;
57 attribute EventHandler oninput;
58 attribute EventHandler oninvalid;
59 attribute EventHandler onkeydown;
60 attribute EventHandler onkeypress;
61 attribute EventHandler onkeyup;
62 attribute EventHandler onload;
63 attribute EventHandler onloadeddata;
64 attribute EventHandler onloadedmetadata;
65 attribute EventHandler onloadstart;
66 attribute EventHandler onmousedown;
67 [LegacyLenientThis] attribute EventHandler onmouseenter;
68 [LegacyLenientThis] attribute EventHandler onmouseleave;
69 attribute EventHandler onmousemove;
70 attribute EventHandler onmouseout;
71 attribute EventHandler onmouseover;
72 attribute EventHandler onmouseup;
73 attribute EventHandler onwheel;
74 attribute EventHandler onpause;
75 attribute EventHandler onplay;
76 attribute EventHandler onplaying;
77 attribute EventHandler onprogress;
78 attribute EventHandler onratechange;
79 attribute EventHandler onreset;
80 attribute EventHandler onresize;
81 attribute EventHandler onscroll;
82 [Pref="apz.scrollend-event.content.enabled"]
83 attribute EventHandler onscrollend;
84 attribute EventHandler onsecuritypolicyviolation;
85 attribute EventHandler onseeked;
86 attribute EventHandler onseeking;
87 attribute EventHandler onselect;
88 attribute EventHandler onslotchange;
89 //(Not implemented)attribute EventHandler onsort;
90 attribute EventHandler onstalled;
91 attribute EventHandler onsubmit;
92 attribute EventHandler onsuspend;
93 attribute EventHandler ontimeupdate;
94 attribute EventHandler onvolumechange;
95 attribute EventHandler onwaiting;
97 attribute EventHandler onselectstart;
98 attribute EventHandler onselectionchange;
100 attribute EventHandler ontoggle;
102 // Pointer events handlers
103 attribute EventHandler onpointercancel;
104 attribute EventHandler onpointerdown;
105 attribute EventHandler onpointerup;
106 attribute EventHandler onpointermove;
107 attribute EventHandler onpointerout;
108 attribute EventHandler onpointerover;
109 attribute EventHandler onpointerenter;
110 attribute EventHandler onpointerleave;
111 attribute EventHandler ongotpointercapture;
112 attribute EventHandler onlostpointercapture;
114 // Mozilla-specific handlers. Unprefixed handlers live in
115 // Document rather than here.
116 [Deprecated="MozfullscreenchangeDeprecatedPrefix"]
117 attribute EventHandler onmozfullscreenchange;
118 [Deprecated="MozfullscreenerrorDeprecatedPrefix"]
119 attribute EventHandler onmozfullscreenerror;
121 // CSS-Animation and CSS-Transition handlers.
122 attribute EventHandler onanimationcancel;
123 attribute EventHandler onanimationend;
124 attribute EventHandler onanimationiteration;
125 attribute EventHandler onanimationstart;
126 attribute EventHandler ontransitioncancel;
127 attribute EventHandler ontransitionend;
128 attribute EventHandler ontransitionrun;
129 attribute EventHandler ontransitionstart;
131 // CSS-Animation and CSS-Transition legacy handlers.
132 // This handler isn't standard.
133 [BinaryName="onwebkitAnimationEnd"]
134 attribute EventHandler onwebkitanimationend;
135 [BinaryName="onwebkitAnimationIteration"]
136 attribute EventHandler onwebkitanimationiteration;
137 [BinaryName="onwebkitAnimationStart"]
138 attribute EventHandler onwebkitanimationstart;
139 [BinaryName="onwebkitTransitionEnd"]
140 attribute EventHandler onwebkittransitionend;
143 interface mixin WindowEventHandlers {
144 attribute EventHandler onafterprint;
145 attribute EventHandler onbeforeprint;
146 attribute OnBeforeUnloadEventHandler onbeforeunload;
147 attribute EventHandler onhashchange;
148 attribute EventHandler onlanguagechange;
149 attribute EventHandler onmessage;
150 attribute EventHandler onmessageerror;
151 attribute EventHandler onoffline;
152 attribute EventHandler ononline;
153 attribute EventHandler onpagehide;
154 attribute EventHandler onpageshow;
155 attribute EventHandler onpopstate;
156 attribute EventHandler onrejectionhandled;
157 attribute EventHandler onstorage;
158 attribute EventHandler onunhandledrejection;
159 attribute EventHandler onunload;
162 // https://w3c.github.io/gamepad/#extensions-to-the-windoweventhandlers-interface-mixin
163 partial interface mixin WindowEventHandlers {
164 attribute EventHandler ongamepadconnected;
165 attribute EventHandler ongamepaddisconnected;
168 interface mixin DocumentAndElementEventHandlers {
169 attribute EventHandler oncopy;
170 attribute EventHandler oncut;
171 attribute EventHandler onpaste;
174 // The spec has |attribute OnErrorEventHandler onerror;| on
175 // GlobalEventHandlers, and calls the handler differently depending on
176 // whether an ErrorEvent was fired. We don't do that, and until we do we'll
177 // need to distinguish between onerror on Window or on nodes.
179 interface mixin OnErrorEventHandlerForNodes {
180 attribute EventHandler onerror;
183 interface mixin OnErrorEventHandlerForWindow {
184 attribute OnErrorEventHandler onerror;