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

@@ -249,7 +249,7 @@ public:
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD WillProcessTokens(void);
NS_IMETHOD DidProcessTokens(void);
NS_IMETHOD WillProcessAToken(void);
@@ -2440,7 +2440,22 @@ HTMLContentSink::WillBuildModel(void)
mScrolledToRefAlready = PR_FALSE;
if (mHTMLDocument) {
mHTMLDocument->SetDTDMode(mParser? mParser->GetParseMode():eDTDMode_quirks);
nsCompatibility mode = eCompatibility_NavQuirks;
if (mParser) {
nsDTDMode dtdMode = mParser->GetParseMode();
switch (dtdMode) {
case eDTDMode_full_standards:
mode = eCompatibility_FullStandards;
break;
case eDTDMode_almost_standards:
mode = eCompatibility_AlmostStandards;
break;
default:
mode = eCompatibility_NavQuirks;
break;
}
}
mHTMLDocument->SetCompatibilityMode(mode);
}
// Notify document that the load is beginning
@@ -3308,14 +3323,12 @@ nsresult HTMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode) {
*/
NS_IMETHODIMP
HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
{
nsresult rv = NS_OK;
MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::AddDocTypeDecl()\n"));
MOZ_TIMER_START(mWatch);
mHTMLDocument->SetDTDMode((nsDTDMode)aMode);
nsCOMPtr<nsIDOMDocument> doc(do_QueryInterface(mHTMLDocument));
if (!doc)
@@ -4257,11 +4270,11 @@ HTMLContentSink::ProcessStyleLink(nsIHTMLContent* aElement,
nsAutoString params;
nsParserUtils::SplitMimeType(aType, mimeType, params);
nsDTDMode mode;
mHTMLDocument->GetDTDMode(mode);
nsCompatibility mode;
mHTMLDocument->GetCompatibilityMode(mode);
PRBool isStyleSheet = PR_FALSE; // see bug 18817
if (eDTDMode_strict== mode) {
if (eCompatibility_NavQuirks != mode) {
if (mimeType.EqualsIgnoreCase("text/css")) {
isStyleSheet = PR_TRUE; // strict mode + good mime type
}