Make hiding a frame with display:none really hide the docshell all the way.

Bug 308182, r=biesi, sr=jst
This commit is contained in:
bzbarsky%mit.edu 2006-01-27 01:04:48 +00:00
Родитель 3d4f85e974
Коммит f5b0e7ca81
2 изменённых файлов: 16 добавлений и 7 удалений

Просмотреть файл

@ -3820,12 +3820,12 @@ nsDocShell::SetVisibility(PRBool aVisibility)
if (!mContentViewer)
return NS_OK;
if (aVisibility) {
NS_ENSURE_SUCCESS(EnsureContentViewer(), NS_ERROR_FAILURE);
mContentViewer->Show();
}
else if (mContentViewer)
else {
mContentViewer->Hide();
}
return NS_OK;
}

Просмотреть файл

@ -571,11 +571,20 @@ nsSubDocumentFrame::Destroy(nsPresContext* aPresContext)
// can safely go away when this frame is destroyed.
content_viewer->SetSticky(PR_FALSE);
// Hide the content viewer now that the frame is going away...
content_viewer->Hide();
}
nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(docShell);
NS_ASSERTION(baseWin, "Docshell must be an nsIBaseWindow");
// Now reverse the steps we took in ShowDocShell(). But don't call
// Destroy(); that will be handled by destroying our frame loader, if
// needed.
// Hide the content viewer now that the frame is going away...
baseWin->SetVisibility(PR_FALSE);
// Clear out the parentWidget, since it's about to die with us
baseWin->SetParentWidget(nsnull);
}
}