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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user