From e820a765e415ea5a245b108437c510ad138a00c6 Mon Sep 17 00:00:00 2001 From: "harishd%netscape.com" Date: Wed, 18 Oct 2000 23:19:14 +0000 Subject: [PATCH] Checking in for Rickg 42525 - Make Transitional doctype, greater that 4.0, with URI, strict r=me,attinasi sr=buster --- htmlparser/src/nsParser.cpp | 26 ++++++++++++++++++++------ parser/htmlparser/src/nsParser.cpp | 26 ++++++++++++++++++++------ 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/htmlparser/src/nsParser.cpp b/htmlparser/src/nsParser.cpp index 70c250577d5..e60264c3346 100644 --- a/htmlparser/src/nsParser.cpp +++ b/htmlparser/src/nsParser.cpp @@ -631,6 +631,7 @@ PRBool IsLoosePI(nsString& aBuffer,PRInt32 anOffset,PRInt32 aCount) { return result; } + /** * This is called when it's time to find out * what mode the parser/DTD should run for this document. @@ -699,6 +700,9 @@ void DetermineParseMode(nsString& aBuffer,nsDTDMode& aParseMode,eParserDocType& PRInt32 theLTPos=aBuffer.FindChar(kLessThan,PR_FALSE,theOffset); PRInt32 theGTPos=aBuffer.FindChar(kGreaterThan,PR_FALSE,theOffset); + PRInt32 theMajorVersion=3; + PRInt32 theMinorVersion=0; + if((kNotFound!=theGTPos) && (kNotFound!=theLTPos)) { const PRUnichar* theBuffer=aBuffer.GetUnicode(); @@ -772,7 +776,6 @@ void DetermineParseMode(nsString& aBuffer,nsDTDMode& aParseMode,eParserDocType& //and now check the version number... PRInt32 theVersionPos=aBuffer.FindCharInSet("1234567890",theMLTagPos); - PRInt32 theMajorVersion=3; if((0<=theVersionPos) && (theVersionPos", + //here are the XHTML doctypes we'll treat accordingly... "", @@ -1242,7 +1254,6 @@ static const char* doctypes[] = { //here are a few HTML doctypes we'll treat as strict... - "", "", "", "", @@ -1265,7 +1276,6 @@ static const char* doctypes[] = { //these we treat as transitional (unless it's disabled)... "", - "", "", "", "", @@ -1278,6 +1288,10 @@ static const char* doctypes[] = { //these we treat as compatible with quirks... (along with any other we encounter)... + "", + "", + + "", "", "", "", diff --git a/parser/htmlparser/src/nsParser.cpp b/parser/htmlparser/src/nsParser.cpp index 70c250577d5..e60264c3346 100644 --- a/parser/htmlparser/src/nsParser.cpp +++ b/parser/htmlparser/src/nsParser.cpp @@ -631,6 +631,7 @@ PRBool IsLoosePI(nsString& aBuffer,PRInt32 anOffset,PRInt32 aCount) { return result; } + /** * This is called when it's time to find out * what mode the parser/DTD should run for this document. @@ -699,6 +700,9 @@ void DetermineParseMode(nsString& aBuffer,nsDTDMode& aParseMode,eParserDocType& PRInt32 theLTPos=aBuffer.FindChar(kLessThan,PR_FALSE,theOffset); PRInt32 theGTPos=aBuffer.FindChar(kGreaterThan,PR_FALSE,theOffset); + PRInt32 theMajorVersion=3; + PRInt32 theMinorVersion=0; + if((kNotFound!=theGTPos) && (kNotFound!=theLTPos)) { const PRUnichar* theBuffer=aBuffer.GetUnicode(); @@ -772,7 +776,6 @@ void DetermineParseMode(nsString& aBuffer,nsDTDMode& aParseMode,eParserDocType& //and now check the version number... PRInt32 theVersionPos=aBuffer.FindCharInSet("1234567890",theMLTagPos); - PRInt32 theMajorVersion=3; if((0<=theVersionPos) && (theVersionPos", + //here are the XHTML doctypes we'll treat accordingly... "", @@ -1242,7 +1254,6 @@ static const char* doctypes[] = { //here are a few HTML doctypes we'll treat as strict... - "", "", "", "", @@ -1265,7 +1276,6 @@ static const char* doctypes[] = { //these we treat as transitional (unless it's disabled)... "", - "", "", "", "", @@ -1278,6 +1288,10 @@ static const char* doctypes[] = { //these we treat as compatible with quirks... (along with any other we encounter)... + "", + "", + + "", "", "", "",