bug 1170153 - check documents have a docshell before trying to tell the parent process about new remote DocAccessibles r=davidb
We should never create DocAccessibles for documents that are going away so it
seems like this shouldn't be necessary, but without a test case its hard to
know why we are creating DocAccessibles for documents without docshells. So
for now work around the issue and hope it doesn't matter in practice.
--- a/accessible/base/DocManager.cpp
+++ b/accessible/base/DocManager.cpp
@@ -452,20 +452,22 @@ DocManager::CreateDocOrRootAccessible(ns
// Note: don't use AccReorderEvent to avoid coalsecense and special reorder
// events processing.
docAcc->FireDelayedEvent(nsIAccessibleEvent::EVENT_REORDER,
ApplicationAcc());
if (IPCAccessibilityActive()) {
DocAccessibleChild* ipcDoc = new DocAccessibleChild(docAcc);
docAcc->SetIPCDoc(ipcDoc);
- nsCOMPtr<nsITabChild> tabChild =
- do_GetInterface(aDocument->GetDocShell());
- static_cast<TabChild*>(tabChild.get())->
- SendPDocAccessibleConstructor(ipcDoc, nullptr, 0);
+ nsIDocShell* docShell = aDocument->GetDocShell();
+ if (docShell) {
+ nsCOMPtr<nsITabChild> tabChild = do_GetInterface(docShell);
+ static_cast<TabChild*>(tabChild.get())->
+ SendPDocAccessibleConstructor(ipcDoc, nullptr, 0);
+ }
}
} else {
parentDocAcc->BindChildDocument(docAcc);
}
#ifdef A11Y_LOG
if (logging::IsEnabled(logging::eDocCreate)) {
logging::DocCreate("document creation finished", aDocument);