Bug 1042654: Remove nsIInlineEventHandlers r=bz

This commit is contained in:
David Zbarsky 2014-09-05 23:32:50 -04:00
Родитель 6813ce3dab
Коммит 783bce0025
5 изменённых файлов: 7 добавлений и 137 удалений

Просмотреть файл

@ -1669,7 +1669,6 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsGlobalWindow)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
NS_INTERFACE_MAP_ENTRY(nsIDOMWindowPerformance)
NS_INTERFACE_MAP_ENTRY(nsIInlineEventHandlers)
NS_INTERFACE_MAP_END
@ -14052,7 +14051,8 @@ nsGlobalWindow::DisableNetworkEvent(uint32_t aType)
}
#endif // MOZ_B2G
#define EVENT(name_, id_, type_, struct_) \
#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_(); \
@ -14070,36 +14070,6 @@ nsGlobalWindow::DisableNetworkEvent(uint32_t aType)
SetOn##name_(handler); \
return NS_OK; \
}
#define ERROR_EVENT(name_, id_, type_, struct_) \
NS_IMETHODIMP nsGlobalWindow::GetOn##name_(JSContext *cx, \
JS::MutableHandle<JS::Value> vp) { \
EventListenerManager *elm = GetExistingListenerManager(); \
if (elm) { \
OnErrorEventHandlerNonNull* h = elm->GetOnErrorEventHandler(); \
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<OnErrorEventHandlerNonNull> handler; \
JS::Rooted<JSObject*> callable(cx); \
if (v.isObject() && \
JS_ObjectIsCallable(cx, callable = &v.toObject())) { \
handler = new OnErrorEventHandlerNonNull(callable, GetIncumbentGlobal()); \
} \
elm->SetEventHandler(handler); \
return NS_OK; \
}
#define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_) \
NS_IMETHODIMP nsGlobalWindow::GetOn##name_(JSContext *cx, \
JS::MutableHandle<JS::Value> vp) { \
@ -14131,11 +14101,13 @@ nsGlobalWindow::DisableNetworkEvent(uint32_t aType)
elm->SetEventHandler(handler); \
return NS_OK; \
}
#define WINDOW_ONLY_EVENT EVENT
#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_

Просмотреть файл

@ -43,7 +43,6 @@
#include "nsFrameMessageManager.h"
#include "mozilla/LinkedList.h"
#include "mozilla/TimeStamp.h"
#include "nsIInlineEventHandlers.h"
#include "nsWrapperCacheInlines.h"
#include "nsIIdleObserver.h"
#include "nsIDocument.h"
@ -329,8 +328,7 @@ class nsGlobalWindow : public mozilla::dom::EventTarget,
public nsSupportsWeakReference,
public nsIInterfaceRequestor,
public PRCListStr,
public nsIDOMWindowPerformance,
public nsIInlineEventHandlers
public nsIDOMWindowPerformance
#ifdef MOZ_B2G
, public nsIDOMWindowB2G
#endif // MOZ_B2G
@ -425,9 +423,6 @@ public:
return GetOuterFromCurrentInner(this);
}
// nsIInlineEventHandlers
NS_DECL_NSIINLINEEVENTHANDLERS
// nsPIDOMWindow
virtual nsPIDOMWindow* GetPrivateRoot();

Просмотреть файл

@ -23,7 +23,7 @@ interface nsIVariant;
* @see <http://www.whatwg.org/html/#window>
*/
[scriptable, uuid(ed7cc4e4-cf5b-42af-9c2e-8df074a01470)]
[scriptable, uuid(3addc629-754d-4a2a-99a3-449ed1a2e4bd)]
interface nsIDOMWindow : nsISupports
{
// the current browsing context
@ -510,9 +510,6 @@ interface nsIDOMWindow : nsISupports
[implicit_jscontext] attribute jsval onuserproximity;
[implicit_jscontext] attribute jsval ondevicelight;
[implicit_jscontext] attribute jsval onmouseenter;
[implicit_jscontext] attribute jsval onmouseleave;
/**
* Console API
*/

Просмотреть файл

@ -23,7 +23,6 @@ XPIDL_SOURCES += [
'nsIDOMText.idl',
'nsIDOMUserDataHandler.idl',
'nsIDOMXMLDocument.idl',
'nsIInlineEventHandlers.idl',
]
XPIDL_MODULE = 'dom_core'

Просмотреть файл

@ -1,93 +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 "domstubs.idl"
%{ C++
#include "jspubtd.h"
%}
[scriptable, uuid(6c1fcf3d-119b-4cf4-9437-b9357508976a)]
interface nsIInlineEventHandlers : nsISupports
{
[implicit_jscontext] attribute jsval onabort;
[implicit_jscontext] attribute jsval onblur;
[implicit_jscontext] attribute jsval oncanplay;
[implicit_jscontext] attribute jsval oncanplaythrough;
[implicit_jscontext] attribute jsval onchange;
[implicit_jscontext] attribute jsval onclick;
[implicit_jscontext] attribute jsval oncontextmenu;
// Not supported yet
// [implicit_jscontext] attribute jsval oncuechange;
[implicit_jscontext] attribute jsval ondblclick;
[implicit_jscontext] attribute jsval ondrag;
[implicit_jscontext] attribute jsval ondragend;
[implicit_jscontext] attribute jsval ondragenter;
[implicit_jscontext] attribute jsval ondragleave;
[implicit_jscontext] attribute jsval ondragover;
[implicit_jscontext] attribute jsval ondragstart;
[implicit_jscontext] attribute jsval ondrop;
[implicit_jscontext] attribute jsval ondurationchange;
[implicit_jscontext] attribute jsval onemptied;
[implicit_jscontext] attribute jsval onended;
[implicit_jscontext] attribute jsval onerror;
[implicit_jscontext] attribute jsval onfocus;
[implicit_jscontext] attribute jsval oninput;
[implicit_jscontext] attribute jsval oninvalid;
[implicit_jscontext] attribute jsval onkeydown;
[implicit_jscontext] attribute jsval onkeypress;
[implicit_jscontext] attribute jsval onkeyup;
[implicit_jscontext] attribute jsval onload;
[implicit_jscontext] attribute jsval onloadeddata;
[implicit_jscontext] attribute jsval onloadedmetadata;
[implicit_jscontext] attribute jsval onloadstart;
[implicit_jscontext] attribute jsval onmousedown;
[implicit_jscontext] attribute jsval onmousemove;
[implicit_jscontext] attribute jsval onmouseout;
[implicit_jscontext] attribute jsval onmouseover;
[implicit_jscontext] attribute jsval onmouseup;
// Not supported yet
// [implicit_jscontext] attribute jsval onmousewheel;
[implicit_jscontext] attribute jsval onmozfullscreenchange;
[implicit_jscontext] attribute jsval onmozfullscreenerror;
[implicit_jscontext] attribute jsval onmozpointerlockchange;
[implicit_jscontext] attribute jsval onmozpointerlockerror;
[implicit_jscontext] attribute jsval onpause;
[implicit_jscontext] attribute jsval onplay;
[implicit_jscontext] attribute jsval onplaying;
[implicit_jscontext] attribute jsval onprogress;
[implicit_jscontext] attribute jsval onratechange;
[implicit_jscontext] attribute jsval onreset;
[implicit_jscontext] attribute jsval onscroll;
[implicit_jscontext] attribute jsval onseeked;
[implicit_jscontext] attribute jsval onseeking;
[implicit_jscontext] attribute jsval onselect;
[implicit_jscontext] attribute jsval onshow;
[implicit_jscontext] attribute jsval onstalled;
[implicit_jscontext] attribute jsval onsubmit;
[implicit_jscontext] attribute jsval onsuspend;
[implicit_jscontext] attribute jsval ontimeupdate;
[implicit_jscontext] attribute jsval onvolumechange;
[implicit_jscontext] attribute jsval onwaiting;
[implicit_jscontext] attribute jsval onwheel;
[implicit_jscontext] attribute jsval onpointerdown;
[implicit_jscontext] attribute jsval onpointermove;
[implicit_jscontext] attribute jsval onpointerout;
[implicit_jscontext] attribute jsval onpointerover;
[implicit_jscontext] attribute jsval onpointerup;
[implicit_jscontext] attribute jsval onpointerenter;
[implicit_jscontext] attribute jsval onpointerleave;
[implicit_jscontext] attribute jsval ongotpointercapture;
[implicit_jscontext] attribute jsval onlostpointercapture;
[implicit_jscontext] attribute jsval onpointercancel;
/**
* Non-HTML5 event attributes
*/
[implicit_jscontext] attribute jsval oncopy;
[implicit_jscontext] attribute jsval oncut;
[implicit_jscontext] attribute jsval onpaste;
[implicit_jscontext] attribute jsval onbeforescriptexecute;
[implicit_jscontext] attribute jsval onafterscriptexecute;
};