1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/Event.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,68 @@ 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.w3.org/TR/2012/WD-dom-20120105/ 1.11 + * 1.12 + * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C 1.13 + * liability, trademark and document use rules apply. 1.14 + */ 1.15 + 1.16 +[Constructor(DOMString type, optional EventInit eventInitDict)] 1.17 +interface Event { 1.18 + [Pure] 1.19 + readonly attribute DOMString type; 1.20 + [Pure] 1.21 + readonly attribute EventTarget? target; 1.22 + [Pure] 1.23 + readonly attribute EventTarget? currentTarget; 1.24 + 1.25 + const unsigned short NONE = 0; 1.26 + const unsigned short CAPTURING_PHASE = 1; 1.27 + const unsigned short AT_TARGET = 2; 1.28 + const unsigned short BUBBLING_PHASE = 3; 1.29 + [Pure] 1.30 + readonly attribute unsigned short eventPhase; 1.31 + 1.32 + void stopPropagation(); 1.33 + void stopImmediatePropagation(); 1.34 + 1.35 + [Pure] 1.36 + readonly attribute boolean bubbles; 1.37 + [Pure] 1.38 + readonly attribute boolean cancelable; 1.39 + void preventDefault(); 1.40 + [Pure] 1.41 + readonly attribute boolean defaultPrevented; 1.42 + 1.43 + [Unforgeable, Pure] 1.44 + readonly attribute boolean isTrusted; 1.45 + [Pure] 1.46 + readonly attribute DOMTimeStamp timeStamp; 1.47 + 1.48 + [Throws] 1.49 + void initEvent(DOMString type, boolean bubbles, boolean cancelable); 1.50 +}; 1.51 + 1.52 +// Mozilla specific legacy stuff. 1.53 +partial interface Event { 1.54 + const long ALT_MASK = 0x00000001; 1.55 + const long CONTROL_MASK = 0x00000002; 1.56 + const long SHIFT_MASK = 0x00000004; 1.57 + const long META_MASK = 0x00000008; 1.58 + 1.59 + readonly attribute EventTarget? originalTarget; 1.60 + readonly attribute EventTarget? explicitOriginalTarget; 1.61 + [ChromeOnly] readonly attribute boolean multipleActionsPrevented; 1.62 + [ChromeOnly] readonly attribute boolean isSynthesized; 1.63 + 1.64 + boolean getPreventDefault(); 1.65 +}; 1.66 + 1.67 +dictionary EventInit { 1.68 + boolean bubbles = false; 1.69 + boolean cancelable = false; 1.70 +}; 1.71 +