Bug 804656: add rolluponmousewheel attribute to allow mousewheel events to hide panels, r=enndeakin
authorShane Caraveo <scaraveo@mozilla.com>
Fri, 25 Jan 2013 14:30:50 -0800
changeset 130581 cf2bcfc5cb4d51bab9bf7f0216c4e194be5ec2c0
parent 130580 d2a2c71ce437d19bef4c46e39090c7efb9794d11
child 130582 c9bba628aeb34fd40fe0bd7782e6d23355b96e70
push id317
push userbbajaj@mozilla.com
push dateTue, 07 May 2013 01:20:33 +0000
treeherdermozilla-release@159a10910249 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenndeakin
bugs804656
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 804656: add rolluponmousewheel attribute to allow mousewheel events to hide panels, r=enndeakin
browser/base/content/browser.xul
content/base/src/nsGkAtomList.h
layout/xul/base/src/nsXULPopupManager.cpp
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -269,16 +269,18 @@
            noautofocus="true"/>
     <panel id="social-flyout-panel"
            class="social-panel"
            onpopupshown="SocialFlyout.onShown()"
            onpopuphidden="SocialFlyout.onHidden()"
            side="right"
            type="arrow"
            hidden="true"
+           rolluponmousewheel="true"
+           consumeoutsideclicks="false"
            noautofocus="true"
            position="topcenter topright"/>
 
     <menupopup id="toolbar-context-menu"
                onpopupshowing="onViewToolbarsPopupShowing(event);">
       <menuseparator/>
       <menuitem command="cmd_ToggleTabsOnTop"
                 type="checkbox"
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -907,16 +907,17 @@ GK_ATOM(rev, "rev")
 GK_ATOM(reverse, "reverse")
 GK_ATOM(reversed, "reversed")
 GK_ATOM(richlistbox, "richlistbox")
 GK_ATOM(richlistitem, "richlistitem")
 GK_ATOM(right, "right")
 GK_ATOM(rightmargin, "rightmargin")
 GK_ATOM(rightpadding, "rightpadding")
 GK_ATOM(role, "role")
+GK_ATOM(rolluponmousewheel, "rolluponmousewheel")
 GK_ATOM(round, "round")
 GK_ATOM(row, "row")
 GK_ATOM(rows, "rows")
 GK_ATOM(rowspan, "rowspan")
 GK_ATOM(rp, "rp")
 GK_ATOM(rt, "rt")
 GK_ATOM(rtl, "rtl")
 GK_ATOM(ruby, "ruby")
--- a/layout/xul/base/src/nsXULPopupManager.cpp
+++ b/layout/xul/base/src/nsXULPopupManager.cpp
@@ -221,16 +221,24 @@ bool nsXULPopupManager::ShouldRollupOnMo
   nsMenuChainItem* item = GetTopVisibleMenu();
   if (!item)
     return false;
 
   nsIContent* content = item->Frame()->GetContent();
   if (!content)
     return false;
 
+  if (content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::rolluponmousewheel,
+                           nsGkAtoms::_true, eCaseMatters))
+    return true;
+
+  if (content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::rolluponmousewheel,
+                           nsGkAtoms::_false, eCaseMatters))
+    return false;
+
   nsAutoString value;
   content->GetAttr(kNameSpaceID_None, nsGkAtoms::type, value);
   return StringBeginsWith(value, NS_LITERAL_STRING("autocomplete"));
 }
 
 // a menu should not roll up if activated by a mouse activate message (eg. X-mouse)
 bool nsXULPopupManager::ShouldRollupOnMouseActivate()
 {