Bug 1382898 - Disable the Stop / Reload animation if the stop / reload buttons are placed outside of the nav-bar due to bug 1382894. r?gijs draft
authorJared Wein <jwein@mozilla.com>
Thu, 20 Jul 2017 20:55:58 -0400
changeset 620601 858024c4e9baf801d104fa89a3de7b8e76889d13
parent 620600 fa94c05940164dd5b82967d9e2c9c6c840f51d12
child 640756 b36713b9df9489cbb0f8d3c1dbfa51a6d1319f70
push id72100
push userbmo:jaws@mozilla.com
push dateThu, 03 Aug 2017 17:22:41 +0000
reviewersgijs
bugs1382898, 1382894
milestone57.0a1
Bug 1382898 - Disable the Stop / Reload animation if the stop / reload buttons are placed outside of the nav-bar due to bug 1382894. r?gijs MozReview-Commit-ID: 1LgSYvl7YGR
browser/base/content/browser.js
browser/themes/shared/toolbarbutton-icons.inc.css
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -5058,16 +5058,17 @@ var CombinedStopReload = {
       this.timeWhenSwitchedToStop = window.performance.now();
     }
 
     let shouldAnimate = AppConstants.MOZ_PHOTON_ANIMATIONS &&
                         aRequest &&
                         aWebProgress.isTopLevel &&
                         aWebProgress.isLoadingDocument &&
                         !gBrowser.tabAnimationsInProgress &&
+                        this.stopReloadContainer.closest("#nav-bar-customization-target") &&
                         this.animate;
 
     this._cancelTransition();
     if (shouldAnimate) {
       BrowserUtils.setToolbarButtonHeightProperty(this.stopReloadContainer);
       this.stopReloadContainer.setAttribute("animate", "true");
     } else {
       this.stopReloadContainer.removeAttribute("animate");
@@ -5082,16 +5083,17 @@ var CombinedStopReload = {
     }
 
     let shouldAnimate = AppConstants.MOZ_PHOTON_ANIMATIONS &&
                         aRequest &&
                         aWebProgress.isTopLevel &&
                         !aWebProgress.isLoadingDocument &&
                         !gBrowser.tabAnimationsInProgress &&
                         this._loadTimeExceedsMinimumForAnimation() &&
+                        this.stopReloadContainer.closest("#nav-bar-customization-target") &&
                         this.animate;
 
     if (shouldAnimate) {
       BrowserUtils.setToolbarButtonHeightProperty(this.stopReloadContainer);
       this.stopReloadContainer.setAttribute("animate", "true");
     } else {
       this.stopReloadContainer.removeAttribute("animate");
     }
--- a/browser/themes/shared/toolbarbutton-icons.inc.css
+++ b/browser/themes/shared/toolbarbutton-icons.inc.css
@@ -39,16 +39,25 @@ toolbar[brighttext] .toolbarbutton-1 {
 %ifdef MOZ_PHOTON_THEME
 %ifdef MOZ_PHOTON_ANIMATIONS
 .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
   animation-fill-mode: forwards;
   animation-iteration-count: 1;
   list-style-image: none;
 }
 
+/* The animations for the reload-button and stop-button are disabled
+   outside of the nav-bar due to bug 1382894. */
+:-moz-any(#reload-button, #stop-button) > .toolbarbutton-animatable-box {
+  display: none;
+}
+#nav-bar-customization-target > #stop-reload-button > :-moz-any(#reload-button, #stop-button) > .toolbarbutton-animatable-box {
+  display: -moz-box;
+}
+
 #stop-reload-button[animate] > #reload-button > .toolbarbutton-icon,
 #stop-reload-button[animate] > #reload-button[displaystop] + #stop-button > .toolbarbutton-icon {
   fill: transparent;
 }
 
 @keyframes reload-to-stop {
   from {
     transform: translateX(0);