Bug 1042654: Clean up XPIDL events r=bz

This commit is contained in:
David Zbarsky 2014-09-05 23:33:40 -04:00
parent 741e046aa5
commit 87e75a12b3
2 changed files with 0 additions and 91 deletions

View File

@ -14022,65 +14022,6 @@ nsGlobalWindow::DisableNetworkEvent(uint32_t aType)
}
#endif // MOZ_B2G
#define EVENT(name_, id_, type_, struct_)
#define EVENT2(name_, id_, type_, struct_) \
NS_IMETHODIMP nsGlobalWindow::GetOn##name_(JSContext *cx, \
JS::MutableHandle<JS::Value> vp) { \
EventHandlerNonNull* h = GetOn##name_(); \
vp.setObjectOrNull(h ? h->Callable().get() : nullptr); \
return NS_OK; \
} \
NS_IMETHODIMP nsGlobalWindow::SetOn##name_(JSContext *cx, \
JS::Handle<JS::Value> v) { \
nsRefPtr<EventHandlerNonNull> handler; \
JS::Rooted<JSObject*> callable(cx); \
if (v.isObject() && \
JS_ObjectIsCallable(cx, callable = &v.toObject())) { \
handler = new EventHandlerNonNull(callable, GetIncumbentGlobal()); \
} \
SetOn##name_(handler); \
return NS_OK; \
}
#define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_) \
NS_IMETHODIMP nsGlobalWindow::GetOn##name_(JSContext *cx, \
JS::MutableHandle<JS::Value> vp) { \
EventListenerManager *elm = GetExistingListenerManager(); \
if (elm) { \
OnBeforeUnloadEventHandlerNonNull* h = \
elm->GetOnBeforeUnloadEventHandler(); \
if (h) { \
vp.setObject(*h->Callable()); \
return NS_OK; \
} \
} \
vp.setNull(); \
return NS_OK; \
} \
NS_IMETHODIMP nsGlobalWindow::SetOn##name_(JSContext *cx, \
JS::Handle<JS::Value> v) { \
EventListenerManager *elm = GetOrCreateListenerManager(); \
if (!elm) { \
return NS_ERROR_OUT_OF_MEMORY; \
} \
\
nsRefPtr<OnBeforeUnloadEventHandlerNonNull> handler; \
JS::Rooted<JSObject*> callable(cx); \
if (v.isObject() && \
JS_ObjectIsCallable(cx, callable = &v.toObject())) { \
handler = new OnBeforeUnloadEventHandlerNonNull(callable, GetIncumbentGlobal()); \
} \
elm->SetEventHandler(handler); \
return NS_OK; \
}
#define WINDOW_ONLY_EVENT EVENT2
#define ERROR_EVENT EVENT
#include "mozilla/EventNameList.h"
#undef WINDOW_ONLY_EVENT
#undef BEFOREUNLOAD_EVENT
#undef ERROR_EVENT
#undef EVENT2
#undef EVENT
#ifdef _WINDOWS_
#error "Never include windows.h in this file!"
#endif

View File

@ -478,38 +478,6 @@ interface nsIDOMWindow : nsISupports
*/
readonly attribute long long mozAnimationStartTime;
/**
* HTML5 event attributes that only apply to windows and <body>/<frameset>
*/
[implicit_jscontext] attribute jsval onafterprint;
[implicit_jscontext] attribute jsval onbeforeprint;
[implicit_jscontext] attribute jsval onbeforeunload;
[implicit_jscontext] attribute jsval onhashchange;
[implicit_jscontext] attribute jsval onlanguagechange;
[implicit_jscontext] attribute jsval onmessage;
[implicit_jscontext] attribute jsval onoffline;
[implicit_jscontext] attribute jsval ononline;
[implicit_jscontext] attribute jsval onpopstate;
[implicit_jscontext] attribute jsval onpagehide;
[implicit_jscontext] attribute jsval onpageshow;
// Not supported yet
// [implicit_jscontext] attribute jsval onredo;
[implicit_jscontext] attribute jsval onresize;
// Not supported yet
// [implicit_jscontext] attribute jsval onstorage;
// Not supported yet
// [implicit_jscontext] attribute jsval onundo;
[implicit_jscontext] attribute jsval onunload;
/**
* Non-HTML5 window-specific event attributes
*/
[implicit_jscontext] attribute jsval ondevicemotion;
[implicit_jscontext] attribute jsval ondeviceorientation;
[implicit_jscontext] attribute jsval ondeviceproximity;
[implicit_jscontext] attribute jsval onuserproximity;
[implicit_jscontext] attribute jsval ondevicelight;
/**
* Console API
*/