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/.
6 * The origin of this IDL file is
7 * http://www.w3.org/TR/2012/WD-dom-20120105/
9 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10 * liability, trademark and document use rules apply.
13 [Exposed=(Window,Worker), ProbablyShortLivingWrapper]
15 constructor(DOMString type, optional EventInit eventInitDict = {});
18 readonly attribute DOMString type;
19 [Pure, BindingAlias="srcElement"]
20 readonly attribute EventTarget? target;
22 readonly attribute EventTarget? currentTarget;
24 sequence<EventTarget> composedPath();
26 const unsigned short NONE = 0;
27 const unsigned short CAPTURING_PHASE = 1;
28 const unsigned short AT_TARGET = 2;
29 const unsigned short BUBBLING_PHASE = 3;
31 readonly attribute unsigned short eventPhase;
33 void stopPropagation();
34 void stopImmediatePropagation();
37 readonly attribute boolean bubbles;
39 readonly attribute boolean cancelable;
41 attribute boolean returnValue;
43 void preventDefault();
44 [Pure, NeedsCallerType]
45 readonly attribute boolean defaultPrevented;
47 readonly attribute boolean defaultPreventedByChrome;
49 readonly attribute boolean defaultPreventedByContent;
51 readonly attribute boolean composed;
54 readonly attribute boolean isTrusted;
56 readonly attribute DOMHighResTimeStamp timeStamp;
58 void initEvent(DOMString type,
59 optional boolean bubbles = false,
60 optional boolean cancelable = false);
61 attribute boolean cancelBubble;
64 // Mozilla specific legacy stuff.
65 partial interface Event {
66 const long ALT_MASK = 0x00000001;
67 const long CONTROL_MASK = 0x00000002;
68 const long SHIFT_MASK = 0x00000004;
69 const long META_MASK = 0x00000008;
71 /** The original target of the event, before any retargetings. */
72 readonly attribute EventTarget? originalTarget;
74 * The explicit original target of the event. If the event was retargeted
75 * for some reason other than an anonymous boundary crossing, this will be set
76 * to the target before the retargeting occurs. For example, mouse events
77 * are retargeted to their parent node when they happen over text nodes (bug
78 * 185889), and in that case .target will show the parent and
79 * .explicitOriginalTarget will show the text node.
80 * .explicitOriginalTarget differs from .originalTarget in that it will never
81 * contain anonymous content.
83 readonly attribute EventTarget? explicitOriginalTarget;
84 [ChromeOnly] readonly attribute EventTarget? composedTarget;
85 [ChromeOnly] void preventMultipleActions();
86 [ChromeOnly] readonly attribute boolean multipleActionsPrevented;
87 [ChromeOnly] readonly attribute boolean isSynthesized;
90 dictionary EventInit {
91 boolean bubbles = false;
92 boolean cancelable = false;
93 boolean composed = false;