landing additional change from bug 407442.

This commit is contained in:
dwitte@stanford.edu 2007-12-20 23:30:15 -08:00
Родитель d7b6a2218b
Коммит b8cabf8cac
2 изменённых файлов: 8 добавлений и 14 удалений

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

@ -369,10 +369,6 @@ nsEventListenerManager::~nsEventListenerManager()
nsresult
nsEventListenerManager::RemoveAllListeners()
{
PRInt32 count = mListeners.Length();
for (PRInt32 i = 0; i < count; i++) {
delete mListeners.ElementAt(i);
}
mListeners.Clear();
return NS_OK;
}
@ -573,7 +569,6 @@ nsEventListenerManager::RemoveEventListener(nsIDOMEventListener *aListener,
(!(ls->mEventType) &&
EVENT_TYPE_DATA_EQUALS(ls->mTypeData, aTypeData)))) {
mListeners.RemoveElementAt(i);
delete ls;
mNoListenerForEvent = NS_EVENT_TYPE_NULL;
mNoListenerForEventAtom = nsnull;
break;
@ -844,7 +839,6 @@ nsEventListenerManager::RemoveScriptEventListener(nsIAtom* aName)
if (ls) {
mListeners.RemoveElement(ls);
delete ls;
mNoListenerForEvent = NS_EVENT_TYPE_NULL;
mNoListenerForEventAtom = nsnull;
}
@ -1157,7 +1151,7 @@ nsEventListenerManager::HandleEvent(nsPresContext* aPresContext,
found:
nsAutoTObserverArray<nsListenerStruct*, 2>::EndLimitedIterator iter(mListeners);
nsAutoTObserverArray<nsAutoPtr<nsListenerStruct>, 2>::EndLimitedIterator iter(mListeners);
nsAutoPopupStatePusher popupStatePusher(nsDOMEvent::GetEventPopupControlState(aEvent));
PRBool hasListener = PR_FALSE;
while (iter.HasMore()) {

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

@ -188,17 +188,17 @@ protected:
nsresult GetDOM2EventGroup(nsIDOMEventGroup** aGroup);
PRBool ListenerCanHandle(nsListenerStruct* aLs, nsEvent* aEvent);
nsAutoTObserverArray<nsListenerStruct*, 2> mListeners;
nsISupports* mTarget; //WEAK
PRUint32 mMayHaveMutationListeners : 1;
nsAutoTObserverArray<nsAutoPtr<nsListenerStruct>, 2> mListeners;
nsISupports* mTarget; //WEAK
PRUint32 mMayHaveMutationListeners : 1;
// These two member variables are used to cache the information
// about the last event which was handled but for which event listener manager
// didn't have event listeners.
PRUint32 mNoListenerForEvent : 31;
nsCOMPtr<nsIAtom> mNoListenerForEventAtom;
PRUint32 mNoListenerForEvent : 31;
nsCOMPtr<nsIAtom> mNoListenerForEventAtom;
static PRUint32 mInstanceCount;
static jsval sAddListenerID;
static PRUint32 mInstanceCount;
static jsval sAddListenerID;
};
#endif // nsEventListenerManager_h__