Bug 1401943 - make reload button work immediately after a tab detach, r?jaws
MozReview-Commit-ID: 58Tvbz6RrnO
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -4939,16 +4939,28 @@ var CombinedStopReload = {
// we get notified of document loads.
if (!stop || !reload)
return false;
this._initialized = true;
if (XULBrowserWindow.stopCommand.getAttribute("disabled") != "true")
reload.setAttribute("displaystop", "true");
stop.addEventListener("click", this);
+
+ // Removing attributes based on the observed command doesn't happen if the button
+ // is in the palette when the command's attribute is removed (cf. bug 309953)
+ for (let button of [stop, reload]) {
+ if (button.hasAttribute("disabled")) {
+ let command = document.getElementById(button.getAttribute("command"));
+ if (!command.hasAttribute("disabled")) {
+ button.removeAttribute("disabled");
+ }
+ }
+ }
+
this.reload = reload;
this.stop = stop;
this.stopReloadContainer = this.reload.parentNode;
this.timeWhenSwitchedToStop = 0;
if (this._shouldStartPrefMonitoring) {
this.startAnimationPrefMonitoring();
}