diff --git a/toolkit/content/widgets/tabbox.xml b/toolkit/content/widgets/tabbox.xml index ad3ce3fe28f..4da9a5e28d7 100644 --- a/toolkit/content/widgets/tabbox.xml +++ b/toolkit/content/widgets/tabbox.xml @@ -11,7 +11,7 @@ - @@ -109,44 +109,72 @@ ]]> + + + + + + + var eventNode = this; + switch (this.getAttribute("eventnode")) { + case "parent": eventNode = this.parentNode; break; + case "window": eventNode = window; break; + case "document": eventNode = document; break; + } + eventNode; + + + + + + + + + + this._eventNode.addEventListener("keypress", this._keyEventHandler, false); + + + + this._eventNode.removeEventListener("keypress", this._keyEventHandler, false); + - - - - - - - - - - - - - - - - - - - 1) { - tabs[0].setAttribute("first-tab", "true"); - tabs[tabs.length - 1].setAttribute("last-tab", "true"); - } - else if (tabs.length == 1) - tabs[0].setAttribute("first-tab", "true"); - } - this.selectedItem = tabs[0]; + if (this.firstChild) + this.firstChild.setAttribute("first-tab", "true"); + if (this.lastChild) + this.lastChild.setAttribute("last-tab", "true"); + this.selectedIndex = 0; var o = this.getAttribute("orient"); if (!o) this.setAttribute("orient", "horizontal"); @@ -192,73 +213,70 @@ - - - = val ? null : tabs[val]; - if (tab) - this.selectedItem = tab; - return tab; - ]]> - - - - - + + + + + + + + + + + diff --git a/toolkit/content/widgets/tabbrowser.xml b/toolkit/content/widgets/tabbrowser.xml index 8f08239e29a..d4dfe5d4816 100644 --- a/toolkit/content/widgets/tabbrowser.xml +++ b/toolkit/content/widgets/tabbrowser.xml @@ -14,9 +14,9 @@ - The Original Code is this file as it was released on - March 28, 2001. - - - The Initial Developer of the Original Code is David Hyatt - - Portions created by David Hyatt are Copyright (C) 2001 - - David Hyatt. All Rights Reserved. + - The Initial Developer of the Original Code is Peter Annema. + - Portions created by Peter Annema are Copyright (C) 2001 + - Peter Annema. All Rights Reserved. - - Contributor(s): - David Hyatt (Original Author of ) @@ -51,7 +51,7 @@ - @@ -79,6 +79,7 @@ - + @@ -108,6 +109,10 @@ .getService(Components.interfaces.nsIPrefService) .getBranch(null); + + Components.classes["@mozilla.org/docshell/urifixup;1"] + .getService(Components.interfaces.nsIURIFixup); + document.getAnonymousNodes(this)[1] @@ -350,7 +355,7 @@ var newTitle = ""; var docTitle; if (this.docShell.contentViewer) - docTitle = this.contentDocument.title; + docTitle = this.contentTitle; if (docTitle) { newTitle += this.ownerDocument.documentElement.getAttribute("titlepreface"); @@ -383,23 +388,12 @@ if (this.mCurrentBrowser) this.mCurrentBrowser.setAttribute("type", "content"); - var updatePageReport = false; - if ((this.mCurrentBrowser.pageReport && !newBrowser.pageReport) || - (!this.mCurrentBrowser.pageReport && newBrowser.pageReport)) - updatePageReport = true; - newBrowser.setAttribute("type", "content-primary"); this.mCurrentBrowser = newBrowser; this.mCurrentTab = this.selectedTab; - if (updatePageReport) - this.mCurrentBrowser.updatePageReport(); - // Update the URL bar. var loc = this.mCurrentBrowser.currentURI; - if (!loc) - loc = ({ spec: "" }); - var webProgress = this.mCurrentBrowser.webProgress; var securityUI = this.mCurrentBrowser.securityUI; var i, p; @@ -552,18 +546,38 @@ index) newIndex = currentIndex-1; @@ -800,9 +811,6 @@ // clean up the before/afterselected attributes before removing the tab oldTab.selected = false; - // XXX browser's destructor isn't always called, so we force a cleanup ourselves - oldBrowser.destroy(); - this.mTabContainer.removeChild(oldTab); this.mPanelContainer.removeChild(oldBrowser); @@ -1096,10 +1104,6 @@ - - @@ -1148,6 +1152,10 @@ onget="return this.mCurrentBrowser.contentDocument;" readonly="true"/> + + @@ -1156,7 +1164,6 @@