assertions for bug 1375 and better autodetection code

git-svn-id: svn://10.0.0.236/trunk@15102 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rickg%netscape.com
1998-11-21 07:48:49 +00:00
parent 3ed308bf62
commit 2954c4d855
10 changed files with 112 additions and 12 deletions

View File

@@ -227,10 +227,10 @@ PRBool CViewSourceHTML::CanParse(nsString& aContentType, nsString& aCommand, PRI
/**
*
* @update gess7/7/98
* This is called to ask the DTD if it recognizes either the aType or data in the buffer.
* @update gess7/7/98
* @param
* @return
* @return detect result
*/
eAutoDetectResult CViewSourceHTML::AutoDetectContentType(nsString& aBuffer,nsString& aType){
eAutoDetectResult result=eUnknownDetect;
@@ -238,9 +238,18 @@ eAutoDetectResult CViewSourceHTML::AutoDetectContentType(nsString& aBuffer,nsStr
result=eValidDetect;
else if(PR_TRUE==aType.Equals(kXMLTextContentType))
result=eValidDetect;
else {
//otherwise, look into the buffer to see if you recognize anything...
if(BufferContainsHTML(aBuffer)){
result=eValidDetect;
if(0==aType.Length())
aType=kHTMLTextContentType;
}
}
return result;
}
/**
*
* @update gess5/18/98