michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: * michael@0: * The origin of this IDL file is michael@0: * http://www.whatwg.org/specs/web-apps/current-work/#eventhandler michael@0: * michael@0: * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and michael@0: * Opera Software ASA. You are granted a license to use, reproduce michael@0: * and create derivative works of this document. michael@0: */ michael@0: [TreatNonObjectAsNull] michael@0: callback EventHandlerNonNull = any (Event event); michael@0: typedef EventHandlerNonNull? EventHandler; michael@0: michael@0: [TreatNonObjectAsNull] michael@0: // https://www.w3.org/Bugs/Public/show_bug.cgi?id=23489 michael@0: //callback OnBeforeUnloadEventHandlerNonNull = DOMString (Event event); michael@0: callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event); michael@0: typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler; michael@0: michael@0: [TreatNonObjectAsNull] michael@0: callback OnErrorEventHandlerNonNull = boolean ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column, optional any error); michael@0: typedef OnErrorEventHandlerNonNull? OnErrorEventHandler; michael@0: michael@0: [NoInterfaceObject] michael@0: interface GlobalEventHandlers { michael@0: attribute EventHandler onabort; michael@0: attribute EventHandler onblur; michael@0: // We think the spec is wrong here. See OnErrorEventHandlerForNodes/Window michael@0: // below. michael@0: // attribute OnErrorEventHandler onerror; michael@0: attribute EventHandler onfocus; michael@0: //(Not implemented)attribute EventHandler oncancel; michael@0: attribute EventHandler oncanplay; michael@0: attribute EventHandler oncanplaythrough; michael@0: attribute EventHandler onchange; michael@0: attribute EventHandler onclick; michael@0: //(Not implemented)attribute EventHandler onclose; michael@0: attribute EventHandler oncontextmenu; michael@0: //(Not implemented)attribute EventHandler oncuechange; michael@0: attribute EventHandler ondblclick; michael@0: attribute EventHandler ondrag; michael@0: attribute EventHandler ondragend; michael@0: attribute EventHandler ondragenter; michael@0: //(Not implemented)attribute EventHandler ondragexit; michael@0: attribute EventHandler ondragleave; michael@0: attribute EventHandler ondragover; michael@0: attribute EventHandler ondragstart; michael@0: attribute EventHandler ondrop; michael@0: attribute EventHandler ondurationchange; michael@0: attribute EventHandler onemptied; michael@0: attribute EventHandler onended; michael@0: attribute EventHandler oninput; michael@0: attribute EventHandler oninvalid; michael@0: attribute EventHandler onkeydown; michael@0: attribute EventHandler onkeypress; michael@0: attribute EventHandler onkeyup; michael@0: attribute EventHandler onload; michael@0: attribute EventHandler onloadeddata; michael@0: attribute EventHandler onloadedmetadata; michael@0: attribute EventHandler onloadstart; michael@0: attribute EventHandler onmousedown; michael@0: [LenientThis] attribute EventHandler onmouseenter; michael@0: [LenientThis] attribute EventHandler onmouseleave; michael@0: attribute EventHandler onmousemove; michael@0: attribute EventHandler onmouseout; michael@0: attribute EventHandler onmouseover; michael@0: attribute EventHandler onmouseup; michael@0: //(Not implemented)attribute EventHandler onmousewheel; michael@0: attribute EventHandler onpause; michael@0: attribute EventHandler onplay; michael@0: attribute EventHandler onplaying; michael@0: attribute EventHandler onprogress; michael@0: attribute EventHandler onratechange; michael@0: attribute EventHandler onreset; michael@0: attribute EventHandler onscroll; michael@0: attribute EventHandler onseeked; michael@0: attribute EventHandler onseeking; michael@0: attribute EventHandler onselect; michael@0: attribute EventHandler onshow; michael@0: //(Not implemented)attribute EventHandler onsort; michael@0: attribute EventHandler onstalled; michael@0: attribute EventHandler onsubmit; michael@0: attribute EventHandler onsuspend; michael@0: attribute EventHandler ontimeupdate; michael@0: attribute EventHandler onvolumechange; michael@0: attribute EventHandler onwaiting; michael@0: michael@0: // Pointer events handlers michael@0: [Pref="dom.w3c_pointer_events.enabled"] michael@0: attribute EventHandler onpointercancel; michael@0: [Pref="dom.w3c_pointer_events.enabled"] michael@0: attribute EventHandler onpointerdown; michael@0: [Pref="dom.w3c_pointer_events.enabled"] michael@0: attribute EventHandler onpointerup; michael@0: [Pref="dom.w3c_pointer_events.enabled"] michael@0: attribute EventHandler onpointermove; michael@0: [Pref="dom.w3c_pointer_events.enabled"] michael@0: attribute EventHandler onpointerout; michael@0: [Pref="dom.w3c_pointer_events.enabled"] michael@0: attribute EventHandler onpointerover; michael@0: [Pref="dom.w3c_pointer_events.enabled"] michael@0: attribute EventHandler onpointerenter; michael@0: [Pref="dom.w3c_pointer_events.enabled"] michael@0: attribute EventHandler onpointerleave; michael@0: [Pref="dom.w3c_pointer_events.enabled"] michael@0: attribute EventHandler ongotpointercapture; michael@0: [Pref="dom.w3c_pointer_events.enabled"] michael@0: attribute EventHandler onlostpointercapture; michael@0: michael@0: // Mozilla-specific handlers michael@0: attribute EventHandler onmozfullscreenchange; michael@0: attribute EventHandler onmozfullscreenerror; michael@0: attribute EventHandler onmozpointerlockchange; michael@0: attribute EventHandler onmozpointerlockerror; michael@0: }; michael@0: michael@0: [NoInterfaceObject] michael@0: interface WindowEventHandlers { michael@0: attribute EventHandler onafterprint; michael@0: attribute EventHandler onbeforeprint; michael@0: attribute OnBeforeUnloadEventHandler onbeforeunload; michael@0: attribute EventHandler onhashchange; michael@0: attribute EventHandler onmessage; michael@0: attribute EventHandler onoffline; michael@0: attribute EventHandler ononline; michael@0: attribute EventHandler onpagehide; michael@0: attribute EventHandler onpageshow; michael@0: attribute EventHandler onpopstate; michael@0: attribute EventHandler onresize; michael@0: //(Not implemented)attribute EventHandler onstorage; michael@0: attribute EventHandler onunload; michael@0: }; michael@0: michael@0: // The spec has |attribute OnErrorEventHandler onerror;| on michael@0: // GlobalEventHandlers, and calls the handler differently depending on michael@0: // whether an ErrorEvent was fired. We don't do that, and until we do we'll michael@0: // need to distinguish between onerror on Window or on nodes. michael@0: michael@0: [NoInterfaceObject] michael@0: interface OnErrorEventHandlerForNodes { michael@0: attribute EventHandler onerror; michael@0: }; michael@0: michael@0: [NoInterfaceObject] michael@0: interface OnErrorEventHandlerForWindow { michael@0: attribute OnErrorEventHandler onerror; michael@0: };