mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 915248 - Convert DeviceProximityEvent to webidl-only r=smaug
This commit is contained in:
parent
d72b3f16e2
commit
ecf9163df9
@ -18,7 +18,6 @@ XPIDL_SOURCES += [
|
||||
'nsIDOMDeviceLightEvent.idl',
|
||||
'nsIDOMDeviceMotionEvent.idl',
|
||||
'nsIDOMDeviceOrientationEvent.idl',
|
||||
'nsIDOMDeviceProximityEvent.idl',
|
||||
'nsIDOMDragEvent.idl',
|
||||
'nsIDOMElementReplaceEvent.idl',
|
||||
'nsIDOMEvent.idl',
|
||||
|
@ -1,27 +0,0 @@
|
||||
/* 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 "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(86c7c396-9c2b-4d45-9c7c-b0dcda024105)]
|
||||
interface nsIDOMDeviceProximityEvent : nsIDOMEvent
|
||||
{
|
||||
[noscript] void initDeviceProximityEvent(in DOMString eventTypeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in double value,
|
||||
in double min,
|
||||
in double max);
|
||||
readonly attribute double value;
|
||||
readonly attribute double min;
|
||||
readonly attribute double max;
|
||||
};
|
||||
|
||||
|
||||
dictionary DeviceProximityEventInit : EventInit
|
||||
{
|
||||
double value = Infinity;
|
||||
double min = -Infinity;
|
||||
double max = Infinity;
|
||||
};
|
@ -18,6 +18,7 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsIPermissionManager.h"
|
||||
#include "mozilla/dom/DeviceProximityEvent.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
@ -257,17 +258,16 @@ nsDeviceSensors::FireDOMProximityEvent(mozilla::dom::EventTarget* aTarget,
|
||||
double aMin,
|
||||
double aMax)
|
||||
{
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
NS_NewDOMDeviceProximityEvent(getter_AddRefs(event), aTarget, nullptr, nullptr);
|
||||
nsCOMPtr<nsIDOMDeviceProximityEvent> oe = do_QueryInterface(event);
|
||||
|
||||
oe->InitDeviceProximityEvent(NS_LITERAL_STRING("deviceproximity"),
|
||||
true,
|
||||
false,
|
||||
aValue,
|
||||
aMin,
|
||||
aMax);
|
||||
|
||||
DeviceProximityEventInitInitializer init;
|
||||
init.mBubbles = true;
|
||||
init.mCancelable = false;
|
||||
init.mValue = aValue;
|
||||
init.mMin = aMin;
|
||||
init.mMax = aMax;
|
||||
nsRefPtr<DeviceProximityEvent> event =
|
||||
DeviceProximityEvent::Constructor(aTarget,
|
||||
NS_LITERAL_STRING("deviceproximity"),
|
||||
init);
|
||||
event->SetTrusted(true);
|
||||
|
||||
bool defaultActionEnabled;
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "nsITimer.h"
|
||||
#include "nsIDOMDeviceLightEvent.h"
|
||||
#include "nsIDOMDeviceOrientationEvent.h"
|
||||
#include "nsIDOMDeviceProximityEvent.h"
|
||||
#include "nsIDOMUserProximityEvent.h"
|
||||
#include "nsIDOMDeviceMotionEvent.h"
|
||||
#include "nsDOMDeviceMotionEvent.h"
|
||||
|
@ -4,7 +4,7 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
[Constructor(DOMString type, optional DeviceProximityEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
|
||||
[Constructor(DOMString type, optional DeviceProximityEventInit eventInitDict)]
|
||||
interface DeviceProximityEvent : Event
|
||||
{
|
||||
readonly attribute double value;
|
||||
|
@ -460,7 +460,6 @@ WEBIDL_FILES += [
|
||||
'CustomEvent.webidl',
|
||||
'DeviceLightEvent.webidl',
|
||||
'DeviceOrientationEvent.webidl',
|
||||
'DeviceProximityEvent.webidl',
|
||||
'DeviceStorageChangeEvent.webidl',
|
||||
'DOMTransactionEvent.webidl',
|
||||
'ElementReplaceEvent.webidl',
|
||||
@ -542,4 +541,5 @@ if CONFIG['MOZ_B2G']:
|
||||
|
||||
GENERATED_EVENTS_WEBIDL_FILES = [
|
||||
'BlobEvent.webidl',
|
||||
'DeviceProximityEvent.webidl',
|
||||
]
|
||||
|
@ -10,7 +10,6 @@
|
||||
simple_events = [
|
||||
'ProgressEvent',
|
||||
'StorageEvent',
|
||||
'DeviceProximityEvent',
|
||||
'MozSettingsEvent',
|
||||
'UserProximityEvent',
|
||||
'CustomEvent',
|
||||
|
Loading…
Reference in New Issue
Block a user