mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1042654: Clean up XPIDL events r=bz
This commit is contained in:
parent
79b86bea52
commit
c71215c6c0
@ -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
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user