Bug 915813: Convert DeviceLightEvent to webidl-only r=smaug

This commit is contained in:
David Zbarsky 2013-09-14 14:59:50 -04:00
parent ed174bb5d0
commit b3c8139b98
7 changed files with 9 additions and 34 deletions

View File

@ -15,7 +15,6 @@ XPIDL_SOURCES += [
'nsIDOMDOMTransactionEvent.idl',
'nsIDOMDataContainerEvent.idl',
'nsIDOMDataTransfer.idl',
'nsIDOMDeviceLightEvent.idl',
'nsIDOMDeviceMotionEvent.idl',
'nsIDOMDeviceOrientationEvent.idl',
'nsIDOMDragEvent.idl',

View File

@ -1,21 +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(0e4d1751-fdcd-4ee6-b82d-d3f5d992370d)]
interface nsIDOMDeviceLightEvent : nsIDOMEvent
{
[noscript] void initDeviceLightEvent(in DOMString eventTypeArg,
in boolean canBubbleArg,
in boolean cancelableArg,
in double value);
readonly attribute double value;
};
dictionary DeviceLightEventInit : EventInit
{
double value = Infinity;
};

View File

@ -18,6 +18,7 @@
#include "mozilla/Preferences.h"
#include "mozilla/Attributes.h"
#include "nsIPermissionManager.h"
#include "mozilla/dom/DeviceLightEvent.h"
#include "mozilla/dom/DeviceProximityEvent.h"
using namespace mozilla;
@ -237,14 +238,12 @@ void
nsDeviceSensors::FireDOMLightEvent(mozilla::dom::EventTarget* aTarget,
double aValue)
{
nsCOMPtr<nsIDOMEvent> event;
NS_NewDOMDeviceLightEvent(getter_AddRefs(event), aTarget, nullptr, nullptr);
nsCOMPtr<nsIDOMDeviceLightEvent> oe = do_QueryInterface(event);
oe->InitDeviceLightEvent(NS_LITERAL_STRING("devicelight"),
true,
false,
aValue);
DeviceLightEventInitInitializer init;
init.mBubbles = true;
init.mCancelable = false;
init.mValue = aValue;
nsRefPtr<DeviceLightEvent> event =
DeviceLightEvent::Constructor(aTarget, NS_LITERAL_STRING("devicelight"), init);
event->SetTrusted(true);

View File

@ -11,7 +11,6 @@
#include "nsTArray.h"
#include "nsCOMPtr.h"
#include "nsITimer.h"
#include "nsIDOMDeviceLightEvent.h"
#include "nsIDOMDeviceOrientationEvent.h"
#include "nsIDOMUserProximityEvent.h"
#include "nsIDOMDeviceMotionEvent.h"

View File

@ -4,7 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[Constructor(DOMString type, optional DeviceLightEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
[Constructor(DOMString type, optional DeviceLightEventInit eventInitDict)]
interface DeviceLightEvent : Event
{
readonly attribute double value;

View File

@ -465,7 +465,6 @@ if CONFIG['MOZ_B2G_RIL']:
WEBIDL_FILES += [
'CloseEvent.webidl',
'CustomEvent.webidl',
'DeviceLightEvent.webidl',
'DeviceOrientationEvent.webidl',
'DeviceStorageChangeEvent.webidl',
'DOMTransactionEvent.webidl',
@ -541,6 +540,7 @@ if CONFIG['MOZ_B2G']:
GENERATED_EVENTS_WEBIDL_FILES = [
'BlobEvent.webidl',
'DeviceLightEvent.webidl',
'DeviceProximityEvent.webidl',
]

View File

@ -20,7 +20,6 @@ simple_events = [
'CloseEvent',
'MozContactChangeEvent',
'DeviceOrientationEvent',
'DeviceLightEvent',
'MozApplicationEvent',
'SmartCardEvent',
'StyleRuleChangeEvent',