Bug 860971, if changing the visibility changes contentviewer, don't try to proceed in nsFrameLoader::Show, r=bz

This commit is contained in:
Olli Pettay 2013-04-13 15:30:38 +03:00
parent 7b3c2a732d
commit e4a38f17fd
2 changed files with 6 additions and 3 deletions

View File

@ -819,6 +819,7 @@ nsFrameLoader::Show(int32_t marginWidth, int32_t marginHeight,
// "Create"...
baseWindow->Create();
baseWindow->SetVisibility(true);
NS_ENSURE_TRUE(mDocShell, false);
// Trigger editor re-initialization if midas is turned on in the
// sub-document. This shouldn't be necessary, but given the way our

View File

@ -5475,13 +5475,15 @@ nsDocShell::GetAllowMixedContentAndConnectionData(bool* aRootHasSecureConnection
NS_IMETHODIMP
nsDocShell::SetVisibility(bool aVisibility)
{
if (!mContentViewer)
// Show()/Hide() may change mContentViewer.
nsCOMPtr<nsIContentViewer> cv = mContentViewer;
if (!cv)
return NS_OK;
if (aVisibility) {
mContentViewer->Show();
cv->Show();
}
else {
mContentViewer->Hide();
cv->Hide();
}
return NS_OK;