Bug 1610775 [wpt PR 21336] - Update urllib3 to 1.25.8, a=testonly
[gecko.git] / dom / webidl / MouseEvent.webidl
blob312b73b53ef76dca6e0c163e2594561dc2fa7223
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
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * For more information on this interface please see
7  * http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html
8  * https://drafts.csswg.org/cssom-view/#extensions-to-the-mouseevent-interface
9  *
10  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
11  * liability, trademark and document use rules apply.
12  */
14 [Exposed=Window]
15 interface MouseEvent : UIEvent {
16   constructor(DOMString typeArg,
17               optional MouseEventInit mouseEventInitDict = {});
19   [NeedsCallerType]
20   readonly attribute long           screenX;
21   [NeedsCallerType]
22   readonly attribute long           screenY;
23   readonly attribute long           pageX;
24   readonly attribute long           pageY;
25   readonly attribute long           clientX;
26   readonly attribute long           clientY;
27   [BinaryName="clientX"]
28   readonly attribute long           x;
29   [BinaryName="clientY"]
30   readonly attribute long           y;
31   readonly attribute long           offsetX;
32   readonly attribute long           offsetY;
33   readonly attribute boolean        ctrlKey;
34   readonly attribute boolean        shiftKey;
35   readonly attribute boolean        altKey;
36   readonly attribute boolean        metaKey;
37   readonly attribute short          button;
38   readonly attribute unsigned short buttons;
39   readonly attribute EventTarget?   relatedTarget;
40   readonly attribute DOMString?     region;
42   // Pointer Lock
43   readonly attribute long           movementX;
44   readonly attribute long           movementY;
46   // Deprecated in DOM Level 3:
47 void initMouseEvent(DOMString typeArg,
48                     optional boolean canBubbleArg = false,
49                     optional boolean cancelableArg = false,
50                     optional Window? viewArg = null,
51                     optional long detailArg = 0,
52                     optional long screenXArg = 0,
53                     optional long screenYArg = 0,
54                     optional long clientXArg = 0,
55                     optional long clientYArg = 0,
56                     optional boolean ctrlKeyArg = false,
57                     optional boolean altKeyArg = false,
58                     optional boolean shiftKeyArg = false,
59                     optional boolean metaKeyArg = false,
60                     optional short buttonArg = 0,
61                     optional EventTarget? relatedTargetArg = null);
62   // Introduced in DOM Level 3:
63   boolean                           getModifierState(DOMString keyArg);
66 // Suggested initMouseEvent replacement initializer:
67 dictionary MouseEventInit : EventModifierInit {
68   // Attributes for MouseEvent:
69   long           screenX       = 0;
70   long           screenY       = 0;
71   long           clientX       = 0;
72   long           clientY       = 0;
73   short          button        = 0;
74   // Note: "buttons" was not previously initializable through initMouseEvent!
75   unsigned short buttons       = 0;
76   EventTarget?   relatedTarget = null;
78   // Pointer Lock
79   long           movementX = 0;
80   long           movementY = 0;
83 // Mozilla extensions
84 partial interface MouseEvent
86   // Finger or touch pressure event value
87   // ranges between 0.0 and 1.0
88   [Deprecated="MouseEvent_MozPressure"]
89   readonly attribute float mozPressure;
91   const unsigned short    MOZ_SOURCE_UNKNOWN    = 0;
92   const unsigned short    MOZ_SOURCE_MOUSE      = 1;
93   const unsigned short    MOZ_SOURCE_PEN        = 2;
94   const unsigned short    MOZ_SOURCE_ERASER     = 3;
95   const unsigned short    MOZ_SOURCE_CURSOR     = 4;
96   const unsigned short    MOZ_SOURCE_TOUCH      = 5;
97   const unsigned short    MOZ_SOURCE_KEYBOARD   = 6;
99   readonly attribute unsigned short mozInputSource;
101   void initNSMouseEvent(DOMString typeArg,
102                         optional boolean canBubbleArg = false,
103                         optional boolean cancelableArg = false,
104                         optional Window? viewArg = null,
105                         optional long detailArg = 0,
106                         optional long screenXArg = 0,
107                         optional long screenYArg = 0,
108                         optional long clientXArg = 0,
109                         optional long clientYArg = 0,
110                         optional boolean ctrlKeyArg = false,
111                         optional boolean altKeyArg = false,
112                         optional boolean shiftKeyArg = false,
113                         optional boolean metaKeyArg = false,
114                         optional short buttonArg = 0,
115                         optional EventTarget? relatedTargetArg = null,
116                         optional float pressure = 0,
117                         optional unsigned short inputSourceArg = 0);
118   [ChromeOnly]
119   readonly attribute boolean hitCluster; // True when touch occurs in a cluster of links