Bug 612839 - Removed nsAHtml5FragmentParser. r=hsivonen
☠☠ backed out by ac7e11df24ae ☠ ☠
authorMarco Castelluccio <mar.castelluccio@studenti.unina.it>
Sun, 07 Aug 2011 16:11:13 +0200
changeset 73979 e60f96b64dfa5a573957e84c11300646942404f2
parent 73978 be8734f3c58fcf807e934aa64ee76859d952bd3d
child 73980 ac7e11df24ae296e60e619bce92ad52264ba14f8
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewershsivonen
bugs612839
milestone8.0a1
Bug 612839 - Removed nsAHtml5FragmentParser. r=hsivonen
content/base/public/nsContentUtils.h
content/base/src/Makefile.in
content/base/src/nsContentUtils.cpp
content/html/content/src/nsGenericHTMLElement.cpp
parser/html/Makefile.in
parser/html/nsAHtml5FragmentParser.h
parser/html/nsHtml5Parser.cpp
parser/html/nsHtml5Parser.h
toolkit/components/feeds/nsScriptableUnescapeHTML.cpp
--- a/content/base/public/nsContentUtils.h
+++ b/content/base/public/nsContentUtils.h
@@ -75,17 +75,17 @@ static fp_except_t oldmask = fpsetmask(~
 #include "nsIDOMEvent.h"
 #include "nsTArray.h"
 #include "nsTextFragment.h"
 #include "nsReadableUtils.h"
 #include "mozilla/AutoRestore.h"
 #include "nsINode.h"
 #include "nsHashtable.h"
 #include "nsIDOMNode.h"
-#include "nsAHtml5FragmentParser.h"
+#include "nsHtml5Parser.h"
 #include "nsIFragmentContentSink.h"
 #include "nsMathUtils.h"
 
 struct nsNativeKeyEvent; // Don't include nsINativeKeyBindings.h here: it will force strange compilation error!
 
 class nsIDOMScriptObjectFactory;
 class nsIXPConnect;
 class nsIContent;
@@ -1860,17 +1860,17 @@ private:
   static PRUint32 sRunnersCountAtFirstBlocker;
   static PRUint32 sScriptBlockerCountWhereRunnersPrevented;
 
   static nsIInterfaceRequestor* sSameOriginChecker;
 
   static PRBool sIsHandlingKeyBoardEvent;
   static PRBool sAllowXULXBL_for_file;
 
-  static nsAHtml5FragmentParser* sHTMLFragmentParser;
+  static nsHtml5Parser* sHTMLFragmentParser;
   static nsIParser* sXMLFragmentParser;
   static nsIFragmentContentSink* sXMLFragmentSink;
 
   static nsString* sShiftText;
   static nsString* sControlText;
   static nsString* sMetaText;
   static nsString* sAltText;
   static nsString* sModifierSeparator;
--- a/content/base/src/Makefile.in
+++ b/content/base/src/Makefile.in
@@ -47,19 +47,21 @@ LIBRARY_NAME	= gkconbase_s
 LIBXUL_LIBRARY	= 1
 
 
 
 EXPORTS		= \
 		nsAtomListUtils.h \
 		nsAttrName.h \
 		nsContentList.h \
+		nsContentSink.h \
 		nsGkAtomList.h \
 		nsGkAtoms.h \
 		nsNodeInfoManager.h \
+		nsNodeUtils.h \
 		nsPropertyTable.h \
 		nsScriptLoader.h \
 		nsStubDocumentObserver.h \
 		nsStubImageDecoderObserver.h \
 		nsStubMutationObserver.h \
 		nsTextFragment.h \
 		mozAutoDocUpdate.h \
 		$(NULL)
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -172,17 +172,16 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_
 #include "nsLayoutStatics.h"
 #include "nsLayoutUtils.h"
 #include "nsFrameManager.h"
 #include "BasicLayers.h"
 #include "nsFocusManager.h"
 #include "nsTextEditorState.h"
 #include "nsIPluginHost.h"
 #include "nsICategoryManager.h"
-#include "nsAHtml5FragmentParser.h"
 #include "nsIViewManager.h"
 
 #ifdef IBMBIDI
 #include "nsIBidiKeyboard.h"
 #endif
 #include "nsCycleCollectionParticipant.h"
 
 // for ReportToConsole
@@ -260,17 +259,17 @@ PRBool nsContentUtils::sAllowXULXBL_for_
 nsString* nsContentUtils::sShiftText = nsnull;
 nsString* nsContentUtils::sControlText = nsnull;
 nsString* nsContentUtils::sMetaText = nsnull;
 nsString* nsContentUtils::sAltText = nsnull;
 nsString* nsContentUtils::sModifierSeparator = nsnull;
 
 PRBool nsContentUtils::sInitialized = PR_FALSE;
 
-nsAHtml5FragmentParser* nsContentUtils::sHTMLFragmentParser = nsnull;
+nsHtml5Parser* nsContentUtils::sHTMLFragmentParser = nsnull;
 nsIParser* nsContentUtils::sXMLFragmentParser = nsnull;
 nsIFragmentContentSink* nsContentUtils::sXMLFragmentSink = nsnull;
 
 static PLDHashTable sEventListenerManagersHash;
 
 class EventListenerManagerMapEntry : public PLDHashEntryHdr
 {
 public:
@@ -3747,17 +3746,17 @@ nsContentUtils::ParseFragmentHTML(const 
                                   nsIContent* aTargetNode,
                                   nsIAtom* aContextLocalName,
                                   PRInt32 aContextNamespace,
                                   PRBool aQuirks,
                                   PRBool aPreventScriptExecution)
 {
   if (!sHTMLFragmentParser) {
     sHTMLFragmentParser =
-      static_cast<nsAHtml5FragmentParser*>(nsHtml5Module::NewHtml5Parser().get());
+      static_cast<nsHtml5Parser*>(nsHtml5Module::NewHtml5Parser().get());
     // Now sHTMLFragmentParser owns the object
   }
   sHTMLFragmentParser->ParseHtml5Fragment(aSourceBuffer,
                                           aTargetNode,
                                           aContextLocalName,
                                           aContextNamespace,
                                           aQuirks,
                                           aPreventScriptExecution);
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -71,17 +71,16 @@
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsINameSpaceManager.h"
 #include "nsDOMError.h"
 #include "nsScriptLoader.h"
 #include "nsRuleData.h"
-#include "nsAHtml5FragmentParser.h"
 
 #include "nsPresState.h"
 #include "nsILayoutHistoryState.h"
 
 #include "nsHTMLParts.h"
 #include "nsContentUtils.h"
 #include "nsString.h"
 #include "nsUnicharUtils.h"
--- a/parser/html/Makefile.in
+++ b/parser/html/Makefile.in
@@ -42,19 +42,43 @@ VPATH     = @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= html5
 LIBRARY_NAME	= html5p_s
 LIBXUL_LIBRARY	= 1
 
 
 EXPORTS		= \
-		nsHtml5Module.h \
-		nsAHtml5FragmentParser.h \
+		jArray.h \
+		nsAHtml5TreeBuilderState.h \
+		nsHtml5ArrayCopy.h \
+		nsHtml5Atoms.h \
+		nsHtml5AtomList.h \
+		nsHtml5AtomTable.h \
+		nsHtml5ByteReadable.h \
+		nsHtml5DocumentMode.h \
+		nsHtml5HtmlAttributes.h \
+		nsHtml5Macros.h \
+		nsHtml5MetaScanner.h \
+		nsHtml5MetaScannerHSupplement.h \
+ 		nsHtml5Module.h \
+		nsHtml5NamedCharacters.h \
+		nsHtml5NamedCharactersAccel.h \
+		nsHtml5Parser.h \
+		nsHtml5PendingNotification.h \
+		nsHtml5Speculation.h \
+		nsHtml5SpeculativeLoad.h \
+		nsHtml5StreamParser.h \
 		nsHtml5SVGLoadDispatcher.h \
+		nsHtml5TreeOperation.h \
+		nsHtml5TreeOpExecutor.h \
+		nsAHtml5TreeOpSink.h \
+		nsHtml5TreeOpStage.h \
+		nsHtml5UTF16Buffer.h \
+		nsHtml5UTF16BufferHSupplement.h \
 		$(NULL)
 
 CPPSRCS		= \
 		nsHtml5Atoms.cpp \
 		nsHtml5Atom.cpp \
 		nsHtml5AtomTable.cpp \
 		nsHtml5Parser.cpp \
 		nsHtml5AttributeName.cpp \
deleted file mode 100644
--- a/parser/html/nsAHtml5FragmentParser.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (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/MPL/
- *
- * 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 HTML Parser C++ Translator code.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Henri Sivonen <hsivonen@iki.fi>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef nsAHtml5FragmentParser_h_
-#define nsAHtml5FragmentParser_h_
-
-#include "nsIParser.h"
-
-/**
- * The purpose of this class is to avoid changing the signatures in nsIParser.h
- * after the Firefox 4.0 interface freeze. In later releases this can be folded
- * into nsIParser.h.
- */
-class nsAHtml5FragmentParser : public nsIParser {
-  public:
-
-    /**
-     * Invoke the fragment parsing algorithm (innerHTML).
-     *
-     * @param aSourceBuffer the string being set as innerHTML
-     * @param aTargetNode the target container
-     * @param aContextLocalName local name of context node
-     * @param aContextNamespace namespace of context node
-     * @param aQuirks true to make <table> not close <p>
-     * @param aPreventScriptExecution true to prevent scripts from executing;
-     * don't set to false when parsing into a target node that has been bound
-     * to tree.
-     */
-    NS_IMETHOD ParseHtml5Fragment(const nsAString& aSourceBuffer,
-                                  nsIContent* aTargetNode,
-                                  nsIAtom* aContextLocalName,
-                                  PRInt32 aContextNamespace,
-                                  PRBool aQuirks,
-                                  PRBool aPreventScriptExecution) = 0;
-
-};
-
-#endif // nsAHtml5FragmentParser_h_
--- a/parser/html/nsHtml5Parser.cpp
+++ b/parser/html/nsHtml5Parser.cpp
@@ -464,17 +464,17 @@ nsHtml5Parser::Terminate()
 
 NS_IMETHODIMP
 nsHtml5Parser::ParseFragment(const nsAString& aSourceBuffer,
                              nsTArray<nsString>& aTagStack)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-NS_IMETHODIMP
+nsresult
 nsHtml5Parser::ParseHtml5Fragment(const nsAString& aSourceBuffer,
                                   nsIContent* aTargetNode,
                                   nsIAtom* aContextLocalName,
                                   PRInt32 aContextNamespace,
                                   PRBool aQuirks,
                                   PRBool aPreventScriptExecution)
 {
   nsIDocument* doc = aTargetNode->GetOwnerDoc();
--- a/parser/html/nsHtml5Parser.h
+++ b/parser/html/nsHtml5Parser.h
@@ -56,19 +56,18 @@
 #include "nsCycleCollectionParticipant.h"
 #include "nsIInputStream.h"
 #include "nsDetectionConfident.h"
 #include "nsHtml5UTF16Buffer.h"
 #include "nsHtml5TreeOpExecutor.h"
 #include "nsHtml5StreamParser.h"
 #include "nsHtml5AtomTable.h"
 #include "nsWeakReference.h"
-#include "nsAHtml5FragmentParser.h"
 
-class nsHtml5Parser : public nsAHtml5FragmentParser, // inherits nsIParser
+class nsHtml5Parser : public nsIParser,
                       public nsSupportsWeakReference
 {
   public:
     NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
     NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsHtml5Parser, nsIParser)
 
@@ -252,39 +251,34 @@ class nsHtml5Parser : public nsAHtml5Fra
 
     /**
      * True if this is a script-created HTML5 parser.
      */
     virtual PRBool IsScriptCreated();
 
     /* End nsIParser  */
 
-    /* Start nsAHtml5FragmentParser */
-
     /**
      * Invoke the fragment parsing algorithm (innerHTML).
      *
      * @param aSourceBuffer the string being set as innerHTML
      * @param aTargetNode the target container
      * @param aContextLocalName local name of context node
      * @param aContextNamespace namespace of context node
      * @param aQuirks true to make <table> not close <p>
      * @param aPreventScriptExecution true to prevent scripts from executing;
      * don't set to false when parsing into a target node that has been bound
      * to tree.
      */
-    NS_IMETHOD ParseHtml5Fragment(const nsAString& aSourceBuffer,
-                                  nsIContent* aTargetNode,
-                                  nsIAtom* aContextLocalName,
-                                  PRInt32 aContextNamespace,
-                                  PRBool aQuirks,
-                                  PRBool aPreventScriptExecution);
-
-
-    /* End nsAHtml5FragmentParser */
+    nsresult ParseHtml5Fragment(const nsAString& aSourceBuffer,
+                                nsIContent* aTargetNode,
+                                nsIAtom* aContextLocalName,
+                                PRInt32 aContextNamespace,
+                                PRBool aQuirks,
+                                PRBool aPreventScriptExecution);
 
     // Not from an external interface
     // Non-inherited methods
 
   public:
 
     /**
      * Initializes the parser to load from a channel.
--- a/toolkit/components/feeds/nsScriptableUnescapeHTML.cpp
+++ b/toolkit/components/feeds/nsScriptableUnescapeHTML.cpp
@@ -61,17 +61,16 @@
 #include "nsIContent.h"
 #include "nsAttrName.h"
 #include "nsHTMLParts.h"
 #include "nsContentCID.h"
 #include "nsIScriptableUnescapeHTML.h"
 #include "nsScriptableUnescapeHTML.h"
 #include "nsAutoPtr.h"
 #include "nsTreeSanitizer.h"
-#include "nsAHtml5FragmentParser.h"
 #include "nsHtml5Module.h"
 
 #define XHTML_DIV_TAG "div xmlns=\"http://www.w3.org/1999/xhtml\""
 
 NS_IMPL_ISUPPORTS1(nsScriptableUnescapeHTML, nsIScriptableUnescapeHTML)
 
 static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID);