From 05ed36cc336d2deae9ccf2bb9ff4a937482b7dca Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Wed, 25 Jan 2012 08:50:04 +0100 Subject: [PATCH] Bug 720124 - Remove dead code from HTMLContentSink: IsFormOnStack; r=hsivonen --- content/base/src/mozSanitizingSerializer.h | 1 - content/base/src/nsPlainTextSerializer.h | 1 - content/html/document/src/nsHTMLContentSink.cpp | 1 - parser/htmlparser/public/nsIHTMLContentSink.h | 12 ++---------- parser/htmlparser/src/CNavDTD.cpp | 16 ---------------- parser/htmlparser/src/nsLoggingSink.h | 1 - .../places/nsPlacesImportExportService.cpp | 1 - 7 files changed, 2 insertions(+), 31 deletions(-) diff --git a/content/base/src/mozSanitizingSerializer.h b/content/base/src/mozSanitizingSerializer.h index 8de52214b8a..2cfb37bfd4b 100644 --- a/content/base/src/mozSanitizingSerializer.h +++ b/content/base/src/mozSanitizingSerializer.h @@ -118,7 +118,6 @@ public: NS_IMETHOD OpenHead(); NS_IMETHOD IsEnabled(PRInt32 aTag, bool* aReturn); NS_IMETHOD NotifyTagObservers(nsIParserNode* aNode) { return NS_OK; } - NS_IMETHOD_(bool) IsFormOnStack() { return false; } NS_IMETHOD BeginContext(PRInt32 aPosition) { return NS_OK; } NS_IMETHOD EndContext(PRInt32 aPosition) { return NS_OK; } NS_IMETHOD DidProcessTokens(void) { return NS_OK; } diff --git a/content/base/src/nsPlainTextSerializer.h b/content/base/src/nsPlainTextSerializer.h index 305748029ee..5bb0ea556e0 100644 --- a/content/base/src/nsPlainTextSerializer.h +++ b/content/base/src/nsPlainTextSerializer.h @@ -118,7 +118,6 @@ public: NS_IMETHOD OpenHead(); NS_IMETHOD IsEnabled(PRInt32 aTag, bool* aReturn); NS_IMETHOD NotifyTagObservers(nsIParserNode* aNode) { return NS_OK; } - NS_IMETHOD_(bool) IsFormOnStack() { return false; } NS_IMETHOD BeginContext(PRInt32 aPosition) { return NS_OK; } NS_IMETHOD EndContext(PRInt32 aPosition) { return NS_OK; } diff --git a/content/html/document/src/nsHTMLContentSink.cpp b/content/html/document/src/nsHTMLContentSink.cpp index b8697e54683..0bf50efd705 100644 --- a/content/html/document/src/nsHTMLContentSink.cpp +++ b/content/html/document/src/nsHTMLContentSink.cpp @@ -204,7 +204,6 @@ public: NS_IMETHOD EndContext(PRInt32 aID); NS_IMETHOD OpenHead(); NS_IMETHOD IsEnabled(PRInt32 aTag, bool* aReturn); - NS_IMETHOD_(bool) IsFormOnStack() { return false; } #ifdef DEBUG // nsIDebugDumpContent diff --git a/parser/htmlparser/public/nsIHTMLContentSink.h b/parser/htmlparser/public/nsIHTMLContentSink.h index 05811e8a085..75a19417706 100644 --- a/parser/htmlparser/public/nsIHTMLContentSink.h +++ b/parser/htmlparser/public/nsIHTMLContentSink.h @@ -83,8 +83,8 @@ #include "nsHTMLTags.h" #define NS_IHTML_CONTENT_SINK_IID \ -{ 0xa3aad227, 0xe137, 0x407c, \ - { 0xa4, 0xa0, 0x9e, 0x23, 0xb6, 0x38, 0xf3, 0x42 } } +{ 0xb6d6ae00, 0x0884, 0x4a30, \ + { 0xa8, 0xb4, 0xce, 0xca, 0x57, 0x27, 0x1a, 0x3e } } #define MAX_REFLOW_DEPTH 200 @@ -204,14 +204,6 @@ public: * @param nsIParserNode reference to parser node interface */ NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) = 0; - - /** - * Call this method to determnine if a FORM is on the sink's stack - * - * @return true if found else false - */ - NS_IMETHOD_(bool) IsFormOnStack() = 0; - }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIHTMLContentSink, NS_IHTML_CONTENT_SINK_IID) diff --git a/parser/htmlparser/src/CNavDTD.cpp b/parser/htmlparser/src/CNavDTD.cpp index a5d38405c87..9cc358df7f1 100644 --- a/parser/htmlparser/src/CNavDTD.cpp +++ b/parser/htmlparser/src/CNavDTD.cpp @@ -1747,16 +1747,6 @@ CNavDTD::HandleSavedTokens(PRInt32 anIndex) PRInt32 attrCount; PRInt32 theTopIndex = anIndex + 1; PRInt32 theTagCount = mBodyContext->GetCount(); - bool formWasOnStack = mSink->IsFormOnStack(); - - if (formWasOnStack) { - // Do this to synchronize dtd stack and the sink stack. - // Note: FORM is never on the dtd stack because its always - // considered as a leaf. However, in the sink FORM can either - // be a container or a leaf. Therefore, we have to check - // with the sink -- Ref: Bug 20087. - ++anIndex; - } // Pause the main context and switch to the new context. result = mSink->BeginContext(anIndex); @@ -1822,12 +1812,6 @@ CNavDTD::HandleSavedTokens(PRInt32 anIndex) true); } - if (!formWasOnStack && mSink->IsFormOnStack()) { - // If a form has appeared on the sink context stack since the beginning of - // HandleSavedTokens, have the sink close it: - mSink->CloseContainer(eHTMLTag_form); - } - // Bad-contents were successfully processed. Now, itz time to get // back to the original body context state. mTempContext->MoveEntries(*mBodyContext, theTagCount - theTopIndex); diff --git a/parser/htmlparser/src/nsLoggingSink.h b/parser/htmlparser/src/nsLoggingSink.h index 7dbc7f21d0a..7c44258fd23 100644 --- a/parser/htmlparser/src/nsLoggingSink.h +++ b/parser/htmlparser/src/nsLoggingSink.h @@ -81,7 +81,6 @@ public: /* Take the largest possible feature set. */ { NS_ENSURE_ARG_POINTER(aReturn); *aReturn = true; return NS_OK; } NS_IMETHOD NotifyTagObservers(nsIParserNode* aNode) { return NS_OK; } - NS_IMETHOD_(bool) IsFormOnStack() { return false; } NS_IMETHOD BeginContext(PRInt32 aPosition); NS_IMETHOD EndContext(PRInt32 aPosition); diff --git a/toolkit/components/places/nsPlacesImportExportService.cpp b/toolkit/components/places/nsPlacesImportExportService.cpp index 3cd5ef2eb37..bfc1a702282 100644 --- a/toolkit/components/places/nsPlacesImportExportService.cpp +++ b/toolkit/components/places/nsPlacesImportExportService.cpp @@ -375,7 +375,6 @@ public: NS_IMETHOD AddComment(const nsIParserNode& aNode) { return NS_OK; } NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) { return NS_OK; } NS_IMETHOD NotifyTagObservers(nsIParserNode* aNode) { return NS_OK; } - NS_IMETHOD_(bool) IsFormOnStack() { return false; } protected: nsCOMPtr mBookmarksService;