Bug 1401943 - make reload button work immediately after a tab detach, r?jaws draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 29 Sep 2017 13:00:50 +0100
changeset 672594 f86edefd8d971255c344de810ee972e8b57239f2
parent 672593 cd9c8c48e4b3ded47a776f757008f3dcf570c59c
child 733839 4121750394e3306ea82fe55dae197a432ab0ffcf
push id82286
push usergijskruitbosch@gmail.com
push dateFri, 29 Sep 2017 12:00:56 +0000
reviewersjaws
bugs1401943
milestone58.0a1
Bug 1401943 - make reload button work immediately after a tab detach, r?jaws MozReview-Commit-ID: 58Tvbz6RrnO
browser/base/content/browser.js
--- 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();
     }