From efdfeda5e1feb95da4be7013d53f9a9fd8653ae1 Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Wed, 25 Aug 1999 03:47:37 +0000 Subject: [PATCH] autogen content if onDataAvailable is never called git-svn-id: svn://10.0.0.236/trunk@44446 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/htmlparser/src/nsParser.cpp | 9 +++++++++ mozilla/parser/htmlparser/src/nsParser.cpp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/mozilla/htmlparser/src/nsParser.cpp b/mozilla/htmlparser/src/nsParser.cpp index 847d375a89d..a54138067bd 100644 --- a/mozilla/htmlparser/src/nsParser.cpp +++ b/mozilla/htmlparser/src/nsParser.cpp @@ -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(""); + mParserContext->mScanner->Append(temp); + nsresult result=ResumeParse(nsnull, PR_TRUE); + } + mParserContext->mStreamListenerState=eOnStop; mStreamStatus=status; diff --git a/mozilla/parser/htmlparser/src/nsParser.cpp b/mozilla/parser/htmlparser/src/nsParser.cpp index 847d375a89d..a54138067bd 100644 --- a/mozilla/parser/htmlparser/src/nsParser.cpp +++ b/mozilla/parser/htmlparser/src/nsParser.cpp @@ -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(""); + mParserContext->mScanner->Append(temp); + nsresult result=ResumeParse(nsnull, PR_TRUE); + } + mParserContext->mStreamListenerState=eOnStop; mStreamStatus=status;