Bug 1366060 - Disable the tab reordering animation if the cosmeticAnimations pref is disabled. r=Gijs
authorJared Wein <jwein@mozilla.com>
Tue, 20 Jun 2017 17:41:35 -0400
changeset 365192 0ba540ea0d540e017d4b89ec9fa871104ebd63a4
parent 365191 49f8263e9220a1d0f56597609dc3b9f94e6051a0
child 365193 7956a36a78f9e3dac03fbe71a740a5335cc7d68d
push id32066
push userkwierso@gmail.com
push dateWed, 21 Jun 2017 23:54:49 +0000
treeherdermozilla-central@95c9259724a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1366060
milestone56.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 1366060 - Disable the tab reordering animation if the cosmeticAnimations pref is disabled. r=Gijs MozReview-Commit-ID: 5YVZvt7dFJT
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -7044,17 +7044,18 @@
             newTranslateX -= tabWidth;
           }
 
           let dropIndex = "animDropIndex" in draggedTab._dragData &&
                           draggedTab._dragData.animDropIndex;
           if (dropIndex && dropIndex > draggedTab._tPos)
             dropIndex--;
 
-          if (oldTranslateX && oldTranslateX != newTranslateX) {
+          let animate = Services.prefs.getBoolPref("toolkit.cosmeticAnimations.enabled");
+          if (oldTranslateX && oldTranslateX != newTranslateX && animate) {
             draggedTab.setAttribute("tabdrop-samewindow", "true");
             draggedTab.style.transform = "translateX(" + newTranslateX + "px)";
             let onTransitionEnd = transitionendEvent => {
               if (transitionendEvent.propertyName != "transform" ||
                   transitionendEvent.originalTarget != draggedTab) {
                 return;
               }
               draggedTab.removeEventListener("transitionend", onTransitionEnd);