Bug 578696 part 2. Make nsXMLEventsManager inherit from nsStubDocumentObserver. r=sicking
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 21 Jul 2010 11:33:31 -0400
changeset 48007 a0556636778c3658bcfdc2814a1478a5497df779
parent 48006 32d3428169a2ba60dc3d76061b64576945777741
child 48008 b357183c1add6f17713dd91d8414a1942a2a4135
push id14533
push userbzbarsky@mozilla.com
push dateWed, 21 Jul 2010 15:42:13 +0000
treeherdermozilla-central@b20c759afb7c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs578696
milestone2.0b3pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 578696 part 2. Make nsXMLEventsManager inherit from nsStubDocumentObserver. r=sicking
content/events/src/nsXMLEventsManager.cpp
content/events/src/nsXMLEventsManager.h
--- a/content/events/src/nsXMLEventsManager.cpp
+++ b/content/events/src/nsXMLEventsManager.cpp
@@ -311,50 +311,29 @@ void nsXMLEventsManager::AddListeners(ns
     cur = mIncomplete[i];
     //If this succeeds, the object will be removed from mIncomplete
     if (nsXMLEventsListener::InitXMLEventsListener(aDocument, this, cur))
       --i;
   }
 }
 
 void 
-nsXMLEventsManager::BeginUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType) {}
-void 
-nsXMLEventsManager::EndUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType) {}
-void 
 nsXMLEventsManager::NodeWillBeDestroyed(const nsINode* aNode)
 {
   mIncomplete.Clear();
   mListeners.Enumerate(EnumAndUnregisterListener, this);
   mListeners.Clear();
 }
 
 void 
-nsXMLEventsManager::BeginLoad(nsIDocument* aDocument) {}
-
-void 
 nsXMLEventsManager::EndLoad(nsIDocument* aDocument)
 {
   AddListeners(aDocument);
 }
-NS_IMPL_NSIDOCUMENTOBSERVER_STATE_STUB(nsXMLEventsManager)
-void
-nsXMLEventsManager::CharacterDataWillChange(nsIDocument* aDocument,
-                                            nsIContent* aContent,
-                                            CharacterDataChangeInfo* aInfo) {}
-void 
-nsXMLEventsManager::CharacterDataChanged(nsIDocument* aDocument,
-                                         nsIContent* aContent,
-                                         CharacterDataChangeInfo* aInfo) {}
-void
-nsXMLEventsManager::AttributeWillChange(nsIDocument* aDocument,
-                                        nsIContent* aContent,
-                                        PRInt32 aNameSpaceID,
-                                        nsIAtom* aAttribute,
-                                        PRInt32 aModType) {}
+
 void
 nsXMLEventsManager::AttributeChanged(nsIDocument* aDocument,
                                      nsIContent* aContent,
                                      PRInt32 aNameSpaceID,
                                      nsIAtom* aAttribute,
                                      PRInt32 aModType)
 {
   if (aNameSpaceID == kNameSpaceID_XMLEvents &&
@@ -432,16 +411,8 @@ nsXMLEventsManager::ContentRemoved(nsIDo
     AddXMLEventsContent(aChild);
   }
 
   PRUint32 count = aChild->GetChildCount();
   for (PRUint32 i = 0; i < count; ++i) {
     ContentRemoved(aDocument, aChild, aChild->GetChildAt(i), i);
   }
 }
-
-void
-nsXMLEventsManager::ParentChainChanged(nsIContent *aContent)
-{
-}
-
-NS_IMPL_NSIDOCUMENTOBSERVER_STYLE_STUB(nsXMLEventsManager)
-
--- a/content/events/src/nsXMLEventsManager.h
+++ b/content/events/src/nsXMLEventsManager.h
@@ -41,16 +41,17 @@
 
 #include "nsCOMPtr.h"
 #include "nsIDocument.h"
 #include "nsIContent.h"
 #include "nsCOMArray.h"
 #include "nsIDOMEventListener.h"
 #include "nsInterfaceHashtable.h"
 #include "nsIAtom.h"
+#include "nsStubDocumentObserver.h"
 
 /*
  * The implementation of the XML Events Basic profile
  */
 
 class nsXMLEventsManager;
 class nsXMLEventsListener : public nsIDOMEventListener {
 public:
@@ -84,22 +85,28 @@ private:
   nsString mEvent;
   nsCOMPtr<nsIAtom> mTarget;
   PRPackedBool mPhase;
   PRPackedBool mStopPropagation;
   PRPackedBool mCancelDefault;
   
 };
 
-class nsXMLEventsManager : public nsIDocumentObserver {
+class nsXMLEventsManager : public nsStubDocumentObserver {
 public:
   nsXMLEventsManager();
   ~nsXMLEventsManager();
   NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOCUMENTOBSERVER
+
+  NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
+  virtual void EndLoad(nsIDocument* aDocument);
+  NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
+  NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
+  NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
+  NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
 
   void AddXMLEventsContent(nsIContent * aContent);
   void RemoveXMLEventsContent(nsIContent * aContent);
   void AddListener(nsIContent * aContent, nsXMLEventsListener * aListener);
   //Returns PR_TRUE if a listener was removed.
   PRBool RemoveListener(nsIContent * aXMLElement);
 private:
   void AddListeners(nsIDocument* aDocument);