mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 846204 - Unregister DocManager from DOM event listeners. r=tbsaunde
This commit is contained in:
parent
a76374a3e1
commit
2135e46a10
@ -348,6 +348,19 @@ DocManager::AddListeners(nsIDocument* aDocument,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DocManager::RemoveListeners(nsIDocument* aDocument)
|
||||
{
|
||||
nsPIDOMWindow* window = aDocument->GetWindow();
|
||||
nsIDOMEventTarget* target = window->GetChromeEventHandler();
|
||||
nsEventListenerManager* elm = target->GetListenerManager(true);
|
||||
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
|
||||
dom::TrustedEventsAtCapture());
|
||||
|
||||
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("DOMContentLoaded"),
|
||||
dom::TrustedEventsAtCapture());
|
||||
}
|
||||
|
||||
DocAccessible*
|
||||
DocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
|
||||
{
|
||||
|
@ -65,6 +65,7 @@ public:
|
||||
inline void NotifyOfDocumentShutdown(nsIDocument* aDocument)
|
||||
{
|
||||
mDocAccessibleCache.Remove(aDocument);
|
||||
RemoveListeners(aDocument);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -101,9 +102,10 @@ private:
|
||||
uint32_t aLoadEventType);
|
||||
|
||||
/**
|
||||
* Add 'pagehide' and 'DOMContentLoaded' event listeners.
|
||||
* Add/remove 'pagehide' and 'DOMContentLoaded' event listeners.
|
||||
*/
|
||||
void AddListeners(nsIDocument *aDocument, bool aAddPageShowListener);
|
||||
void RemoveListeners(nsIDocument* aDocument);
|
||||
|
||||
/**
|
||||
* Create document or root accessible.
|
||||
|
Loading…
Reference in New Issue
Block a user