Bug 1638030 - Fix broken gBrowser.animationsEnabled checks. r=Gijs, a=pascalc
authorDão Gottwald <dao@mozilla.com>
Fri, 15 May 2020 10:30:09 +0000
changeset 591494 d89dbbcf87a89b4bd21c06d07b749e6a5727e8fb
parent 591493 7cfdc9c5b7093370bac2a18a67fd2fe09fd54378
child 591495 a9a74eed0c655ddf535650364fb918c998f15e62
push id13152
push userjcristau@mozilla.com
push dateMon, 18 May 2020 14:17:16 +0000
treeherdermozilla-beta@d89dbbcf87a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, pascalc
bugs1638030
milestone77.0
Bug 1638030 - Fix broken gBrowser.animationsEnabled checks. r=Gijs, a=pascalc Differential Revision: https://phabricator.services.mozilla.com/D75344
browser/base/content/tabbrowser-tabs.js
--- a/browser/base/content/tabbrowser-tabs.js
+++ b/browser/base/content/tabbrowser-tabs.js
@@ -662,18 +662,17 @@
           "animDropIndex" in draggedTab._dragData &&
           draggedTab._dragData.animDropIndex;
         let incrementDropIndex = true;
         if (dropIndex && dropIndex > movingTabs[0]._tPos) {
           dropIndex--;
           incrementDropIndex = false;
         }
 
-        let animate = gBrowser.animationsEnabled;
-        if (oldTranslateX && oldTranslateX != newTranslateX && animate) {
+        if (oldTranslateX && oldTranslateX != newTranslateX && !gReduceMotion) {
           for (let tab of movingTabs) {
             tab.setAttribute("tabdrop-samewindow", "true");
             tab.style.transform = "translateX(" + newTranslateX + "px)";
             let onTransitionEnd = transitionendEvent => {
               if (
                 transitionendEvent.propertyName != "transform" ||
                 transitionendEvent.originalTarget != tab
               ) {
@@ -1513,17 +1512,17 @@
 
     /**
      * Regroup all selected tabs around the
      * tab in param
      */
     _groupSelectedTabs(tab) {
       let draggedTabPos = tab._tPos;
       let selectedTabs = gBrowser.selectedTabs;
-      let animate = gBrowser.animationsEnabled;
+      let animate = !gReduceMotion;
 
       tab.groupingTabsData = {
         finished: !animate,
       };
 
       // Animate left selected tabs
 
       let insertAtPos = draggedTabPos - 1;