diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 1ed27b49332b..908196ab48e5 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1578,8 +1578,6 @@ function BrowserShutdown() Components.utils.reportError(ex); } - gBookmarkAllTabsHandler.uninit(); - BrowserOffline.uninit(); OfflineApps.uninit(); DownloadMonitorPanel.uninit(); @@ -4291,7 +4289,7 @@ var XULBrowserWindow = { // Of course, this is especially wrong with bfcache on... // fix bug 253793 - turn off highlight when page changes - gFindBar.getElement("highlight").checked = false; + gFindBar.getElement("highlight").checked = false; } // See bug 358202, when tabs are switched during a drag operation, @@ -6783,18 +6781,14 @@ function formatURL(aFormat, aIsPref) { */ var gBookmarkAllTabsHandler = { init: function () { - Services.obs.addObserver(this, "tab-visibility-change", false); - this._command = document.getElementById("Browser:BookmarkAllTabs"); gBrowser.tabContainer.addEventListener("TabOpen", this, true); gBrowser.tabContainer.addEventListener("TabClose", this, true); + gBrowser.tabContainer.addEventListener("TabSelect", this, true); + gBrowser.tabContainer.addEventListener("TabMove", this, true); this._updateCommandState(); }, - uninit: function () { - Services.obs.removeObserver(this, "tab-visibility-change"); - }, - _updateCommandState: function BATH__updateCommandState(aTabClose) { let numTabs = gBrowser.visibleTabs.length; @@ -6815,12 +6809,7 @@ var gBookmarkAllTabsHandler = { // nsIDOMEventListener handleEvent: function(aEvent) { this._updateCommandState(aEvent.type == "TabClose"); - }, - - observe: function(subject, topic, data) { - if (topic == "tab-visibility-change" && subject == window) - this._updateCommandState(); - }, + } }; /** @@ -7864,3 +7853,4 @@ XPCOMUtils.defineLazyGetter(this, "HUDConsoleUI", function () { Components.utils.reportError(ex); } }); + diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index a0c0c4adbd4a..3f94e7a36d58 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -555,7 +555,7 @@ _startStalledTimer: function () { this._cancelStalledTimer(); - this._stalledTimer = setTimeout(function (self) { + this._stalledTimer = setTimeout(function (self) { self.mTab.setAttribute("stalled", "true"); }, 700, this); }, @@ -634,7 +634,7 @@ @@ -2726,7 +2725,7 @@ var tab = this._getDragTargetTab(event); if (window.getComputedStyle(this, null).direction == "ltr") { for (let i = tab ? tab._tPos : 0; i < tabs.length; i++) - if (event.screenX < tabs[i].boxObject.screenX + tabs[i].boxObject.width / 2) + if (event.screenX < tabs[i].boxObject.screenX + tabs[i].boxObject.width / 2) return i; } else { for (let i = tab ? tab._tPos : 0; i < tabs.length; i++) @@ -2961,7 +2960,7 @@ var scrollRect = tabStrip.scrollClientRect; var rect = this.getBoundingClientRect(); var minMargin = scrollRect.left - rect.left; - var maxMargin = Math.min(minMargin + scrollRect.width, + var maxMargin = Math.min(minMargin + scrollRect.width, scrollRect.right); if (!ltr) [minMargin, maxMargin] = [this.clientWidth - maxMargin, @@ -3342,7 +3341,7 @@ var curTabBO = this.childNodes[i].tab.boxObject; if (curTabBO.screenX >= tabstripBO.screenX && curTabBO.screenX + curTabBO.width <= tabstripBO.screenX + tabstripBO.width) - this.childNodes[i].setAttribute("tabIsVisible", "true"); + this.childNodes[i].setAttribute("tabIsVisible", "true"); else this.childNodes[i].removeAttribute("tabIsVisible"); } @@ -3353,7 +3352,7 @@