[Pkg-mozext-commits] [tabmixplus] 136/147: Since Nightly 55.0a1 (2017-04-20) closing tab does is broken, Folllow up bug 1352069 - Introduce a pref that allows for disabling animations

David Prévot taffit at moszumanska.debian.org
Sat Aug 5 15:27:45 UTC 2017


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit fe3e7974c0b233e15b38ccc19e7b4c6f3a01856b
Author: onemen <tabmix.onemen at gmail.com>
Date:   Fri Apr 21 14:10:38 2017 +0300

    Since Nightly 55.0a1 (2017-04-20) closing tab does is broken, Folllow up bug 1352069 - Introduce a pref that allows for disabling animations
---
 chrome/content/minit/tablib.js            | 2 +-
 chrome/content/preferences/events.js      | 7 +++++++
 chrome/content/preferences/preferences.js | 5 +++++
 chrome/content/tab/tab.js                 | 2 +-
 chrome/content/tabmix.js                  | 6 +++---
 modules/TabmixSvc.jsm                     | 8 ++++++++
 modules/extensions/TabGroupsManager.jsm   | 4 ++--
 7 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 662bef6..2dc1d3c 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -269,7 +269,7 @@ Tabmix.tablib = {
     Tabmix.changeCode(gBrowser, "gBrowser._endRemoveTab")._replace(
       'this._blurTab(aTab);',
       'Tabmix.tablib.onRemoveTab(aTab); \
-       if (Services.prefs.getBoolPref("browser.tabs.animate")) { \
+       if (TabmixSvc.tabAnimationsEnabled) { \
          TMP_eventListener.onTabClose_updateTabBar(aTab);\
        } \
        $&'
diff --git a/chrome/content/preferences/events.js b/chrome/content/preferences/events.js
index 6105eb3..e6bc9a1 100644
--- a/chrome/content/preferences/events.js
+++ b/chrome/content/preferences/events.js
@@ -49,6 +49,13 @@ var gEventsPane = {
       $("selectSyncedTabs").hidden = true;
     }
 
+    // Bug 1352069 - Introduce a pref that allows for disabling cosmetic animations
+    // remove the UI for the old 'browser.tabs.animate'
+    if (Tabmix.isVersion(550)) {
+      gPrefWindow.removeChild("pref_disableTabsAnimate");
+      gPrefWindow.removeChild("disableTabsAnimate");
+    }
+
     this.alignTabOpeningBoxes();
 
     gPrefWindow.initPane("paneEvents");
diff --git a/chrome/content/preferences/preferences.js b/chrome/content/preferences/preferences.js
index 07702b3..014929e 100644
--- a/chrome/content/preferences/preferences.js
+++ b/chrome/content/preferences/preferences.js
@@ -368,6 +368,11 @@ XPCOMUtils.defineLazyGetter(window, "gPreferenceList", () => {
     "toolkit.scrollbox.clickToScroll.scrollDelay", "toolkit.scrollbox.smoothScroll"
   ];
 
+  if (Tabmix.isVersion(550)) {
+    const index = otherPrefs.indexOf("browser.tabs.animate");
+    otherPrefs.splice(index, 1);
+  }
+
   let prefs = Services.prefs.getDefaultBranch("");
   let tabmixPrefs = Services.prefs.getChildList("extensions.tabmix.").sort();
   // filter out preference without default value
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index 5d4e201..4fab3a8 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -851,7 +851,7 @@ Tabmix.tabsUtils = {
     if (!this.overflow) {
       // prevent new-tab-button on the right from flickering when new tabs animate is on.
       if (this.disAllowNewtabbutton &&
-          Services.prefs.getBoolPref("browser.tabs.animate")) {
+          TabmixSvc.tabAnimationsEnabled) {
         // after 250ms new tab is fully opened
         if (!this.adjustNewtabButtonTimeout) {
           let timeout = 250;
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index d66883f..0967921 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -799,7 +799,7 @@ var TMP_eventListener = {
     } else if (!this._onOpenTimeout) {
       let self = this;
       let timeout = Tabmix.tabsUtils.disAllowNewtabbutton &&
-          Services.prefs.getBoolPref("browser.tabs.animate") ? 0 : 200;
+          TabmixSvc.tabAnimationsEnabled ? 0 : 200;
       this._onOpenTimeout = window.setTimeout(function TMP_onOpenTimeout(tab) {
         if (self._onOpenTimeout) {
           clearTimeout(self._onOpenTimeout);
@@ -851,10 +851,10 @@ var TMP_eventListener = {
       }
     }
 
-    // when browser.tabs.animate is true gBrowser._endRemoveTab calls
+    // when tab animations enabled is true gBrowser._endRemoveTab calls
     // onTabClose_updateTabBar.
     // we would like to get early respond when row height is going to change.
-    var updateNow = !Services.prefs.getBoolPref("browser.tabs.animate");
+    var updateNow = !TabmixSvc.tabAnimationsEnabled;
     if (!updateNow && tabBar.hasAttribute("multibar")) {
       let lastTab = Tabmix.visibleTabs.last;
       if (!TabmixTabbar.inSameRow(lastTab, Tabmix.visibleTabs.previous(lastTab))) {
diff --git a/modules/TabmixSvc.jsm b/modules/TabmixSvc.jsm
index da5f5e2..8968f7e 100644
--- a/modules/TabmixSvc.jsm
+++ b/modules/TabmixSvc.jsm
@@ -371,6 +371,14 @@ XPCOMUtils.defineLazyGetter(TabmixSvc, "SERIALIZED_SYSTEMPRINCIPAL", function()
       this.SessionStoreGlobal.Utils.SERIALIZED_SYSTEMPRINCIPAL || null;
 });
 
+// Firefox 55
+// Bug 1352069 - Introduce a pref that allows for disabling cosmetic animations
+XPCOMUtils.defineLazyGetter(TabmixSvc, "tabAnimationsEnabled", () => {
+  return isVersion(550) ?
+    Services.prefs.getBoolPref("toolkit.cosmeticAnimations.enabled") :
+    Services.prefs.getBoolPref("browser.tabs.animate");
+});
+
 tabStateCache = {
   saveTabAttributes(tab, attrib, save = true) {
     if (TabmixSvc.isPaleMoon) {
diff --git a/modules/extensions/TabGroupsManager.jsm b/modules/extensions/TabGroupsManager.jsm
index 049bb71..65bde73 100644
--- a/modules/extensions/TabGroupsManager.jsm
+++ b/modules/extensions/TabGroupsManager.jsm
@@ -16,12 +16,12 @@ this.TMP_TabGroupsManager = {
       '    $1$2'
     ).toCode();
 
-    // in Firefox 4.0 we call TabGroupsManager.eventListener.onTabClose regardless of browser.tabs.animate
+    // we call TabGroupsManager.eventListener.onTabClose regardless of tab animations
     this.changeCode(aWindow.TMP_eventListener, "TMP_eventListener.onTabClose")._replace(
       'this.onTabClose_updateTabBar(tab);',
       'try {TabGroupsManager.eventListener.onTabClose(aEvent);} catch(e) {Tabmix.log(e);}'
     )._replace(
-      '!Services.prefs.getBoolPref("browser.tabs.animate")', 'true'
+      '!TabmixSvc.tabAnimationsEnabled', 'true'
     ).toCode();
 
     this.changeCode(aWindow.TMP_tabDNDObserver, "TMP_tabDNDObserver.onDragExit")._replace(

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list