Bug 884296 - Remove the rest of the classinfos for DOM events, r=peterv

--HG--
extra : rebase_source : 9b397e2e19e8e15d2753dc5bf7c18e2b3147f92b
This commit is contained in:
Olli Pettay 2013-06-20 17:13:52 +03:00
parent cae93a0212
commit 75377b423a
31 changed files with 9 additions and 249 deletions

View File

@ -28,7 +28,6 @@ DOMWheelEvent::DOMWheelEvent(EventTarget* aOwner,
static_cast<widget::WheelEvent*>(mEvent)->inputSource =
nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
}
SetIsDOMBinding();
}
DOMWheelEvent::~DOMWheelEvent()

View File

@ -22,7 +22,6 @@ nsDOMAnimationEvent::nsDOMAnimationEvent(mozilla::dom::EventTarget* aOwner,
mEventIsInternal = true;
mEvent->time = PR_Now();
}
SetIsDOMBinding();
}
nsDOMAnimationEvent::~nsDOMAnimationEvent()

View File

@ -18,7 +18,6 @@ public:
nsPresContext* aPresContext, nsEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext, aEvent)
{
SetIsDOMBinding();
}
virtual JSObject* WrapObject(JSContext* aCx,

View File

@ -20,7 +20,6 @@ nsDOMClipboardEvent::nsDOMClipboardEvent(mozilla::dom::EventTarget* aOwner,
mEventIsInternal = true;
mEvent->time = PR_Now();
}
SetIsDOMBinding();
}
nsDOMClipboardEvent::~nsDOMClipboardEvent()

View File

@ -17,7 +17,6 @@ nsDOMCommandEvent::nsDOMCommandEvent(mozilla::dom::EventTarget* aOwner,
} else {
mEventIsInternal = true;
}
SetIsDOMBinding();
}
nsDOMCommandEvent::~nsDOMCommandEvent()

View File

@ -29,8 +29,6 @@ nsDOMCompositionEvent::nsDOMCompositionEvent(mozilla::dom::EventTarget* aOwner,
mData = static_cast<nsCompositionEvent*>(mEvent)->data;
// TODO: Native event should have locale information.
SetIsDOMBinding();
}
nsDOMCompositionEvent::~nsDOMCompositionEvent()

View File

@ -14,7 +14,6 @@ nsDOMDataContainerEvent::nsDOMDataContainerEvent(
: nsDOMEvent(aOwner, aPresContext, aEvent)
{
mData.Init();
SetIsDOMBinding();
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsDOMDataContainerEvent,

View File

@ -49,7 +49,6 @@ public:
nsPresContext* aPresContext, nsEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext, aEvent)
{
SetIsDOMBinding();
}
NS_DECL_ISUPPORTS_INHERITED

View File

@ -25,7 +25,6 @@ nsDOMDragEvent::nsDOMDragEvent(mozilla::dom::EventTarget* aOwner,
mEvent->refPoint.x = mEvent->refPoint.y = 0;
static_cast<nsMouseEvent*>(mEvent)->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
}
SetIsDOMBinding();
}
nsDOMDragEvent::~nsDOMDragEvent()

View File

@ -51,12 +51,13 @@ nsDOMEvent::nsDOMEvent(mozilla::dom::EventTarget* aOwner,
nsDOMEvent::nsDOMEvent(nsPIDOMWindow* aParent)
{
ConstructorInit(static_cast<nsGlobalWindow *>(aParent), nullptr, nullptr);
SetIsDOMBinding();
}
void nsDOMEvent::ConstructorInit(mozilla::dom::EventTarget* aOwner,
void
nsDOMEvent::ConstructorInit(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsEvent* aEvent)
{
SetIsDOMBinding();
SetOwner(aOwner);
mPrivateDataDuplicated = false;
@ -122,14 +123,10 @@ nsDOMEvent::~nsDOMEvent()
}
}
DOMCI_DATA(Event, nsDOMEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMEvent)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMEvent)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_ENTRY(nsIDOMEvent)
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIJSNativeInitializer, !IsDOMBinding())
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Event)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMEvent)
@ -333,57 +330,6 @@ nsDOMEvent::SetTrusted(bool aTrusted)
mEvent->mFlags.mIsTrusted = aTrusted;
}
NS_IMETHODIMP
nsDOMEvent::Initialize(nsISupports* aOwner, JSContext* aCx, JSObject* aObj,
const JS::CallArgs& aArgs)
{
MOZ_ASSERT(!IsDOMBinding());
NS_ENSURE_TRUE(aArgs.length() >= 1, NS_ERROR_XPC_NOT_ENOUGH_ARGS);
bool trusted = false;
nsCOMPtr<nsPIDOMWindow> w = do_QueryInterface(aOwner);
if (w) {
nsCOMPtr<nsIDocument> d = w->GetExtantDoc();
if (d) {
trusted = nsContentUtils::IsChromeDoc(d);
nsIPresShell* s = d->GetShell();
if (s) {
InitPresContextData(s->GetPresContext());
}
}
}
if (!mOwner) {
mOwner = w;
}
JSString* jsstr = JS_ValueToString(aCx, aArgs[0]);
if (!jsstr) {
return NS_ERROR_DOM_SYNTAX_ERR;
}
JS::Anchor<JSString*> deleteProtector(jsstr);
nsDependentJSString type;
NS_ENSURE_STATE(type.init(aCx, jsstr));
nsresult rv = InitFromCtor(type, aCx, aArgs.length() >= 2 ? &(aArgs[1]) : nullptr);
NS_ENSURE_SUCCESS(rv, rv);
SetTrusted(trusted);
return NS_OK;
}
nsresult
nsDOMEvent::InitFromCtor(const nsAString& aType,
JSContext* aCx, JS::Value* aVal)
{
mozilla::idl::EventInit d;
nsresult rv = d.Init(aCx, aVal);
NS_ENSURE_SUCCESS(rv, rv);
return InitEvent(aType, d.bubbles, d.cancelable);
}
bool
nsDOMEvent::Init(mozilla::dom::EventTarget* aGlobal)
{
@ -410,7 +356,7 @@ nsDOMEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
mozilla::ErrorResult& aRv)
{
nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.Get());
nsRefPtr<nsDOMEvent> e = nsDOMEvent::CreateEvent(t, nullptr, nullptr);
nsRefPtr<nsDOMEvent> e = new nsDOMEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);
aRv = e->InitEvent(aType, aParam.mBubbles, aParam.mCancelable);
e->SetTrusted(trusted);
@ -1338,6 +1284,6 @@ nsresult NS_NewDOMEvent(nsIDOMEvent** aInstancePtrResult,
nsEvent *aEvent)
{
nsRefPtr<nsDOMEvent> it =
nsDOMEvent::CreateEvent(aOwner, aPresContext, aEvent);
new nsDOMEvent(aOwner, aPresContext, aEvent);
return CallQueryInterface(it, aInstancePtrResult);
}

View File

@ -33,10 +33,9 @@ class nsDOMEventBase : public nsIDOMEvent
};
class nsDOMEvent : public nsDOMEventBase,
public nsIJSNativeInitializer,
public nsWrapperCache
{
protected:
public:
nsDOMEvent(mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext,
nsEvent* aEvent);
nsDOMEvent(nsPIDOMWindow* aWindow);
@ -72,17 +71,8 @@ public:
return static_cast<nsDOMEvent*>(event);
}
static already_AddRefed<nsDOMEvent> CreateEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent)
{
nsRefPtr<nsDOMEvent> e = new nsDOMEvent(aOwner, aPresContext, aEvent);
e->SetIsDOMBinding();
return e.forget();
}
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDOMEvent, nsIDOMEvent)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMEvent)
nsISupports* GetParentObject()
{
@ -98,13 +88,6 @@ public:
// nsIDOMEvent Interface
NS_DECL_NSIDOMEVENT
// nsIJSNativeInitializer
NS_IMETHOD Initialize(nsISupports* aOwner, JSContext* aCx, JSObject* aObj,
const JS::CallArgs& aArgs) MOZ_OVERRIDE;
virtual nsresult InitFromCtor(const nsAString& aType,
JSContext* aCx, JS::Value* aVal);
void InitPresContextData(nsPresContext* aPresContext);
// Returns true if the event should be trusted.

View File

@ -22,7 +22,6 @@ nsDOMFocusEvent::nsDOMFocusEvent(mozilla::dom::EventTarget* aOwner,
mEventIsInternal = true;
mEvent->time = PR_Now();
}
SetIsDOMBinding();
}
nsDOMFocusEvent::~nsDOMFocusEvent()

View File

@ -20,7 +20,6 @@ nsDOMKeyboardEvent::nsDOMKeyboardEvent(mozilla::dom::EventTarget* aOwner,
mEventIsInternal = true;
mEvent->time = PR_Now();
}
SetIsDOMBinding();
}
nsDOMKeyboardEvent::~nsDOMKeyboardEvent()

View File

@ -36,7 +36,6 @@ nsDOMMessageEvent::nsDOMMessageEvent(mozilla::dom::EventTarget* aOwner,
: nsDOMEvent(aOwner, aPresContext, aEvent),
mData(JSVAL_VOID)
{
SetIsDOMBinding();
}
nsDOMMessageEvent::~nsDOMMessageEvent()

View File

@ -154,7 +154,6 @@ nsDOMMouseEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
{
nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.Get());
nsRefPtr<nsDOMMouseEvent> e = new nsDOMMouseEvent(t, nullptr, nullptr);
e->SetIsDOMBinding();
bool trusted = e->Init(t);
e->InitMouseEvent(aType, aParam.mBubbles, aParam.mCancelable,
aParam.mView, aParam.mDetail, aParam.mScreenX,
@ -435,6 +434,5 @@ nsresult NS_NewDOMMouseEvent(nsIDOMEvent** aInstancePtrResult,
nsInputEvent *aEvent)
{
nsDOMMouseEvent* it = new nsDOMMouseEvent(aOwner, aPresContext, aEvent);
it->SetIsDOMBinding();
return CallQueryInterface(it, aInstancePtrResult);
}

View File

@ -23,7 +23,6 @@ nsDOMMouseScrollEvent::nsDOMMouseScrollEvent(mozilla::dom::EventTarget* aOwner,
if(mEvent->eventStructType == NS_MOUSE_SCROLL_EVENT) {
mDetail = static_cast<nsMouseScrollEvent*>(mEvent)->delta;
}
SetIsDOMBinding();
}
nsDOMMouseScrollEvent::~nsDOMMouseScrollEvent()

View File

@ -15,7 +15,6 @@ nsDOMMutationEvent::nsDOMMutationEvent(mozilla::dom::EventTarget* aOwner,
aEvent ? aEvent : new nsMutationEvent(false, 0))
{
mEventIsInternal = (aEvent == nullptr);
SetIsDOMBinding();
}
nsDOMMutationEvent::~nsDOMMutationEvent()

View File

@ -30,7 +30,6 @@ nsDOMNotifyAudioAvailableEvent::nsDOMNotifyAudioAvailableEvent(EventTarget* aOwn
if (mEvent) {
mEvent->message = aEventType;
}
SetIsDOMBinding();
}
NS_IMPL_ADDREF_INHERITED(nsDOMNotifyAudioAvailableEvent, nsDOMEvent)

View File

@ -24,7 +24,6 @@ nsDOMNotifyPaintEvent::nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner,
if (aInvalidateRequests) {
mInvalidateRequests.MoveElementsFrom(aInvalidateRequests->mRequests);
}
SetIsDOMBinding();
}
NS_INTERFACE_MAP_BEGIN(nsDOMNotifyPaintEvent)

View File

@ -17,7 +17,6 @@ nsDOMScrollAreaEvent::nsDOMScrollAreaEvent(mozilla::dom::EventTarget* aOwner,
, mClientArea(nullptr)
{
mClientArea.SetLayoutRect(aEvent ? aEvent->mArea : nsRect());
SetIsDOMBinding();
}
nsDOMScrollAreaEvent::~nsDOMScrollAreaEvent()

View File

@ -21,7 +21,6 @@ nsDOMSimpleGestureEvent::nsDOMSimpleGestureEvent(mozilla::dom::EventTarget* aOwn
mEvent->refPoint.x = mEvent->refPoint.y = 0;
static_cast<nsMouseEvent*>(mEvent)->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
}
SetIsDOMBinding();
}
nsDOMSimpleGestureEvent::~nsDOMSimpleGestureEvent()

View File

@ -47,7 +47,6 @@ nsDOMTextEvent::nsDOMTextEvent(mozilla::dom::EventTarget* aOwner,
}
}
}
SetIsDOMBinding();
}
NS_IMPL_ADDREF_INHERITED(nsDOMTextEvent, nsDOMUIEvent)

View File

@ -84,7 +84,6 @@ nsDOMTouchEvent::nsDOMTouchEvent(mozilla::dom::EventTarget* aOwner,
mEventIsInternal = true;
mEvent->time = PR_Now();
}
SetIsDOMBinding();
}
nsDOMTouchEvent::~nsDOMTouchEvent()

View File

@ -22,7 +22,6 @@ nsDOMTransitionEvent::nsDOMTransitionEvent(mozilla::dom::EventTarget* aOwner,
mEventIsInternal = true;
mEvent->time = PR_Now();
}
SetIsDOMBinding();
}
nsDOMTransitionEvent::~nsDOMTransitionEvent()

View File

@ -83,7 +83,6 @@ nsDOMUIEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
{
nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.Get());
nsRefPtr<nsDOMUIEvent> e = new nsDOMUIEvent(t, nullptr, nullptr);
e->SetIsDOMBinding();
bool trusted = e->Init(t);
aRv = e->InitUIEvent(aType, aParam.mBubbles, aParam.mCancelable, aParam.mView,
aParam.mDetail);
@ -518,6 +517,5 @@ nsresult NS_NewDOMUIEvent(nsIDOMEvent** aInstancePtrResult,
nsGUIEvent *aEvent)
{
nsDOMUIEvent* it = new nsDOMUIEvent(aOwner, aPresContext, aEvent);
it->SetIsDOMBinding();
return CallQueryInterface(it, aInstancePtrResult);
}

View File

@ -19,7 +19,6 @@ nsDOMXULCommandEvent::nsDOMXULCommandEvent(mozilla::dom::EventTarget* aOwner,
mEventIsInternal = true;
mEvent->time = PR_Now();
}
SetIsDOMBinding();
}
NS_IMPL_ADDREF_INHERITED(nsDOMXULCommandEvent, nsDOMUIEvent)

View File

@ -24,8 +24,6 @@ SVGZoomEvent::SVGZoomEvent(EventTarget* aOwner,
, mPreviousScale(0)
, mNewScale(0)
{
SetIsDOMBinding();
if (aEvent) {
mEventIsInternal = false;
}

View File

@ -161,9 +161,6 @@
#include "nsIDOMCSSPageRule.h"
#include "nsIDOMCSSStyleRule.h"
#include "nsIDOMCSSStyleSheet.h"
#define MOZ_GENERATED_EVENTS_INCLUDES
#include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENTS_INCLUDES
#include "nsIDOMDeviceMotionEvent.h" //nsIDOMDeviceAcceleration
#include "nsIDOMXULCommandDispatcher.h"
#ifndef MOZ_DISABLE_CRYPTOLEGACY
@ -294,7 +291,6 @@ using mozilla::dom::workers::ResolveWorkerClasses;
#include "nsIDOMGlobalObjectConstructor.h"
#include "nsIDOMCanvasRenderingContext2D.h"
#include "LockedFile.h"
#include "GeneratedEvents.h"
#include "nsDebug.h"
#include "mozilla/dom/BindingUtils.h"
@ -513,17 +509,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
// Misc Core related classes
// Event
NS_DEFINE_CLASSINFO_DATA(Event, nsEventSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
#define MOZ_GENERATED_EVENT_LIST
#define MOZ_GENERATED_EVENT(_event_interface) \
NS_DEFINE_CLASSINFO_DATA(_event_interface, nsEventSH, \
DOM_DEFAULT_SCRIPTABLE_FLAGS)
#include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENT_LIST
NS_DEFINE_CLASSINFO_DATA(DeviceAcceleration, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(DeviceRotationRate, nsDOMGenericSH,
@ -815,22 +800,6 @@ NS_DEFINE_CONTRACT_CTOR(XSLTProcessor,
#undef NS_DEFINE_CONTRACT_CTOR
#define NS_DEFINE_EVENT_CTOR(_class) \
static nsresult \
NS_DOM##_class##Ctor(nsISupports** aInstancePtrResult) \
{ \
nsIDOMEvent* e = nullptr; \
nsresult rv = NS_NewDOM##_class(&e, nullptr, nullptr, nullptr); \
*aInstancePtrResult = e; \
return rv; \
}
#define MOZ_GENERATED_EVENT_LIST
#define MOZ_GENERATED_EVENT(_event_interface) \
NS_DEFINE_EVENT_CTOR(_event_interface)
#include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENT_LIST
struct nsConstructorFuncMapData
{
int32_t mDOMClassInfoID;
@ -840,23 +809,14 @@ struct nsConstructorFuncMapData
#define NS_DEFINE_CONSTRUCTOR_FUNC_DATA(_class, _func) \
{ eDOMClassInfo_##_class##_id, _func },
#define NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(_class) \
{ eDOMClassInfo_##_class##_id, NS_DOM##_class##Ctor },
static const nsConstructorFuncMapData kConstructorFuncMap[] =
{
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(Blob, nsDOMMultipartFile::NewBlob)
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(File, nsDOMMultipartFile::NewFile)
#define MOZ_GENERATED_EVENT_LIST
#define MOZ_GENERATED_EVENT(_event_interface) \
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(_event_interface)
#include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENT_LIST
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(MozSmsFilter, SmsFilter::NewSmsFilter)
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(XSLTProcessor, XSLTProcessorCtor)
};
#undef NS_DEFINE_CONSTRUCTOR_FUNC_DATA
#undef NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA
nsIXPConnect *nsDOMClassInfo::sXPConnect = nullptr;
nsIScriptSecurityManager *nsDOMClassInfo::sSecMan = nullptr;
@ -1321,9 +1281,6 @@ nsDOMClassInfo::RegisterExternalClasses()
DOM_CLASSINFO_MAP_CONDITIONAL_ENTRY(nsITouchEventReceiver, \
nsDOMTouchEvent::PrefEnabled())
#define DOM_CLASSINFO_EVENT_MAP_ENTRIES \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent) \
#ifdef MOZ_B2G
#define DOM_CLASSINFO_WINDOW_MAP_ENTRIES(_support_indexed_db) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow) \
@ -1480,27 +1437,12 @@ nsDOMClassInfo::Init()
nsDOMTouchEvent::PrefEnabled())
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(Event, nsIDOMEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
#define MOZ_GENERATED_EVENT_LIST
#define MOZ_GENERATED_EVENT(_event_interface) \
DOM_CLASSINFO_MAP_BEGIN(_event_interface, nsIDOM##_event_interface) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOM##_event_interface) \
DOM_CLASSINFO_EVENT_MAP_ENTRIES \
DOM_CLASSINFO_MAP_END
#include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENT_LIST
DOM_CLASSINFO_MAP_BEGIN(DeviceAcceleration, nsIDOMDeviceAcceleration)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDeviceAcceleration)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(DeviceRotationRate, nsIDOMDeviceRotationRate)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDeviceRotationRate)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(HTMLFormElement, nsIDOMHTMLFormElement)
@ -5182,40 +5124,6 @@ nsEventTargetSH::PreserveWrapper(nsISupports *aNative)
nsContentUtils::PreserveWrapper(aNative, target);
}
// Event helper
NS_IMETHODIMP
nsEventSH::PreCreate(nsISupports* aNativeObj, JSContext* aCx,
JSObject* aGlobalObj, JSObject** aParentObj)
{
JS::Rooted<JSObject*> globalObj(aCx, aGlobalObj);
nsDOMEvent* event =
nsDOMEvent::FromSupports(aNativeObj);
nsCOMPtr<nsIScriptGlobalObject> native_parent;
event->GetParentObject(getter_AddRefs(native_parent));
*aParentObj = native_parent ? native_parent->GetGlobalJSObject() : globalObj;
return *aParentObj ? NS_OK : NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsEventSH::AddProperty(nsIXPConnectWrappedNative* aWrapper, JSContext* aCx,
JSObject* aObj, jsid Id, jsval* aVp, bool* aRetval)
{
nsEventSH::PreserveWrapper(GetNative(aWrapper, aObj));
return NS_OK;
}
void
nsEventSH::PreserveWrapper(nsISupports* aNative)
{
nsDOMEvent* event =
nsDOMEvent::FromSupports(aNative);
nsContentUtils::PreserveWrapper(aNative, event);
}
// IDBEventTarget helper
NS_IMETHODIMP

View File

@ -296,31 +296,6 @@ public:
}
};
// Makes sure that the wrapper is preserved if new properties are added.
class nsEventSH : public nsDOMGenericSH
{
protected:
nsEventSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
{
}
virtual ~nsEventSH()
{
}
public:
NS_IMETHOD PreCreate(nsISupports* aNativeObj, JSContext* aCx,
JSObject* aGlobalObj, JSObject** aParentObj) MOZ_OVERRIDE;
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative* aWrapper, JSContext* aCx,
JSObject* aObj, jsid Id, jsval* aVp, bool* aRetval) MOZ_OVERRIDE;
virtual void PreserveWrapper(nsISupports *aNative) MOZ_OVERRIDE;
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{
return new nsEventSH(aData);
}
};
// Window scriptable helper
class nsWindowSH : public nsDOMGenericSH

View File

@ -18,12 +18,6 @@ DOMCI_CLASS(DOMConstructor)
DOMCI_CLASS(DOMException)
DOMCI_CLASS(Element)
// Event classes
DOMCI_CLASS(Event)
#define MOZ_GENERATED_EVENT_LIST
#define MOZ_GENERATED_EVENT(_event_interface) DOMCI_CLASS(_event_interface)
#include "GeneratedEvents.h"
#undef MOZ_GENERATED_EVENT_LIST
DOMCI_CLASS(DeviceAcceleration)
DOMCI_CLASS(DeviceRotationRate)

View File

@ -172,7 +172,6 @@ def print_class_declaration(eventname, iface, fd, conf):
fd.write(" NS_FORWARD_%s(%s::)\n" % (baseiface.name.upper(), baseimpl))
fd.write(" NS_DECL_%s\n" % iface.name.upper())
fd.write(" virtual nsresult InitFromCtor(const nsAString& aType, JSContext* aCx, jsval* aVal);\n\n")
hasVariant = False
for a in allattributes:
@ -261,7 +260,6 @@ def print_cpp_file(fd, conf):
fd.write("/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n\n")
fd.write('#include "GeneratedEventClasses.h"\n')
fd.write('#include "xpcprivate.h"\n');
fd.write('#include "nsDOMClassInfoID.h"\n')
fd.write('#include "nsPresContext.h"\n')
fd.write('#include "nsGUIEvent.h"\n')
fd.write('#include "nsDOMEvent.h"\n');
@ -393,7 +391,6 @@ def write_cpp(eventname, iface, fd, conf):
for a in attributes:
fd.write(",\n m%s(%s)" % (firstCap(a.name), init_value(a)))
fd.write("\n{\n")
fd.write(" SetIsDOMBinding();\n")
fd.write("}\n\n")
fd.write("%s::~%s() {}\n\n" % (classname, classname))
@ -411,27 +408,13 @@ def write_cpp(eventname, iface, fd, conf):
fd.write("NS_IMPL_RELEASE_INHERITED(%s, %s)\n\n" % (classname, basename))
fd.write("} // namespace dom\n")
fd.write("} // namespace mozilla\n\n")
fd.write("DOMCI_DATA(%s, mozilla::dom::%s)\n\n" % (eventname, classname))
fd.write("namespace mozilla {\n")
fd.write("namespace dom {\n\n")
fd.write("NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(%s)\n" % classname)
fd.write(" NS_INTERFACE_MAP_ENTRY(nsIDOM%s)\n" % eventname)
fd.write(" NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(%s)\n" % eventname)
fd.write("NS_INTERFACE_MAP_END_INHERITING(%s)\n\n" % basename)
fd.write("nsresult\n")
fd.write("%s::InitFromCtor(const nsAString& aType, JSContext* aCx, jsval* aVal)\n" % classname)
fd.write("{\n");
fd.write(" mozilla::idl::%sInit d;\n" % eventname)
fd.write(" nsresult rv = d.Init(aCx, aVal);\n")
fd.write(" NS_ENSURE_SUCCESS(rv, rv);\n")
fd.write(" return Init%s(aType, d.bubbles, d.cancelable" % eventname)
for a in allattributes:
fd.write(", d.%s" % a.name)
fd.write(");\n")
fd.write("}\n\n")
hasVariant = False
for a in allattributes:
if a.type == "nsIVariant":