diff --git a/mozilla/htmlparser/robot/nsRobotSink.cpp b/mozilla/htmlparser/robot/nsRobotSink.cpp index ef5c8190443..c72735fac9d 100644 --- a/mozilla/htmlparser/robot/nsRobotSink.cpp +++ b/mozilla/htmlparser/robot/nsRobotSink.cpp @@ -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 diff --git a/mozilla/htmlparser/src/CNavDTD.cpp b/mozilla/htmlparser/src/CNavDTD.cpp index 32f6057a10e..ce529264928 100644 --- a/mozilla/htmlparser/src/CNavDTD.cpp +++ b/mozilla/htmlparser/src/CNavDTD.cpp @@ -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) { diff --git a/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp b/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp index c08f898722e..83b2b9ded29 100644 --- a/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp +++ b/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp @@ -908,7 +908,11 @@ nsHTMLContentSinkStream::WillResume(void) { return NS_OK; } - +NS_IMETHODIMP +nsHTMLContentSinkStream::NotifyError(nsresult aErrorResult) +{ + return NS_OK; +} /** diff --git a/mozilla/htmlparser/src/nsHTMLContentSinkStream.h b/mozilla/htmlparser/src/nsHTMLContentSinkStream.h index b68ea395356..1e6ca2d0fed 100644 --- a/mozilla/htmlparser/src/nsHTMLContentSinkStream.h +++ b/mozilla/htmlparser/src/nsHTMLContentSinkStream.h @@ -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); diff --git a/mozilla/htmlparser/src/nsHTMLNullSink.cpp b/mozilla/htmlparser/src/nsHTMLNullSink.cpp index 7eefef09ec7..37401b2110b 100644 --- a/mozilla/htmlparser/src/nsHTMLNullSink.cpp +++ b/mozilla/htmlparser/src/nsHTMLNullSink.cpp @@ -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; +} diff --git a/mozilla/htmlparser/src/nsIContentSink.h b/mozilla/htmlparser/src/nsIContentSink.h index 5206ac6657b..76a4c040ff7 100644 --- a/mozilla/htmlparser/src/nsIContentSink.h +++ b/mozilla/htmlparser/src/nsIContentSink.h @@ -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___ */ diff --git a/mozilla/htmlparser/src/nsLoggingSink.cpp b/mozilla/htmlparser/src/nsLoggingSink.cpp index d3a2be2adc4..44aa611f7c9 100644 --- a/mozilla/htmlparser/src/nsLoggingSink.cpp +++ b/mozilla/htmlparser/src/nsLoggingSink.cpp @@ -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 diff --git a/mozilla/htmlparser/src/nsWellFormedDTD.cpp b/mozilla/htmlparser/src/nsWellFormedDTD.cpp index 0129b349bf2..6508a2d77d9 100644 --- a/mozilla/htmlparser/src/nsWellFormedDTD.cpp +++ b/mozilla/htmlparser/src/nsWellFormedDTD.cpp @@ -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; } diff --git a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp b/mozilla/parser/htmlparser/robot/nsRobotSink.cpp index ef5c8190443..c72735fac9d 100644 --- a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp +++ b/mozilla/parser/htmlparser/robot/nsRobotSink.cpp @@ -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 diff --git a/mozilla/parser/htmlparser/src/CNavDTD.cpp b/mozilla/parser/htmlparser/src/CNavDTD.cpp index 32f6057a10e..ce529264928 100644 --- a/mozilla/parser/htmlparser/src/CNavDTD.cpp +++ b/mozilla/parser/htmlparser/src/CNavDTD.cpp @@ -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) { diff --git a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp index c08f898722e..83b2b9ded29 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp @@ -908,7 +908,11 @@ nsHTMLContentSinkStream::WillResume(void) { return NS_OK; } - +NS_IMETHODIMP +nsHTMLContentSinkStream::NotifyError(nsresult aErrorResult) +{ + return NS_OK; +} /** diff --git a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.h b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.h index b68ea395356..1e6ca2d0fed 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.h +++ b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.h @@ -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); diff --git a/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp b/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp index 7eefef09ec7..37401b2110b 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp @@ -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; +} diff --git a/mozilla/parser/htmlparser/src/nsIContentSink.h b/mozilla/parser/htmlparser/src/nsIContentSink.h index 5206ac6657b..76a4c040ff7 100644 --- a/mozilla/parser/htmlparser/src/nsIContentSink.h +++ b/mozilla/parser/htmlparser/src/nsIContentSink.h @@ -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___ */ diff --git a/mozilla/parser/htmlparser/src/nsLoggingSink.cpp b/mozilla/parser/htmlparser/src/nsLoggingSink.cpp index d3a2be2adc4..44aa611f7c9 100644 --- a/mozilla/parser/htmlparser/src/nsLoggingSink.cpp +++ b/mozilla/parser/htmlparser/src/nsLoggingSink.cpp @@ -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 diff --git a/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp b/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp index 0129b349bf2..6508a2d77d9 100644 --- a/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp +++ b/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp @@ -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; }