2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-03-31 08:42:20 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
|
|
|
* http://www.w3.org/TR/2012/WD-dom-20120105/
|
|
|
|
*
|
|
|
|
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
|
|
|
* liability, trademark and document use rules apply.
|
|
|
|
*/
|
|
|
|
|
2014-08-05 06:20:34 +04:00
|
|
|
[Constructor(DOMString type, optional EventInit eventInitDict),
|
2017-04-11 00:01:29 +03:00
|
|
|
Exposed=(Window,Worker,System), ProbablyShortLivingWrapper]
|
2012-03-31 08:42:20 +04:00
|
|
|
interface Event {
|
2013-10-09 22:58:15 +04:00
|
|
|
[Pure]
|
2012-03-31 08:42:20 +04:00
|
|
|
readonly attribute DOMString type;
|
2018-05-08 20:52:42 +03:00
|
|
|
[Pure, BindingAlias="srcElement"]
|
2012-03-31 08:42:20 +04:00
|
|
|
readonly attribute EventTarget? target;
|
2013-10-09 22:58:15 +04:00
|
|
|
[Pure]
|
2012-03-31 08:42:20 +04:00
|
|
|
readonly attribute EventTarget? currentTarget;
|
|
|
|
|
2017-12-18 19:07:36 +03:00
|
|
|
sequence<EventTarget> composedPath();
|
|
|
|
|
2013-03-09 15:34:29 +04:00
|
|
|
const unsigned short NONE = 0;
|
2012-03-31 08:42:20 +04:00
|
|
|
const unsigned short CAPTURING_PHASE = 1;
|
|
|
|
const unsigned short AT_TARGET = 2;
|
|
|
|
const unsigned short BUBBLING_PHASE = 3;
|
2013-10-09 22:58:15 +04:00
|
|
|
[Pure]
|
2012-03-31 08:42:20 +04:00
|
|
|
readonly attribute unsigned short eventPhase;
|
|
|
|
|
|
|
|
void stopPropagation();
|
|
|
|
void stopImmediatePropagation();
|
|
|
|
|
2013-10-09 22:58:15 +04:00
|
|
|
[Pure]
|
2012-03-31 08:42:20 +04:00
|
|
|
readonly attribute boolean bubbles;
|
2013-10-09 22:58:15 +04:00
|
|
|
[Pure]
|
2012-03-31 08:42:20 +04:00
|
|
|
readonly attribute boolean cancelable;
|
2016-11-16 22:10:22 +03:00
|
|
|
[NeedsCallerType]
|
2018-08-28 09:28:56 +03:00
|
|
|
attribute boolean returnValue;
|
|
|
|
[NeedsCallerType]
|
2012-03-31 08:42:20 +04:00
|
|
|
void preventDefault();
|
2016-11-16 22:10:22 +03:00
|
|
|
[Pure, NeedsCallerType]
|
2012-03-31 08:42:20 +04:00
|
|
|
readonly attribute boolean defaultPrevented;
|
2016-03-15 08:45:23 +03:00
|
|
|
[ChromeOnly, Pure]
|
|
|
|
readonly attribute boolean defaultPreventedByChrome;
|
|
|
|
[ChromeOnly, Pure]
|
|
|
|
readonly attribute boolean defaultPreventedByContent;
|
2016-08-31 06:16:11 +03:00
|
|
|
[Pure]
|
|
|
|
readonly attribute boolean composed;
|
2012-03-31 08:42:20 +04:00
|
|
|
|
2013-10-09 22:58:15 +04:00
|
|
|
[Unforgeable, Pure]
|
2012-03-31 08:42:20 +04:00
|
|
|
readonly attribute boolean isTrusted;
|
2013-10-09 22:58:15 +04:00
|
|
|
[Pure]
|
2014-06-06 09:29:49 +04:00
|
|
|
readonly attribute DOMHighResTimeStamp timeStamp;
|
2012-03-31 08:42:20 +04:00
|
|
|
|
2017-04-02 21:16:33 +03:00
|
|
|
void initEvent(DOMString type,
|
|
|
|
optional boolean bubbles = false,
|
|
|
|
optional boolean cancelable = false);
|
2016-11-29 05:28:21 +03:00
|
|
|
attribute boolean cancelBubble;
|
2012-03-31 08:42:20 +04:00
|
|
|
};
|
|
|
|
|
2013-03-09 15:34:29 +04:00
|
|
|
// Mozilla specific legacy stuff.
|
|
|
|
partial interface Event {
|
|
|
|
const long ALT_MASK = 0x00000001;
|
|
|
|
const long CONTROL_MASK = 0x00000002;
|
|
|
|
const long SHIFT_MASK = 0x00000004;
|
|
|
|
const long META_MASK = 0x00000008;
|
|
|
|
|
2018-04-20 07:49:30 +03:00
|
|
|
/** The original target of the event, before any retargetings. */
|
2013-03-09 15:34:29 +04:00
|
|
|
readonly attribute EventTarget? originalTarget;
|
2018-04-20 07:49:30 +03:00
|
|
|
/**
|
|
|
|
* The explicit original target of the event. If the event was retargeted
|
|
|
|
* for some reason other than an anonymous boundary crossing, this will be set
|
|
|
|
* to the target before the retargeting occurs. For example, mouse events
|
|
|
|
* are retargeted to their parent node when they happen over text nodes (bug
|
|
|
|
* 185889), and in that case .target will show the parent and
|
|
|
|
* .explicitOriginalTarget will show the text node.
|
|
|
|
* .explicitOriginalTarget differs from .originalTarget in that it will never
|
|
|
|
* contain anonymous content.
|
|
|
|
*/
|
2013-03-09 15:34:29 +04:00
|
|
|
readonly attribute EventTarget? explicitOriginalTarget;
|
2015-01-23 14:55:46 +03:00
|
|
|
[ChromeOnly] readonly attribute EventTarget? composedTarget;
|
2013-03-12 15:28:17 +04:00
|
|
|
[ChromeOnly] readonly attribute boolean multipleActionsPrevented;
|
2014-01-15 18:28:04 +04:00
|
|
|
[ChromeOnly] readonly attribute boolean isSynthesized;
|
2013-03-09 15:34:29 +04:00
|
|
|
};
|
|
|
|
|
2012-03-31 08:42:20 +04:00
|
|
|
dictionary EventInit {
|
2013-03-09 15:34:29 +04:00
|
|
|
boolean bubbles = false;
|
|
|
|
boolean cancelable = false;
|
2016-08-31 06:16:11 +03:00
|
|
|
boolean composed = false;
|
2012-03-31 08:42:20 +04:00
|
|
|
};
|