new contentsink api's for kipp

This commit is contained in:
rickg
1998-05-07 21:11:07 +00:00
parent 26b1fc28bb
commit 6ac9607e07
18 changed files with 478 additions and 98 deletions
+9
View File
@@ -516,15 +516,19 @@ PRBool nsHTMLParser::Parse(nsIURL* aURL,eParseMode aMode){
mDTD->SetParser(this);
mTokenizer=new CTokenizer(aURL, theDelegate, mParseMode);
mSink->WillBuildModel();
#ifdef __INCREMENTAL
int iter=-1;
for(;;){
mSink->WillResume();
mTokenizer->TokenizeAvailable(++iter);
mSink->WillInterrupt();
}
#else
mTokenizer->Tokenize();
#endif
result=IterateTokens();
mSink->DidBuildModel();
}
return result;
}
@@ -541,6 +545,11 @@ PRBool nsHTMLParser::Parse(nsIURL* aURL,eParseMode aMode){
* @return PR_TRUE if parsing concluded successfully.
*/
PRBool nsHTMLParser::ResumeParse() {
mSink->WillResume();
int iter=0;
PRInt32 errcode=mTokenizer->TokenizeAvailable(iter);
if(kInterrupted==errcode)
mSink->WillInterrupt();
PRBool result=IterateTokens();
return result;
}