Bug 645538. Remove bogus warning. r=roc

This commit is contained in:
Boris Zbarsky 2011-09-26 00:53:30 -04:00
parent eaa64ca885
commit d328ef8584

View File

@ -2383,6 +2383,9 @@ DocumentViewerImpl::FindContainerView()
nsCOMPtr<nsPIDOMWindow> pwin(do_GetInterface(docShellItem));
if (pwin) {
nsCOMPtr<nsIContent> containerElement = do_QueryInterface(pwin->GetFrameElementInternal());
if (!containerElement) {
return nsnull;
}
nsCOMPtr<nsIPresShell> parentPresShell;
if (docShellItem) {
nsCOMPtr<nsIDocShellTreeItem> parentDocShellItem;
@ -2392,15 +2395,13 @@ DocumentViewerImpl::FindContainerView()
parentDocShell->GetPresShell(getter_AddRefs(parentPresShell));
}
}
if (!parentPresShell && containerElement) {
if (!parentPresShell) {
nsCOMPtr<nsIDocument> parentDoc = containerElement->GetCurrentDoc();
if (parentDoc) {
parentPresShell = parentDoc->GetShell();
}
}
if (!containerElement) {
NS_WARNING("Subdocument container has no content");
} else if (!parentPresShell) {
if (!parentPresShell) {
NS_WARNING("Subdocument container has no presshell");
} else {
nsIFrame* f = parentPresShell->GetRealPrimaryFrameFor(containerElement);
@ -3531,7 +3532,7 @@ nsDocViewerFocusListener::HandleEvent(nsIDOMEvent* aEvent)
NS_ENSURE_STATE(mDocViewer);
nsCOMPtr<nsIPresShell> shell;
nsresult rv = mDocViewer->GetPresShell(getter_AddRefs(shell));
mDocViewer->GetPresShell(getter_AddRefs(shell));
NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
nsCOMPtr<nsISelectionController> selCon = do_QueryInterface(shell);