fix for bug 132681

r=harishd, sr=jst, a=scc
performance fix - stop scanning files that are known to be XML for html-like text


git-svn-id: svn://10.0.0.236/trunk@117373 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
alecf%netscape.com
2002-03-24 17:16:44 +00:00
parent d988f6df1d
commit 9f32fc6e9c
2 changed files with 22 additions and 2 deletions

View File

@@ -341,7 +341,17 @@ CNavDTD::CanParse(CParserContext& aParserContext,
}
else if(PR_TRUE==aParserContext.mMimeType.Equals(NS_LITERAL_CSTRING(kTextJSContentType))) {
result=ePrimaryDetect;
}
}
// do this for XML-based content-types so that we don't fall back
// to BufferContainsHTML() for known content types
// see bug 132681
// this will be cleaned up after moz 1.0 -alecf
else if (aParserContext.mMimeType.Equals(NS_LITERAL_CSTRING(kRDFTextContentType)) ||
aParserContext.mMimeType.Equals(NS_LITERAL_CSTRING(kXULTextContentType)) ||
aParserContext.mMimeType.Equals(NS_LITERAL_CSTRING(kXMLTextContentType)) ||
aParserContext.mMimeType.Equals(NS_LITERAL_CSTRING(kXMLApplicationContentType))) {
result=eUnknownDetect;
}
else {
//otherwise, look into the buffer to see if you recognize anything...
PRBool theBufHasXML=PR_FALSE;

View File

@@ -341,7 +341,17 @@ CNavDTD::CanParse(CParserContext& aParserContext,
}
else if(PR_TRUE==aParserContext.mMimeType.Equals(NS_LITERAL_CSTRING(kTextJSContentType))) {
result=ePrimaryDetect;
}
}
// do this for XML-based content-types so that we don't fall back
// to BufferContainsHTML() for known content types
// see bug 132681
// this will be cleaned up after moz 1.0 -alecf
else if (aParserContext.mMimeType.Equals(NS_LITERAL_CSTRING(kRDFTextContentType)) ||
aParserContext.mMimeType.Equals(NS_LITERAL_CSTRING(kXULTextContentType)) ||
aParserContext.mMimeType.Equals(NS_LITERAL_CSTRING(kXMLTextContentType)) ||
aParserContext.mMimeType.Equals(NS_LITERAL_CSTRING(kXMLApplicationContentType))) {
result=eUnknownDetect;
}
else {
//otherwise, look into the buffer to see if you recognize anything...
PRBool theBufHasXML=PR_FALSE;