From 3d4b1daba213abe942a39d0c964a0a18ed8b1938 Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Tue, 19 Dec 2000 22:07:58 +0000 Subject: [PATCH] Bug #59827 --> pass the redirect flag up via a OnStatechange if we get a redirect. Also set the is document flag if the original channel matches mDocumentChannel. sr=rpotts git-svn-id: svn://10.0.0.236/trunk@83865 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/uriloader/base/nsDocLoader.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/mozilla/uriloader/base/nsDocLoader.cpp b/mozilla/uriloader/base/nsDocLoader.cpp index 55db1607c3b..558086ea710 100644 --- a/mozilla/uriloader/base/nsDocLoader.cpp +++ b/mozilla/uriloader/base/nsDocLoader.cpp @@ -1432,7 +1432,26 @@ NS_IMETHODIMP nsDocLoaderImpl::OnRedirect(nsISupports * aContext, nsIURI * aNewL // part of the document (like an image). Proper implementation requires this, otherwise // we end up setting the url bar location to a redirected image url when we didn't want to. // for now, we'll make the implementation empty. - return NS_OK; + + if (aContext) + { + PRInt32 stateFlags = nsIWebProgressListener::STATE_REDIRECTING | + nsIWebProgressListener::STATE_IS_REQUEST | + nsIWebProgressListener::STATE_IS_NETWORK; + nsCOMPtr channel (do_QueryInterface(aContext)); + // if the current channel == the document channel (then we must be getting a redirect on the + // actual document and not a part in the document so be sure to set the state is document flag + // and to reset mDocumentChannel... + if (channel.get() == mDocumentChannel.get()) + { + stateFlags |= nsIWebProgressListener::STATE_IS_DOCUMENT; + mDocumentChannel = channel; // reset the document channel + } + + FireOnStateChange(this, channel, stateFlags, NS_OK); + } + + return NS_OK; }