bug 931399 - shutdown DocAccessibles in nsDocumentViewer::Destroy r=bz

This commit is contained in:
Trevor Saunders 2013-12-06 16:03:40 -05:00
parent 1dfe0d31a7
commit 504c05cb4a
2 changed files with 14 additions and 0 deletions

View File

@ -9,6 +9,7 @@
#define mozilla_a11y_IUnknownImpl_h_
#include <windows.h>
#undef CreateEvent // thank you windows you're such a helper
#include "nsError.h"
// Avoid warning C4509 like "nonstandard extension used:

View File

@ -33,6 +33,9 @@
#include "nsIDOMHTMLElement.h"
#include "nsContentUtils.h"
#include "nsLayoutStylesheetCache.h"
#ifdef ACCESSIBILITY
#include "mozilla/a11y/DocAccessible.h"
#endif
#include "mozilla/BasicEvents.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/EncodingUtils.h"
@ -1565,6 +1568,16 @@ nsDocumentViewer::Destroy()
// cache ourselves.
shEntry->SyncPresentationState();
// Shut down accessibility for the document before we start to tear it down.
#ifdef ACCESSIBILITY
if (mPresShell) {
a11y::DocAccessible* docAcc = mPresShell->GetDocAccessible();
if (docAcc) {
docAcc->Shutdown();
}
}
#endif
// Break the link from the document/presentation to the docshell, so that
// link traversals cannot affect the currently-loaded document.
// When the presentation is restored, Open() and InitInternal() will reset