diff options
author | Moonchild <moonchild@palemoon.org> | 2019-12-28 10:14:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-28 10:14:29 +0000 |
commit | 357405f6356e28e5fa94cecc078b65c20433d236 (patch) | |
tree | 9716965ca2d9d03446fc9290d37e5ef42f80558e /dom/events/EventListenerManager.cpp | |
parent | f60bbaf9e49733e61aaec675276fcd898ef6bc73 (diff) | |
parent | 8b88623463bf30ae7e5fcc64ef7d8d5fb62354c9 (diff) | |
download | UXP-357405f6356e28e5fa94cecc078b65c20433d236.tar UXP-357405f6356e28e5fa94cecc078b65c20433d236.tar.gz UXP-357405f6356e28e5fa94cecc078b65c20433d236.tar.lz UXP-357405f6356e28e5fa94cecc078b65c20433d236.tar.xz UXP-357405f6356e28e5fa94cecc078b65c20433d236.zip |
Merge pull request #1335 from MoonchildProductions/document_open
Align document.open() with the overhauled specification
Diffstat (limited to 'dom/events/EventListenerManager.cpp')
-rw-r--r-- | dom/events/EventListenerManager.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp index fe896870c..0774c3296 100644 --- a/dom/events/EventListenerManager.cpp +++ b/dom/events/EventListenerManager.cpp @@ -166,11 +166,11 @@ EventListenerManager::~EventListenerManager() // XXX azakai: Is there any reason to not just call Disconnect // from right here, if not previously called? NS_ASSERTION(!mTarget, "didn't call Disconnect"); - RemoveAllListeners(); + RemoveAllListenersSilently(); } void -EventListenerManager::RemoveAllListeners() +EventListenerManager::RemoveAllListenersSilently() { if (mClearingListeners) { return; @@ -1329,7 +1329,7 @@ void EventListenerManager::Disconnect() { mTarget = nullptr; - RemoveAllListeners(); + RemoveAllListenersSilently(); } void @@ -1734,6 +1734,21 @@ EventListenerManager::IsApzAwareEvent(nsIAtom* aEvent) return false; } +void +EventListenerManager::RemoveAllListeners() +{ + while (!mListeners.IsEmpty()) { + size_t idx = mListeners.Length() - 1; + nsCOMPtr<nsIAtom> type = mListeners.ElementAt(idx).mTypeAtom; + EventMessage message = mListeners.ElementAt(idx).mEventMessage; + mListeners.RemoveElementAt(idx); + NotifyEventListenerRemoved(type); + if (IsDeviceType(message)) { + DisableDevice(message); + } + } +} + already_AddRefed<nsIScriptGlobalObject> EventListenerManager::GetScriptGlobalAndDocument(nsIDocument** aDoc) { |