diff --git a/mozilla/config/autoconf.mk.in b/mozilla/config/autoconf.mk.in index 809d70e904f..1f8d8997240 100644 --- a/mozilla/config/autoconf.mk.in +++ b/mozilla/config/autoconf.mk.in @@ -87,7 +87,6 @@ ENABLE_TESTS = @ENABLE_TESTS@ IBMBIDI = @IBMBIDI@ SUNCTL = @SUNCTL@ ACCESSIBILITY = @ACCESSIBILITY@ -MOZ_VIEW_SOURCE = @MOZ_VIEW_SOURCE@ MOZ_XPINSTALL = @MOZ_XPINSTALL@ MOZ_JSLOADER = @MOZ_JSLOADER@ MOZ_USE_NATIVE_UCONV = @MOZ_USE_NATIVE_UCONV@ diff --git a/mozilla/configure.in b/mozilla/configure.in index 82ffab17814..75d82b16a6a 100644 --- a/mozilla/configure.in +++ b/mozilla/configure.in @@ -3436,19 +3436,6 @@ MOZ_ARG_ENABLE_BOOL(ctl, SUNCTL=1, SUNCTL= ) -dnl ======================================================== -dnl view source support on by default -dnl ======================================================== -MOZ_VIEW_SOURCE=1 -MOZ_ARG_DISABLE_BOOL(view-source, -[ --disable-view-source Disable view source support], - MOZ_VIEW_SOURCE=, - MOZ_VIEW_SOURCE=1 ) -if test "$MOZ_VIEW_SOURCE"; then - AC_DEFINE(MOZ_VIEW_SOURCE) -fi - - dnl ======================================================== dnl accessibility support on by default dnl ======================================================== @@ -5078,7 +5065,6 @@ AC_SUBST(IBMBIDI) AC_SUBST(SUNCTL) AC_SUBST(ACCESSIBILITY) AC_SUBST(MOZ_XPINSTALL) -AC_SUBST(MOZ_VIEW_SOURCE) AC_SUBST(MOZ_SINGLE_PROFILE) AC_SUBST(MOZ_XPFE_COMPONENTS) AC_SUBST(MOZ_USER_DIR) diff --git a/mozilla/htmlparser/src/CNavDTD.cpp b/mozilla/htmlparser/src/CNavDTD.cpp index a89f512c05e..ea8f9825626 100644 --- a/mozilla/htmlparser/src/CNavDTD.cpp +++ b/mozilla/htmlparser/src/CNavDTD.cpp @@ -58,6 +58,7 @@ #include "nsDTDUtils.h" #include "nsHTMLTokenizer.h" #include "nsTime.h" +#include "nsViewSourceHTML.h" #include "nsParserNode.h" #include "nsHTMLEntities.h" #include "nsLinebreakConverter.h" diff --git a/mozilla/htmlparser/src/COtherDTD.cpp b/mozilla/htmlparser/src/COtherDTD.cpp index 879b2d69d47..a50aa3dbecf 100644 --- a/mozilla/htmlparser/src/COtherDTD.cpp +++ b/mozilla/htmlparser/src/COtherDTD.cpp @@ -55,6 +55,7 @@ #include "nsDTDUtils.h" #include "nsHTMLTokenizer.h" #include "nsTime.h" +#include "nsViewSourceHTML.h" #include "nsParserNode.h" #include "nsHTMLEntities.h" #include "nsLinebreakConverter.h" @@ -62,6 +63,7 @@ #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); @@ -297,7 +299,7 @@ COtherDTD::CanParse(CParserContext& aParserContext, const nsString& aBuffer, } } } - } + } return result; } diff --git a/mozilla/htmlparser/src/Makefile.in b/mozilla/htmlparser/src/Makefile.in index e38dbb21123..9d9afe0d5a4 100644 --- a/mozilla/htmlparser/src/Makefile.in +++ b/mozilla/htmlparser/src/Makefile.in @@ -1,3 +1,4 @@ +# # 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 @@ -73,15 +74,10 @@ 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 \ diff --git a/mozilla/htmlparser/src/nsParser.cpp b/mozilla/htmlparser/src/nsParser.cpp index eb0bbf02662..2fe9163b849 100644 --- a/mozilla/htmlparser/src/nsParser.cpp +++ b/mozilla/htmlparser/src/nsParser.cpp @@ -48,6 +48,7 @@ #include "nsCRT.h" #include "nsScanner.h" #include "plstr.h" +#include "nsViewSourceHTML.h" #include "nsIStringStream.h" #include "nsIChannel.h" #include "nsICachingChannel.h" @@ -66,10 +67,6 @@ #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 @@ -1157,7 +1154,6 @@ 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); @@ -1165,7 +1161,6 @@ FindSuitableDTD(CParserContext& aParserContext, sharedObjects->mDTDDeque.Push(theDTD); sharedObjects->mHasViewSourceDTD = PR_TRUE; } -#endif } } diff --git a/mozilla/htmlparser/src/nsParserModule.cpp b/mozilla/htmlparser/src/nsParserModule.cpp index d05d52759b2..4f4879aa96f 100644 --- a/mozilla/htmlparser/src/nsParserModule.cpp +++ b/mozilla/htmlparser/src/nsParserModule.cpp @@ -47,16 +47,13 @@ #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" @@ -72,11 +69,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsExpatDriver) NS_GENERIC_FACTORY_CONSTRUCTOR(nsParser) NS_GENERIC_FACTORY_CONSTRUCTOR(CNavDTD) NS_GENERIC_FACTORY_CONSTRUCTOR(CTransitionalDTD) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsParserService) - -#ifdef MOZ_VIEW_SOURCE NS_GENERIC_FACTORY_CONSTRUCTOR(CViewSourceHTML) -#endif +NS_GENERIC_FACTORY_CONSTRUCTOR(nsParserService) static const nsModuleComponentInfo gComponents[] = { @@ -89,9 +83,7 @@ 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", diff --git a/mozilla/layout/build/nsContentDLF.cpp b/mozilla/layout/build/nsContentDLF.cpp index caea8bac89a..f432ef63039 100644 --- a/mozilla/layout/build/nsContentDLF.cpp +++ b/mozilla/layout/build/nsContentDLF.cpp @@ -95,9 +95,7 @@ static const char* const gHTMLTypes[] = { "text/css", "text/javascript", "application/x-javascript", -#ifdef MOZ_VIEW_SOURCE "application/x-view-source", //XXX I wish I could just use nsMimeTypes.h here -#endif "application/xhtml+xml", 0 }; @@ -164,7 +162,7 @@ nsContentDLF::CreateInstance(const char* aCommand, EnsureUAStyleSheet(); // Are we viewing source? -#ifdef MOZ_VIEW_SOURCE + nsCOMPtr viewSourceChannel = do_QueryInterface(aChannel); if (viewSourceChannel) { @@ -214,7 +212,7 @@ nsContentDLF::CreateInstance(const char* aCommand, aChannel->SetContentType(NS_LITERAL_CSTRING("text/plain")); aContentType = "text/plain"; } -#endif + // Try html int typeIndex=0; while(gHTMLTypes[typeIndex]) { diff --git a/mozilla/parser/htmlparser/src/CNavDTD.cpp b/mozilla/parser/htmlparser/src/CNavDTD.cpp index a89f512c05e..ea8f9825626 100644 --- a/mozilla/parser/htmlparser/src/CNavDTD.cpp +++ b/mozilla/parser/htmlparser/src/CNavDTD.cpp @@ -58,6 +58,7 @@ #include "nsDTDUtils.h" #include "nsHTMLTokenizer.h" #include "nsTime.h" +#include "nsViewSourceHTML.h" #include "nsParserNode.h" #include "nsHTMLEntities.h" #include "nsLinebreakConverter.h" diff --git a/mozilla/parser/htmlparser/src/COtherDTD.cpp b/mozilla/parser/htmlparser/src/COtherDTD.cpp index 879b2d69d47..a50aa3dbecf 100644 --- a/mozilla/parser/htmlparser/src/COtherDTD.cpp +++ b/mozilla/parser/htmlparser/src/COtherDTD.cpp @@ -55,6 +55,7 @@ #include "nsDTDUtils.h" #include "nsHTMLTokenizer.h" #include "nsTime.h" +#include "nsViewSourceHTML.h" #include "nsParserNode.h" #include "nsHTMLEntities.h" #include "nsLinebreakConverter.h" @@ -62,6 +63,7 @@ #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); @@ -297,7 +299,7 @@ COtherDTD::CanParse(CParserContext& aParserContext, const nsString& aBuffer, } } } - } + } return result; } diff --git a/mozilla/parser/htmlparser/src/Makefile.in b/mozilla/parser/htmlparser/src/Makefile.in index e38dbb21123..9d9afe0d5a4 100644 --- a/mozilla/parser/htmlparser/src/Makefile.in +++ b/mozilla/parser/htmlparser/src/Makefile.in @@ -1,3 +1,4 @@ +# # 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 @@ -73,15 +74,10 @@ 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 \ diff --git a/mozilla/parser/htmlparser/src/nsParser.cpp b/mozilla/parser/htmlparser/src/nsParser.cpp index eb0bbf02662..2fe9163b849 100644 --- a/mozilla/parser/htmlparser/src/nsParser.cpp +++ b/mozilla/parser/htmlparser/src/nsParser.cpp @@ -48,6 +48,7 @@ #include "nsCRT.h" #include "nsScanner.h" #include "plstr.h" +#include "nsViewSourceHTML.h" #include "nsIStringStream.h" #include "nsIChannel.h" #include "nsICachingChannel.h" @@ -66,10 +67,6 @@ #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 @@ -1157,7 +1154,6 @@ 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); @@ -1165,7 +1161,6 @@ FindSuitableDTD(CParserContext& aParserContext, sharedObjects->mDTDDeque.Push(theDTD); sharedObjects->mHasViewSourceDTD = PR_TRUE; } -#endif } } diff --git a/mozilla/parser/htmlparser/src/nsParserModule.cpp b/mozilla/parser/htmlparser/src/nsParserModule.cpp index d05d52759b2..4f4879aa96f 100644 --- a/mozilla/parser/htmlparser/src/nsParserModule.cpp +++ b/mozilla/parser/htmlparser/src/nsParserModule.cpp @@ -47,16 +47,13 @@ #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" @@ -72,11 +69,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsExpatDriver) NS_GENERIC_FACTORY_CONSTRUCTOR(nsParser) NS_GENERIC_FACTORY_CONSTRUCTOR(CNavDTD) NS_GENERIC_FACTORY_CONSTRUCTOR(CTransitionalDTD) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsParserService) - -#ifdef MOZ_VIEW_SOURCE NS_GENERIC_FACTORY_CONSTRUCTOR(CViewSourceHTML) -#endif +NS_GENERIC_FACTORY_CONSTRUCTOR(nsParserService) static const nsModuleComponentInfo gComponents[] = { @@ -89,9 +83,7 @@ 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",