new primaryDetect code in DTD detection system; fixes XIF

git-svn-id: svn://10.0.0.236/trunk@21236 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rickg%netscape.com
1999-02-18 23:45:44 +00:00
parent 67e1d76bc2
commit 7d4f2c2c76
36 changed files with 252 additions and 650 deletions

View File

@@ -227,30 +227,17 @@ nsresult CViewSourceHTML::CreateNewInstance(nsIDTD** aInstancePtrResult){
* @param
* @return TRUE if this DTD can satisfy the request; FALSE otherwise.
*/
PRBool CViewSourceHTML::CanParse(nsString& aContentType, nsString& aCommand, PRInt32 aVersion){
PRBool result=PR_FALSE;
if(aCommand.Equals(kViewSourceCommand)) {
result=(aContentType.Equals(kXMLTextContentType) ||
aContentType.Equals(kRDFTextContentType) ||
aContentType.Equals(kHTMLTextContentType) ||
aContentType.Equals(kPlainTextContentType) ||
aContentType.Equals(kXULTextContentType));
}
return result;
}
/**
* This is called to ask the DTD if it recognizes either the aType or data in the buffer.
* We intentionally say NO to autodetect types so that XML and HTML dtds can do the right thing.
* If either of those DTD's say YES, then we'll agree and render either.
*
* @update gess7/7/98
* @param
* @return detect result
*/
eAutoDetectResult CViewSourceHTML::AutoDetectContentType(nsString& aBuffer,nsString& aType){
eAutoDetectResult CViewSourceHTML::CanParse(nsString& aContentType, nsString& aCommand, nsString& aBuffer, PRInt32 aVersion) {
eAutoDetectResult result=eUnknownDetect;
if(aCommand.Equals(kViewSourceCommand)) {
if(aContentType.Equals(kXMLTextContentType) ||
aContentType.Equals(kRDFTextContentType) ||
aContentType.Equals(kHTMLTextContentType) ||
aContentType.Equals(kPlainTextContentType) ||
aContentType.Equals(kXULTextContentType)) {
result=eValidDetect;
}
}
return result;
}
@@ -503,7 +490,7 @@ nsresult WriteNBSP(PRInt32 aCount, nsIContentSink& aSink) {
* @param
* @return result status
*/
nsresult CViewSourceHTML::WriteText(nsString& aTextString,nsIContentSink& aSink,PRBool aPreserveSpace) {
nsresult CViewSourceHTML::WriteText(const nsString& aTextString,nsIContentSink& aSink,PRBool aPreserveSpace) {
nsresult result=NS_OK;
CTextToken theTextToken;