1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/EventHandler.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,150 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + * 1.9 + * The origin of this IDL file is 1.10 + * http://www.whatwg.org/specs/web-apps/current-work/#eventhandler 1.11 + * 1.12 + * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and 1.13 + * Opera Software ASA. You are granted a license to use, reproduce 1.14 + * and create derivative works of this document. 1.15 + */ 1.16 +[TreatNonObjectAsNull] 1.17 +callback EventHandlerNonNull = any (Event event); 1.18 +typedef EventHandlerNonNull? EventHandler; 1.19 + 1.20 +[TreatNonObjectAsNull] 1.21 +// https://www.w3.org/Bugs/Public/show_bug.cgi?id=23489 1.22 +//callback OnBeforeUnloadEventHandlerNonNull = DOMString (Event event); 1.23 +callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event); 1.24 +typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler; 1.25 + 1.26 +[TreatNonObjectAsNull] 1.27 +callback OnErrorEventHandlerNonNull = boolean ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column, optional any error); 1.28 +typedef OnErrorEventHandlerNonNull? OnErrorEventHandler; 1.29 + 1.30 +[NoInterfaceObject] 1.31 +interface GlobalEventHandlers { 1.32 + attribute EventHandler onabort; 1.33 + attribute EventHandler onblur; 1.34 +// We think the spec is wrong here. See OnErrorEventHandlerForNodes/Window 1.35 +// below. 1.36 +// attribute OnErrorEventHandler onerror; 1.37 + attribute EventHandler onfocus; 1.38 + //(Not implemented)attribute EventHandler oncancel; 1.39 + attribute EventHandler oncanplay; 1.40 + attribute EventHandler oncanplaythrough; 1.41 + attribute EventHandler onchange; 1.42 + attribute EventHandler onclick; 1.43 + //(Not implemented)attribute EventHandler onclose; 1.44 + attribute EventHandler oncontextmenu; 1.45 + //(Not implemented)attribute EventHandler oncuechange; 1.46 + attribute EventHandler ondblclick; 1.47 + attribute EventHandler ondrag; 1.48 + attribute EventHandler ondragend; 1.49 + attribute EventHandler ondragenter; 1.50 + //(Not implemented)attribute EventHandler ondragexit; 1.51 + attribute EventHandler ondragleave; 1.52 + attribute EventHandler ondragover; 1.53 + attribute EventHandler ondragstart; 1.54 + attribute EventHandler ondrop; 1.55 + attribute EventHandler ondurationchange; 1.56 + attribute EventHandler onemptied; 1.57 + attribute EventHandler onended; 1.58 + attribute EventHandler oninput; 1.59 + attribute EventHandler oninvalid; 1.60 + attribute EventHandler onkeydown; 1.61 + attribute EventHandler onkeypress; 1.62 + attribute EventHandler onkeyup; 1.63 + attribute EventHandler onload; 1.64 + attribute EventHandler onloadeddata; 1.65 + attribute EventHandler onloadedmetadata; 1.66 + attribute EventHandler onloadstart; 1.67 + attribute EventHandler onmousedown; 1.68 + [LenientThis] attribute EventHandler onmouseenter; 1.69 + [LenientThis] attribute EventHandler onmouseleave; 1.70 + attribute EventHandler onmousemove; 1.71 + attribute EventHandler onmouseout; 1.72 + attribute EventHandler onmouseover; 1.73 + attribute EventHandler onmouseup; 1.74 + //(Not implemented)attribute EventHandler onmousewheel; 1.75 + attribute EventHandler onpause; 1.76 + attribute EventHandler onplay; 1.77 + attribute EventHandler onplaying; 1.78 + attribute EventHandler onprogress; 1.79 + attribute EventHandler onratechange; 1.80 + attribute EventHandler onreset; 1.81 + attribute EventHandler onscroll; 1.82 + attribute EventHandler onseeked; 1.83 + attribute EventHandler onseeking; 1.84 + attribute EventHandler onselect; 1.85 + attribute EventHandler onshow; 1.86 + //(Not implemented)attribute EventHandler onsort; 1.87 + attribute EventHandler onstalled; 1.88 + attribute EventHandler onsubmit; 1.89 + attribute EventHandler onsuspend; 1.90 + attribute EventHandler ontimeupdate; 1.91 + attribute EventHandler onvolumechange; 1.92 + attribute EventHandler onwaiting; 1.93 + 1.94 + // Pointer events handlers 1.95 + [Pref="dom.w3c_pointer_events.enabled"] 1.96 + attribute EventHandler onpointercancel; 1.97 + [Pref="dom.w3c_pointer_events.enabled"] 1.98 + attribute EventHandler onpointerdown; 1.99 + [Pref="dom.w3c_pointer_events.enabled"] 1.100 + attribute EventHandler onpointerup; 1.101 + [Pref="dom.w3c_pointer_events.enabled"] 1.102 + attribute EventHandler onpointermove; 1.103 + [Pref="dom.w3c_pointer_events.enabled"] 1.104 + attribute EventHandler onpointerout; 1.105 + [Pref="dom.w3c_pointer_events.enabled"] 1.106 + attribute EventHandler onpointerover; 1.107 + [Pref="dom.w3c_pointer_events.enabled"] 1.108 + attribute EventHandler onpointerenter; 1.109 + [Pref="dom.w3c_pointer_events.enabled"] 1.110 + attribute EventHandler onpointerleave; 1.111 + [Pref="dom.w3c_pointer_events.enabled"] 1.112 + attribute EventHandler ongotpointercapture; 1.113 + [Pref="dom.w3c_pointer_events.enabled"] 1.114 + attribute EventHandler onlostpointercapture; 1.115 + 1.116 + // Mozilla-specific handlers 1.117 + attribute EventHandler onmozfullscreenchange; 1.118 + attribute EventHandler onmozfullscreenerror; 1.119 + attribute EventHandler onmozpointerlockchange; 1.120 + attribute EventHandler onmozpointerlockerror; 1.121 +}; 1.122 + 1.123 +[NoInterfaceObject] 1.124 +interface WindowEventHandlers { 1.125 + attribute EventHandler onafterprint; 1.126 + attribute EventHandler onbeforeprint; 1.127 + attribute OnBeforeUnloadEventHandler onbeforeunload; 1.128 + attribute EventHandler onhashchange; 1.129 + attribute EventHandler onmessage; 1.130 + attribute EventHandler onoffline; 1.131 + attribute EventHandler ononline; 1.132 + attribute EventHandler onpagehide; 1.133 + attribute EventHandler onpageshow; 1.134 + attribute EventHandler onpopstate; 1.135 + attribute EventHandler onresize; 1.136 + //(Not implemented)attribute EventHandler onstorage; 1.137 + attribute EventHandler onunload; 1.138 +}; 1.139 + 1.140 +// The spec has |attribute OnErrorEventHandler onerror;| on 1.141 +// GlobalEventHandlers, and calls the handler differently depending on 1.142 +// whether an ErrorEvent was fired. We don't do that, and until we do we'll 1.143 +// need to distinguish between onerror on Window or on nodes. 1.144 + 1.145 +[NoInterfaceObject] 1.146 +interface OnErrorEventHandlerForNodes { 1.147 + attribute EventHandler onerror; 1.148 +}; 1.149 + 1.150 +[NoInterfaceObject] 1.151 +interface OnErrorEventHandlerForWindow { 1.152 + attribute OnErrorEventHandler onerror; 1.153 +};