Bug 1512493 - Make switching tabs by scrolling pref-controlled and off by default. r=stransky, a=RyanVM DEVEDITION_65_0b11_BUILD1 DEVEDITION_65_0b11_RELEASE FENNEC_65_0b11_BUILD1 FENNEC_65_0b11_RELEASE FIREFOX_65_0b11_BUILD1 FIREFOX_65_0b11_RELEASE
authorDão Gottwald <dao@mozilla.com>
Wed, 09 Jan 2019 14:38:42 +0000
changeset 509468 8574d2808aaa0afa131cc57be70b86dad3398ff0
parent 509467 161822bbdcd274f0d67aa7c1a6913caeabf80aa6
child 509469 a7933955fab82df154215796d6a5332a63955787
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstransky, RyanVM
bugs1512493
milestone65.0
Bug 1512493 - Make switching tabs by scrolling pref-controlled and off by default. r=stransky, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D16021
modules/libpref/init/all.js
toolkit/content/jar.mn
toolkit/content/widgets/tabbox.xml
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1064,16 +1064,18 @@ pref("toolkit.osfile.log", false);
 pref("toolkit.cosmeticAnimations.enabled", true);
 
 pref("toolkit.scrollbox.smoothScroll", true);
 pref("toolkit.scrollbox.scrollIncrement", 20);
 pref("toolkit.scrollbox.verticalScrollDistance", 3);
 pref("toolkit.scrollbox.horizontalScrollDistance", 5);
 pref("toolkit.scrollbox.clickToScroll.scrollDelay", 150);
 
+pref("toolkit.tabbox.switchByScrolling", false);
+
 // Telemetry settings.
 // Server to submit telemetry pings to.
 pref("toolkit.telemetry.server", "https://incoming.telemetry.mozilla.org");
 // Telemetry server owner. Please change if you set toolkit.telemetry.server to a different server
 pref("toolkit.telemetry.server_owner", "Mozilla");
 // Determines whether full SQL strings are returned when they might contain sensitive info
 // i.e. dynamically constructed SQL strings or SQL executed by addons against addon DBs
 pref("toolkit.telemetry.debugSlowSql", false);
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -77,17 +77,17 @@ toolkit.jar:
    content/global/bindings/menulist.xml        (widgets/menulist.xml)
    content/global/bindings/notification.xml    (widgets/notification.xml)
    content/global/bindings/numberbox.xml       (widgets/numberbox.xml)
    content/global/bindings/popup.xml           (widgets/popup.xml)
    content/global/bindings/radio.xml           (widgets/radio.xml)
    content/global/bindings/richlistbox.xml     (widgets/richlistbox.xml)
    content/global/bindings/scrollbox.xml       (widgets/scrollbox.xml)
    content/global/bindings/spinner.js          (widgets/spinner.js)
-*  content/global/bindings/tabbox.xml          (widgets/tabbox.xml)
+   content/global/bindings/tabbox.xml          (widgets/tabbox.xml)
    content/global/bindings/text.xml            (widgets/text.xml)
 *  content/global/bindings/textbox.xml         (widgets/textbox.xml)
    content/global/bindings/timekeeper.js       (widgets/timekeeper.js)
    content/global/bindings/timepicker.js       (widgets/timepicker.js)
    content/global/bindings/toolbar.xml         (widgets/toolbar.xml)
    content/global/bindings/toolbarbutton.xml   (widgets/toolbarbutton.xml)
    content/global/bindings/tree.xml            (widgets/tree.xml)
    content/global/bindings/videocontrols.xml   (widgets/videocontrols.xml)
--- a/toolkit/content/widgets/tabbox.xml
+++ b/toolkit/content/widgets/tabbox.xml
@@ -133,16 +133,20 @@
         ]]></getter>
       </property>
 
       <!-- _tabbox is deprecated, it exists only for backwards compatibility. -->
       <field name="_tabbox" readonly="true"><![CDATA[
         this.tabbox;
       ]]></field>
 
+      <field name="_prefService" readonly="true"><![CDATA[
+        Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
+      ]]></field>
+
       <property name="selectedIndex">
         <getter>
         <![CDATA[
           const tabs = this.children;
           for (var i = 0; i < tabs.length; i++) {
             if (tabs[i].selected)
               return i;
           }
@@ -349,30 +353,30 @@
           tab.setAttribute("value", value);
           this.appendChild(tab);
           return tab;
         ]]>
         </body>
       </method>
     </implementation>
 
-#ifdef MOZ_WIDGET_GTK
     <handlers>
       <handler event="DOMMouseScroll">
       <![CDATA[
-        if (event.detail > 0)
-          this.advanceSelectedTab(1, false);
-        else
-          this.advanceSelectedTab(-1, false);
-
-        event.stopPropagation();
+        if (this._prefService.getBoolPref("toolkit.tabbox.switchByScrolling")) {
+          if (event.detail > 0) {
+            this.advanceSelectedTab(1, false);
+          } else {
+            this.advanceSelectedTab(-1, false);
+          }
+          event.stopPropagation();
+        }
       ]]>
       </handler>
     </handlers>
-#endif
   </binding>
 
   <binding id="tab"
            extends="chrome://global/content/bindings/general.xml#basetext">
     <content>
       <xul:hbox class="tab-middle box-inherit" xbl:inherits="align,dir,pack,orient,selected,visuallyselected" flex="1">
         <xul:image class="tab-icon"
                    xbl:inherits="validate,src=image"