dom/webidl/MouseEvent.webidl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 5 *
michael@0 6 * For more information on this interface please see
michael@0 7 * http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html
michael@0 8 *
michael@0 9 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
michael@0 10 * liability, trademark and document use rules apply.
michael@0 11 */
michael@0 12
michael@0 13 interface MouseEvent : UIEvent {
michael@0 14 readonly attribute long screenX;
michael@0 15 readonly attribute long screenY;
michael@0 16 readonly attribute long clientX;
michael@0 17 readonly attribute long clientY;
michael@0 18 readonly attribute boolean ctrlKey;
michael@0 19 readonly attribute boolean shiftKey;
michael@0 20 readonly attribute boolean altKey;
michael@0 21 readonly attribute boolean metaKey;
michael@0 22 readonly attribute short button;
michael@0 23 readonly attribute unsigned short buttons;
michael@0 24 readonly attribute EventTarget? relatedTarget;
michael@0 25 // Deprecated in DOM Level 3:
michael@0 26 [Throws]
michael@0 27 void initMouseEvent(DOMString typeArg,
michael@0 28 boolean canBubbleArg,
michael@0 29 boolean cancelableArg,
michael@0 30 WindowProxy? viewArg,
michael@0 31 long detailArg,
michael@0 32 long screenXArg,
michael@0 33 long screenYArg,
michael@0 34 long clientXArg,
michael@0 35 long clientYArg,
michael@0 36 boolean ctrlKeyArg,
michael@0 37 boolean altKeyArg,
michael@0 38 boolean shiftKeyArg,
michael@0 39 boolean metaKeyArg,
michael@0 40 short buttonArg,
michael@0 41 EventTarget? relatedTargetArg);
michael@0 42 // Introduced in DOM Level 3:
michael@0 43 boolean getModifierState(DOMString keyArg);
michael@0 44 };
michael@0 45
michael@0 46
michael@0 47 // Event Constructor Syntax:
michael@0 48 [Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)]
michael@0 49 partial interface MouseEvent
michael@0 50 {
michael@0 51 };
michael@0 52
michael@0 53 // Suggested initMouseEvent replacement initializer:
michael@0 54 dictionary MouseEventInit {
michael@0 55 // Attributes from Event:
michael@0 56 boolean bubbles = false;
michael@0 57 boolean cancelable = false;
michael@0 58
michael@0 59 // Attributes from UIEvent:
michael@0 60 WindowProxy? view = null;
michael@0 61 long detail = 0;
michael@0 62
michael@0 63 // Attributes for MouseEvent:
michael@0 64 long screenX = 0;
michael@0 65 long screenY = 0;
michael@0 66 long clientX = 0;
michael@0 67 long clientY = 0;
michael@0 68 boolean ctrlKey = false;
michael@0 69 boolean shiftKey = false;
michael@0 70 boolean altKey = false;
michael@0 71 boolean metaKey = false;
michael@0 72 short button = 0;
michael@0 73 // Note: "buttons" was not previously initializable through initMouseEvent!
michael@0 74 unsigned short buttons = 0;
michael@0 75 EventTarget? relatedTarget = null;
michael@0 76 };
michael@0 77
michael@0 78 // Mozilla extensions
michael@0 79 partial interface MouseEvent
michael@0 80 {
michael@0 81 readonly attribute long mozMovementX;
michael@0 82 readonly attribute long mozMovementY;
michael@0 83
michael@0 84 // Finger or touch pressure event value
michael@0 85 // ranges between 0.0 and 1.0
michael@0 86 readonly attribute float mozPressure;
michael@0 87
michael@0 88 const unsigned short MOZ_SOURCE_UNKNOWN = 0;
michael@0 89 const unsigned short MOZ_SOURCE_MOUSE = 1;
michael@0 90 const unsigned short MOZ_SOURCE_PEN = 2;
michael@0 91 const unsigned short MOZ_SOURCE_ERASER = 3;
michael@0 92 const unsigned short MOZ_SOURCE_CURSOR = 4;
michael@0 93 const unsigned short MOZ_SOURCE_TOUCH = 5;
michael@0 94 const unsigned short MOZ_SOURCE_KEYBOARD = 6;
michael@0 95
michael@0 96 readonly attribute unsigned short mozInputSource;
michael@0 97
michael@0 98 [Throws]
michael@0 99 void initNSMouseEvent(DOMString typeArg,
michael@0 100 boolean canBubbleArg,
michael@0 101 boolean cancelableArg,
michael@0 102 WindowProxy? viewArg,
michael@0 103 long detailArg,
michael@0 104 long screenXArg,
michael@0 105 long screenYArg,
michael@0 106 long clientXArg,
michael@0 107 long clientYArg,
michael@0 108 boolean ctrlKeyArg,
michael@0 109 boolean altKeyArg,
michael@0 110 boolean shiftKeyArg,
michael@0 111 boolean metaKeyArg,
michael@0 112 short buttonArg,
michael@0 113 EventTarget? relatedTargetArg,
michael@0 114 float pressure,
michael@0 115 unsigned short inputSourceArg);
michael@0 116
michael@0 117 };
michael@0 118

mercurial