From ebd8214caecbe896dbd362360043e51cdd951c30 Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Wed, 2 Dec 1998 00:29:31 +0000 Subject: [PATCH] Allow nsWellFormedDTD to handle text/rdf. git-svn-id: svn://10.0.0.236/trunk@15571 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/htmlparser/src/nsWellFormedDTD.cpp | 7 +++++-- mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mozilla/htmlparser/src/nsWellFormedDTD.cpp b/mozilla/htmlparser/src/nsWellFormedDTD.cpp index 8f89f460699..9bd96e08e2a 100644 --- a/mozilla/htmlparser/src/nsWellFormedDTD.cpp +++ b/mozilla/htmlparser/src/nsWellFormedDTD.cpp @@ -57,6 +57,7 @@ static NS_DEFINE_IID(kClassIID, NS_WELLFORMED_DTD_IID); //static const char* kNullToken = "Error: Null token given"; //static const char* kInvalidTagStackPos = "Error: invalid tag stack position"; static const char* kXMLTextContentType = "text/xml"; +static const char* kRDFTextContentType = "text/rdf"; static const char* kViewSourceCommand= "view-source"; static nsAutoString gEmpty; @@ -171,7 +172,8 @@ nsresult CWellFormedDTD::CreateNewInstance(nsIDTD** aInstancePtrResult){ PRBool CWellFormedDTD::CanParse(nsString& aContentType, nsString& aCommand, PRInt32 aVersion){ PRBool result=PR_FALSE; if(!aCommand.Equals(kViewSourceCommand)) { - result=aContentType.Equals(kXMLTextContentType); + result=(aContentType.Equals(kXMLTextContentType) || + aContentType.Equals(kRDFTextContentType)); } return result; } @@ -185,7 +187,8 @@ PRBool CWellFormedDTD::CanParse(nsString& aContentType, nsString& aCommand, PRIn */ eAutoDetectResult CWellFormedDTD::AutoDetectContentType(nsString& aBuffer,nsString& aType){ eAutoDetectResult result=eUnknownDetect; - if(PR_TRUE==aType.Equals(kXMLTextContentType)) + if(PR_TRUE==aType.Equals(kXMLTextContentType) || + PR_TRUE==aType.Equals(kRDFTextContentType)) result=eValidDetect; return result; } diff --git a/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp b/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp index 8f89f460699..9bd96e08e2a 100644 --- a/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp +++ b/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp @@ -57,6 +57,7 @@ static NS_DEFINE_IID(kClassIID, NS_WELLFORMED_DTD_IID); //static const char* kNullToken = "Error: Null token given"; //static const char* kInvalidTagStackPos = "Error: invalid tag stack position"; static const char* kXMLTextContentType = "text/xml"; +static const char* kRDFTextContentType = "text/rdf"; static const char* kViewSourceCommand= "view-source"; static nsAutoString gEmpty; @@ -171,7 +172,8 @@ nsresult CWellFormedDTD::CreateNewInstance(nsIDTD** aInstancePtrResult){ PRBool CWellFormedDTD::CanParse(nsString& aContentType, nsString& aCommand, PRInt32 aVersion){ PRBool result=PR_FALSE; if(!aCommand.Equals(kViewSourceCommand)) { - result=aContentType.Equals(kXMLTextContentType); + result=(aContentType.Equals(kXMLTextContentType) || + aContentType.Equals(kRDFTextContentType)); } return result; } @@ -185,7 +187,8 @@ PRBool CWellFormedDTD::CanParse(nsString& aContentType, nsString& aCommand, PRIn */ eAutoDetectResult CWellFormedDTD::AutoDetectContentType(nsString& aBuffer,nsString& aType){ eAutoDetectResult result=eUnknownDetect; - if(PR_TRUE==aType.Equals(kXMLTextContentType)) + if(PR_TRUE==aType.Equals(kXMLTextContentType) || + PR_TRUE==aType.Equals(kRDFTextContentType)) result=eValidDetect; return result; }