bullet-proof hiding the view. we might not have one if things are not dismissed correctly. r=pchen/sr=hyatt/a=asa. bug 83753.

This commit is contained in:
pinkerton%netscape.com 2001-06-04 23:55:48 +00:00
Родитель cc0956733b
Коммит 489aec8c58
1 изменённых файлов: 13 добавлений и 6 удалений

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

@ -610,14 +610,21 @@ nsPopupSetFrame::ActivatePopup(PRBool aActivateFlag)
content->GetDocument(*getter_AddRefs(doc));
doc->FlushPendingNotifications();
// make sure we hide the popup.
// make sure we hide the popup. We can't assume that we'll have a view
// since we could be cleaning up after someone that didn't correctly
// destroy the popup.
nsIFrame* activeChild = GetActiveChild();
nsIView* view = nsnull;
activeChild->GetView(mPresContext, &view);
nsCOMPtr<nsIViewManager> viewManager;
view->GetViewManager(*getter_AddRefs(viewManager));
viewManager->SetViewVisibility(view, nsViewVisibility_kHide);
viewManager->ResizeView(view, 0, 0);
if ( activeChild ) {
activeChild->GetView(mPresContext, &view);
NS_ASSERTION ( view, "View is gone, looks like someone forgot to rollup the popup!" );
if ( view ) {
nsCOMPtr<nsIViewManager> viewManager;
view->GetViewManager(*getter_AddRefs(viewManager));
viewManager->SetViewVisibility(view, nsViewVisibility_kHide);
viewManager->ResizeView(view, 0, 0);
}
}
}
}
}