diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 70f7861b40e..5c9ed43f70a 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -43,6 +43,8 @@ %tabBrowserDTD; + +%globalDTD; ]> - + @@ -90,8 +92,7 @@ tabbrowser.removeTab(tabbrowser.mContextTab);"/> - + + + + + + 1 false/true NO + var owner = (aURIs.length > 1) || aLoadInBackground ? null : gBrowser.selectedTab; + var firstTabAdded = null; + if (aReplace) + this.loadURI(aURIs[0], null, null); + else + firstTabAdded = gBrowser.addTab(aURIs[0], null, null, null, owner); + + for (var i = 1; i < aURIs.length; ++i) + gBrowser.addTab(aURIs[i]); + if (!aLoadInBackground) { + if (firstTabAdded) { + // .selectedTab setter focuses the content area + this.selectedTab = firstTabAdded; + } + else + window.content.focus(); + } + ]]> + + + + + + + + + @@ -1255,15 +1326,32 @@ newIndex = currentIndex-1; else if (currentIndex < index) newIndex = currentIndex; - else if (index == l - 1) - newIndex = index-1; - else - newIndex = index; + else { + if ("owner" in aTab && aTab.owner && + this.mPrefs.getBoolPref("browser.tabs.selectOwnerOnClose")) { + for (i = 0; i < this.mTabContainer.childNodes.length; ++i) { + var tab = this.mTabContainer.childNodes[i]; + if (tab == aTab.owner) { + newIndex = i; + break; + } + } + } + if (newIndex == -1) + newIndex = (index == l - 1) ? index - 1 : index; + } var oldTab = aTab; // clean up the before/afterselected attributes before removing the tab oldTab.selected = false; + + // Remove this tab as the owner of any other tabs, since it's going away. + for (i = 0; i < this.mTabContainer.childNodes.length; ++i) { + tab = this.mTabContainer.childNodes[i]; + if (tab.owner == oldTab) + tab.owner = null; + } // Because of the way XBL works (fields just set JS // properties on the element) and the code we have in place @@ -1339,7 +1427,7 @@ ]]> - + @@ -1456,7 +1544,8 @@ + + + + + + + + + + + + + + + + + + var pb2 = + Components.classes['@mozilla.org/preferences-service;1']. + getService(Components.interfaces.nsIPrefBranch2); + try { + this.mTabClipWidth = pb2.getIntPref("browser.tabs.tabClipWidth"); + } + catch (e) { + } + + this._updateDisableBackgroundClose(); + pb2.addObserver("browser.tabs.disableBackgroundClose", this, false); + + var self = this; + function onResize() { + self.adjustCloseButtons(1); + } + window.addEventListener("resize", onResize, false); + + + + var pb2 = + Components.classes["@mozilla.org/preferences-service;1"]. + getService(Components.interfaces.nsIPrefBranch2); + pb2.removeObserver("browser.tabs.disableBackgroundClose", this); + + + + + + + + + + + + 140 + + + this.mTabClipWidth || width == 0) + this.removeAttribute("tiny"); + else + this.setAttribute("tiny", "true"); + } + catch (e) { + } + ]]> + + + + + + + + + + + + + + + + + + + + false + + + + + var anonid = event.originalTarget.getAttribute("anonid"); + if (anonid == "close-button") + this.mOverCloseButton = true; + + + var anonid = event.originalTarget.getAttribute("anonid"); + if (anonid == "close-button") + this.mOverCloseButton = false; + + + + + + + + + diff --git a/browser/themes/pinstripe/browser/tabbrowser/tabbrowserBindings.xml b/browser/themes/pinstripe/browser/tabbrowser/tabbrowserBindings.xml index ce85c5e348f..343b1ae73b1 100644 --- a/browser/themes/pinstripe/browser/tabbrowser/tabbrowserBindings.xml +++ b/browser/themes/pinstripe/browser/tabbrowser/tabbrowserBindings.xml @@ -5,17 +5,18 @@ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:xbl="http://www.mozilla.org/xbl"> - + + + + + - - - - - - + + + @@ -37,8 +38,8 @@ - + @@ -54,12 +55,6 @@ - - - - - -