mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 875050 - Add EventListenerAdded/Removed to EventTarget, r=bz
--HG-- extra : rebase_source : c7aea2048abd1d74ae02c1cfae84602cdf3af8c3
This commit is contained in:
parent
c4af7d1677
commit
825b5cb20b
@ -60,6 +60,10 @@ public:
|
||||
return SetEventHandler(type, aHandler, rv);
|
||||
}
|
||||
|
||||
// Note, for an event 'foo' aType will be 'onfoo'.
|
||||
virtual void EventListenerAdded(nsIAtom* aType) {}
|
||||
virtual void EventListenerRemoved(nsIAtom* aType) {}
|
||||
|
||||
protected:
|
||||
EventHandlerNonNull* GetEventHandler(nsIAtom* aType);
|
||||
void SetEventHandler(nsIAtom* aType, EventHandlerNonNull* aHandler,
|
||||
|
@ -352,6 +352,9 @@ nsEventListenerManager::AddEventListenerInternal(
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (aTypeAtom && mTarget) {
|
||||
mTarget->EventListenerAdded(aTypeAtom);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
@ -464,6 +467,9 @@ nsEventListenerManager::RemoveEventListenerInternal(
|
||||
--count;
|
||||
mNoListenerForEvent = NS_EVENT_TYPE_NULL;
|
||||
mNoListenerForEventAtom = nullptr;
|
||||
if (mTarget && aUserType) {
|
||||
mTarget->EventListenerRemoved(aUserType);
|
||||
}
|
||||
|
||||
if (!deviceType
|
||||
#ifdef MOZ_B2G
|
||||
@ -748,6 +754,9 @@ nsEventListenerManager::RemoveEventHandler(nsIAtom* aName)
|
||||
mListeners.RemoveElementAt(uint32_t(ls - &mListeners.ElementAt(0)));
|
||||
mNoListenerForEvent = NS_EVENT_TYPE_NULL;
|
||||
mNoListenerForEventAtom = nullptr;
|
||||
if (mTarget) {
|
||||
mTarget->EventListenerRemoved(aName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user