|
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 */ |
|
12 |
|
13 [Constructor(DOMString type, optional EventInit eventInitDict)] |
|
14 interface Event { |
|
15 [Pure] |
|
16 readonly attribute DOMString type; |
|
17 [Pure] |
|
18 readonly attribute EventTarget? target; |
|
19 [Pure] |
|
20 readonly attribute EventTarget? currentTarget; |
|
21 |
|
22 const unsigned short NONE = 0; |
|
23 const unsigned short CAPTURING_PHASE = 1; |
|
24 const unsigned short AT_TARGET = 2; |
|
25 const unsigned short BUBBLING_PHASE = 3; |
|
26 [Pure] |
|
27 readonly attribute unsigned short eventPhase; |
|
28 |
|
29 void stopPropagation(); |
|
30 void stopImmediatePropagation(); |
|
31 |
|
32 [Pure] |
|
33 readonly attribute boolean bubbles; |
|
34 [Pure] |
|
35 readonly attribute boolean cancelable; |
|
36 void preventDefault(); |
|
37 [Pure] |
|
38 readonly attribute boolean defaultPrevented; |
|
39 |
|
40 [Unforgeable, Pure] |
|
41 readonly attribute boolean isTrusted; |
|
42 [Pure] |
|
43 readonly attribute DOMTimeStamp timeStamp; |
|
44 |
|
45 [Throws] |
|
46 void initEvent(DOMString type, boolean bubbles, boolean cancelable); |
|
47 }; |
|
48 |
|
49 // Mozilla specific legacy stuff. |
|
50 partial interface Event { |
|
51 const long ALT_MASK = 0x00000001; |
|
52 const long CONTROL_MASK = 0x00000002; |
|
53 const long SHIFT_MASK = 0x00000004; |
|
54 const long META_MASK = 0x00000008; |
|
55 |
|
56 readonly attribute EventTarget? originalTarget; |
|
57 readonly attribute EventTarget? explicitOriginalTarget; |
|
58 [ChromeOnly] readonly attribute boolean multipleActionsPrevented; |
|
59 [ChromeOnly] readonly attribute boolean isSynthesized; |
|
60 |
|
61 boolean getPreventDefault(); |
|
62 }; |
|
63 |
|
64 dictionary EventInit { |
|
65 boolean bubbles = false; |
|
66 boolean cancelable = false; |
|
67 }; |
|
68 |