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)); content->GetDocument(*getter_AddRefs(doc));
doc->FlushPendingNotifications(); 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(); nsIFrame* activeChild = GetActiveChild();
nsIView* view = nsnull; nsIView* view = nsnull;
activeChild->GetView(mPresContext, &view); if ( activeChild ) {
nsCOMPtr<nsIViewManager> viewManager; activeChild->GetView(mPresContext, &view);
view->GetViewManager(*getter_AddRefs(viewManager)); NS_ASSERTION ( view, "View is gone, looks like someone forgot to rollup the popup!" );
viewManager->SetViewVisibility(view, nsViewVisibility_kHide); if ( view ) {
viewManager->ResizeView(view, 0, 0); nsCOMPtr<nsIViewManager> viewManager;
view->GetViewManager(*getter_AddRefs(viewManager));
viewManager->SetViewVisibility(view, nsViewVisibility_kHide);
viewManager->ResizeView(view, 0, 0);
}
}
} }
} }
} }