From 61888f4746cb5aeb211ef87ef07b7713f22ce671 Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Wed, 22 Aug 2007 05:04:21 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20327604:=20Status=20bar=20message=20text?= =?UTF-8?q?=20persists=20when=20switching=20tabs=20while=20page=20is=20loa?= =?UTF-8?q?ding,=20patch=20by=20Simon=20B=EF=BF=BDnzli=20,=20r+a=3Dmconnor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- browser/base/content/tabbrowser.xml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index ef7f6ea8975..9797cddb352 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -295,6 +295,12 @@ mBlank: aStartsBlank, mLastURI: null, + // cache flags for correct status bar update after tab switching + mStateFlags: 0, + mStatus: 0, + mMessage: "", + mTotalProgress: 0, + onProgressChange : function (aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) @@ -308,6 +314,8 @@ aCurTotalProgress, aMaxTotalProgress); } } + + this.mTotalProgress = aMaxTotalProgress ? aCurTotalProgress / aMaxTotalProgress : 0; }, onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) @@ -377,6 +385,15 @@ p.onStateChange(aWebProgress, aRequest, aStateFlags, aStatus); } } + + if (aStateFlags & (nsIWebProgressListener.STATE_START | + nsIWebProgressListener.STATE_STOP)) { + // reset cached temporary values at beginning and end + this.mMessage = ""; + this.mTotalProgress = 0; + } + this.mStateFlags = aStateFlags; + this.mStatus = aStatus; }, onLocationChange : function(aWebProgress, aRequest, aLocation) @@ -410,6 +427,8 @@ p.onStatusChange(aWebProgress, aRequest, aStatus, aMessage); } } + + this.mMessage = aMessage; }, onSecurityChange : function(aWebProgress, aRequest, aState) @@ -690,6 +709,14 @@ p.onLocationChange(webProgress, null, loc); if (securityUI) p.onSecurityChange(webProgress, null, securityUI.state); + + // make sure that all status indicators are properly updated + if ("onUpdateCurrentBrowser" in p) { + var listener = this.mTabListeners[this.mTabContainer.selectedIndex] || null; + if (listener && listener.mStateFlags) + p.onUpdateCurrentBrowser(listener.mStateFlags, listener.mStatus, + listener.mMessage, listener.mTotalProgress); + } } }