Sync up the MIME type list in parser with what nsContentDLF has, and improve

the error handling for cases when a mismatch does happen.  Bug 306502,
r=mrbkap, sr=brendan


git-svn-id: svn://10.0.0.236/trunk@179398 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2005-08-31 17:33:54 +00:00
parent 1d2d5dce42
commit 0fc90867a3
4 changed files with 20 additions and 6 deletions

View File

@@ -1151,6 +1151,9 @@ void DetermineParseMode(const nsString& aBuffer,
} else if (aMimeType.EqualsLiteral(kPlainTextContentType) ||
aMimeType.EqualsLiteral(kTextCSSContentType) ||
aMimeType.EqualsLiteral(kApplicationJSContentType) ||
aMimeType.EqualsLiteral(kApplicationXJSContentType) ||
aMimeType.EqualsLiteral(kTextECMAScriptContentType) ||
aMimeType.EqualsLiteral(kApplicationECMAScriptContentType) ||
aMimeType.EqualsLiteral(kTextJSContentType)) {
aDocType = ePlainText;
aParseMode = eDTDMode_quirks;
@@ -2716,7 +2719,9 @@ nsresult nsParser::OnStopRequest(nsIRequest *request, nsISupports* aContext,
if (mParserFilter)
mParserFilter->Finish();
rv = ResumeParse(PR_TRUE, PR_TRUE);
if (NS_SUCCEEDED(rv)) {
rv = ResumeParse(PR_TRUE, PR_TRUE);
}
// If the parser isn't enabled, we don't finish parsing till
// it is reenabled.