Fix a crash when interrupting a page load

git-svn-id: svn://10.0.0.236/trunk@20238 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pierre%netscape.com
1999-02-10 09:12:48 +00:00
parent a1f45d1784
commit 091d8a00a7
2 changed files with 40 additions and 36 deletions

View File

@@ -702,26 +702,28 @@ nsresult nsParser::ResumeParse(nsIDTD* aDefaultDTD) {
nsresult result=NS_OK;
if(mParserContext->mParserEnabled) {
result=WillBuildModel(mParserContext->mScanner->GetFilename(),aDefaultDTD);
mParserContext->mDTD->WillResumeParse();
if(NS_OK==result) {
result=Tokenize();
result=BuildModel();
if (mParserContext->mDTD) {
mParserContext->mDTD->WillResumeParse();
if(NS_OK==result) {
result=Tokenize();
result=BuildModel();
if((!mParserContext->mMultipart) || ((eOnStop==mParserContext->mStreamListenerState) && (NS_OK==result))){
DidBuildModel(mStreamStatus);
}
else {
mParserContext->mDTD->WillInterruptParse();
// If we're told to block the parser, we disable
// all further parsing (and cache any data coming
// in) until the parser is enabled.
PRUint32 b1=NS_ERROR_HTMLPARSER_BLOCK;
if(NS_ERROR_HTMLPARSER_BLOCK==result) {
EnableParser(PR_FALSE);
result=NS_OK;
if((!mParserContext->mMultipart) || ((eOnStop==mParserContext->mStreamListenerState) && (NS_OK==result))){
DidBuildModel(mStreamStatus);
}
}//if
else {
mParserContext->mDTD->WillInterruptParse();
// If we're told to block the parser, we disable
// all further parsing (and cache any data coming
// in) until the parser is enabled.
PRUint32 b1=NS_ERROR_HTMLPARSER_BLOCK;
if(NS_ERROR_HTMLPARSER_BLOCK==result) {
EnableParser(PR_FALSE);
result=NS_OK;
}
}//if
}//if
}//if
}//if
return result;