Bug 1638030 - Fix broken gBrowser.animationsEnabled checks. r=Gijs
authorDão Gottwald <dao@mozilla.com>
Fri, 15 May 2020 10:30:09 +0000
changeset 530250 65de1f6a9f6e0a219e0ba7ff5f2c60f40ba6ba7e
parent 530249 82aeb12966b3b086c099d843258590df370b9ba7
child 530251 ccd3a06efe81123e9ff32a697bc3c0f54e26a734
push id37420
push usernerli@mozilla.com
push dateFri, 15 May 2020 21:52:36 +0000
treeherdermozilla-central@f340bbb582d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1638030
milestone78.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 1638030 - Fix broken gBrowser.animationsEnabled checks. r=Gijs 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;