209330 Use the real progress when no document is loading, to ensure that state

changes are sent when necessary
r=darin sr=jst a=brendan
This commit is contained in:
cbiesinger%web.de 2005-04-20 17:14:48 +00:00
Родитель d940f877c4
Коммит e5d73d5ca5
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -127,6 +127,7 @@ nsBrowserStatusFilter::OnStateChange(nsIWebProgress *aWebProgress,
mTotalRequests = 0;
mFinishedRequests = 0;
mUseRealProgressFlag = PR_FALSE;
mIsLoadingDocument = PR_TRUE;
}
if (aStateFlags & STATE_IS_REQUEST) {
++mTotalRequests;
@ -134,10 +135,16 @@ nsBrowserStatusFilter::OnStateChange(nsIWebProgress *aWebProgress,
// if the total requests exceeds 1, then we'll base our progress
// notifications on the percentage of completed requests.
// otherwise, progress for the single request will be reported.
mUseRealProgressFlag = (mTotalRequests == 1);
// But if we're not loading a document, we must be sure to deliver
// OnStateChange for STATE_STOP correctly: use the real progress in
// such cases
mUseRealProgressFlag = (mTotalRequests == 1) || !mIsLoadingDocument;
}
}
else if (aStateFlags & STATE_STOP) {
if (aStateFlags & STATE_IS_NETWORK) {
mIsLoadingDocument = PR_FALSE;
}
if (aStateFlags & STATE_IS_REQUEST) {
++mFinishedRequests;
if (!mUseRealProgressFlag && mTotalRequests)

Просмотреть файл

@ -87,6 +87,9 @@ private:
// indicates whether a timeout is pending
PRPackedBool mDelayedStatus;
PRPackedBool mDelayedProgress;
// indicates whether a document is currently loading
PRPackedBool mIsLoadingDocument;
};
#define NS_BROWSERSTATUSFILTER_CLASSNAME \