autogen content if onDataAvailable is never called

git-svn-id: svn://10.0.0.236/trunk@44446 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rickg%netscape.com
1999-08-25 03:47:37 +00:00
parent f27dfc377c
commit efdfeda5e1
2 changed files with 18 additions and 0 deletions

View File

@@ -1177,6 +1177,15 @@ nsresult nsParser::OnStopRequest(nsIChannel* channel, nsISupports* aContext,
nsresult nsParser::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
#endif
{
if(eOnStart==mParserContext->mStreamListenerState) {
//If you're here, then OnDataAvailable() never got called.
//Prior to necko, we never dealt with this case, but the problem may have existed.
//What we'll do (for now at least) is construct the worlds smallest HTML document.
nsAutoString temp("<BODY></BODY>");
mParserContext->mScanner->Append(temp);
nsresult result=ResumeParse(nsnull, PR_TRUE);
}
mParserContext->mStreamListenerState=eOnStop;
mStreamStatus=status;