Bug 531075: Don't allow ourselves to reopen popups that are already in the open-popup chain. r=bz

This commit is contained in:
Daniel Holbert 2009-12-01 13:42:19 -08:00
parent cf468b0bee
commit 6ed52fe387

View File

@ -1218,6 +1218,12 @@ 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()),