Bug 239201. Anonymous views (views without frames) should inherit their visibility from their parent. Then visibility:hidden IFRAMEs will hide their widgets. r+sr=dbaron

This commit is contained in:
roc+%cs.cmu.edu 2004-05-31 20:01:58 +00:00
Родитель 00f697cb04
Коммит 1169792709
3 изменённых файлов: 18 добавлений и 2 удалений

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

@ -729,7 +729,10 @@ nsSubDocumentFrame::CreateViewAndWidget(nsContentType aContentType)
nsRect viewBounds(0, 0, 0, 0); // size will be fixed during reflow
nsIViewManager* viewMan = outerView->GetViewManager();
rv = innerView->Init(viewMan, viewBounds, outerView);
// Create the inner view hidden if the outer view is already hidden
// (it won't get hidden properly otherwise)
rv = innerView->Init(viewMan, viewBounds, outerView,
outerView->GetVisibility());
viewMan->InsertChild(outerView, innerView, nsnull, PR_TRUE);
nsWidgetInitData initData;

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

@ -729,7 +729,10 @@ nsSubDocumentFrame::CreateViewAndWidget(nsContentType aContentType)
nsRect viewBounds(0, 0, 0, 0); // size will be fixed during reflow
nsIViewManager* viewMan = outerView->GetViewManager();
rv = innerView->Init(viewMan, viewBounds, outerView);
// Create the inner view hidden if the outer view is already hidden
// (it won't get hidden properly otherwise)
rv = innerView->Init(viewMan, viewBounds, outerView,
outerView->GetVisibility());
viewMan->InsertChild(outerView, innerView, nsnull, PR_TRUE);
nsWidgetInitData initData;

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

@ -2859,6 +2859,16 @@ NS_IMETHODIMP nsViewManager::SetViewVisibility(nsIView *aView, nsViewVisibility
}
}
}
// Any child views not associated with frames might not get their visibility
// updated, so propagate our visibility to them. This is important because
// hidden views should have all hidden children.
for (nsView* childView = view->GetFirstChild(); childView;
childView = childView->GetNextSibling()) {
if (!childView->GetClientData()) {
childView->SetVisibility(aVisible);
}
}
}
return NS_OK;
}