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.
This commit is contained in:
Trevor Saunders 2015-07-06 08:15:37 -04:00
parent 2ad9b546ea
commit c3ed0f0ced

View File

@ -457,10 +457,12 @@ DocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
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);