diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp
index 21ddd7266c0..70e930990ea 100644
--- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp
+++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp
@@ -173,7 +173,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD BeginContext(PRInt32 aID);
@@ -2181,7 +2181,7 @@ nsresult HTMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode) {
*/
NS_IMETHODIMP
-HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
+HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}
diff --git a/mozilla/content/html/document/src/nsHTMLFragmentContentSink.cpp b/mozilla/content/html/document/src/nsHTMLFragmentContentSink.cpp
index 6801b1e6d8d..53fa4f46a13 100644
--- a/mozilla/content/html/document/src/nsHTMLFragmentContentSink.cpp
+++ b/mozilla/content/html/document/src/nsHTMLFragmentContentSink.cpp
@@ -66,7 +66,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD BeginContext(PRInt32 aID);
@@ -499,7 +499,7 @@ nsHTMLFragmentContentSink::AddProcessingInstruction(const nsIParserNode& aNode)
*/
NS_IMETHODIMP
-nsHTMLFragmentContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
+nsHTMLFragmentContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}
diff --git a/mozilla/content/xml/document/public/nsIXMLContentSink.h b/mozilla/content/xml/document/public/nsIXMLContentSink.h
index 20d75bc22de..28397b30b2b 100644
--- a/mozilla/content/xml/document/public/nsIXMLContentSink.h
+++ b/mozilla/content/xml/document/public/nsIXMLContentSink.h
@@ -67,16 +67,6 @@ public:
*/
NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode)=0;
- /**
- * This method is called by the parser when it encounters
- * a document type declaration.
- *
- * XXX Should the parser also part the internal subset?
- *
- * @param nsIParserNode reference to parser node interface
- */
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode)=0;
-
/**
* This method is called by the parser when it encounters
* character data - either regular CDATA or a marked CDATA
diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.cpp b/mozilla/content/xml/document/src/nsXMLContentSink.cpp
index fe4c235f041..c438ccefd6a 100644
--- a/mozilla/content/xml/document/src/nsXMLContentSink.cpp
+++ b/mozilla/content/xml/document/src/nsXMLContentSink.cpp
@@ -1364,7 +1364,7 @@ nsXMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode)
NS_IMETHODIMP
-nsXMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
+nsXMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
printf("nsXMLContentSink::AddDocTypeDecl\n");
return NS_OK;
diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.h b/mozilla/content/xml/document/src/nsXMLContentSink.h
index 440c9ffee1b..82d27668333 100644
--- a/mozilla/content/xml/document/src/nsXMLContentSink.h
+++ b/mozilla/content/xml/document/src/nsXMLContentSink.h
@@ -78,10 +78,10 @@ public:
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddCDATASection(const nsIParserNode& aNode);
NS_IMETHOD NotifyError(const nsParserError* aError);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIXMLContentSink
- NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
NS_IMETHOD AddNotation(const nsIParserNode& aNode);
diff --git a/mozilla/content/xsl/document/src/nsXSLContentSink.cpp b/mozilla/content/xsl/document/src/nsXSLContentSink.cpp
index e70a1af6bfd..ca46e4955f3 100644
--- a/mozilla/content/xsl/document/src/nsXSLContentSink.cpp
+++ b/mozilla/content/xsl/document/src/nsXSLContentSink.cpp
@@ -173,6 +173,14 @@ nsXSLContentSink::NotifyError(const nsParserError* aError)
return result;
}
+/*
+NS_IMETHODIMP
+nsXSLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
+{
+ // We'll use nsXMLContentSink::AddDocTypeDecl() for now...
+}
+*/
+
// nsIXMLContentSink
@@ -184,14 +192,6 @@ nsXSLContentSink::AddXMLDecl(const nsIParserNode& aNode)
}
*/
-/*
-NS_IMETHODIMP
-nsXSLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
-{
- // We'll use nsXMLContentSink::AddDocTypeDecl() for now...
-}
-*/
-
/*
NS_IMETHODIMP
nsXSLContentSink::AddCharacterData(const nsIParserNode& aNode)
diff --git a/mozilla/content/xsl/document/src/nsXSLContentSink.h b/mozilla/content/xsl/document/src/nsXSLContentSink.h
index acfe094b6c5..6bb2d1ce106 100644
--- a/mozilla/content/xsl/document/src/nsXSLContentSink.h
+++ b/mozilla/content/xsl/document/src/nsXSLContentSink.h
@@ -51,10 +51,10 @@ public:
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD NotifyError(const nsParserError* aError);
+ //NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIXMLContentSink
- //NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
- //NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ //NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
//NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
//NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
//NS_IMETHOD AddNotation(const nsIParserNode& aNode);
diff --git a/mozilla/htmlparser/robot/nsRobotSink.cpp b/mozilla/htmlparser/robot/nsRobotSink.cpp
index ceef68a8ca7..1a715dd5bc4 100644
--- a/mozilla/htmlparser/robot/nsRobotSink.cpp
+++ b/mozilla/htmlparser/robot/nsRobotSink.cpp
@@ -74,7 +74,7 @@ public:
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
NS_IMETHOD WillBuildModel(void) { return NS_OK; }
NS_IMETHOD DidBuildModel(PRInt32 aQualityLevel) { return NS_OK; }
NS_IMETHOD WillInterrupt(void) { return NS_OK; }
@@ -295,7 +295,7 @@ NS_IMETHODIMP RobotSink::AddProcessingInstruction(const nsIParserNode& aNode) {
*/
NS_IMETHODIMP
-RobotSink::AddDocTypeDecl(const nsIParserNode& aNode)
+RobotSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}
diff --git a/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp b/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp
index 5ae795094cb..94676869163 100644
--- a/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp
+++ b/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp
@@ -1146,7 +1146,7 @@ nsHTMLContentSinkStream::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
-nsHTMLContentSinkStream::AddDocTypeDecl(const nsIParserNode& aNode)
+nsHTMLContentSinkStream::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
#ifdef VERBOSE_DEBUG
DebugDump("<",aNode.GetText(),(mNodeStackPos)*2);
diff --git a/mozilla/htmlparser/src/nsHTMLContentSinkStream.h b/mozilla/htmlparser/src/nsHTMLContentSinkStream.h
index 2b9fc46ab82..35f5889a224 100644
--- a/mozilla/htmlparser/src/nsHTMLContentSinkStream.h
+++ b/mozilla/htmlparser/src/nsHTMLContentSinkStream.h
@@ -97,7 +97,7 @@ class nsHTMLContentSinkStream : public nsIHTMLContentSink {
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
/*******************************************************************
* The following methods are inherited from nsIHTMLContentSink.
diff --git a/mozilla/htmlparser/src/nsHTMLNullSink.cpp b/mozilla/htmlparser/src/nsHTMLNullSink.cpp
index 2a0abaaa571..ef6ab871b17 100644
--- a/mozilla/htmlparser/src/nsHTMLNullSink.cpp
+++ b/mozilla/htmlparser/src/nsHTMLNullSink.cpp
@@ -49,7 +49,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD SetTitle(const nsString& aValue);
@@ -517,7 +517,7 @@ nsHTMLNullSink::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
-nsHTMLNullSink::AddDocTypeDecl(const nsIParserNode& aNode)
+nsHTMLNullSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
#ifdef VERBOSE_DEBUG
DebugDump("<",aNode.GetText(),(mNodeStackPos)*2);
diff --git a/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.cpp b/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.cpp
index e927f6237df..7f5a116ec58 100644
--- a/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.cpp
+++ b/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.cpp
@@ -595,7 +595,7 @@ nsHTMLToTXTSinkStream::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
-nsHTMLToTXTSinkStream::AddDocTypeDecl(const nsIParserNode& aNode)
+nsHTMLToTXTSinkStream::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}
diff --git a/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.h b/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.h
index 207ff48519f..a855cb1d7b6 100644
--- a/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.h
+++ b/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.h
@@ -86,7 +86,7 @@ class nsHTMLToTXTSinkStream : public nsIHTMLContentSink
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
/*******************************************************************
* The following methods are inherited from nsIHTMLContentSink.
diff --git a/mozilla/htmlparser/src/nsIContentSink.h b/mozilla/htmlparser/src/nsIContentSink.h
index 48da905c5c0..ce7195cff31 100644
--- a/mozilla/htmlparser/src/nsIContentSink.h
+++ b/mozilla/htmlparser/src/nsIContentSink.h
@@ -142,7 +142,7 @@ public:
*
* @param nsIParserNode reference to parser node interface
*/
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode)=0;
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)=0;
/**
* This gets called by the parser if it hits an unrecoverable
diff --git a/mozilla/htmlparser/src/nsLoggingSink.cpp b/mozilla/htmlparser/src/nsLoggingSink.cpp
index 4290ac7658d..c8bb339d4b2 100644
--- a/mozilla/htmlparser/src/nsLoggingSink.cpp
+++ b/mozilla/htmlparser/src/nsLoggingSink.cpp
@@ -85,7 +85,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD SetTitle(const nsString& aValue);
@@ -288,7 +288,7 @@ nsLoggingSink::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
-nsLoggingSink::AddDocTypeDecl(const nsIParserNode& aNode)
+nsLoggingSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
#ifdef VERBOSE_DEBUG
DebugDump("<",aNode.GetText(),(mNodeStackPos)*2);
diff --git a/mozilla/htmlparser/src/nsWellFormedDTD.cpp b/mozilla/htmlparser/src/nsWellFormedDTD.cpp
index 0aa012394d0..2ecfd90460e 100644
--- a/mozilla/htmlparser/src/nsWellFormedDTD.cpp
+++ b/mozilla/htmlparser/src/nsWellFormedDTD.cpp
@@ -574,7 +574,7 @@ NS_IMETHODIMP CWellFormedDTD::HandleToken(CToken* aToken,nsIParser* aParser) {
}
break;
case eToken_doctypeDecl:
- result = mSink->AddDocTypeDecl(theNode);
+ result = mSink->AddDocTypeDecl(theNode, 0);
break;
case eToken_style:
case eToken_skippedcontent:
diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp
index 21ddd7266c0..70e930990ea 100644
--- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp
+++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp
@@ -173,7 +173,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD BeginContext(PRInt32 aID);
@@ -2181,7 +2181,7 @@ nsresult HTMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode) {
*/
NS_IMETHODIMP
-HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
+HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}
diff --git a/mozilla/layout/html/document/src/nsHTMLFragmentContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLFragmentContentSink.cpp
index 6801b1e6d8d..53fa4f46a13 100644
--- a/mozilla/layout/html/document/src/nsHTMLFragmentContentSink.cpp
+++ b/mozilla/layout/html/document/src/nsHTMLFragmentContentSink.cpp
@@ -66,7 +66,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD BeginContext(PRInt32 aID);
@@ -499,7 +499,7 @@ nsHTMLFragmentContentSink::AddProcessingInstruction(const nsIParserNode& aNode)
*/
NS_IMETHODIMP
-nsHTMLFragmentContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
+nsHTMLFragmentContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}
diff --git a/mozilla/layout/xml/document/public/nsIXMLContentSink.h b/mozilla/layout/xml/document/public/nsIXMLContentSink.h
index 20d75bc22de..28397b30b2b 100644
--- a/mozilla/layout/xml/document/public/nsIXMLContentSink.h
+++ b/mozilla/layout/xml/document/public/nsIXMLContentSink.h
@@ -67,16 +67,6 @@ public:
*/
NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode)=0;
- /**
- * This method is called by the parser when it encounters
- * a document type declaration.
- *
- * XXX Should the parser also part the internal subset?
- *
- * @param nsIParserNode reference to parser node interface
- */
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode)=0;
-
/**
* This method is called by the parser when it encounters
* character data - either regular CDATA or a marked CDATA
diff --git a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp
index fe4c235f041..c438ccefd6a 100644
--- a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp
+++ b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp
@@ -1364,7 +1364,7 @@ nsXMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode)
NS_IMETHODIMP
-nsXMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
+nsXMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
printf("nsXMLContentSink::AddDocTypeDecl\n");
return NS_OK;
diff --git a/mozilla/layout/xml/document/src/nsXMLContentSink.h b/mozilla/layout/xml/document/src/nsXMLContentSink.h
index 440c9ffee1b..82d27668333 100644
--- a/mozilla/layout/xml/document/src/nsXMLContentSink.h
+++ b/mozilla/layout/xml/document/src/nsXMLContentSink.h
@@ -78,10 +78,10 @@ public:
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddCDATASection(const nsIParserNode& aNode);
NS_IMETHOD NotifyError(const nsParserError* aError);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIXMLContentSink
- NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
NS_IMETHOD AddNotation(const nsIParserNode& aNode);
diff --git a/mozilla/layout/xsl/document/src/nsXSLContentSink.cpp b/mozilla/layout/xsl/document/src/nsXSLContentSink.cpp
index e70a1af6bfd..ca46e4955f3 100644
--- a/mozilla/layout/xsl/document/src/nsXSLContentSink.cpp
+++ b/mozilla/layout/xsl/document/src/nsXSLContentSink.cpp
@@ -173,6 +173,14 @@ nsXSLContentSink::NotifyError(const nsParserError* aError)
return result;
}
+/*
+NS_IMETHODIMP
+nsXSLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
+{
+ // We'll use nsXMLContentSink::AddDocTypeDecl() for now...
+}
+*/
+
// nsIXMLContentSink
@@ -184,14 +192,6 @@ nsXSLContentSink::AddXMLDecl(const nsIParserNode& aNode)
}
*/
-/*
-NS_IMETHODIMP
-nsXSLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
-{
- // We'll use nsXMLContentSink::AddDocTypeDecl() for now...
-}
-*/
-
/*
NS_IMETHODIMP
nsXSLContentSink::AddCharacterData(const nsIParserNode& aNode)
diff --git a/mozilla/layout/xsl/document/src/nsXSLContentSink.h b/mozilla/layout/xsl/document/src/nsXSLContentSink.h
index acfe094b6c5..6bb2d1ce106 100644
--- a/mozilla/layout/xsl/document/src/nsXSLContentSink.h
+++ b/mozilla/layout/xsl/document/src/nsXSLContentSink.h
@@ -51,10 +51,10 @@ public:
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD NotifyError(const nsParserError* aError);
+ //NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIXMLContentSink
- //NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
- //NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ //NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
//NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
//NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
//NS_IMETHOD AddNotation(const nsIParserNode& aNode);
diff --git a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp b/mozilla/parser/htmlparser/robot/nsRobotSink.cpp
index ceef68a8ca7..1a715dd5bc4 100644
--- a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp
+++ b/mozilla/parser/htmlparser/robot/nsRobotSink.cpp
@@ -74,7 +74,7 @@ public:
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
NS_IMETHOD WillBuildModel(void) { return NS_OK; }
NS_IMETHOD DidBuildModel(PRInt32 aQualityLevel) { return NS_OK; }
NS_IMETHOD WillInterrupt(void) { return NS_OK; }
@@ -295,7 +295,7 @@ NS_IMETHODIMP RobotSink::AddProcessingInstruction(const nsIParserNode& aNode) {
*/
NS_IMETHODIMP
-RobotSink::AddDocTypeDecl(const nsIParserNode& aNode)
+RobotSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}
diff --git a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp
index 5ae795094cb..94676869163 100644
--- a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp
+++ b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp
@@ -1146,7 +1146,7 @@ nsHTMLContentSinkStream::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
-nsHTMLContentSinkStream::AddDocTypeDecl(const nsIParserNode& aNode)
+nsHTMLContentSinkStream::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
#ifdef VERBOSE_DEBUG
DebugDump("<",aNode.GetText(),(mNodeStackPos)*2);
diff --git a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.h b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.h
index 2b9fc46ab82..35f5889a224 100644
--- a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.h
+++ b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.h
@@ -97,7 +97,7 @@ class nsHTMLContentSinkStream : public nsIHTMLContentSink {
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
/*******************************************************************
* The following methods are inherited from nsIHTMLContentSink.
diff --git a/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp b/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp
index 2a0abaaa571..ef6ab871b17 100644
--- a/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp
+++ b/mozilla/parser/htmlparser/src/nsHTMLNullSink.cpp
@@ -49,7 +49,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD SetTitle(const nsString& aValue);
@@ -517,7 +517,7 @@ nsHTMLNullSink::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
-nsHTMLNullSink::AddDocTypeDecl(const nsIParserNode& aNode)
+nsHTMLNullSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
#ifdef VERBOSE_DEBUG
DebugDump("<",aNode.GetText(),(mNodeStackPos)*2);
diff --git a/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp b/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp
index e927f6237df..7f5a116ec58 100644
--- a/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp
+++ b/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp
@@ -595,7 +595,7 @@ nsHTMLToTXTSinkStream::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
-nsHTMLToTXTSinkStream::AddDocTypeDecl(const nsIParserNode& aNode)
+nsHTMLToTXTSinkStream::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}
diff --git a/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.h b/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.h
index 207ff48519f..a855cb1d7b6 100644
--- a/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.h
+++ b/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.h
@@ -86,7 +86,7 @@ class nsHTMLToTXTSinkStream : public nsIHTMLContentSink
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
/*******************************************************************
* The following methods are inherited from nsIHTMLContentSink.
diff --git a/mozilla/parser/htmlparser/src/nsIContentSink.h b/mozilla/parser/htmlparser/src/nsIContentSink.h
index 48da905c5c0..ce7195cff31 100644
--- a/mozilla/parser/htmlparser/src/nsIContentSink.h
+++ b/mozilla/parser/htmlparser/src/nsIContentSink.h
@@ -142,7 +142,7 @@ public:
*
* @param nsIParserNode reference to parser node interface
*/
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode)=0;
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)=0;
/**
* This gets called by the parser if it hits an unrecoverable
diff --git a/mozilla/parser/htmlparser/src/nsLoggingSink.cpp b/mozilla/parser/htmlparser/src/nsLoggingSink.cpp
index 4290ac7658d..c8bb339d4b2 100644
--- a/mozilla/parser/htmlparser/src/nsLoggingSink.cpp
+++ b/mozilla/parser/htmlparser/src/nsLoggingSink.cpp
@@ -85,7 +85,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD SetTitle(const nsString& aValue);
@@ -288,7 +288,7 @@ nsLoggingSink::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
-nsLoggingSink::AddDocTypeDecl(const nsIParserNode& aNode)
+nsLoggingSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
#ifdef VERBOSE_DEBUG
DebugDump("<",aNode.GetText(),(mNodeStackPos)*2);
diff --git a/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp b/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp
index 0aa012394d0..2ecfd90460e 100644
--- a/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp
+++ b/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp
@@ -574,7 +574,7 @@ NS_IMETHODIMP CWellFormedDTD::HandleToken(CToken* aToken,nsIParser* aParser) {
}
break;
case eToken_doctypeDecl:
- result = mSink->AddDocTypeDecl(theNode);
+ result = mSink->AddDocTypeDecl(theNode, 0);
break;
case eToken_style:
case eToken_skippedcontent:
diff --git a/mozilla/rdf/base/src/nsRDFContentSink.cpp b/mozilla/rdf/base/src/nsRDFContentSink.cpp
index 80eafaf797f..0f568492cf3 100644
--- a/mozilla/rdf/base/src/nsRDFContentSink.cpp
+++ b/mozilla/rdf/base/src/nsRDFContentSink.cpp
@@ -162,10 +162,10 @@ public:
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD NotifyError(const nsParserError* aError);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIXMLContentSink
- NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
NS_IMETHOD AddNotation(const nsIParserNode& aNode);
@@ -634,7 +634,7 @@ RDFContentSinkImpl::AddProcessingInstruction(const nsIParserNode& aNode)
}
NS_IMETHODIMP
-RDFContentSinkImpl::AddDocTypeDecl(const nsIParserNode& aNode)
+RDFContentSinkImpl::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
// XXX We'll ignore it for now
PR_LOG(gLog, PR_LOG_ALWAYS,
diff --git a/mozilla/rdf/base/src/nsRDFContentSink.h b/mozilla/rdf/base/src/nsRDFContentSink.h
new file mode 100644
index 00000000000..eff7a20b57f
--- /dev/null
+++ b/mozilla/rdf/base/src/nsRDFContentSink.h
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * The Original Code is Mozilla Communicator client code.
+ *
+ * The Initial Developer of the Original Code is Netscape Communications
+ * Corporation. Portions created by Netscape are Copyright (C) 1998
+ * Netscape Communications Corporation. All Rights Reserved.
+ */
+
+/*
+
+
+
+ */
+
+#ifndef nsRDFContentSink_h__
+#define nsRDFContentSink_h__
+
+#include "nsIRDFContentSink.h"
+
+class nsIURI;
+class nsVoidArray;
+class nsIRDFResource;
+class nsIRDFDataSource;
+class nsIRDFService;
+class nsINameSpaceManager;
+
+typedef enum {
+ eRDFContentSinkState_InProlog,
+ eRDFContentSinkState_InDocumentElement,
+ eRDFContentSinkState_InDescriptionElement,
+ eRDFContentSinkState_InContainerElement,
+ eRDFContentSinkState_InPropertyElement,
+ eRDFContentSinkState_InMemberElement,
+ eRDFContentSinkState_InEpilog
+} RDFContentSinkState;
+
+
+class RDFContentSinkImpl : public nsIRDFContentSink
+{
+public:
+ RDFContentSinkImpl();
+ virtual ~RDFContentSinkImpl();
+
+ // nsISupports
+ NS_DECL_ISUPPORTS
+
+ // nsIContentSink
+ NS_IMETHOD WillBuildModel(void);
+ NS_IMETHOD DidBuildModel(PRInt32 aQualityLevel);
+ NS_IMETHOD WillInterrupt(void);
+ NS_IMETHOD WillResume(void);
+ NS_IMETHOD SetParser(nsIParser* aParser);
+ NS_IMETHOD OpenContainer(const nsIParserNode& aNode);
+ NS_IMETHOD CloseContainer(const nsIParserNode& aNode);
+ NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
+ NS_IMETHOD AddComment(const nsIParserNode& aNode);
+ NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
+ NS_IMETHOD NotifyError(nsresult aErrorResult);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
+
+ // nsIXMLContentSink
+ NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
+ NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
+ NS_IMETHOD AddNotation(const nsIParserNode& aNode);
+ NS_IMETHOD AddEntityReference(const nsIParserNode& aNode);
+
+ // nsIRDFContentSink
+ NS_IMETHOD SetDataSource(nsIRDFDataSource* ds);
+ NS_IMETHOD GetDataSource(nsIRDFDataSource*& ds);
+ NS_IMETHOD Init(nsIURI* aURL, nsINameSpaceManager* aNameSpaceManager);
+
+protected:
+ // Text management
+ nsresult FlushText(PRBool aCreateTextNode=PR_TRUE,
+ PRBool* aDidFlush=nsnull);
+
+ PRUnichar* mText;
+ PRInt32 mTextLength;
+ PRInt32 mTextSize;
+ PRBool mConstrainSize;
+
+ // namespace management
+ void PushNameSpacesFrom(const nsIParserNode& aNode);
+ nsIAtom* CutNameSpacePrefix(nsString& aString);
+ PRInt32 GetNameSpaceID(nsIAtom* aPrefix);
+ void GetNameSpaceURI(PRInt32 aID, nsString& aURI);
+ void PopNameSpaces();
+
+ nsINameSpaceManager* mNameSpaceManager;
+ nsVoidArray* mNameSpaceStack;
+ PRInt32 mRDFNameSpaceID;
+
+ void SplitQualifiedName(const nsString& aQualifiedName,
+ PRInt32& rNameSpaceID,
+ nsString& rProperty);
+
+ // RDF-specific parsing
+ nsresult GetIdAboutAttribute(const nsIParserNode& aNode, nsString& rResource);
+ nsresult GetResourceAttribute(const nsIParserNode& aNode, nsString& rResource);
+ nsresult AddProperties(const nsIParserNode& aNode, nsIRDFResource* aSubject);
+
+ virtual nsresult OpenRDF(const nsIParserNode& aNode);
+ virtual nsresult OpenObject(const nsIParserNode& aNode);
+ virtual nsresult OpenProperty(const nsIParserNode& aNode);
+ virtual nsresult OpenMember(const nsIParserNode& aNode);
+ virtual nsresult OpenValue(const nsIParserNode& aNode);
+
+ // Miscellaneous RDF junk
+ nsIRDFService* mRDFService;
+ nsIRDFDataSource* mDataSource;
+ RDFContentSinkState mState;
+
+ // content stack management
+ PRInt32 PushContext(nsIRDFResource *aContext, RDFContentSinkState aState);
+ nsresult PopContext(nsIRDFResource*& rContext, RDFContentSinkState& rState);
+ nsIRDFResource* GetContextElement(PRInt32 ancestor = 0);
+
+ nsVoidArray* mContextStack;
+
+ nsIURI* mDocumentURL;
+ PRUint32 mGenSym; // for generating anonymous resources
+};
+
+
+#endif // nsRDFContentSink_h__
diff --git a/mozilla/rdf/datasource/src/nsXULContentSink.cpp b/mozilla/rdf/datasource/src/nsXULContentSink.cpp
index 6688b7f9761..2deb6d5a3bf 100644
--- a/mozilla/rdf/datasource/src/nsXULContentSink.cpp
+++ b/mozilla/rdf/datasource/src/nsXULContentSink.cpp
@@ -164,10 +164,10 @@ public:
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD NotifyError(const nsParserError* aError);
+ NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIXMLContentSink
- NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
- NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
+ NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
NS_IMETHOD AddNotation(const nsIParserNode& aNode);
@@ -968,7 +968,7 @@ XULContentSinkImpl::AddProcessingInstruction(const nsIParserNode& aNode)
}
NS_IMETHODIMP
-XULContentSinkImpl::AddDocTypeDecl(const nsIParserNode& aNode)
+XULContentSinkImpl::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
PR_LOG(gLog, PR_LOG_WARNING,
("xul: ignoring doctype decl at line %d", aNode.GetSourceLineNumber()));