fixed DTDMode regression

git-svn-id: svn://10.0.0.236/trunk@68211 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rickg%netscape.com 2000-05-04 05:54:04 +00:00
parent 6792920069
commit 7be87c598e
6 changed files with 20 additions and 34 deletions

View File

@ -3033,7 +3033,7 @@ HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
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));
@ -3712,7 +3712,7 @@ HTMLContentSink::ProcessStyleLink(nsIHTMLContent* aElement,
mHTMLDocument->GetDTDMode(mode);
PRBool isStyleSheet = PR_FALSE; // see bug 18817
if (eDTDMode_NoQuirks == mode) {
if (eDTDMode_noquirks== mode) {
if (mimeType.EqualsIgnoreCase("text/css")) {
isStyleSheet = PR_TRUE; // strict mode + good mime type
}

View File

@ -62,7 +62,6 @@
#include "nsIBaseWindow.h"
#include "nsIWebShellServices.h"
#include "nsIDocumentLoader.h"
#include "CNavDTD.h"
#include "nsIScriptGlobalObject.h"
#include "nsContentList.h"
#include "nsDOMError.h"
@ -71,6 +70,7 @@
#include "nsIScriptSecurityManager.h"
#include "nsJSUtils.h"
#include "nsDOMPropEnums.h"
#include "CNavDTD.h"
#include "nsIIOService.h"
#include "nsICookieService.h"
@ -200,7 +200,7 @@ nsHTMLDocument::nsHTMLDocument()
mLayers = nsnull;
mNamedItems = nsnull;
mParser = nsnull;
mDTDMode = eDTDMode_Nav;
mDTDMode = eDTDMode_quirks;
mCSSLoader = nsnull;
// Find/Search Init
@ -381,7 +381,7 @@ nsHTMLDocument::CreateShell(nsIPresContext* aContext,
aInstancePtrResult);
if (NS_SUCCEEDED(result)) {
aContext->SetCompatibilityMode(((eDTDMode_NoQuirks == mDTDMode) ?
aContext->SetCompatibilityMode(((eDTDMode_strict== mDTDMode) ?
eCompatibility_Standard :
eCompatibility_NavQuirks));
}
@ -1018,7 +1018,7 @@ nsHTMLDocument::GetCSSLoader(nsICSSLoader*& aLoader)
}
if (mCSSLoader) {
mCSSLoader->SetCaseSensitive(PR_FALSE);
mCSSLoader->SetQuirkMode(PRBool(eDTDMode_NoQuirks != mDTDMode));
mCSSLoader->SetQuirkMode(PRBool(eDTDMode_strict!= mDTDMode));
}
aLoader = mCSSLoader;
NS_IF_ADDREF(aLoader);
@ -1038,7 +1038,7 @@ nsHTMLDocument::SetDTDMode(nsDTDMode aMode)
{
mDTDMode = aMode;
if (mCSSLoader) {
mCSSLoader->SetQuirkMode(PRBool(eDTDMode_NoQuirks != mDTDMode));
mCSSLoader->SetQuirkMode(PRBool(eDTDMode_strict!= mDTDMode));
}
nsIPresShell* shell = (nsIPresShell*) mPresShells.ElementAt(0);
@ -1046,7 +1046,7 @@ nsHTMLDocument::SetDTDMode(nsDTDMode aMode)
nsCOMPtr<nsIPresContext> pc;
shell->GetPresContext(getter_AddRefs(pc));
if (pc) {
pc->SetCompatibilityMode(((eDTDMode_NoQuirks == mDTDMode) ?
pc->SetCompatibilityMode(((eDTDMode_strict== mDTDMode) ?
eCompatibility_Standard :
eCompatibility_NavQuirks));
}

View File

@ -23,6 +23,8 @@
#define nsIHTMLDocument_h___
#include "nsISupports.h"
#include "nsIDTD.h"
class nsIImageMap;
class nsString;
class nsIDOMHTMLCollection;
@ -36,15 +38,6 @@ class nsICSSLoader;
#define NS_IHTMLDOCUMENT_IID \
{0xb2a848b0, 0xd0a9, 0x11d1, {0x89, 0xb1, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81}}
enum nsDTDMode {
eDTDMode_Unknown =0,
eDTDMode_Nav =1, //5.0 version of nav. and greater
eDTDMode_NoQuirks =2, //pre 5.0 versions
eDTDMode_Other =4, //pre 5.0 without quirks (as best as we can...)
eDTDMode_Autodetect =5
};
/**
* HTML document extensions to nsIDocument.

View File

@ -3033,7 +3033,7 @@ HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
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));
@ -3712,7 +3712,7 @@ HTMLContentSink::ProcessStyleLink(nsIHTMLContent* aElement,
mHTMLDocument->GetDTDMode(mode);
PRBool isStyleSheet = PR_FALSE; // see bug 18817
if (eDTDMode_NoQuirks == mode) {
if (eDTDMode_noquirks== mode) {
if (mimeType.EqualsIgnoreCase("text/css")) {
isStyleSheet = PR_TRUE; // strict mode + good mime type
}

View File

@ -62,7 +62,6 @@
#include "nsIBaseWindow.h"
#include "nsIWebShellServices.h"
#include "nsIDocumentLoader.h"
#include "CNavDTD.h"
#include "nsIScriptGlobalObject.h"
#include "nsContentList.h"
#include "nsDOMError.h"
@ -71,6 +70,7 @@
#include "nsIScriptSecurityManager.h"
#include "nsJSUtils.h"
#include "nsDOMPropEnums.h"
#include "CNavDTD.h"
#include "nsIIOService.h"
#include "nsICookieService.h"
@ -200,7 +200,7 @@ nsHTMLDocument::nsHTMLDocument()
mLayers = nsnull;
mNamedItems = nsnull;
mParser = nsnull;
mDTDMode = eDTDMode_Nav;
mDTDMode = eDTDMode_quirks;
mCSSLoader = nsnull;
// Find/Search Init
@ -381,7 +381,7 @@ nsHTMLDocument::CreateShell(nsIPresContext* aContext,
aInstancePtrResult);
if (NS_SUCCEEDED(result)) {
aContext->SetCompatibilityMode(((eDTDMode_NoQuirks == mDTDMode) ?
aContext->SetCompatibilityMode(((eDTDMode_strict== mDTDMode) ?
eCompatibility_Standard :
eCompatibility_NavQuirks));
}
@ -1018,7 +1018,7 @@ nsHTMLDocument::GetCSSLoader(nsICSSLoader*& aLoader)
}
if (mCSSLoader) {
mCSSLoader->SetCaseSensitive(PR_FALSE);
mCSSLoader->SetQuirkMode(PRBool(eDTDMode_NoQuirks != mDTDMode));
mCSSLoader->SetQuirkMode(PRBool(eDTDMode_strict!= mDTDMode));
}
aLoader = mCSSLoader;
NS_IF_ADDREF(aLoader);
@ -1038,7 +1038,7 @@ nsHTMLDocument::SetDTDMode(nsDTDMode aMode)
{
mDTDMode = aMode;
if (mCSSLoader) {
mCSSLoader->SetQuirkMode(PRBool(eDTDMode_NoQuirks != mDTDMode));
mCSSLoader->SetQuirkMode(PRBool(eDTDMode_strict!= mDTDMode));
}
nsIPresShell* shell = (nsIPresShell*) mPresShells.ElementAt(0);
@ -1046,7 +1046,7 @@ nsHTMLDocument::SetDTDMode(nsDTDMode aMode)
nsCOMPtr<nsIPresContext> pc;
shell->GetPresContext(getter_AddRefs(pc));
if (pc) {
pc->SetCompatibilityMode(((eDTDMode_NoQuirks == mDTDMode) ?
pc->SetCompatibilityMode(((eDTDMode_strict== mDTDMode) ?
eCompatibility_Standard :
eCompatibility_NavQuirks));
}

View File

@ -23,6 +23,8 @@
#define nsIHTMLDocument_h___
#include "nsISupports.h"
#include "nsIDTD.h"
class nsIImageMap;
class nsString;
class nsIDOMHTMLCollection;
@ -36,15 +38,6 @@ class nsICSSLoader;
#define NS_IHTMLDOCUMENT_IID \
{0xb2a848b0, 0xd0a9, 0x11d1, {0x89, 0xb1, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81}}
enum nsDTDMode {
eDTDMode_Unknown =0,
eDTDMode_Nav =1, //5.0 version of nav. and greater
eDTDMode_NoQuirks =2, //pre 5.0 versions
eDTDMode_Other =4, //pre 5.0 without quirks (as best as we can...)
eDTDMode_Autodetect =5
};
/**
* HTML document extensions to nsIDocument.