diff --git a/mozilla/browser/base/content/tabbrowser.xml b/mozilla/browser/base/content/tabbrowser.xml index 23b2e19bb43..a04950a0375 100644 --- a/mozilla/browser/base/content/tabbrowser.xml +++ b/mozilla/browser/base/content/tabbrowser.xml @@ -280,7 +280,6 @@ mTab: aTab, mBrowser: aBrowser, mBlank: aStartsBlank, - mIcon: null, mLastURI: null, onProgressChange : function (aWebProgress, aRequest, @@ -308,9 +307,6 @@ const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; - if (aStateFlags & nsIWebProgressListener.STATE_START) - this.mBrowser.mFavIconURL = null; - if (aStateFlags & nsIWebProgressListener.STATE_START && aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { // It's okay to clear what the user typed when we start @@ -323,9 +319,8 @@ if (!this.mBlank) { this.mTab.setAttribute("busy", "true"); + this.mTabBrowser.updateIcon(this.mTab); this.mTab.label = this.mTabBrowser.mStringBundle.getString("tabs.loading"); - this.mTab.removeAttribute("image"); - this.mIcon = null; if (this.mTabBrowser.mCurrentTab == this.mTab) this.mTabBrowser.mIsBusy = true; @@ -333,15 +328,20 @@ } else if (aStateFlags & nsIWebProgressListener.STATE_STOP && aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { - // The document is done loading, it's okay to clear - // the value again. - if (aWebProgress.DOMWindow == this.mBrowser.contentWindow) + if (aWebProgress.DOMWindow == this.mBrowser.contentWindow) { + // The document is done loading, it's okay to clear + // the value again. this.mBrowser.userTypedClear = false; + if (!this.mBrowser.mIconURL) + this.mTabBrowser.useDefaultIcon(this.mTab); + } + if (this.mBlank) this.mBlank = false; this.mTab.removeAttribute("busy"); + this.mTabBrowser.updateIcon(this.mTab); var location = aRequest.QueryInterface(nsIChannel).URI; @@ -349,13 +349,6 @@ if (location.scheme == "keyword") this.mBrowser.userTypedValue = null; - if (this.mTabBrowser.shouldLoadFavIcon(location)) { - if (this.mIcon) - this.mTab.setAttribute("image", this.mIcon); - else - this.mTabBrowser.loadFavIcon(location, "image", this.mTab); - } - if (this.mTab.label == this.mTabBrowser.mStringBundle.getString("tabs.loading")) this.mTabBrowser.setTabTitle(this.mTab); @@ -378,6 +371,9 @@ if (this.mBrowser.userTypedClear) this.mBrowser.userTypedValue = null; + if (aWebProgress.DOMWindow == this.mBrowser.contentWindow) + this.mTabBrowser.setIcon(this.mTab, null); + if (!this.mBlank && this.mTabBrowser.mCurrentTab == this.mTab) { for (var i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) { var p = this.mTabBrowser.mProgressListeners[i]; @@ -412,13 +408,6 @@ } }, - setIcon : function(aURI) - { - this.mIcon = aURI; - if (!this.mTab.hasAttribute("busy")) - this.mTab.setAttribute("image", aURI); - }, - QueryInterface : function(aIID) { if (aIID.equals(Components.interfaces.nsIWebProgressListener) || @@ -432,12 +421,34 @@ - + + + + + + + + + @@ -453,19 +464,20 @@ - - - - + + @@ -508,7 +520,7 @@ - + @@ -923,11 +910,7 @@ this.mCurrentBrowser.addEventListener("DOMTitleChanged", this.onTitleChanged, false); this.setTabTitle(this.mCurrentTab); - - // Hook up our favicon. - var uri = this.mCurrentBrowser.currentURI; - if (this.shouldLoadFavIcon(uri)) - this.loadFavIcon(uri, "image", this.mCurrentTab); + this.setIcon(this.mCurrentTab, this.mCurrentBrowser.mIconURL); var filter; if (this.mTabFilters.length > 0) {