Bug 384898: Cleanup nsScanner. r=mrbkap, sr=jst
git-svn-id: svn://10.0.0.236/trunk@228788 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1280,43 +1280,6 @@ nsParser::Parse(nsIURI* aURL,
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cause parser to parse input from given stream
|
||||
*/
|
||||
NS_IMETHODIMP
|
||||
nsParser::Parse(nsIInputStream* aStream,
|
||||
const nsACString& aMimeType,
|
||||
void* aKey,
|
||||
nsDTDMode aMode)
|
||||
{
|
||||
nsresult result = NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
// Ok, time to create our tokenizer and begin the process
|
||||
nsAutoString theUnknownFilename(NS_LITERAL_STRING("unknown"));
|
||||
|
||||
nsScanner* theScanner = new nsScanner(theUnknownFilename, aStream, mCharset,
|
||||
mCharsetSource);
|
||||
|
||||
CParserContext* pc = new CParserContext(theScanner, aKey, mCommand, 0);
|
||||
if (pc && theScanner) {
|
||||
PushContext(*pc);
|
||||
pc->SetMimeType(aMimeType);
|
||||
pc->mStreamListenerState = eOnStart;
|
||||
pc->mMultipart = PR_FALSE;
|
||||
pc->mContextType = CParserContext::eCTStream;
|
||||
pc->mDTDMode = aMode;
|
||||
mParserContext->mScanner->FillBuffer();
|
||||
result = ResumeParse();
|
||||
pc = PopContext();
|
||||
delete pc;
|
||||
} else {
|
||||
result = mInternalState = NS_ERROR_HTMLPARSER_BADCONTEXT;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method if all you want to do is parse 1 string full of HTML text.
|
||||
* In particular, this method should be called by the DOM when it has an HTML
|
||||
|
||||
Reference in New Issue
Block a user