mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Hooking up ISO doctypes [ These are mapped to strict DTD ].
This commit is contained in:
parent
3bfa9ab2b4
commit
085c53756c
@ -445,14 +445,14 @@ eParseMode DetermineParseMode(nsParser& aParser) {
|
||||
nsString& theBuffer=theScanner->GetBuffer();
|
||||
theBuffer.Left(theBufCopy,125);
|
||||
PRInt32 theIndex=theBufCopy.Find("<!");
|
||||
if(theIndex!=kNotFound)
|
||||
theIndex=theBufCopy.Find("DOCTYPE",PR_TRUE,2);
|
||||
theIndex=(theIndex!=kNotFound)? theIndex=theBufCopy.Find("DOCTYPE",PR_TRUE,2):kNotFound;
|
||||
|
||||
if(kNotFound<theIndex) {
|
||||
//good, we found "DOCTYPE" -- now go find it's end delimiter '>'
|
||||
theBufCopy.StripWhitespace();
|
||||
PRInt32 theSubIndex=theBufCopy.FindChar(kGreaterThan,theIndex+1);
|
||||
theBufCopy.Truncate(theSubIndex);
|
||||
theSubIndex=theBufCopy.Find("HTML 4.0",PR_TRUE,theIndex+8);
|
||||
theSubIndex=theBufCopy.Find("HTML4.0",PR_TRUE,theIndex+8);
|
||||
if(kNotFound<theSubIndex) {
|
||||
if(theBufCopy.Find("TRANSITIONAL",PR_TRUE,theSubIndex)>kNotFound)
|
||||
return eParseMode_navigator;
|
||||
@ -464,6 +464,13 @@ eParseMode DetermineParseMode(nsParser& aParser) {
|
||||
else
|
||||
return eParseMode_noquirks;
|
||||
}
|
||||
theSubIndex=theBufCopy.Find("ISO/IEC15445:1999",PR_TRUE,theIndex+8);
|
||||
if(kNotFound<theSubIndex) {
|
||||
theSubIndex=theBufCopy.Find("HTML",PR_TRUE,theSubIndex+18);
|
||||
if(kNotFound==theSubIndex)
|
||||
theSubIndex=theBufCopy.Find("HYPERTEXTMARKUPLANGUAGE",PR_TRUE,theSubIndex+18);
|
||||
return eParseMode_noquirks;
|
||||
}
|
||||
}
|
||||
|
||||
theIndex=theBufCopy.Find("NOQUIRKS",PR_TRUE);
|
||||
|
@ -445,14 +445,14 @@ eParseMode DetermineParseMode(nsParser& aParser) {
|
||||
nsString& theBuffer=theScanner->GetBuffer();
|
||||
theBuffer.Left(theBufCopy,125);
|
||||
PRInt32 theIndex=theBufCopy.Find("<!");
|
||||
if(theIndex!=kNotFound)
|
||||
theIndex=theBufCopy.Find("DOCTYPE",PR_TRUE,2);
|
||||
theIndex=(theIndex!=kNotFound)? theIndex=theBufCopy.Find("DOCTYPE",PR_TRUE,2):kNotFound;
|
||||
|
||||
if(kNotFound<theIndex) {
|
||||
//good, we found "DOCTYPE" -- now go find it's end delimiter '>'
|
||||
theBufCopy.StripWhitespace();
|
||||
PRInt32 theSubIndex=theBufCopy.FindChar(kGreaterThan,theIndex+1);
|
||||
theBufCopy.Truncate(theSubIndex);
|
||||
theSubIndex=theBufCopy.Find("HTML 4.0",PR_TRUE,theIndex+8);
|
||||
theSubIndex=theBufCopy.Find("HTML4.0",PR_TRUE,theIndex+8);
|
||||
if(kNotFound<theSubIndex) {
|
||||
if(theBufCopy.Find("TRANSITIONAL",PR_TRUE,theSubIndex)>kNotFound)
|
||||
return eParseMode_navigator;
|
||||
@ -464,6 +464,13 @@ eParseMode DetermineParseMode(nsParser& aParser) {
|
||||
else
|
||||
return eParseMode_noquirks;
|
||||
}
|
||||
theSubIndex=theBufCopy.Find("ISO/IEC15445:1999",PR_TRUE,theIndex+8);
|
||||
if(kNotFound<theSubIndex) {
|
||||
theSubIndex=theBufCopy.Find("HTML",PR_TRUE,theSubIndex+18);
|
||||
if(kNotFound==theSubIndex)
|
||||
theSubIndex=theBufCopy.Find("HYPERTEXTMARKUPLANGUAGE",PR_TRUE,theSubIndex+18);
|
||||
return eParseMode_noquirks;
|
||||
}
|
||||
}
|
||||
|
||||
theIndex=theBufCopy.Find("NOQUIRKS",PR_TRUE);
|
||||
|
Loading…
Reference in New Issue
Block a user