bug 1181177 - null check tabChild in DocManager::CreateDocOrRootAccessible r=davidb

This causes e10s to behave differently from non e10s, because in e10s we don't
forward the creation of the document to the parent process.  However this only
seems to happen in strange edge cases.
This commit is contained in:
Trevor Saunders 2015-07-10 15:43:51 -04:00
parent 28816e663a
commit c1e81e7509

View File

@ -460,8 +460,14 @@ DocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
nsIDocShell* docShell = aDocument->GetDocShell();
if (docShell) {
nsCOMPtr<nsITabChild> tabChild = do_GetInterface(docShell);
static_cast<TabChild*>(tabChild.get())->
SendPDocAccessibleConstructor(ipcDoc, nullptr, 0);
// XXX We may need to handle the case that we don't have a tab child
// differently. It may be that this will cause us to fail to notify
// the parent process about important accessible documents.
if (tabChild) {
static_cast<TabChild*>(tabChild.get())->
SendPDocAccessibleConstructor(ipcDoc, nullptr, 0);
}
}
}
} else {