Bug 1787199 [wpt PR 35620] - Add tests for `VisibilityStateEntry`, a=testonly
[gecko.git] / dom / webidl / XULCommandEvent.webidl
blobb3114fdfac22d29f467ade1f0148c87c85d36bd3
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  */
7 /**
8  * This interface is supported by command events, which are dispatched to
9  * XUL elements as a result of mouse or keyboard activation.
10  */
11 [ChromeOnly,
12  Exposed=Window]
13 interface XULCommandEvent : UIEvent
15   /**
16    * Command events support the same set of modifier keys as mouse and key
17    * events.
18    */
19   readonly attribute boolean ctrlKey;
20   readonly attribute boolean shiftKey;
21   readonly attribute boolean altKey;
22   readonly attribute boolean metaKey;
24   /**
25    * Command events use the same button values as mouse events.
26    * The button will be 0 if the command was not caused by a mouse event.
27    */
28   readonly attribute short button;
30   /**
31    * The input source, if this event was triggered by a mouse event.
32    */
33   readonly attribute unsigned short inputSource;
35   /**
36    * If the command event was redispatched because of a command= attribute
37    * on the original target, sourceEvent will be set to the original DOM Event.
38    * Otherwise, sourceEvent is null.
39    */
40   readonly attribute Event? sourceEvent;
42   /**
43    * Creates a new command event with the given attributes.
44    */
45   [Throws]
46   undefined initCommandEvent(DOMString type,
47                              optional boolean canBubble = false,
48                              optional boolean cancelable = false,
49                              optional Window? view = null,
50                              optional long detail = 0,
51                              optional boolean ctrlKey = false,
52                              optional boolean altKey = false,
53                              optional boolean shiftKey = false,
54                              optional boolean metaKey = false,
55                              optional short buttonArg = 0,
56                              optional Event? sourceEvent = null,
57                              optional unsigned short inputSource = 0);