Bug 1671598 [wpt PR 26128] - [AspectRatio] Fix divide by zero with a small float...
[gecko.git] / dom / webidl / DeviceMotionEvent.webidl
blobc46cf6730a85bbf69b449f6c6eced8428d8e27fe
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  * https://w3c.github.io/deviceorientation/
7  */
9 [NoInterfaceObject,
10   Exposed=Window]
11 interface DeviceAcceleration {
12   readonly attribute double? x;
13   readonly attribute double? y;
14   readonly attribute double? z;
17 [NoInterfaceObject,
18  Exposed=Window]
19 interface DeviceRotationRate {
20   readonly attribute double? alpha;
21   readonly attribute double? beta;
22   readonly attribute double? gamma;
25 [Pref="device.sensors.motion.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled",
26  Exposed=Window]
27 interface DeviceMotionEvent : Event {
28   constructor(DOMString type,
29               optional DeviceMotionEventInit eventInitDict = {});
31   readonly attribute DeviceAcceleration? acceleration;
32   readonly attribute DeviceAcceleration? accelerationIncludingGravity;
33   readonly attribute DeviceRotationRate? rotationRate;
34   readonly attribute double? interval;
37 dictionary DeviceAccelerationInit {
38   double? x = null;
39   double? y = null;
40   double? z = null;
43 dictionary DeviceRotationRateInit {
44   double? alpha = null;
45   double? beta = null;
46   double? gamma = null;
49 dictionary DeviceMotionEventInit : EventInit {
50   // FIXME: bug 1493860: should this "= {}" be here?
51   DeviceAccelerationInit acceleration = {};
52   // FIXME: bug 1493860: should this "= {}" be here?
53   DeviceAccelerationInit accelerationIncludingGravity = {};
54   // FIXME: bug 1493860: should this "= {}" be here?
55   DeviceRotationRateInit rotationRate = {};
56   double? interval = null;
59 // Mozilla extensions.
60 partial interface DeviceMotionEvent {
61   void initDeviceMotionEvent(DOMString type,
62                              optional boolean canBubble = false,
63                              optional boolean cancelable = false,
64                              optional DeviceAccelerationInit acceleration = {},
65                              optional DeviceAccelerationInit accelerationIncludingGravity = {},
66                              optional DeviceRotationRateInit rotationRate = {},
67                              optional double? interval = null);