1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/interfaces/events/nsIDOMWheelEvent.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,48 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim: set ts=2 et sw=2 tw=80: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.8 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsIDOMMouseEvent.idl" 1.11 + 1.12 +[scriptable, builtinclass, uuid(86e2b577-7e61-4ed5-8ddd-c1533bf07137)] 1.13 +interface nsIDOMWheelEvent : nsIDOMMouseEvent 1.14 +{ 1.15 + const unsigned long DOM_DELTA_PIXEL = 0x00; 1.16 + const unsigned long DOM_DELTA_LINE = 0x01; 1.17 + const unsigned long DOM_DELTA_PAGE = 0x02; 1.18 + 1.19 + // Note that DOM Level 3 Events defines the type of delta values as float. 1.20 + // However, we should use double for them. Javascript engine always uses 1.21 + // double even if interface attributes are float. If we defined them 1.22 + // as float, that would cause error at casting from float to double. 1.23 + // E.g., following function may return false if the deltaX is float: 1.24 + // 1.25 + // function () { 1.26 + // var event = new WheelEvent("wheel", { deltaX: 0.1 }); 1.27 + // return (event.deltaX == 0.1); 1.28 + // } 1.29 + 1.30 + readonly attribute double deltaX; 1.31 + readonly attribute double deltaY; 1.32 + readonly attribute double deltaZ; 1.33 + readonly attribute unsigned long deltaMode; 1.34 + 1.35 + [noscript] void initWheelEvent(in DOMString typeArg, 1.36 + in boolean canBubbleArg, 1.37 + in boolean cancelableArg, 1.38 + in nsIDOMWindow viewArg, 1.39 + in long detailArg, 1.40 + in long screenXArg, 1.41 + in long screenYArg, 1.42 + in long clientXArg, 1.43 + in long clientYArg, 1.44 + in unsigned short buttonArg, 1.45 + in nsIDOMEventTarget relatedTargetArg, 1.46 + in DOMString modifiersListArg, 1.47 + in double deltaXArg, 1.48 + in double deltaYArg, 1.49 + in double deltaZArg, 1.50 + in unsigned long deltaMode); 1.51 +};