Bug 912956 part.11 Get rid of NS_EVENT_TYPE_* r=smaug

This commit is contained in:
Masayuki Nakano 2013-09-24 19:04:16 +09:00
parent 70c7884310
commit 110474e4ea
5 changed files with 10 additions and 10 deletions

View File

@ -220,7 +220,7 @@ public:
*
* If aTargets is non-null, event target chain will be created, but
* event won't be handled. In this case aEvent->message should be
* NS_EVENT_TYPE_NULL.
* NS_EVENT_NULL.
* @note Use this method when dispatching an nsEvent.
*/
static nsresult Dispatch(nsISupports* aTarget,

View File

@ -236,7 +236,7 @@ nsEventListenerManager::AddEventListenerInternal(
}
}
mNoListenerForEvent = NS_EVENT_TYPE_NULL;
mNoListenerForEvent = NS_EVENT_NULL;
mNoListenerForEventAtom = nullptr;
ls = aAllEvents ? mListeners.InsertElementAt(0) : mListeners.AppendElement();
@ -474,7 +474,7 @@ nsEventListenerManager::RemoveEventListenerInternal(
nsRefPtr<nsEventListenerManager> kungFuDeathGrip = this;
mListeners.RemoveElementAt(i);
--count;
mNoListenerForEvent = NS_EVENT_TYPE_NULL;
mNoListenerForEvent = NS_EVENT_NULL;
mNoListenerForEventAtom = nullptr;
if (mTarget && aUserType) {
mTarget->EventListenerRemoved(aUserType);
@ -771,7 +771,7 @@ nsEventListenerManager::RemoveEventHandler(nsIAtom* aName,
if (ls) {
mListeners.RemoveElementAt(uint32_t(ls - &mListeners.ElementAt(0)));
mNoListenerForEvent = NS_EVENT_TYPE_NULL;
mNoListenerForEvent = NS_EVENT_NULL;
mNoListenerForEventAtom = nullptr;
if (mTarget) {
mTarget->EventListenerRemoved(aName);
@ -1084,7 +1084,7 @@ nsEventListenerManager::AddListenerForAllEvents(nsIDOMEventListener* aListener,
flags.mAllowUntrustedEvents = aWantsUntrusted;
flags.mInSystemGroup = aSystemEventGroup;
EventListenerHolder holder(aListener);
AddEventListenerInternal(holder, NS_EVENT_TYPE_ALL, nullptr, EmptyString(),
AddEventListenerInternal(holder, NS_EVENT_ALL, nullptr, EmptyString(),
flags, false, true);
}
@ -1097,7 +1097,7 @@ nsEventListenerManager::RemoveListenerForAllEvents(nsIDOMEventListener* aListene
flags.mCapture = aUseCapture;
flags.mInSystemGroup = aSystemEventGroup;
EventListenerHolder holder(aListener);
RemoveEventListenerInternal(holder, NS_EVENT_TYPE_ALL, nullptr, EmptyString(),
RemoveEventListenerInternal(holder, NS_EVENT_ALL, nullptr, EmptyString(),
flags, true);
}

View File

@ -192,7 +192,7 @@ nsEventListenerService::GetEventTargetChainFor(nsIDOMEventTarget* aEventTarget,
*aCount = 0;
*aOutArray = nullptr;
NS_ENSURE_ARG(aEventTarget);
nsEvent event(true, NS_EVENT_TYPE_NULL);
nsEvent event(true, NS_EVENT_NULL);
nsCOMArray<EventTarget> targets;
nsresult rv = nsEventDispatcher::Dispatch(aEventTarget, nullptr, &event,
nullptr, nullptr, nullptr, &targets);

View File

@ -80,6 +80,9 @@ enum nsEventStructType
#define NS_EVENT_NULL 0
// This is a dummy event message for all event listener implementation in
// nsEventListenerManager.
#define NS_EVENT_ALL 1
#define NS_WINDOW_START 100

View File

@ -13,9 +13,6 @@
#include "mozilla/TextEvents.h"
#include "mozilla/TouchEvents.h"
#define NS_EVENT_TYPE_NULL 0
#define NS_EVENT_TYPE_ALL 1 // Not a real event type
#define NS_IS_INPUT_EVENT(evnt) \
(((evnt)->eventStructType == NS_INPUT_EVENT) || \
((evnt)->eventStructType == NS_MOUSE_EVENT) || \