Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / webidl / EventTarget.webidl
blob5fe193a034cbda29e0b124736469a2038ab5ed58
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  */
14 dictionary EventListenerOptions {
15   boolean capture = false;
16   /* Setting to true make the listener be added to the system group. */
17   [Func="ThreadSafeIsChromeOrUAWidget"]
18   boolean mozSystemGroup = false;
21 dictionary AddEventListenerOptions : EventListenerOptions {
22   boolean passive;
23   boolean once = false;
24   AbortSignal signal;
25   [ChromeOnly]
26   boolean wantUntrusted;
29 [Exposed=*]
30 interface EventTarget {
31   [Throws]
32   constructor();
34   /* Passing null for wantsUntrusted means "default behavior", which
35      differs in content and chrome.  In content that default boolean
36      value is true, while in chrome the default boolean value is
37      false. */
38   [Throws]
39   undefined addEventListener(DOMString type,
40                              EventListener? listener,
41                              optional (AddEventListenerOptions or boolean) options = {},
42                              optional boolean? wantsUntrusted = null);
43   [Throws]
44   undefined removeEventListener(DOMString type,
45                                 EventListener? listener,
46                                 optional (EventListenerOptions or boolean) options = {});
47   [Throws, NeedsCallerType]
48   boolean dispatchEvent(Event event);
51 // Mozilla extensions for use by JS-implemented event targets to
52 // implement on* properties.
53 partial interface EventTarget {
54   // The use of [TreatNonCallableAsNull] here is a bit of a hack: it just makes
55   // the codegen check whether the type involved is either
56   // [TreatNonCallableAsNull] or [TreatNonObjectAsNull] and if it is handle it
57   // accordingly.  In particular, it will NOT actually treat a non-null
58   // non-callable object as null here.
59   [ChromeOnly, Throws]
60   undefined setEventHandler(DOMString type,
61                             [TreatNonCallableAsNull] EventHandler handler);
63   [ChromeOnly]
64   EventHandler getEventHandler(DOMString type);
67 // Mozilla extension to make firing events on event targets from
68 // chrome easier.  This returns the window which can be used to create
69 // events to fire at this EventTarget, or null if there isn't one.
70 partial interface EventTarget {
71   [ChromeOnly, Exposed=Window, BinaryName="ownerGlobalForBindings"]
72   readonly attribute WindowProxy? ownerGlobal;