Fix for bug# 5682
This commit is contained in:
harishd%netscape.com 1999-06-10 23:22:37 +00:00
Родитель cedb446f6d
Коммит 1e5be5249e
2 изменённых файлов: 14 добавлений и 4 удалений

Просмотреть файл

@ -839,7 +839,7 @@ nsresult nsParser::ParseFragment(const nsString& aSourceBuffer,void* aKey,nsITag
nsresult nsParser::ResumeParse(nsIDTD* aDefaultDTD) { nsresult nsParser::ResumeParse(nsIDTD* aDefaultDTD) {
nsresult result=NS_OK; nsresult result=NS_OK;
if(mParserContext->mParserEnabled) { if(mParserContext->mParserEnabled && !mParserContext->mParserTerminated) {
result=WillBuildModel(mParserContext->mScanner->GetFilename(),aDefaultDTD); result=WillBuildModel(mParserContext->mScanner->GetFilename(),aDefaultDTD);
if(mParserContext->mDTD) { if(mParserContext->mDTD) {
mParserContext->mDTD->WillResumeParse(); mParserContext->mDTD->WillResumeParse();
@ -848,7 +848,8 @@ nsresult nsParser::ResumeParse(nsIDTD* aDefaultDTD) {
result=Tokenize(); result=Tokenize();
result=BuildModel(); result=BuildModel();
if((!mParserContext->mMultipart) || ((eOnStop==mParserContext->mStreamListenerState) && (NS_OK==result))){ if((!mParserContext->mMultipart) || (mParserContext->mParserTerminated) ||
((eOnStop==mParserContext->mStreamListenerState) && (NS_OK==result))){
DidBuildModel(mStreamStatus); DidBuildModel(mStreamStatus);
} }
else { else {
@ -899,6 +900,8 @@ nsresult nsParser::BuildModel() {
nsIDTD* theRootDTD=theRootContext->mDTD; nsIDTD* theRootDTD=theRootContext->mDTD;
if(theRootDTD) { if(theRootDTD) {
result=theRootDTD->BuildModel(this,theTokenizer,mTokenObserver,mSink); result=theRootDTD->BuildModel(this,theTokenizer,mTokenObserver,mSink);
if(NS_ERROR_HTMLPARSER_STOPPARSING==result)
mParserContext->mParserTerminated=PR_TRUE;
} }
} }
else{ else{
@ -1149,6 +1152,8 @@ nsresult nsParser::Tokenize(){
result=NS_OK; result=NS_OK;
break; break;
} }
else if(NS_ERROR_HTMLPARSER_STOPPARSING==result)
mParserContext->mParserTerminated=PR_TRUE;
} }
} }
DidTokenize(); DidTokenize();

Просмотреть файл

@ -839,7 +839,7 @@ nsresult nsParser::ParseFragment(const nsString& aSourceBuffer,void* aKey,nsITag
nsresult nsParser::ResumeParse(nsIDTD* aDefaultDTD) { nsresult nsParser::ResumeParse(nsIDTD* aDefaultDTD) {
nsresult result=NS_OK; nsresult result=NS_OK;
if(mParserContext->mParserEnabled) { if(mParserContext->mParserEnabled && !mParserContext->mParserTerminated) {
result=WillBuildModel(mParserContext->mScanner->GetFilename(),aDefaultDTD); result=WillBuildModel(mParserContext->mScanner->GetFilename(),aDefaultDTD);
if(mParserContext->mDTD) { if(mParserContext->mDTD) {
mParserContext->mDTD->WillResumeParse(); mParserContext->mDTD->WillResumeParse();
@ -848,7 +848,8 @@ nsresult nsParser::ResumeParse(nsIDTD* aDefaultDTD) {
result=Tokenize(); result=Tokenize();
result=BuildModel(); result=BuildModel();
if((!mParserContext->mMultipart) || ((eOnStop==mParserContext->mStreamListenerState) && (NS_OK==result))){ if((!mParserContext->mMultipart) || (mParserContext->mParserTerminated) ||
((eOnStop==mParserContext->mStreamListenerState) && (NS_OK==result))){
DidBuildModel(mStreamStatus); DidBuildModel(mStreamStatus);
} }
else { else {
@ -899,6 +900,8 @@ nsresult nsParser::BuildModel() {
nsIDTD* theRootDTD=theRootContext->mDTD; nsIDTD* theRootDTD=theRootContext->mDTD;
if(theRootDTD) { if(theRootDTD) {
result=theRootDTD->BuildModel(this,theTokenizer,mTokenObserver,mSink); result=theRootDTD->BuildModel(this,theTokenizer,mTokenObserver,mSink);
if(NS_ERROR_HTMLPARSER_STOPPARSING==result)
mParserContext->mParserTerminated=PR_TRUE;
} }
} }
else{ else{
@ -1149,6 +1152,8 @@ nsresult nsParser::Tokenize(){
result=NS_OK; result=NS_OK;
break; break;
} }
else if(NS_ERROR_HTMLPARSER_STOPPARSING==result)
mParserContext->mParserTerminated=PR_TRUE;
} }
} }
DidTokenize(); DidTokenize();