Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsIDOMMouseEvent.idl"
9 [scriptable, builtinclass, uuid(86e2b577-7e61-4ed5-8ddd-c1533bf07137)]
10 interface nsIDOMWheelEvent : nsIDOMMouseEvent
11 {
12 const unsigned long DOM_DELTA_PIXEL = 0x00;
13 const unsigned long DOM_DELTA_LINE = 0x01;
14 const unsigned long DOM_DELTA_PAGE = 0x02;
16 // Note that DOM Level 3 Events defines the type of delta values as float.
17 // However, we should use double for them. Javascript engine always uses
18 // double even if interface attributes are float. If we defined them
19 // as float, that would cause error at casting from float to double.
20 // E.g., following function may return false if the deltaX is float:
21 //
22 // function () {
23 // var event = new WheelEvent("wheel", { deltaX: 0.1 });
24 // return (event.deltaX == 0.1);
25 // }
27 readonly attribute double deltaX;
28 readonly attribute double deltaY;
29 readonly attribute double deltaZ;
30 readonly attribute unsigned long deltaMode;
32 [noscript] void initWheelEvent(in DOMString typeArg,
33 in boolean canBubbleArg,
34 in boolean cancelableArg,
35 in nsIDOMWindow viewArg,
36 in long detailArg,
37 in long screenXArg,
38 in long screenYArg,
39 in long clientXArg,
40 in long clientYArg,
41 in unsigned short buttonArg,
42 in nsIDOMEventTarget relatedTargetArg,
43 in DOMString modifiersListArg,
44 in double deltaXArg,
45 in double deltaYArg,
46 in double deltaZArg,
47 in unsigned long deltaMode);
48 };