Bug 1447472 part 3. Remove nsIDOMNSEvent. r=qdot

MozReview-Commit-ID: HT1gskFxEZL
This commit is contained in:
Boris Zbarsky 2018-03-26 14:53:53 -04:00
Родитель 37b111ac2a
Коммит 20e0796330
7 изменённых файлов: 12 добавлений и 36 удалений

Просмотреть файл

@ -15,7 +15,7 @@ SimpleTest.waitForExplicitFinish();
var utils = SpecialPowers.getDOMWindowUtils(window);
function test_sendMouseEventDefaults() {
var x = 1, y = 2, button = 1, clickCount = 2,
modifiers = SpecialPowers.Ci.nsIDOMNSEvent.SHIFT_MASK;
modifiers = SpecialPowers.Ci.nsIDOMWindowUtils.MODIFIER_SHIFT;
window.addEventListener("mousedown", function(evt) {
// Mandatory args
@ -40,7 +40,7 @@ function test_sendMouseEventDefaults() {
function test_sendMouseEventOptionals() {
var x = 1, y = 2, button = 1, clickCount = 3,
modifiers = SpecialPowers.Ci.nsIDOMNSEvent.SHIFT_MASK,
modifiers = SpecialPowers.Ci.nsIDOMWindowUtils.MODIFIER_SHIFT,
pressure = 0.5,
source = MouseEvent.MOZ_SOURCE_KEYBOARD;

Просмотреть файл

@ -261,7 +261,7 @@ interface nsIDOMWindowUtils : nsISupports {
/**
* Following modifiers are for sent*Event() except sendNative*Event().
* NOTE: MODIFIER_ALT, MODIFIER_CONTROL, MODIFIER_SHIFT and MODIFIER_META
* are must be same values as nsIDOMNSEvent::*_MASK for backward
* are must be same values as EventBinding::*_MASK for backward
* compatibility.
*/
const long MODIFIER_ALT = 0x0001;
@ -723,7 +723,7 @@ interface nsIDOMWindowUtils : nsISupports {
* @param aY y offset in CSS pixels
* @param aDirection direction, using constants defined in SimpleGestureEvent.webidl
* @param aDelta amount of magnification or rotation for magnify and rotation events
* @param aModifiers modifiers pressed, using constants defined in nsIDOMNSEvent
* @param aModifiers modifiers pressed, using constants defined in Event.webidl
* @param aClickCount For tap gestures, the number of taps.
*/
void sendSimpleGestureEvent(in AString aType,

Просмотреть файл

@ -11,7 +11,6 @@ XPIDL_SOURCES += [
'nsIDOMEvent.idl',
'nsIDOMEventListener.idl',
'nsIDOMEventTarget.idl',
'nsIDOMNSEvent.idl',
]
XPIDL_MODULE = 'dom_events'

Просмотреть файл

@ -1,21 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "domstubs.idl"
%{C++
#ifdef ERROR
#undef ERROR
#endif
%}
[uuid(2580b4a2-6d85-4ca6-9be2-98f3406ad296)]
interface nsIDOMNSEvent : nsISupports
{
const long ALT_MASK = 0x00000001;
const long CONTROL_MASK = 0x00000002;
const long SHIFT_MASK = 0x00000004;
const long META_MASK = 0x00000008;
};

Просмотреть файл

@ -200,22 +200,22 @@ event.sendKey = function(key, window = undefined) {
event.parseModifiers_ = function(modifiers) {
let mval = 0;
if (modifiers.shiftKey) {
mval |= Ci.nsIDOMNSEvent.SHIFT_MASK;
mval |= Ci.nsIDOMWindowUtils.MODIFIER_SHIFT;
}
if (modifiers.ctrlKey) {
mval |= Ci.nsIDOMNSEvent.CONTROL_MASK;
mval |= Ci.nsIDOMWindowUtils.MODIFIER_CONTROL;
}
if (modifiers.altKey) {
mval |= Ci.nsIDOMNSEvent.ALT_MASK;
mval |= Ci.nsIDOMWindowUtils.MODIFIER_ALT;
}
if (modifiers.metaKey) {
mval |= Ci.nsIDOMNSEvent.META_MASK;
mval |= Ci.nsIDOMWindowUtils.MODIFIER_META;
}
if (modifiers.accelKey) {
if (navigator.platform.includes("Mac")) {
mval |= Ci.nsIDOMNSEvent.META_MASK;
mval |= Ci.nsIDOMWindowUtils.MODIFIER_META;
} else {
mval |= Ci.nsIDOMNSEvent.CONTROL_MASK;
mval |= Ci.nsIDOMWindowUtils.MODIFIER_CONTROL;
}
}
return mval;

Просмотреть файл

@ -168,8 +168,8 @@ function runTests() {
// test dragging a slider by tapping off the thumb and holding shift
// modifiers don't affect touch events
var mods = /Mac/.test(navigator.platform) ? Ci.nsIDOMNSEvent.ALT_MASK :
Ci.nsIDOMNSEvent.SHIFT_MASK;
var mods = /Mac/.test(navigator.platform) ? Ci.nsIDOMWindowUtils.MODIFIER_ALT :
Ci.nsIDOMWindowUtils.MODIFIER_SHIFT;
testTouchDragSlider("TouchDrag Slider Left+Shift", "scale1", "left", isMac ? 1 : 0, isMac ? 2 : 0, mods);
testTouchDragSlider("TouchDrag Slider Right+Shift", "scale1", "right", isMac ? 3 : 4, isMac ? 2 : 4, mods);
testMouseDragSlider("MouseDrag Slider Left+Shift", "scale1", "left", isMac ? 0 : 1, isMac ? 0 : 2, mods);

Просмотреть файл

@ -22,7 +22,6 @@
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMNode.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMNSEvent.h"
#include "nsIDOMOfflineResourceList.h"
#include "nsIDOMParser.h"
#include "nsIDOMRange.h"
@ -153,7 +152,6 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] =
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIMessageSender, MessageSender),
DEFINE_SHIM(NodeList),
DEFINE_SHIM(Node),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMNSEvent, Event),
DEFINE_SHIM(OfflineResourceList),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMParser, DOMParser),
DEFINE_SHIM(Range),