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
This commit is contained in:
mscott%netscape.com
2000-12-19 22:07:58 +00:00
parent 5811dd1c0b
commit 3d4b1daba2

View File

@@ -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<nsIChannel> 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;
}