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,10 +610,15 @@ 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;
if ( activeChild ) {
activeChild->GetView(mPresContext, &view); activeChild->GetView(mPresContext, &view);
NS_ASSERTION ( view, "View is gone, looks like someone forgot to rollup the popup!" );
if ( view ) {
nsCOMPtr<nsIViewManager> viewManager; nsCOMPtr<nsIViewManager> viewManager;
view->GetViewManager(*getter_AddRefs(viewManager)); view->GetViewManager(*getter_AddRefs(viewManager));
viewManager->SetViewVisibility(view, nsViewVisibility_kHide); viewManager->SetViewVisibility(view, nsViewVisibility_kHide);
@ -621,6 +626,8 @@ nsPopupSetFrame::ActivatePopup(PRBool aActivateFlag)
} }
} }
} }
}
}
PRBool PRBool
nsPopupSetFrame::OnCreate(nsIContent* aPopupContent) nsPopupSetFrame::OnCreate(nsIContent* aPopupContent)