зеркало из https://github.com/mozilla/gecko-dev.git
Added XML display support. Added NotifyError method to nsIContentSink
This commit is contained in:
Родитель
e0004fcce5
Коммит
c11e2c8964
|
@ -67,6 +67,7 @@ public:
|
|||
NS_IMETHOD CloseFrameset(const nsIParserNode& aNode);
|
||||
NS_IMETHOD OpenContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD CloseContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD NotifyError(nsresult aErrorResult);
|
||||
NS_IMETHOD CloseTopmostContainer();
|
||||
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddComment(const nsIParserNode& aNode);
|
||||
|
@ -251,6 +252,11 @@ NS_IMETHODIMP RobotSink::AddLeaf(const nsIParserNode& aNode)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP RobotSink::NotifyError(nsresult aErrorResult)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* This gets called by the parsing system when we find a comment
|
||||
* @update gess11/9/98
|
||||
|
|
|
@ -93,7 +93,6 @@ static eHTMLTags gWhitespaceTags[]={
|
|||
|
||||
static CTokenRecycler gTokenRecycler;
|
||||
|
||||
|
||||
/************************************************************************
|
||||
And now for the main class -- CNavDTD...
|
||||
************************************************************************/
|
||||
|
@ -3200,7 +3199,9 @@ CNavDTD::ConsumeEntity(PRUnichar aChar,CScanner& aScanner,CToken*& aToken) {
|
|||
* @return new token or null
|
||||
*/
|
||||
nsresult
|
||||
CNavDTD::ConsumeWhitespace(PRUnichar aChar,CScanner& aScanner,CToken*& aToken) {
|
||||
CNavDTD::ConsumeWhitespace(PRUnichar aChar,
|
||||
CScanner& aScanner,
|
||||
CToken*& aToken) {
|
||||
aToken = gTokenRecycler.CreateTokenOfType(eToken_whitespace,eHTMLTag_whitespace,gEmpty);
|
||||
nsresult result=kNoError;
|
||||
if(aToken) {
|
||||
|
|
|
@ -908,7 +908,11 @@ nsHTMLContentSinkStream::WillResume(void) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLContentSinkStream::NotifyError(nsresult aErrorResult)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -92,6 +92,7 @@ class nsHTMLContentSinkStream : public nsIHTMLContentSink {
|
|||
NS_IMETHOD OpenContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD CloseContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
|
||||
NS_IMETHOD NotifyError(nsresult aErrorResult);
|
||||
NS_IMETHOD AddComment(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
|
||||
|
||||
|
|
|
@ -46,6 +46,8 @@ public:
|
|||
NS_IMETHOD OpenContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD CloseContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
|
||||
NS_IMETHOD NotifyError(nsresult aErrorResult);
|
||||
|
||||
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddComment(const nsIParserNode& aNode);
|
||||
|
||||
|
@ -568,5 +570,9 @@ nsHTMLNullSink::WillResume(void) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLNullSink::NotifyError(nsresult aErrorResult)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,6 +122,13 @@ public:
|
|||
*/
|
||||
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) = 0;
|
||||
|
||||
/**
|
||||
* This gets called by the parser if it hits an unrecoverable
|
||||
* error (in XML, if the document is not well-formed or valid).
|
||||
*
|
||||
* @param aErrorResult the error code
|
||||
*/
|
||||
NS_IMETHOD NotifyError(nsresult aErrorResult)=0;
|
||||
};
|
||||
|
||||
#endif /* nsIContentSink_h___ */
|
||||
|
|
|
@ -79,6 +79,7 @@ public:
|
|||
NS_IMETHOD OpenContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD CloseContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
|
||||
NS_IMETHOD NotifyError(nsresult aErrorResult);
|
||||
NS_IMETHOD AddComment(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
|
||||
|
||||
|
@ -241,6 +242,12 @@ nsLoggingSink::AddLeaf(const nsIParserNode& aNode)
|
|||
return LeafNode(aNode);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLoggingSink::NotifyError(nsresult aErrorResult)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This gets called by the parser when you want to add
|
||||
|
|
|
@ -200,6 +200,7 @@ NS_IMETHODIMP CWellFormedDTD::WillBuildModel(nsString& aFilename,PRBool aNotifyS
|
|||
mLineNumber=0;
|
||||
result = mSink->WillBuildModel();
|
||||
|
||||
#if 0
|
||||
/* COMMENT OUT THIS BLOCK IF: you aren't using an nsHTMLContentSink...*/
|
||||
{
|
||||
nsIHTMLContentSink* theSink=(nsIHTMLContentSink*)mSink;
|
||||
|
@ -215,6 +216,7 @@ NS_IMETHODIMP CWellFormedDTD::WillBuildModel(nsString& aFilename,PRBool aNotifyS
|
|||
theSink->OpenBody(theBodyNode);
|
||||
}
|
||||
/* COMMENT OUT THIS BLOCK IF: you aren't using an nsHTMLContentSink...*/
|
||||
#endif
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -232,7 +234,9 @@ NS_IMETHODIMP CWellFormedDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySi
|
|||
//ADD CODE HERE TO CLOSE OPEN CONTAINERS...
|
||||
|
||||
if((aNotifySink) && (mSink)) {
|
||||
result = mSink->DidBuildModel(1);
|
||||
|
||||
#if 0
|
||||
/* COMMENT OUT THIS BLOCK IF: you aren't using an nsHTMLContentSink...*/
|
||||
{
|
||||
nsIHTMLContentSink* theSink=(nsIHTMLContentSink*)mSink;
|
||||
|
@ -247,10 +251,9 @@ NS_IMETHODIMP CWellFormedDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySi
|
|||
nsCParserNode theHTMLNode(&theBodyToken,0);
|
||||
theSink->CloseHTML(theBodyNode);
|
||||
|
||||
result = mSink->DidBuildModel(1);
|
||||
}
|
||||
/* COMMENT OUT THIS BLOCK IF: you aren't using an nsHTMLContentSink...*/
|
||||
|
||||
#endif
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -67,6 +67,7 @@ public:
|
|||
NS_IMETHOD CloseFrameset(const nsIParserNode& aNode);
|
||||
NS_IMETHOD OpenContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD CloseContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD NotifyError(nsresult aErrorResult);
|
||||
NS_IMETHOD CloseTopmostContainer();
|
||||
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddComment(const nsIParserNode& aNode);
|
||||
|
@ -251,6 +252,11 @@ NS_IMETHODIMP RobotSink::AddLeaf(const nsIParserNode& aNode)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP RobotSink::NotifyError(nsresult aErrorResult)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* This gets called by the parsing system when we find a comment
|
||||
* @update gess11/9/98
|
||||
|
|
|
@ -93,7 +93,6 @@ static eHTMLTags gWhitespaceTags[]={
|
|||
|
||||
static CTokenRecycler gTokenRecycler;
|
||||
|
||||
|
||||
/************************************************************************
|
||||
And now for the main class -- CNavDTD...
|
||||
************************************************************************/
|
||||
|
@ -3200,7 +3199,9 @@ CNavDTD::ConsumeEntity(PRUnichar aChar,CScanner& aScanner,CToken*& aToken) {
|
|||
* @return new token or null
|
||||
*/
|
||||
nsresult
|
||||
CNavDTD::ConsumeWhitespace(PRUnichar aChar,CScanner& aScanner,CToken*& aToken) {
|
||||
CNavDTD::ConsumeWhitespace(PRUnichar aChar,
|
||||
CScanner& aScanner,
|
||||
CToken*& aToken) {
|
||||
aToken = gTokenRecycler.CreateTokenOfType(eToken_whitespace,eHTMLTag_whitespace,gEmpty);
|
||||
nsresult result=kNoError;
|
||||
if(aToken) {
|
||||
|
|
|
@ -908,7 +908,11 @@ nsHTMLContentSinkStream::WillResume(void) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLContentSinkStream::NotifyError(nsresult aErrorResult)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -92,6 +92,7 @@ class nsHTMLContentSinkStream : public nsIHTMLContentSink {
|
|||
NS_IMETHOD OpenContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD CloseContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
|
||||
NS_IMETHOD NotifyError(nsresult aErrorResult);
|
||||
NS_IMETHOD AddComment(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
|
||||
|
||||
|
|
|
@ -46,6 +46,8 @@ public:
|
|||
NS_IMETHOD OpenContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD CloseContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
|
||||
NS_IMETHOD NotifyError(nsresult aErrorResult);
|
||||
|
||||
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddComment(const nsIParserNode& aNode);
|
||||
|
||||
|
@ -568,5 +570,9 @@ nsHTMLNullSink::WillResume(void) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLNullSink::NotifyError(nsresult aErrorResult)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,6 +122,13 @@ public:
|
|||
*/
|
||||
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) = 0;
|
||||
|
||||
/**
|
||||
* This gets called by the parser if it hits an unrecoverable
|
||||
* error (in XML, if the document is not well-formed or valid).
|
||||
*
|
||||
* @param aErrorResult the error code
|
||||
*/
|
||||
NS_IMETHOD NotifyError(nsresult aErrorResult)=0;
|
||||
};
|
||||
|
||||
#endif /* nsIContentSink_h___ */
|
||||
|
|
|
@ -79,6 +79,7 @@ public:
|
|||
NS_IMETHOD OpenContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD CloseContainer(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
|
||||
NS_IMETHOD NotifyError(nsresult aErrorResult);
|
||||
NS_IMETHOD AddComment(const nsIParserNode& aNode);
|
||||
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
|
||||
|
||||
|
@ -241,6 +242,12 @@ nsLoggingSink::AddLeaf(const nsIParserNode& aNode)
|
|||
return LeafNode(aNode);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLoggingSink::NotifyError(nsresult aErrorResult)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This gets called by the parser when you want to add
|
||||
|
|
|
@ -200,6 +200,7 @@ NS_IMETHODIMP CWellFormedDTD::WillBuildModel(nsString& aFilename,PRBool aNotifyS
|
|||
mLineNumber=0;
|
||||
result = mSink->WillBuildModel();
|
||||
|
||||
#if 0
|
||||
/* COMMENT OUT THIS BLOCK IF: you aren't using an nsHTMLContentSink...*/
|
||||
{
|
||||
nsIHTMLContentSink* theSink=(nsIHTMLContentSink*)mSink;
|
||||
|
@ -215,6 +216,7 @@ NS_IMETHODIMP CWellFormedDTD::WillBuildModel(nsString& aFilename,PRBool aNotifyS
|
|||
theSink->OpenBody(theBodyNode);
|
||||
}
|
||||
/* COMMENT OUT THIS BLOCK IF: you aren't using an nsHTMLContentSink...*/
|
||||
#endif
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -232,7 +234,9 @@ NS_IMETHODIMP CWellFormedDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySi
|
|||
//ADD CODE HERE TO CLOSE OPEN CONTAINERS...
|
||||
|
||||
if((aNotifySink) && (mSink)) {
|
||||
result = mSink->DidBuildModel(1);
|
||||
|
||||
#if 0
|
||||
/* COMMENT OUT THIS BLOCK IF: you aren't using an nsHTMLContentSink...*/
|
||||
{
|
||||
nsIHTMLContentSink* theSink=(nsIHTMLContentSink*)mSink;
|
||||
|
@ -247,10 +251,9 @@ NS_IMETHODIMP CWellFormedDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySi
|
|||
nsCParserNode theHTMLNode(&theBodyToken,0);
|
||||
theSink->CloseHTML(theBodyNode);
|
||||
|
||||
result = mSink->DidBuildModel(1);
|
||||
}
|
||||
/* COMMENT OUT THIS BLOCK IF: you aren't using an nsHTMLContentSink...*/
|
||||
|
||||
#endif
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче