OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 */ | 18 */ |
19 | 19 |
| 20 // https://w3c.github.io/uievents/#interface-MouseEvent |
| 21 |
20 [ | 22 [ |
21 EventConstructor, | 23 Constructor(DOMString type, optional MouseEventInit eventInitDict), |
| 24 ConstructorCallWith=ScriptState, |
22 ] interface MouseEvent : UIEvent { | 25 ] interface MouseEvent : UIEvent { |
23 [InitializedByEventConstructor] readonly attribute long screenX; | 26 readonly attribute long screenX; |
24 [InitializedByEventConstructor] readonly attribute long screenY; | 27 readonly attribute long screenY; |
25 [InitializedByEventConstructor] readonly attribute long clientX; | 28 readonly attribute long clientX; |
26 [InitializedByEventConstructor] readonly attribute long clientY; | 29 readonly attribute long clientY; |
27 [InitializedByEventConstructor] readonly attribute boolean ctrlKey; | 30 readonly attribute boolean ctrlKey; |
28 [InitializedByEventConstructor] readonly attribute boolean shiftKey
; | 31 readonly attribute boolean shiftKey; |
29 [InitializedByEventConstructor] readonly attribute boolean altKey; | 32 readonly attribute boolean altKey; |
30 [InitializedByEventConstructor] readonly attribute boolean metaKey; | 33 readonly attribute boolean metaKey; |
31 [InitializedByEventConstructor] readonly attribute unsigned short button; | 34 readonly attribute short button; |
32 [InitializedByEventConstructor] readonly attribute EventTarget? relatedT
arget; | 35 readonly attribute unsigned short buttons; |
33 [MeasureAs=MouseEventMovementX] readonly attribute long movement
X; | 36 readonly attribute EventTarget? relatedTarget; |
34 [MeasureAs=MouseEventMovementY] readonly attribute long movement
Y; | 37 // TODO(philipj): boolean getModifierState(DOMString keyArg); |
35 [MeasureAs=PrefixedMouseEventMovementX, ImplementedAs=movementX] readonly at
tribute long webkitMovementX; | |
36 [MeasureAs=PrefixedMouseEventMovementY, ImplementedAs=movementY] readonly at
tribute long webkitMovementY; | |
37 | 38 |
38 void initMouseEvent([Default=Undefined] optional DOMString type, | 39 // https://w3c.github.io/uievents/#idl-interface-MouseEvent-initializers |
39 [Default=Undefined] optional boolean canB
ubble, | 40 // TODO(philipj): None of the initMouseEvent() arguments should be optional. |
40 [Default=Undefined] optional boolean canc
elable, | 41 [CallWith=ScriptState, Measure] void initMouseEvent([Default=Undefined] opti
onal DOMString type, |
41 [Default=Undefined] optional Window view, | 42 [Default=Undefined] opti
onal boolean bubbles, |
42 [Default=Undefined] optional long detail, | 43 [Default=Undefined] opti
onal boolean cancelable, |
43 [Default=Undefined] optional long screenX
, | 44 [Default=Undefined] opti
onal Window? view, |
44 [Default=Undefined] optional long screenY
, | 45 [Default=Undefined] opti
onal long detail, |
45 [Default=Undefined] optional long clientX
, | 46 [Default=Undefined] opti
onal long screenX, |
46 [Default=Undefined] optional long clientY
, | 47 [Default=Undefined] opti
onal long screenY, |
47 [Default=Undefined] optional boolean ctrl
Key, | 48 [Default=Undefined] opti
onal long clientX, |
48 [Default=Undefined] optional boolean altK
ey, | 49 [Default=Undefined] opti
onal long clientY, |
49 [Default=Undefined] optional boolean shif
tKey, | 50 [Default=Undefined] opti
onal boolean ctrlKey, |
50 [Default=Undefined] optional boolean meta
Key, | 51 [Default=Undefined] opti
onal boolean altKey, |
51 [Default=Undefined] optional unsigned sho
rt button, | 52 [Default=Undefined] opti
onal boolean shiftKey, |
52 [Default=Undefined] optional EventTarget
relatedTarget); | 53 [Default=Undefined] opti
onal boolean metaKey, |
| 54 [Default=Undefined] opti
onal unsigned short button, |
| 55 [Default=Undefined] opti
onal EventTarget? relatedTarget); |
| 56 |
| 57 // CSSOM View Module |
| 58 // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-mouseevent-interfac
e |
| 59 // TODO(philipj): These attributes should be of type double, and the spec |
| 60 // also redefines screenX/Y and clientX/Y as double. |
| 61 readonly attribute long pageX; |
| 62 readonly attribute long pageY; |
| 63 [MeasureAs=MouseEventX] readonly attribute long x; |
| 64 [MeasureAs=MouseEventY] readonly attribute long y; |
| 65 [MeasureAs=MouseEventOffsetX] readonly attribute long offsetX; |
| 66 [MeasureAs=MouseEventOffsetY] readonly attribute long offsetY; |
| 67 |
| 68 // Pointer Lock |
| 69 // https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#extensions
-to-the-mouseevent-interface |
| 70 [MeasureAs=MouseEventMovementX] readonly attribute long movementX; |
| 71 [MeasureAs=MouseEventMovementY] readonly attribute long movementY; |
53 | 72 |
54 // Non-standard | 73 // Non-standard |
55 [MeasureAs=MouseEventOffsetX] readonly attribute long offsetX; | |
56 [MeasureAs=MouseEventOffsetY] readonly attribute long offsetY; | |
57 [MeasureAs=MouseEventX] readonly attribute long x; | |
58 [MeasureAs=MouseEventY] readonly attribute long y; | |
59 [MeasureAs=MouseEventFromElement] readonly attribute Node fromElement; | 74 [MeasureAs=MouseEventFromElement] readonly attribute Node fromElement; |
60 [MeasureAs=MouseEventToElement] readonly attribute Node toElement; | 75 [MeasureAs=MouseEventToElement] readonly attribute Node toElement; |
| 76 [MeasureAs=MouseEventWhich] readonly attribute long which; |
| 77 [DeprecateAs=PrefixedMouseEventMovementX, ImplementedAs=movementX] readonly
attribute long webkitMovementX; |
| 78 [DeprecateAs=PrefixedMouseEventMovementY, ImplementedAs=movementY] readonly
attribute long webkitMovementY; |
| 79 [Measure] readonly attribute long layerX; |
| 80 [Measure] readonly attribute long layerY; |
61 | 81 |
62 // FIXME: this belongs on the DragEvent interface | 82 // FIXME: dataTransfer belongs on the DragEvent interface. crbug.com/498504 |
63 readonly attribute DataTransfer dataTransfer; | 83 readonly attribute DataTransfer dataTransfer; |
64 }; | 84 }; |
OLD | NEW |