mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Added support for onPaint methods
This commit is contained in:
parent
94f22e1b8e
commit
bda57dc5bf
@ -41,6 +41,7 @@
|
||||
#include "nsIDOMFormListener.h"
|
||||
#include "nsIDOMLoadListener.h"
|
||||
#include "nsIDOMDragListener.h"
|
||||
#include "nsIDOMPaintListener.h"
|
||||
#include "nsIScriptEventListener.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIBrowserWindow.h"
|
||||
@ -67,6 +68,7 @@ static NS_DEFINE_IID(kIDOMFocusListenerIID, NS_IDOMFOCUSLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDOMFormListenerIID, NS_IDOMFORMLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDOMLoadListenerIID, NS_IDOMLOADLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDOMDragListenerIID, NS_IDOMDRAGLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDOMPaintListenerIID, NS_IDOMPAINTLISTENER_IID);
|
||||
static NS_DEFINE_IID(kIEventListenerManagerIID, NS_IEVENTLISTENERMANAGER_IID);
|
||||
static NS_DEFINE_IID(kIPrivateDOMEventIID, NS_IPRIVATEDOMEVENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMEventCapturerIID, NS_IDOMEVENTCAPTURER_IID);
|
||||
@ -1487,6 +1489,17 @@ GlobalWindowImpl::CheckForEventListener(JSContext *aContext, nsString& aPropName
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (aPropName == "onpaint") {
|
||||
if (NS_OK == GetListenerManager(&mManager)) {
|
||||
nsIScriptContext *mScriptCX = (nsIScriptContext *)
|
||||
JS_GetContextPrivate(aContext);
|
||||
if (NS_OK != mManager->RegisterScriptEventListener(mScriptCX, this,
|
||||
kIDOMPaintListenerIID)) {
|
||||
NS_RELEASE(mManager);
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
NS_IF_RELEASE(mManager);
|
||||
|
||||
return PR_TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user