Bug 406646. Make sure to only search *visible* popups for mouse event targets. r=enndeakin

--HG--
extra : rebase_source : bd0825d6a6469a10dcdd9e4ae9e9c91dcbafbe99
This commit is contained in:
Robert O'Callahan 2009-02-24 21:25:25 +13:00
parent 759614de52
commit 19082bf736
4 changed files with 7 additions and 7 deletions

View File

@ -1015,7 +1015,7 @@ PRBool nsCaret::IsMenuPopupHidingCaret()
#ifdef MOZ_XUL
// Check if there are open popups.
nsXULPopupManager *popMgr = nsXULPopupManager::GetInstance();
nsTArray<nsIFrame*> popups = popMgr->GetOpenPopups();
nsTArray<nsIFrame*> popups = popMgr->GetVisiblePopups();
if (popups.Length() == 0)
return PR_FALSE; // No popups, so caret can't be hidden by them.

View File

@ -5662,7 +5662,7 @@ PresShell::HandleEvent(nsIView *aView,
#ifdef MOZ_XUL
nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
if (pm) {
nsTArray<nsIFrame*> popups = pm->GetOpenPopups();
nsTArray<nsIFrame*> popups = pm->GetVisiblePopups();
PRUint32 i;
// Search from top to bottom
for (i = 0; i < popups.Length(); i++) {

View File

@ -498,10 +498,10 @@ public:
nsIFrame* GetTopPopup(nsPopupType aType);
/**
* Return an array of all the open popup frames for menus, in order from
* top to bottom.
* Return an array of all the open and visible popup frames for
* menus, in order from top to bottom.
*/
nsTArray<nsIFrame *> GetOpenPopups();
nsTArray<nsIFrame *> GetVisiblePopups();
/**
* Return false if a popup may not be opened. This will return false if the

View File

@ -1169,13 +1169,13 @@ nsXULPopupManager::GetTopPopup(nsPopupType aType)
}
nsTArray<nsIFrame *>
nsXULPopupManager::GetOpenPopups()
nsXULPopupManager::GetVisiblePopups()
{
nsTArray<nsIFrame *> popups;
nsMenuChainItem* item = mPopups;
while (item) {
if (item->Frame()->PopupState() != ePopupInvisible)
if (item->Frame()->PopupState() == ePopupOpenAndVisible)
popups.AppendElement(static_cast<nsIFrame*>(item->Frame()));
item = item->GetParent();
}