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/.
6 * The origin of this IDL file is
7 * https://w3c.github.io/input-events/#interface-InputEvent
11 interface InputEvent : UIEvent
13 constructor(DOMString type, optional InputEventInit eventInitDict = {});
15 readonly attribute boolean isComposing;
17 readonly attribute DOMString inputType;
20 readonly attribute DOMString? data;
23 dictionary InputEventInit : UIEventInit
25 boolean isComposing = false;
26 DOMString inputType = "";
27 // NOTE: Currently, default value of `data` attribute is declared as empty
28 // string by UI Events. However, both Chrome and Safari uses `null`,
29 // and there is a spec issue about this:
30 // https://github.com/w3c/uievents/issues/139
31 // So, we take `null` for compatibility with them.
32 DOMString? data = null;
35 // https://w3c.github.io/input-events/#interface-InputEvent
36 // https://rawgit.com/w3c/input-events/v1/index.html#interface-InputEvent
37 partial interface InputEvent
40 readonly attribute DataTransfer? dataTransfer;
41 // Enable `getTargetRanges()` only when `beforeinput` event is enabled
42 // because this may be used for feature detection of `beforeinput` event
43 // support (due to Chrome not supporting `onbeforeinput` attribute).
44 sequence<StaticRange> getTargetRanges();
47 partial dictionary InputEventInit
49 DataTransfer? dataTransfer = null;
50 sequence<StaticRange> targetRanges = [];