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] 14callback EventHandlerNonNull = any (Event event); 15typedef EventHandlerNonNull? EventHandler; 16 17[TreatNonObjectAsNull] 18callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event); 19typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler; 20 21[TreatNonObjectAsNull] 22callback OnErrorEventHandlerNonNull = any ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column, optional any error); 23typedef OnErrorEventHandlerNonNull? OnErrorEventHandler; 24 25interface mixin GlobalEventHandlers { 26 attribute EventHandler onabort; 27 attribute EventHandler onblur; 28// We think the spec is wrong here. See OnErrorEventHandlerForNodes/Window 29// below. 30// attribute OnErrorEventHandler onerror; 31 attribute EventHandler onfocus; 32 //(Not implemented)attribute EventHandler oncancel; 33 attribute EventHandler onauxclick; 34 attribute EventHandler oncanplay; 35 attribute EventHandler oncanplaythrough; 36 attribute EventHandler onchange; 37 attribute EventHandler onclick; 38 attribute EventHandler onclose; 39 attribute EventHandler oncontextmenu; 40 //(Not implemented)attribute EventHandler oncuechange; 41 attribute EventHandler ondblclick; 42 attribute EventHandler ondrag; 43 attribute EventHandler ondragend; 44 attribute EventHandler ondragenter; 45 attribute EventHandler ondragexit; 46 attribute EventHandler ondragleave; 47 attribute EventHandler ondragover; 48 attribute EventHandler ondragstart; 49 attribute EventHandler ondrop; 50 attribute EventHandler ondurationchange; 51 attribute EventHandler onemptied; 52 attribute EventHandler onended; 53 attribute EventHandler oninput; 54 attribute EventHandler oninvalid; 55 attribute EventHandler onkeydown; 56 attribute EventHandler onkeypress; 57 attribute EventHandler onkeyup; 58 attribute EventHandler onload; 59 attribute EventHandler onloadeddata; 60 attribute EventHandler onloadedmetadata; 61 attribute EventHandler onloadend; 62 attribute EventHandler onloadstart; 63 attribute EventHandler onmousedown; 64 [LenientThis] attribute EventHandler onmouseenter; 65 [LenientThis] attribute EventHandler onmouseleave; 66 attribute EventHandler onmousemove; 67 attribute EventHandler onmouseout; 68 attribute EventHandler onmouseover; 69 attribute EventHandler onmouseup; 70 attribute EventHandler onwheel; 71 attribute EventHandler onpause; 72 attribute EventHandler onplay; 73 attribute EventHandler onplaying; 74 attribute EventHandler onprogress; 75 attribute EventHandler onratechange; 76 attribute EventHandler onreset; 77 attribute EventHandler onresize; 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 [Pref="dom.select_events.enabled"] 92 attribute EventHandler onselectstart; 93 94 attribute EventHandler ontoggle; 95 96 // Pointer events handlers 97 [Pref="dom.w3c_pointer_events.enabled"] 98 attribute EventHandler onpointercancel; 99 [Pref="dom.w3c_pointer_events.enabled"] 100 attribute EventHandler onpointerdown; 101 [Pref="dom.w3c_pointer_events.enabled"] 102 attribute EventHandler onpointerup; 103 [Pref="dom.w3c_pointer_events.enabled"] 104 attribute EventHandler onpointermove; 105 [Pref="dom.w3c_pointer_events.enabled"] 106 attribute EventHandler onpointerout; 107 [Pref="dom.w3c_pointer_events.enabled"] 108 attribute EventHandler onpointerover; 109 [Pref="dom.w3c_pointer_events.enabled"] 110 attribute EventHandler onpointerenter; 111 [Pref="dom.w3c_pointer_events.enabled"] 112 attribute EventHandler onpointerleave; 113 [Pref="dom.w3c_pointer_events.enabled"] 114 attribute EventHandler ongotpointercapture; 115 [Pref="dom.w3c_pointer_events.enabled"] 116 attribute EventHandler onlostpointercapture; 117 118 // CSS-Animation and CSS-Transition handlers. 119 attribute EventHandler onanimationcancel; 120 attribute EventHandler onanimationend; 121 attribute EventHandler onanimationiteration; 122 attribute EventHandler onanimationstart; 123 attribute EventHandler ontransitioncancel; 124 attribute EventHandler ontransitionend; 125 attribute EventHandler ontransitionrun; 126 attribute EventHandler ontransitionstart; 127 128 // CSS-Animation and CSS-Transition legacy handlers. 129 // This handler isn't standard. 130 attribute EventHandler onwebkitanimationend; 131 attribute EventHandler onwebkitanimationiteration; 132 attribute EventHandler onwebkitanimationstart; 133 attribute EventHandler onwebkittransitionend; 134}; 135 136interface mixin WindowEventHandlers { 137 attribute EventHandler onafterprint; 138 attribute EventHandler onbeforeprint; 139 attribute OnBeforeUnloadEventHandler onbeforeunload; 140 attribute EventHandler onhashchange; 141 attribute EventHandler onlanguagechange; 142 attribute EventHandler onmessage; 143 attribute EventHandler onmessageerror; 144 attribute EventHandler onoffline; 145 attribute EventHandler ononline; 146 attribute EventHandler onpagehide; 147 attribute EventHandler onpageshow; 148 attribute EventHandler onpopstate; 149 attribute EventHandler onstorage; 150 attribute EventHandler onunload; 151}; 152 153interface mixin DocumentAndElementEventHandlers { 154 attribute EventHandler oncopy; 155 attribute EventHandler oncut; 156 attribute EventHandler onpaste; 157}; 158 159// The spec has |attribute OnErrorEventHandler onerror;| on 160// GlobalEventHandlers, and calls the handler differently depending on 161// whether an ErrorEvent was fired. We don't do that, and until we do we'll 162// need to distinguish between onerror on Window or on nodes. 163 164interface mixin OnErrorEventHandlerForNodes { 165 attribute EventHandler onerror; 166}; 167 168interface mixin OnErrorEventHandlerForWindow { 169 attribute OnErrorEventHandler onerror; 170}; 171