Split strict mode into almost-standards and full-standards mode, where the only quirk in almost standards mode is the quirky inline box model. Remove previous fix for bug 151620. Tweak mode detection to use almost-standards for XHTML Transitional, HTML 4.01 transitional with system ID, and for IBM system DOCTYPE. b=153032 r=karnaze, bzbarsky, harishd sr=waterson

git-svn-id: svn://10.0.0.236/trunk@124017 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%fas.harvard.edu
2002-06-25 21:16:17 +00:00
parent acbe281411
commit 7c4652cc16
102 changed files with 736 additions and 659 deletions

View File

@@ -357,7 +357,8 @@ CNavDTD::CanParse(CParserContext& aParserContext,
aParserContext.SetMimeType(NS_LITERAL_CSTRING(kHTMLTextContentType));
if(!theBufHasXML) {
switch(aParserContext.mDTDMode) {
case eDTDMode_strict:
case eDTDMode_full_standards:
case eDTDMode_almost_standards:
result=eValidDetect;
break;
default:
@@ -1994,7 +1995,9 @@ nsresult CNavDTD::HandleEndToken(CToken* aToken) {
// If the bit kHandleStrayTag is set then we automatically open up a matching
// start tag ( compatibility ). Currently this bit is set on P tag.
// This also fixes Bug: 22623
if(gHTMLElements[theChildTag].HasSpecialProperty(kHandleStrayTag) && mDTDMode!=eDTDMode_strict) {
if(gHTMLElements[theChildTag].HasSpecialProperty(kHandleStrayTag) &&
mDTDMode != eDTDMode_full_standards &&
mDTDMode != eDTDMode_almost_standards) {
// Oh boy!! we found a "stray" tag. Nav4.x and IE introduce line break in
// such cases. So, let's simulate that effect for compatibility.
// Ex. <html><body>Hello</P>There</body></html>
@@ -2343,23 +2346,9 @@ nsresult CNavDTD::HandleDocTypeDeclToken(CToken* aToken){
STOP_TIMER();
MOZ_TIMER_DEBUGLOG(("Stop: Parse Time: CNavDTD::HandleDocTypeDeclToken(), this=%p\n", this));
/*************************************************************
While the parser is happy to deal with various modes, the
rest of layout prefers only 2: strict vs. quirks. So we'll
constrain the modes when reporting to layout.
*************************************************************/
nsDTDMode theMode=mDTDMode;
switch(mDTDMode) {
case eDTDMode_strict:
theMode=eDTDMode_strict;
break;
default:
theMode=eDTDMode_quirks;
}
result = (mSink)? mSink->AddDocTypeDecl(*theNode,theMode):NS_OK;
result = (mSink)? mSink->AddDocTypeDecl(*theNode):NS_OK;
IF_FREE(theNode, &mNodeAllocator);
IF_FREE(theNode, &mNodeAllocator);
MOZ_TIMER_DEBUGLOG(("Start: Parse Time: CNavDTD::HandleDocTypeDeclToken(), this=%p\n", this));
START_TIMER();