Bug 1378313 - Fix up bogus code showing the reload button as enabled when it's disabled. r?johannh
Bug 1376893's approach is wrong in various ways:
- It shows the reload button as enabled for about:blank
- The disabled state styling is implemented in browser/themes/shared/toolbarbuttons.inc.css, and could be implemented differently. browser/base/content/browser.css should not depend on theme specifics.
- :not(:-moz-window-inactive) only begins to make sense on Mac, and obviously prevents the fix from taking effect in inactive windows
MozReview-Commit-ID: A5yX9dc4TOK
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -469,22 +469,20 @@ toolbar:not(#TabsToolbar) > #personal-bo
display: -moz-box;
}
#reload-button:not([displaystop]) + #stop-button,
#reload-button[displaystop] {
visibility: collapse;
}
-/* The reload-button is only disabled temporarily when it becomes visible
- to prevent users from accidentally clicking it. We don't however need
- to show this disabled state, as the flicker that it generates is short
- enough to be visible but not long enough to explain anything to users. */
-#reload-button[disabled]:not(:-moz-window-inactive) > .toolbarbutton-icon {
- opacity: 1 !important;
+/* Temporarily disable the reload button to prevent the user from
+ accidentally reloading the page when intending to click the stop button. */
+#reload-button[temporarily-disabled] {
+ pointer-events: none;
}
#PanelUI-feeds > .feed-toolbarbutton:-moz-locale-dir(rtl) {
direction: rtl;
}
#panelMenu_bookmarksMenu > .bookmark-item {
max-width: none;
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -4963,21 +4963,20 @@ var CombinedStopReload = {
return;
}
if (this._timer)
return;
// Temporarily disable the reload button to prevent the user from
// accidentally reloading the page when intending to click the stop button
- this.reload.disabled = true;
+ this.reload.setAttribute("temporarily-disabled", "true");
this._timer = setTimeout(function(self) {
self._timer = 0;
- self.reload.disabled = XULBrowserWindow.reloadCommand
- .getAttribute("disabled") == "true";
+ self.reload.removeAttribute("temporarily-disabled");
}, 650, this);
},
_cancelTransition() {
if (this._timer) {
clearTimeout(this._timer);
this._timer = 0;
}