зеркало из https://github.com/mozilla/gecko-dev.git
Bug 846204 - Unregister DocManager from DOM event listeners. r=tbsaunde
This commit is contained in:
Родитель
d8db757ce1
Коммит
4766e33cac
|
@ -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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче