Backed out changeset 62f7af8fe549 (bug 1843981) for causing valgrind bustage. CLOSED...
[gecko.git] / dom / webidl / Event.webidl
blob24eb456fa57b52d15063273de92f9be112a5345f
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.w3.org/TR/2012/WD-dom-20120105/
8  *
9  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10  * liability, trademark and document use rules apply.
11  */
13 [Exposed=(Window,Worker,AudioWorklet), ProbablyShortLivingWrapper]
14 interface Event {
15   constructor(DOMString type, optional EventInit eventInitDict = {});
17   [Pure]
18   readonly attribute DOMString type;
19   [Pure, BindingAlias="srcElement"]
20   readonly attribute EventTarget? target;
21   [Pure]
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;
30   [Pure]
31   readonly attribute unsigned short eventPhase;
33   undefined stopPropagation();
34   undefined stopImmediatePropagation();
36   [Pure]
37   readonly attribute boolean bubbles;
38   [Pure]
39   readonly attribute boolean cancelable;
40   [NeedsCallerType]
41   attribute boolean returnValue;
42   [NeedsCallerType]
43   undefined preventDefault();
44   [Pure, NeedsCallerType]
45   readonly attribute boolean defaultPrevented;
46   [ChromeOnly, Pure]
47   readonly attribute boolean defaultPreventedByChrome;
48   [ChromeOnly, Pure]
49   readonly attribute boolean defaultPreventedByContent;
50   [Pure]
51   readonly attribute boolean composed;
53   [LegacyUnforgeable, Pure]
54   readonly attribute boolean isTrusted;
55   [Pure]
56   readonly attribute DOMHighResTimeStamp timeStamp;
58   undefined 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;
73   /**
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.
82    */
83   readonly attribute EventTarget? explicitOriginalTarget;
84   [ChromeOnly] readonly attribute EventTarget? composedTarget;
85   [ChromeOnly] undefined preventMultipleActions();
86   [ChromeOnly] readonly attribute boolean multipleActionsPrevented;
87   [ChromeOnly] readonly attribute boolean isSynthesized;
88   /**
89    * When the event target is a remote browser, calling this will fire an
90    * reply event in the chrome process.
91    */
92   [ChromeOnly] undefined requestReplyFromRemoteContent();
93   /**
94    * Returns true when the event shouldn't be handled by chrome.
95    */
96   [ChromeOnly] readonly attribute boolean isWaitingReplyFromRemoteContent;
97   /**
98    * Returns true when the event is a reply event from a remote process.
99    */
100   [ChromeOnly] readonly attribute boolean isReplyEventFromRemoteContent;
103 dictionary EventInit {
104   boolean bubbles = false;
105   boolean cancelable = false;
106   boolean composed = false;