From fda83a7b523b05fde9bcd973ea4f930dd9f72e16 Mon Sep 17 00:00:00 2001 From: Felipe Gomes Date: Wed, 19 Jan 2011 19:21:38 -0800 Subject: [PATCH] Bug 597723. Mouse scrolling shouldn't dismiss panel notifications. r=enndeakin a=blocking-final --- layout/xul/base/src/nsXULPopupManager.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/layout/xul/base/src/nsXULPopupManager.cpp b/layout/xul/base/src/nsXULPopupManager.cpp index 12ee4e619f1..4f17070d7d0 100644 --- a/layout/xul/base/src/nsXULPopupManager.cpp +++ b/layout/xul/base/src/nsXULPopupManager.cpp @@ -217,8 +217,19 @@ NS_IMETHODIMP nsXULPopupManager::ShouldRollupOnMouseWheelEvent(PRBool *aShouldRo { // should rollup only for autocomplete widgets // XXXndeakin this should really be something the popup has more control over + + *aShouldRollup = PR_FALSE; nsMenuChainItem* item = GetTopVisibleMenu(); - *aShouldRollup = (item && !item->Frame()->IsMenu()); + if (!item) + return NS_OK; + + nsIContent* content = item->Frame()->GetContent(); + if (content) { + nsAutoString value; + content->GetAttr(kNameSpaceID_None, nsGkAtoms::type, value); + *aShouldRollup = StringBeginsWith(value, NS_LITERAL_STRING("autocomplete")); + } + return NS_OK; }