Bug 531075 followup: Shift new early-return down a bit, to let simpler early-returns catch open-and-visible popups. r=bz

This commit is contained in:
Daniel Holbert 2009-12-03 20:01:39 -08:00
Родитель 35a1d741cd
Коммит 529276334d
1 изменённых файлов: 6 добавлений и 6 удалений

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

@ -1218,12 +1218,6 @@ nsXULPopupManager::GetVisiblePopups()
PRBool
nsXULPopupManager::MayShowPopup(nsMenuPopupFrame* aPopup)
{
// Don't show popups that we already have in our popup chain
if (IsPopupOpen(aPopup->GetContent())) {
NS_WARNING("Refusing to show duplicate popup");
return PR_FALSE;
}
// if a popup's IsOpen method returns true, then the popup must always be in
// the popup chain scanned in IsPopupOpen.
NS_ASSERTION(!aPopup->IsOpen() || IsPopupOpen(aPopup->GetContent()),
@ -1241,6 +1235,12 @@ nsXULPopupManager::MayShowPopup(nsMenuPopupFrame* aPopup)
if (state != ePopupClosed && state != ePopupInvisible)
return PR_FALSE;
// Don't show popups that we already have in our popup chain
if (IsPopupOpen(aPopup->GetContent())) {
NS_WARNING("Refusing to show duplicate popup");
return PR_FALSE;
}
// if the popup was just rolled up, don't reopen it
nsCOMPtr<nsIWidget> widget;
aPopup->GetWidget(getter_AddRefs(widget));