|
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/. |
|
5 * |
|
6 * The origin of this IDL file is |
|
7 * http://www.whatwg.org/specs/web-apps/current-work/#eventhandler |
|
8 * |
|
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. |
|
12 */ |
|
13 [TreatNonObjectAsNull] |
|
14 callback EventHandlerNonNull = any (Event event); |
|
15 typedef EventHandlerNonNull? EventHandler; |
|
16 |
|
17 [TreatNonObjectAsNull] |
|
18 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=23489 |
|
19 //callback OnBeforeUnloadEventHandlerNonNull = DOMString (Event event); |
|
20 callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event); |
|
21 typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler; |
|
22 |
|
23 [TreatNonObjectAsNull] |
|
24 callback OnErrorEventHandlerNonNull = boolean ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column, optional any error); |
|
25 typedef OnErrorEventHandlerNonNull? OnErrorEventHandler; |
|
26 |
|
27 [NoInterfaceObject] |
|
28 interface GlobalEventHandlers { |
|
29 attribute EventHandler onabort; |
|
30 attribute EventHandler onblur; |
|
31 // We think the spec is wrong here. See OnErrorEventHandlerForNodes/Window |
|
32 // below. |
|
33 // attribute OnErrorEventHandler onerror; |
|
34 attribute EventHandler onfocus; |
|
35 //(Not implemented)attribute EventHandler oncancel; |
|
36 attribute EventHandler oncanplay; |
|
37 attribute EventHandler oncanplaythrough; |
|
38 attribute EventHandler onchange; |
|
39 attribute EventHandler onclick; |
|
40 //(Not implemented)attribute EventHandler onclose; |
|
41 attribute EventHandler oncontextmenu; |
|
42 //(Not implemented)attribute EventHandler oncuechange; |
|
43 attribute EventHandler ondblclick; |
|
44 attribute EventHandler ondrag; |
|
45 attribute EventHandler ondragend; |
|
46 attribute EventHandler ondragenter; |
|
47 //(Not implemented)attribute EventHandler ondragexit; |
|
48 attribute EventHandler ondragleave; |
|
49 attribute EventHandler ondragover; |
|
50 attribute EventHandler ondragstart; |
|
51 attribute EventHandler ondrop; |
|
52 attribute EventHandler ondurationchange; |
|
53 attribute EventHandler onemptied; |
|
54 attribute EventHandler onended; |
|
55 attribute EventHandler oninput; |
|
56 attribute EventHandler oninvalid; |
|
57 attribute EventHandler onkeydown; |
|
58 attribute EventHandler onkeypress; |
|
59 attribute EventHandler onkeyup; |
|
60 attribute EventHandler onload; |
|
61 attribute EventHandler onloadeddata; |
|
62 attribute EventHandler onloadedmetadata; |
|
63 attribute EventHandler onloadstart; |
|
64 attribute EventHandler onmousedown; |
|
65 [LenientThis] attribute EventHandler onmouseenter; |
|
66 [LenientThis] attribute EventHandler onmouseleave; |
|
67 attribute EventHandler onmousemove; |
|
68 attribute EventHandler onmouseout; |
|
69 attribute EventHandler onmouseover; |
|
70 attribute EventHandler onmouseup; |
|
71 //(Not implemented)attribute EventHandler onmousewheel; |
|
72 attribute EventHandler onpause; |
|
73 attribute EventHandler onplay; |
|
74 attribute EventHandler onplaying; |
|
75 attribute EventHandler onprogress; |
|
76 attribute EventHandler onratechange; |
|
77 attribute EventHandler onreset; |
|
78 attribute EventHandler onscroll; |
|
79 attribute EventHandler onseeked; |
|
80 attribute EventHandler onseeking; |
|
81 attribute EventHandler onselect; |
|
82 attribute EventHandler onshow; |
|
83 //(Not implemented)attribute EventHandler onsort; |
|
84 attribute EventHandler onstalled; |
|
85 attribute EventHandler onsubmit; |
|
86 attribute EventHandler onsuspend; |
|
87 attribute EventHandler ontimeupdate; |
|
88 attribute EventHandler onvolumechange; |
|
89 attribute EventHandler onwaiting; |
|
90 |
|
91 // Pointer events handlers |
|
92 [Pref="dom.w3c_pointer_events.enabled"] |
|
93 attribute EventHandler onpointercancel; |
|
94 [Pref="dom.w3c_pointer_events.enabled"] |
|
95 attribute EventHandler onpointerdown; |
|
96 [Pref="dom.w3c_pointer_events.enabled"] |
|
97 attribute EventHandler onpointerup; |
|
98 [Pref="dom.w3c_pointer_events.enabled"] |
|
99 attribute EventHandler onpointermove; |
|
100 [Pref="dom.w3c_pointer_events.enabled"] |
|
101 attribute EventHandler onpointerout; |
|
102 [Pref="dom.w3c_pointer_events.enabled"] |
|
103 attribute EventHandler onpointerover; |
|
104 [Pref="dom.w3c_pointer_events.enabled"] |
|
105 attribute EventHandler onpointerenter; |
|
106 [Pref="dom.w3c_pointer_events.enabled"] |
|
107 attribute EventHandler onpointerleave; |
|
108 [Pref="dom.w3c_pointer_events.enabled"] |
|
109 attribute EventHandler ongotpointercapture; |
|
110 [Pref="dom.w3c_pointer_events.enabled"] |
|
111 attribute EventHandler onlostpointercapture; |
|
112 |
|
113 // Mozilla-specific handlers |
|
114 attribute EventHandler onmozfullscreenchange; |
|
115 attribute EventHandler onmozfullscreenerror; |
|
116 attribute EventHandler onmozpointerlockchange; |
|
117 attribute EventHandler onmozpointerlockerror; |
|
118 }; |
|
119 |
|
120 [NoInterfaceObject] |
|
121 interface WindowEventHandlers { |
|
122 attribute EventHandler onafterprint; |
|
123 attribute EventHandler onbeforeprint; |
|
124 attribute OnBeforeUnloadEventHandler onbeforeunload; |
|
125 attribute EventHandler onhashchange; |
|
126 attribute EventHandler onmessage; |
|
127 attribute EventHandler onoffline; |
|
128 attribute EventHandler ononline; |
|
129 attribute EventHandler onpagehide; |
|
130 attribute EventHandler onpageshow; |
|
131 attribute EventHandler onpopstate; |
|
132 attribute EventHandler onresize; |
|
133 //(Not implemented)attribute EventHandler onstorage; |
|
134 attribute EventHandler onunload; |
|
135 }; |
|
136 |
|
137 // The spec has |attribute OnErrorEventHandler onerror;| on |
|
138 // GlobalEventHandlers, and calls the handler differently depending on |
|
139 // whether an ErrorEvent was fired. We don't do that, and until we do we'll |
|
140 // need to distinguish between onerror on Window or on nodes. |
|
141 |
|
142 [NoInterfaceObject] |
|
143 interface OnErrorEventHandlerForNodes { |
|
144 attribute EventHandler onerror; |
|
145 }; |
|
146 |
|
147 [NoInterfaceObject] |
|
148 interface OnErrorEventHandlerForWindow { |
|
149 attribute OnErrorEventHandler onerror; |
|
150 }; |