68790 - Remove nsHTMLContentSinkStream dependency. Not in use anymore
r=heikki sr=jst git-svn-id: svn://10.0.0.236/trunk@92594 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -6,7 +6,6 @@ nshtmlpars.h
|
||||
nsIContentSink.h
|
||||
nsIHTMLContentSink.h
|
||||
nsIHTMLFragmentContentSink.h
|
||||
nsHTMLContentSinkStream.h
|
||||
nsITokenizer.h
|
||||
nsHTMLTokens.h
|
||||
nsIParserNode.h
|
||||
|
||||
@@ -72,7 +72,6 @@ CPPSRCS = \
|
||||
nsScanner.cpp \
|
||||
nsToken.cpp \
|
||||
nsTokenHandler.cpp \
|
||||
nsHTMLContentSinkStream.cpp \
|
||||
nsValidDTD.cpp \
|
||||
nsWellFormedDTD.cpp \
|
||||
nsViewSourceHTML.cpp \
|
||||
@@ -94,7 +93,6 @@ EXPORTS = \
|
||||
nsITokenizer.h \
|
||||
nsIExpatTokenizer.h \
|
||||
nsIHTMLContentSink.h \
|
||||
nsHTMLContentSinkStream.h \
|
||||
nsIHTMLFragmentContentSink.h \
|
||||
nsHTMLEntities.h \
|
||||
nsHTMLEntityList.h \
|
||||
|
||||
@@ -49,7 +49,6 @@ CPPSRCS= \
|
||||
nsScanner.cpp \
|
||||
nsToken.cpp \
|
||||
nsTokenHandler.cpp \
|
||||
nsHTMLContentSinkStream.cpp \
|
||||
nsValidDTD.cpp \
|
||||
nsWellFormedDTD.cpp \
|
||||
nsViewSourceHTML.cpp \
|
||||
@@ -77,7 +76,6 @@ CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsScanner.obj \
|
||||
.\$(OBJDIR)\nsToken.obj \
|
||||
.\$(OBJDIR)\nsTokenHandler.obj \
|
||||
.\$(OBJDIR)\nsHTMLContentSinkStream.obj \
|
||||
.\$(OBJDIR)\nsValidDTD.obj \
|
||||
.\$(OBJDIR)\nsWellFormedDTD.obj \
|
||||
.\$(OBJDIR)\nsViewSourceHTML.obj \
|
||||
@@ -92,7 +90,6 @@ EXPORTS= \
|
||||
nsIContentSink.h \
|
||||
nsIHTMLContentSink.h \
|
||||
nsILoggingSink.h \
|
||||
nsHTMLContentSinkStream.h \
|
||||
nsIHTMLFragmentContentSink.h \
|
||||
nsHTMLEntities.h \
|
||||
nsHTMLEntityList.h \
|
||||
|
||||
@@ -240,7 +240,6 @@ class nsIParser : public nsISupports {
|
||||
|
||||
virtual nsresult Terminate(void) = 0;
|
||||
|
||||
virtual PRBool IsValidFragment(const nsAReadableString& aSourceBuffer,nsITagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType,nsDTDMode aMode=eDTDMode_autodetect)=0;
|
||||
virtual nsresult ParseFragment(const nsAReadableString& aSourceBuffer,void* aKey,nsITagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType,nsDTDMode aMode=eDTDMode_autodetect)=0;
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "nshtmlpars.h"
|
||||
#include "nsWellFormedDTD.h"
|
||||
#include "nsViewSourceHTML.h"
|
||||
#include "nsHTMLContentSinkStream.h" //this is here so we can get a null sink, which really should be gotten from nsICOntentSink.h
|
||||
#include "nsIStringStream.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsIProgressEventSink.h"
|
||||
@@ -1736,62 +1735,6 @@ aMimeType,PRBool aVerifyEnabled,PRBool aLastCall,nsDTDMode aMode){
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Call this method to test whether a given fragment is valid within a given context-stack.
|
||||
* @update gess 04/01/99
|
||||
* @param aSourceBuffer contains the content blob you're trying to insert
|
||||
* @param aInsertPos tells us where in the context stack you're trying to do the insertion
|
||||
* @param aMimeType tells us what kind of stuff you're inserting
|
||||
* @return TRUE if valid, otherwise FALSE
|
||||
*/
|
||||
PRBool nsParser::IsValidFragment(const nsAReadableString& aSourceBuffer,nsITagStack& aStack,PRUint32 anInsertPos,const nsString& aMimeType,nsDTDMode aMode){
|
||||
|
||||
/************************************************************************************
|
||||
This method works like this:
|
||||
1. Convert aStack to a markup string
|
||||
2. Append a "sentinel" tag to markup string so we know where new content is inserted
|
||||
3. Append new context to markup stack
|
||||
4. Call the normal parse() methods for a string, using an HTMLContentSink.
|
||||
The output of this call is stored in an outputstring
|
||||
5. Scan the output string looking for markup inside our sentinel. If non-empty
|
||||
then we have to assume that the fragment is valid (at least in part)
|
||||
************************************************************************************/
|
||||
|
||||
nsAutoString theContext;
|
||||
PRUint32 theCount=aStack.GetSize();
|
||||
PRUint32 theIndex=0;
|
||||
while(theIndex++<theCount){
|
||||
theContext.AppendWithConversion("<");
|
||||
theContext.Append(aStack.TagAt(theCount-theIndex));
|
||||
theContext.AppendWithConversion(">");
|
||||
}
|
||||
theContext.AppendWithConversion("<endnote>"); //XXXHack! I'll make this better later.
|
||||
nsAutoString theBuffer(theContext);
|
||||
theBuffer.Append(aSourceBuffer);
|
||||
|
||||
PRBool result=PR_FALSE;
|
||||
if(theBuffer.Length()){
|
||||
//now it's time to try to build the model from this fragment
|
||||
|
||||
nsString theOutput;
|
||||
nsIHTMLContentSink* theSink=0;
|
||||
nsresult theResult=NS_New_HTML_ContentSinkStream(&theSink,&theOutput,0);
|
||||
SetContentSink(theSink);
|
||||
theResult=Parse(theBuffer,(void*)&theBuffer,aMimeType,PR_FALSE,PR_TRUE);
|
||||
theOutput.StripWhitespace();
|
||||
if(NS_OK==theResult){
|
||||
theOutput.Cut(0,theContext.Length());
|
||||
PRInt32 aPos=theOutput.RFind("</endnote>");
|
||||
if(-1<aPos)
|
||||
theOutput.Truncate(aPos);
|
||||
result=PRBool(0<theOutput.Length());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @update gess 04/01/99
|
||||
|
||||
@@ -200,7 +200,6 @@ class nsParser : public nsIParser,
|
||||
*/
|
||||
virtual nsresult Parse(const nsAReadableString& aSourceBuffer,void* aKey,const nsString& aContentType,PRBool aEnableVerify=PR_FALSE,PRBool aLastCall=PR_FALSE,nsDTDMode aMode=eDTDMode_autodetect);
|
||||
|
||||
virtual PRBool IsValidFragment(const nsAReadableString& aSourceBuffer,nsITagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType,nsDTDMode aMode=eDTDMode_autodetect);
|
||||
virtual nsresult ParseFragment(const nsAReadableString& aSourceBuffer,void* aKey,nsITagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType,nsDTDMode aMode=eDTDMode_autodetect);
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "COtherDTD.h"
|
||||
#include "COtherDTD.h"
|
||||
#include "nsViewSourceHTML.h"
|
||||
#include "nsHTMLContentSinkStream.h"
|
||||
#include "nsHTMLEntities.h"
|
||||
#include "nsHTMLTokenizer.h"
|
||||
#include "nsXMLTokenizer.h"
|
||||
@@ -156,7 +155,6 @@ static NS_DEFINE_CID(kNavDTDCID, NS_CNAVDTD_CID);
|
||||
static NS_DEFINE_CID(kCOtherDTDCID, NS_COTHER_DTD_CID);
|
||||
static NS_DEFINE_CID(kCTransitionalDTDCID, NS_CTRANSITIONAL_DTD_CID);
|
||||
static NS_DEFINE_CID(kViewSourceDTDCID, NS_VIEWSOURCE_DTD_CID);
|
||||
static NS_DEFINE_CID(kHTMLContentSinkStreamCID, NS_HTMLCONTENTSINKSTREAM_CID);
|
||||
static NS_DEFINE_CID(kParserServiceCID, NS_PARSERSERVICE_CID);
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsParser)
|
||||
@@ -166,7 +164,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(CNavDTD)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(COtherDTD)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(CTransitionalDTD)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(CViewSourceHTML)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLContentSinkStream)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsParserService)
|
||||
|
||||
static nsModuleComponentInfo gComponents[] = {
|
||||
@@ -178,8 +175,6 @@ static nsModuleComponentInfo gComponents[] = {
|
||||
{ "Transitional DTD", NS_CTRANSITIONAL_DTD_CID, NULL,
|
||||
CTransitionalDTDConstructor },
|
||||
{ "ViewSource DTD", NS_VIEWSOURCE_DTD_CID, NULL, CViewSourceHTMLConstructor },
|
||||
{ "HTML Content Sink Stream", NS_HTMLCONTENTSINKSTREAM_CID, NULL,
|
||||
nsHTMLContentSinkStreamConstructor },
|
||||
{ "ParserService", NS_PARSERSERVICE_CID, NULL, nsParserServiceConstructor }
|
||||
};
|
||||
#define NUM_COMPONENTS (sizeof(gComponents) / sizeof(gComponents[0]))
|
||||
|
||||
Reference in New Issue
Block a user