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
--- 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);