Adding the ablity to disable view source. r=bz,sr=darin,b=199335
git-svn-id: svn://10.0.0.236/trunk@145367 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -58,7 +58,6 @@
|
||||
#include "nsDTDUtils.h"
|
||||
#include "nsHTMLTokenizer.h"
|
||||
#include "nsTime.h"
|
||||
#include "nsViewSourceHTML.h"
|
||||
#include "nsParserNode.h"
|
||||
#include "nsHTMLEntities.h"
|
||||
#include "nsLinebreakConverter.h"
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
#include "nsDTDUtils.h"
|
||||
#include "nsHTMLTokenizer.h"
|
||||
#include "nsTime.h"
|
||||
#include "nsViewSourceHTML.h"
|
||||
#include "nsParserNode.h"
|
||||
#include "nsHTMLEntities.h"
|
||||
#include "nsLinebreakConverter.h"
|
||||
@@ -63,7 +62,6 @@
|
||||
|
||||
#include "prmem.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIHTMLContentSinkIID, NS_IHTML_CONTENT_SINK_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
||||
@@ -299,7 +297,7 @@ COtherDTD::CanParse(CParserContext& aParserContext, const nsString& aBuffer,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
@@ -74,10 +73,15 @@ CPPSRCS = \
|
||||
nsParserNode.cpp \
|
||||
nsScanner.cpp \
|
||||
nsToken.cpp \
|
||||
nsViewSourceHTML.cpp\
|
||||
nsParserMsgUtils.cpp\
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_VIEW_SOURCE
|
||||
CPPSRCS += \
|
||||
nsViewSourceHTML.cpp \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifdef MOZ_DEBUG
|
||||
CPPSRCS += \
|
||||
nsLoggingSink.cpp \
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include "nsCRT.h"
|
||||
#include "nsScanner.h"
|
||||
#include "plstr.h"
|
||||
#include "nsViewSourceHTML.h"
|
||||
#include "nsIStringStream.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsICachingChannel.h"
|
||||
@@ -67,6 +66,10 @@
|
||||
#include "nsIServiceManager.h"
|
||||
//#define rickgdebug
|
||||
|
||||
#ifdef MOZ_VIEW_SOURCE
|
||||
#include "nsViewSourceHTML.h"
|
||||
#endif
|
||||
|
||||
#define NS_PARSER_FLAG_DTD_VERIFICATION 0x00000001
|
||||
#define NS_PARSER_FLAG_PARSER_ENABLED 0x00000002
|
||||
#define NS_PARSER_FLAG_OBSERVERS_ENABLED 0x00000004
|
||||
@@ -1154,6 +1157,7 @@ FindSuitableDTD(CParserContext& aParserContext,
|
||||
sharedObjects->mDTDDeque.Push(theDTD);
|
||||
sharedObjects->mHasXMLDTD = PR_TRUE;
|
||||
}
|
||||
#ifdef MOZ_VIEW_SOURCE
|
||||
else if (!sharedObjects->mHasViewSourceDTD) {
|
||||
rv = NS_NewViewSourceHTML(&theDTD); //do this so all non-html files can be viewed...
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@@ -1161,6 +1165,7 @@ FindSuitableDTD(CParserContext& aParserContext,
|
||||
sharedObjects->mDTDDeque.Push(theDTD);
|
||||
sharedObjects->mHasViewSourceDTD = PR_TRUE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,13 +47,16 @@
|
||||
#include "nsParser.h"
|
||||
#include "CNavDTD.h"
|
||||
#include "COtherDTD.h"
|
||||
#include "nsViewSourceHTML.h"
|
||||
#include "nsHTMLEntities.h"
|
||||
#include "nsHTMLTokenizer.h"
|
||||
//#include "nsTextTokenizer.h"
|
||||
#include "nsElementTable.h"
|
||||
#include "nsParserService.h"
|
||||
|
||||
#ifdef MOZ_VIEW_SOURCE
|
||||
#include "nsViewSourceHTML.h"
|
||||
#endif
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
#include "nsLoggingSink.h"
|
||||
#include "nsExpatDriver.h"
|
||||
@@ -69,9 +72,12 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsExpatDriver)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsParser)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(CNavDTD)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(CTransitionalDTD)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(CViewSourceHTML)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsParserService)
|
||||
|
||||
#ifdef MOZ_VIEW_SOURCE
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(CViewSourceHTML)
|
||||
#endif
|
||||
|
||||
static const nsModuleComponentInfo gComponents[] = {
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
@@ -83,7 +89,9 @@ static const nsModuleComponentInfo gComponents[] = {
|
||||
{ "Navigator HTML DTD", NS_CNAVDTD_CID, NULL, CNavDTDConstructor },
|
||||
{ "Transitional DTD", NS_CTRANSITIONAL_DTD_CID, NULL,
|
||||
CTransitionalDTDConstructor },
|
||||
#ifdef MOZ_VIEW_SOURCE
|
||||
{ "ViewSource DTD", NS_VIEWSOURCE_DTD_CID, NULL, CViewSourceHTMLConstructor },
|
||||
#endif
|
||||
{ "ParserService",
|
||||
NS_PARSERSERVICE_CID,
|
||||
NS_PARSER_CONTRACTID_PREFIX "/parser-service;1",
|
||||
|
||||
Reference in New Issue
Block a user