dom/webidl/DeviceMotionEvent.webidl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/webidl/DeviceMotionEvent.webidl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,58 @@
     1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 + */
     1.9 +
    1.10 +[NoInterfaceObject]
    1.11 +interface DeviceAcceleration {
    1.12 +  readonly attribute double? x;
    1.13 +  readonly attribute double? y;
    1.14 +  readonly attribute double? z;
    1.15 +};
    1.16 +
    1.17 +[NoInterfaceObject]
    1.18 +interface DeviceRotationRate {
    1.19 +  readonly attribute double? alpha;
    1.20 +  readonly attribute double? beta;
    1.21 +  readonly attribute double? gamma;
    1.22 +};
    1.23 +
    1.24 +[Constructor(DOMString type, optional DeviceMotionEventInit eventInitDict)]
    1.25 +interface DeviceMotionEvent : Event {
    1.26 +  readonly attribute DeviceAcceleration? acceleration;
    1.27 +  readonly attribute DeviceAcceleration? accelerationIncludingGravity;
    1.28 +  readonly attribute DeviceRotationRate? rotationRate;
    1.29 +  readonly attribute double? interval;
    1.30 +};
    1.31 +
    1.32 +dictionary DeviceAccelerationInit {
    1.33 +  double? x = null;
    1.34 +  double? y = null;
    1.35 +  double? z = null;
    1.36 +};
    1.37 +
    1.38 +dictionary DeviceRotationRateInit {
    1.39 +  double? alpha = null;
    1.40 +  double? beta = null;
    1.41 +  double? gamma = null;
    1.42 +};
    1.43 +
    1.44 +dictionary DeviceMotionEventInit : EventInit {
    1.45 +  DeviceAccelerationInit acceleration;
    1.46 +  DeviceAccelerationInit accelerationIncludingGravity;
    1.47 +  DeviceRotationRateInit rotationRate;
    1.48 +  double? interval = null;
    1.49 +};
    1.50 +
    1.51 +// Mozilla extensions.
    1.52 +partial interface DeviceMotionEvent {
    1.53 +  [Throws]
    1.54 +  void initDeviceMotionEvent(DOMString type,
    1.55 +                             boolean canBubble,
    1.56 +                             boolean cancelable,
    1.57 +                             DeviceAccelerationInit acceleration,
    1.58 +                             DeviceAccelerationInit accelerationIncludingGravity,
    1.59 +                             DeviceRotationRateInit rotationRate,
    1.60 +                             double? interval);
    1.61 +};

mercurial