зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
00f697cb04
Коммит
1169792709
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче