Bug 720124 - Remove dead code from HTMLContentSink: AddDocTypeDecl; r=hsivonen

This commit is contained in:
Ms2ger 2012-01-25 08:50:02 +01:00
parent 437f03c00c
commit 4d51def3be
9 changed files with 3 additions and 67 deletions

View File

@ -316,12 +316,6 @@ mozSanitizingHTMLSerializer::AddLeaf(const nsIParserNode& aNode)
return DoAddLeaf(type, text); return DoAddLeaf(type, text);
} }
NS_IMETHODIMP
mozSanitizingHTMLSerializer::AddDocTypeDecl(const nsIParserNode& aNode)
{
return NS_OK;
}
NS_IMETHODIMP NS_IMETHODIMP
mozSanitizingHTMLSerializer::SetDocumentCharset(nsACString& aCharset) mozSanitizingHTMLSerializer::SetDocumentCharset(nsACString& aCharset)
{ {

View File

@ -110,7 +110,6 @@ public:
NS_IMETHOD AddComment(const nsIParserNode& aNode) { return NS_OK; } NS_IMETHOD AddComment(const nsIParserNode& aNode) { return NS_OK; }
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode)
{ return NS_OK; } { return NS_OK; }
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
virtual void FlushPendingNotifications(mozFlushType aType) { } virtual void FlushPendingNotifications(mozFlushType aType) { }
NS_IMETHOD SetDocumentCharset(nsACString& aCharset); NS_IMETHOD SetDocumentCharset(nsACString& aCharset);
virtual nsISupports *GetTarget() { return nsnull; } virtual nsISupports *GetTarget() { return nsnull; }

View File

@ -110,7 +110,6 @@ public:
NS_IMETHOD AddLeaf(const nsIParserNode& aNode); NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode) { return NS_OK; } NS_IMETHOD AddComment(const nsIParserNode& aNode) { return NS_OK; }
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) { return NS_OK; } NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) { return NS_OK; }
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode) { return NS_OK; }
virtual void FlushPendingNotifications(mozFlushType aType) { } virtual void FlushPendingNotifications(mozFlushType aType) { }
NS_IMETHOD SetDocumentCharset(nsACString& aCharset) { return NS_OK; } NS_IMETHOD SetDocumentCharset(nsACString& aCharset) { return NS_OK; }
virtual nsISupports *GetTarget() { return nsnull; } virtual nsISupports *GetTarget() { return nsnull; }

View File

@ -204,7 +204,6 @@ public:
NS_IMETHOD AddLeaf(const nsIParserNode& aNode); NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode); NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode); NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD DidProcessTokens(void); NS_IMETHOD DidProcessTokens(void);
NS_IMETHOD WillProcessAToken(void); NS_IMETHOD WillProcessAToken(void);
NS_IMETHOD DidProcessAToken(void); NS_IMETHOD DidProcessAToken(void);
@ -2109,18 +2108,6 @@ HTMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode)
return result; return result;
} }
/**
* This gets called by the parser when it encounters
* a DOCTYPE declaration in the HTML document.
*/
NS_IMETHODIMP
HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
{
MOZ_NOT_REACHED("Must not use HTMLContentSink for doctypes.");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP NS_IMETHODIMP
HTMLContentSink::DidProcessTokens(void) HTMLContentSink::DidProcessTokens(void)
{ {

View File

@ -83,8 +83,8 @@
#include "nsHTMLTags.h" #include "nsHTMLTags.h"
#define NS_IHTML_CONTENT_SINK_IID \ #define NS_IHTML_CONTENT_SINK_IID \
{ 0x44b5a4f4, 0x01f7, 0x4116, \ { 0xa3aad227, 0xe137, 0x407c, \
{ 0xb5, 0xa5, 0x56, 0x4d, 0x64, 0x0b, 0x68, 0x1f } } { 0xa4, 0xa0, 0x9e, 0x23, 0xb6, 0x38, 0xf3, 0x42 } }
#define MAX_REFLOW_DEPTH 200 #define MAX_REFLOW_DEPTH 200
@ -205,16 +205,6 @@ public:
*/ */
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) = 0; NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) = 0;
/**
* This method is called by the parser when it encounters
* a document type declaration.
*
* XXX Should the parser also parse the internal subset?
*
* @param nsIParserNode reference to parser node interface
*/
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode) = 0;
/** /**
* Call this method to determnine if a FORM is on the sink's stack * Call this method to determnine if a FORM is on the sink's stack
* *

View File

@ -1987,15 +1987,7 @@ CNavDTD::HandleDocTypeDeclToken(CToken* aToken)
// Now remove "<!" from the begining // Now remove "<!" from the begining
docTypeStr.Cut(0, 2); docTypeStr.Cut(0, 2);
theToken->SetStringValue(docTypeStr); theToken->SetStringValue(docTypeStr);
return NS_OK;
nsCParserNode* theNode = mNodeAllocator.CreateNode(aToken, mTokenAllocator);
NS_ENSURE_TRUE(theNode, NS_ERROR_OUT_OF_MEMORY);
nsresult result = mSink ? mSink->AddDocTypeDecl(*theNode) : NS_OK;
IF_FREE(theNode, &mNodeAllocator);
return result;
} }
/** /**

View File

@ -241,29 +241,6 @@ nsLoggingSink::AddProcessingInstruction(const nsIParserNode& aNode){
return theResult; return theResult;
} }
/**
* This gets called by the parser when it encounters
* a DOCTYPE declaration in the HTML document.
*/
NS_IMETHODIMP
nsLoggingSink::AddDocTypeDecl(const nsIParserNode& aNode) {
#ifdef VERBOSE_DEBUG
DebugDump("<",aNode.GetText(),(mNodeStackPos)*2);
#endif
nsresult theResult=NS_OK;
//then proxy the call to the real sink if you have one.
if(mSink) {
theResult=mSink->AddDocTypeDecl(aNode);
}
return theResult;
}
/** /**
* This gets called by the parser when you want to add * This gets called by the parser when you want to add
* a comment node to the current container in the content * a comment node to the current container in the content

View File

@ -71,7 +71,6 @@ public:
NS_IMETHOD AddLeaf(const nsIParserNode& aNode); NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode); NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode); NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
virtual void FlushPendingNotifications(mozFlushType aType) { } virtual void FlushPendingNotifications(mozFlushType aType) { }
NS_IMETHOD SetDocumentCharset(nsACString& aCharset) { return NS_OK; } NS_IMETHOD SetDocumentCharset(nsACString& aCharset) { return NS_OK; }
virtual nsISupports *GetTarget() { return nsnull; } virtual nsISupports *GetTarget() { return nsnull; }

View File

@ -374,7 +374,6 @@ public:
NS_IMETHOD AddLeaf(const nsIParserNode& aNode); NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode) { return NS_OK; } NS_IMETHOD AddComment(const nsIParserNode& aNode) { return NS_OK; }
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) { return NS_OK; } NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) { return NS_OK; }
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode) { return NS_OK; }
NS_IMETHOD NotifyTagObservers(nsIParserNode* aNode) { return NS_OK; } NS_IMETHOD NotifyTagObservers(nsIParserNode* aNode) { return NS_OK; }
NS_IMETHOD_(bool) IsFormOnStack() { return false; } NS_IMETHOD_(bool) IsFormOnStack() { return false; }