Bug 912956 part.9 Rename nsMutationEvent.h to mozilla/MutationEvent.h r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 24 Sep 2013 19:04:16 +0900
changeset 148424 ba03fca314e1eb3813b6a80c36e1c6481433a5ce
parent 148423 ab54eba99d340c18571fb34b43b4940b1ceab85f
child 148425 6ed0d8104386cd910b6d153831ccffee02f38656
push id34214
push usermasayuki@d-toybox.com
push dateTue, 24 Sep 2013 10:04:32 +0000
treeherdermozilla-inbound@008ba688cd5a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs912956
milestone27.0a1
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 912956 part.9 Rename nsMutationEvent.h to mozilla/MutationEvent.h r=smaug
content/base/src/Attr.cpp
content/base/src/Element.cpp
content/base/src/FragmentOrElement.cpp
content/base/src/nsContentUtils.cpp
content/base/src/nsDocument.cpp
content/base/src/nsGenericDOMDataNode.cpp
content/base/src/nsINode.cpp
content/base/src/nsStyledElement.cpp
content/events/public/MutationEvent.h
content/events/public/moz.build
content/events/public/nsMutationEvent.h
content/events/src/nsDOMEvent.cpp
content/events/src/nsDOMMutationEvent.cpp
content/events/src/nsDOMMutationEvent.h
content/events/src/nsEventDispatcher.cpp
content/events/src/nsEventListenerManager.cpp
content/html/content/src/HTMLInputElement.cpp
content/html/content/src/nsGenericHTMLElement.cpp
content/svg/content/src/nsSVGElement.cpp
content/xul/content/src/nsXULElement.cpp
widget/BasicEvents.h
widget/EventForwards.h
--- a/content/base/src/Attr.cpp
+++ b/content/base/src/Attr.cpp
@@ -5,32 +5,32 @@
 
 /*
  * Implementation of DOM Core's nsIDOMAttr node.
  */
 
 #include "mozilla/dom/Attr.h"
 #include "mozilla/dom/AttrBinding.h"
 #include "mozilla/dom/Element.h"
+#include "mozilla/MutationEvent.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsINameSpaceManager.h"
 #include "nsError.h"
 #include "nsUnicharUtils.h"
 #include "nsDOMString.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMUserDataHandler.h"
 #include "nsEventDispatcher.h"
 #include "nsGkAtoms.h"
 #include "nsCOMArray.h"
 #include "nsNodeUtils.h"
 #include "nsEventListenerManager.h"
 #include "nsTextNode.h"
 #include "mozAutoDocUpdate.h"
-#include "nsMutationEvent.h"
 #include "nsAsyncDOMEvent.h"
 #include "nsWrapperCacheInlines.h"
 
 nsIAttribute::nsIAttribute(nsDOMAttributeMap* aAttrMap,
                            already_AddRefed<nsINodeInfo> aNodeInfo,
                            bool aNsAware)
 : nsINode(aNodeInfo), mAttrMap(aAttrMap), mNsAware(aNsAware)
 {
--- a/content/base/src/Element.cpp
+++ b/content/base/src/Element.cpp
@@ -43,17 +43,17 @@
 #include "nsINameSpaceManager.h"
 #include "nsContentList.h"
 #include "nsDOMTokenList.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsError.h"
 #include "nsDOMString.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIDOMMutationEvent.h"
-#include "nsMutationEvent.h"
+#include "mozilla/MutationEvent.h"
 #include "nsNodeUtils.h"
 #include "mozilla/dom/DirectionalityUtils.h"
 #include "nsDocument.h"
 #include "nsAttrValueOrString.h"
 #include "nsAttrValueInlines.h"
 #ifdef MOZ_XUL
 #include "nsXULElement.h"
 #endif /* MOZ_XUL */
--- a/content/base/src/FragmentOrElement.cpp
+++ b/content/base/src/FragmentOrElement.cpp
@@ -46,17 +46,17 @@
 #include "nsINameSpaceManager.h"
 #include "nsContentList.h"
 #include "nsDOMTokenList.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsError.h"
 #include "nsDOMString.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIDOMMutationEvent.h"
-#include "nsMutationEvent.h"
+#include "mozilla/MutationEvent.h"
 #include "nsNodeUtils.h"
 #include "nsDocument.h"
 #include "nsAttrValueOrString.h"
 #ifdef MOZ_XUL
 #include "nsXULElement.h"
 #endif /* MOZ_XUL */
 #include "nsFrameManager.h"
 #include "nsFrameSelection.h"
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -33,16 +33,17 @@
 #include "mozilla/Base64.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/dom/DocumentFragment.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLMediaElement.h"
 #include "mozilla/dom/HTMLTemplateElement.h"
 #include "mozilla/dom/TextDecoder.h"
 #include "mozilla/Likely.h"
+#include "mozilla/MutationEvent.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Selection.h"
 #include "mozilla/Util.h"
 #include "nsAString.h"
 #include "nsAttrName.h"
 #include "nsAttrValue.h"
 #include "nsAttrValueInlines.h"
 #include "nsBindingManager.h"
@@ -139,17 +140,16 @@
 #include "nsIStringBundle.h"
 #include "nsIURI.h"
 #include "nsIURL.h"
 #include "nsIWebNavigation.h"
 #include "nsIWordBreaker.h"
 #include "nsIXPConnect.h"
 #include "nsJSUtils.h"
 #include "nsLWBrkCIID.h"
-#include "nsMutationEvent.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsNodeInfoManager.h"
 #include "nsNullPrincipal.h"
 #include "nsParserCIID.h"
 #include "nsParserConstants.h"
 #include "nsPIDOMWindow.h"
 #include "nsPresContext.h"
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -115,17 +115,17 @@
 #include "nsCharsetAlias.h"
 #include "nsCharsetSource.h"
 #include "nsIParser.h"
 #include "nsIContentSink.h"
 
 #include "nsDateTimeFormatCID.h"
 #include "nsIDateTimeFormat.h"
 #include "nsEventDispatcher.h"
-#include "nsMutationEvent.h"
+#include "mozilla/MutationEvent.h"
 #include "nsDOMCID.h"
 
 #include "jsapi.h"
 #include "nsIXPConnect.h"
 #include "nsCCUncollectableMarker.h"
 #include "nsIContentPolicy.h"
 #include "nsContentPolicyUtils.h"
 #include "nsICategoryManager.h"
--- a/content/base/src/nsGenericDOMDataNode.cpp
+++ b/content/base/src/nsGenericDOMDataNode.cpp
@@ -12,17 +12,17 @@
 
 #include "nsGenericDOMDataNode.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/dom/Element.h"
 #include "nsIDocument.h"
 #include "nsEventListenerManager.h"
 #include "nsIDOMDocument.h"
 #include "nsReadableUtils.h"
-#include "nsMutationEvent.h"
+#include "mozilla/MutationEvent.h"
 #include "nsINameSpaceManager.h"
 #include "nsIURI.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMText.h"
 #include "nsCOMPtr.h"
 #include "nsDOMString.h"
 #include "nsIDOMUserDataHandler.h"
 #include "nsChangeHint.h"
--- a/content/base/src/nsINode.cpp
+++ b/content/base/src/nsINode.cpp
@@ -11,16 +11,17 @@
 #include "nsINode.h"
 
 #include "AccessCheck.h"
 #include "jsapi.h"
 #include "mozAutoDocUpdate.h"
 #include "mozilla/CORSMode.h"
 #include "mozilla/Likely.h"
 #include "mozilla/MemoryReporting.h"
+#include "mozilla/MutationEvent.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Util.h"
 #include "nsAsyncDOMEvent.h"
 #include "nsAttrValueOrString.h"
 #include "nsBindingManager.h"
 #include "nsCCUncollectableMarker.h"
 #include "nsClientRect.h"
 #include "nsContentCreatorFunctions.h"
@@ -71,17 +72,16 @@
 #include "nsIScrollableFrame.h"
 #include "nsIServiceManager.h"
 #include "nsIURL.h"
 #include "nsView.h"
 #include "nsViewManager.h"
 #include "nsIWebNavigation.h"
 #include "nsIWidget.h"
 #include "nsLayoutUtils.h"
-#include "nsMutationEvent.h"
 #include "nsNetUtil.h"
 #include "nsNodeInfoManager.h"
 #include "nsNodeUtils.h"
 #include "nsPIBoxObject.h"
 #include "nsPIDOMWindow.h"
 #include "nsPresContext.h"
 #include "nsRuleProcessorData.h"
 #include "nsString.h"
--- a/content/base/src/nsStyledElement.cpp
+++ b/content/base/src/nsStyledElement.cpp
@@ -4,17 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsStyledElement.h"
 #include "nsGkAtoms.h"
 #include "nsAttrValue.h"
 #include "nsAttrValueInlines.h"
 #include "mozilla/dom/Element.h"
-#include "nsMutationEvent.h"
+#include "mozilla/MutationEvent.h"
 #include "nsDOMCSSDeclaration.h"
 #include "nsDOMCSSAttrDeclaration.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIDocument.h"
 #include "mozilla/css/StyleRule.h"
 #include "nsCSSParser.h"
 #include "mozilla/css/Loader.h"
 #include "nsIDOMMutationEvent.h"
rename from content/events/public/nsMutationEvent.h
rename to content/events/public/MutationEvent.h
--- a/content/events/public/nsMutationEvent.h
+++ b/content/events/public/MutationEvent.h
@@ -1,62 +1,61 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef nsMutationEvent_h__
-#define nsMutationEvent_h__
+#ifndef mozilla_MutationEvent_h__
+#define mozilla_MutationEvent_h__
 
-#include "nsGUIEvent.h"
-#include "nsIDOMNode.h"
+#include "mozilla/BasicEvents.h"
+#include "nsCOMPtr.h"
 #include "nsIAtom.h"
+#include "nsIDOMNode.h"
 
-class nsMutationEvent : public nsEvent
+namespace mozilla {
+
+class InternalMutationEvent : public WidgetEvent
 {
 public:
-  nsMutationEvent(bool isTrusted, uint32_t msg)
-    : nsEvent(isTrusted, msg, NS_MUTATION_EVENT),
-      mAttrChange(0)
+  InternalMutationEvent(bool aIsTrusted, uint32_t aMessage) :
+    WidgetEvent(aIsTrusted, aMessage, NS_MUTATION_EVENT),
+    mAttrChange(0)
   {
     mFlags.mCancelable = false;
   }
 
   nsCOMPtr<nsIDOMNode> mRelatedNode;
   nsCOMPtr<nsIAtom>    mAttrName;
   nsCOMPtr<nsIAtom>    mPrevAttrValue;
   nsCOMPtr<nsIAtom>    mNewAttrValue;
   unsigned short       mAttrChange;
 
-  void AssignMutationEventData(const nsMutationEvent& aEvent, bool aCopyTargets)
+  void AssignMutationEventData(const InternalMutationEvent& aEvent,
+                               bool aCopyTargets)
   {
     AssignEventData(aEvent, aCopyTargets);
 
     mRelatedNode = aEvent.mRelatedNode;
     mAttrName = aEvent.mAttrName;
     mPrevAttrValue = aEvent.mPrevAttrValue;
     mNewAttrValue = aEvent.mNewAttrValue;
     mAttrChange = aEvent.mAttrChange;
   }
 };
 
-#define NS_MUTATION_START           1800
-#define NS_MUTATION_SUBTREEMODIFIED                   (NS_MUTATION_START)
-#define NS_MUTATION_NODEINSERTED                      (NS_MUTATION_START+1)
-#define NS_MUTATION_NODEREMOVED                       (NS_MUTATION_START+2)
-#define NS_MUTATION_NODEREMOVEDFROMDOCUMENT           (NS_MUTATION_START+3)
-#define NS_MUTATION_NODEINSERTEDINTODOCUMENT          (NS_MUTATION_START+4)
-#define NS_MUTATION_ATTRMODIFIED                      (NS_MUTATION_START+5)
-#define NS_MUTATION_CHARACTERDATAMODIFIED             (NS_MUTATION_START+6)
-#define NS_MUTATION_END                               (NS_MUTATION_START+6)
-
 // Bits are actually checked to optimize mutation event firing.
 // That's why I don't number from 0x00.  The first event should
 // always be 0x01.
 #define NS_EVENT_BITS_MUTATION_SUBTREEMODIFIED                0x01
 #define NS_EVENT_BITS_MUTATION_NODEINSERTED                   0x02
 #define NS_EVENT_BITS_MUTATION_NODEREMOVED                    0x04
 #define NS_EVENT_BITS_MUTATION_NODEREMOVEDFROMDOCUMENT        0x08
 #define NS_EVENT_BITS_MUTATION_NODEINSERTEDINTODOCUMENT       0x10
 #define NS_EVENT_BITS_MUTATION_ATTRMODIFIED                   0x20
 #define NS_EVENT_BITS_MUTATION_CHARACTERDATAMODIFIED          0x40
 
-#endif // nsMutationEvent_h__
+} // namespace mozilla
+
+// TODO: Remove following typedef
+typedef mozilla::InternalMutationEvent nsMutationEvent;
+
+#endif // mozilla_MutationEvent_h__
--- a/content/events/public/moz.build
+++ b/content/events/public/moz.build
@@ -15,16 +15,19 @@ MODULE = 'content'
 EXPORTS += [
     'nsAsyncDOMEvent.h',
     'nsDOMKeyNameList.h',
     'nsEventDispatcher.h',
     'nsEventNameList.h',
     'nsEventStates.h',
     'nsIPrivateTextEvent.h',
     'nsIPrivateTextRange.h',
-    'nsMutationEvent.h',
     'nsVKList.h',
 ]
 
+EXPORTS.mozilla += [
+    'MutationEvent.h',
+]
+
 EXPORTS.mozilla.dom += [
     'EventTarget.h',
 ]
 
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -9,17 +9,17 @@
 #include "nsCOMPtr.h"
 #include "nsError.h"
 #include "nsDOMEvent.h"
 #include "nsEventStateManager.h"
 #include "nsIFrame.h"
 #include "nsIContent.h"
 #include "nsIPresShell.h"
 #include "nsIDocument.h"
-#include "nsMutationEvent.h"
+#include "mozilla/MutationEvent.h"
 #include "nsContentUtils.h"
 #include "nsJSEnvironment.h"
 #include "mozilla/Preferences.h"
 #include "nsLayoutUtils.h"
 #include "nsIScrollableFrame.h"
 #include "nsDOMEventTargetHelper.h"
 #include "nsPIWindowRoot.h"
 #include "nsGlobalWindow.h"
--- a/content/events/src/nsDOMMutationEvent.cpp
+++ b/content/events/src/nsDOMMutationEvent.cpp
@@ -1,107 +1,125 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCOMPtr.h"
 #include "nsDOMMutationEvent.h"
+#include "mozilla/MutationEvent.h"
+
+using namespace mozilla;
 
 class nsPresContext;
 
 nsDOMMutationEvent::nsDOMMutationEvent(mozilla::dom::EventTarget* aOwner,
                                        nsPresContext* aPresContext,
-                                       nsMutationEvent* aEvent)
+                                       InternalMutationEvent* aEvent)
   : nsDOMEvent(aOwner, aPresContext,
-               aEvent ? aEvent : new nsMutationEvent(false, 0))
+               aEvent ? aEvent : new InternalMutationEvent(false, 0))
 {
   mEventIsInternal = (aEvent == nullptr);
 }
 
 nsDOMMutationEvent::~nsDOMMutationEvent()
 {
   if (mEventIsInternal) {
-    nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
+    InternalMutationEvent* mutation =
+      static_cast<InternalMutationEvent*>(mEvent);
     delete mutation;
     mEvent = nullptr;
   }
 }
 
 NS_INTERFACE_MAP_BEGIN(nsDOMMutationEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMutationEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
 
 NS_IMPL_ADDREF_INHERITED(nsDOMMutationEvent, nsDOMEvent)
 NS_IMPL_RELEASE_INHERITED(nsDOMMutationEvent, nsDOMEvent)
 
+already_AddRefed<nsINode>
+nsDOMMutationEvent::GetRelatedNode()
+{
+  nsCOMPtr<nsINode> n = do_QueryInterface(
+    static_cast<InternalMutationEvent*>(mEvent)->mRelatedNode);
+  return n.forget();
+}
+
 NS_IMETHODIMP
 nsDOMMutationEvent::GetRelatedNode(nsIDOMNode** aRelatedNode)
 {
   nsCOMPtr<nsINode> relatedNode = GetRelatedNode();
   nsCOMPtr<nsIDOMNode> relatedDOMNode = relatedNode ? relatedNode->AsDOMNode() : nullptr;
   relatedDOMNode.forget(aRelatedNode);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMMutationEvent::GetPrevValue(nsAString& aPrevValue)
 {
-  nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
+  InternalMutationEvent* mutation = static_cast<InternalMutationEvent*>(mEvent);
   if (mutation->mPrevAttrValue)
     mutation->mPrevAttrValue->ToString(aPrevValue);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMMutationEvent::GetNewValue(nsAString& aNewValue)
 {
-  nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
+  InternalMutationEvent* mutation = static_cast<InternalMutationEvent*>(mEvent);
   if (mutation->mNewAttrValue)
       mutation->mNewAttrValue->ToString(aNewValue);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMMutationEvent::GetAttrName(nsAString& aAttrName)
 {
-  nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
+  InternalMutationEvent* mutation = static_cast<InternalMutationEvent*>(mEvent);
   if (mutation->mAttrName)
       mutation->mAttrName->ToString(aAttrName);
   return NS_OK;
 }
 
+uint16_t
+nsDOMMutationEvent::AttrChange()
+{
+  return static_cast<InternalMutationEvent*>(mEvent)->mAttrChange;
+}
+
 NS_IMETHODIMP
 nsDOMMutationEvent::GetAttrChange(uint16_t* aAttrChange)
 {
   *aAttrChange = AttrChange();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMMutationEvent::InitMutationEvent(const nsAString& aTypeArg, bool aCanBubbleArg, bool aCancelableArg, nsIDOMNode* aRelatedNodeArg, const nsAString& aPrevValueArg, const nsAString& aNewValueArg, const nsAString& aAttrNameArg, uint16_t aAttrChangeArg)
 {
   nsresult rv = nsDOMEvent::InitEvent(aTypeArg, aCanBubbleArg, aCancelableArg);
   NS_ENSURE_SUCCESS(rv, rv);
   
-  nsMutationEvent* mutation = static_cast<nsMutationEvent*>(mEvent);
+  InternalMutationEvent* mutation = static_cast<InternalMutationEvent*>(mEvent);
   mutation->mRelatedNode = aRelatedNodeArg;
   if (!aPrevValueArg.IsEmpty())
     mutation->mPrevAttrValue = do_GetAtom(aPrevValueArg);
   if (!aNewValueArg.IsEmpty())
     mutation->mNewAttrValue = do_GetAtom(aNewValueArg);
   if (!aAttrNameArg.IsEmpty()) {
     mutation->mAttrName = do_GetAtom(aAttrNameArg);
   }
   mutation->mAttrChange = aAttrChangeArg;
     
   return NS_OK;
 }
 
 nsresult NS_NewDOMMutationEvent(nsIDOMEvent** aInstancePtrResult,
                                 mozilla::dom::EventTarget* aOwner,
                                 nsPresContext* aPresContext,
-                                nsMutationEvent *aEvent) 
+                                InternalMutationEvent* aEvent) 
 {
   nsDOMMutationEvent* it = new nsDOMMutationEvent(aOwner, aPresContext, aEvent);
 
   return CallQueryInterface(it, aInstancePtrResult);
 }
--- a/content/events/src/nsDOMMutationEvent.h
+++ b/content/events/src/nsDOMMutationEvent.h
@@ -4,18 +4,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsDOMMutationEvent_h__
 #define nsDOMMutationEvent_h__
 
 #include "nsIDOMMutationEvent.h"
 #include "nsINode.h"
 #include "nsDOMEvent.h"
-#include "nsMutationEvent.h"
 #include "mozilla/dom/MutationEventBinding.h"
+#include "mozilla/EventForwards.h"
 
 class nsDOMMutationEvent : public nsDOMEvent,
                            public nsIDOMMutationEvent
 {
 public:
   nsDOMMutationEvent(mozilla::dom::EventTarget* aOwner,
                      nsPresContext* aPresContext, nsMutationEvent* aEvent);
 
@@ -34,27 +34,19 @@ public:
     return mozilla::dom::MutationEventBinding::Wrap(aCx, aScope, this);
   }
 
   // xpidl implementation
   // GetPrevValue(nsAString& aPrevValue);
   // GetNewValue(nsAString& aNewValue);
   // GetAttrName(nsAString& aAttrName);
 
-  already_AddRefed<nsINode> GetRelatedNode()
-  {
-    nsCOMPtr<nsINode> n =
-      do_QueryInterface(static_cast<nsMutationEvent*>(mEvent)->mRelatedNode);
-    return n.forget();
-  }
+  already_AddRefed<nsINode> GetRelatedNode();
 
-  uint16_t AttrChange()
-  {
-    return static_cast<nsMutationEvent*>(mEvent)->mAttrChange;
-  }
+  uint16_t AttrChange();
 
   void InitMutationEvent(const nsAString& aType,
                          bool& aCanBubble, bool& aCancelable,
                          nsINode* aRelatedNode,
                          const nsAString& aPrevValue,
                          const nsAString& aNewValue,
                          const nsAString& aAttrName,
                          uint16_t& aAttrChange, mozilla::ErrorResult& aRv)
--- a/content/events/src/nsEventDispatcher.cpp
+++ b/content/events/src/nsEventDispatcher.cpp
@@ -5,24 +5,24 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsEventDispatcher.h"
 #include "nsPresContext.h"
 #include "nsEventListenerManager.h"
 #include "nsContentUtils.h"
 #include "nsCxPusher.h"
 #include "nsError.h"
-#include "nsMutationEvent.h"
 #include <new>
 #include "nsINode.h"
 #include "nsPIDOMWindow.h"
 #include "nsDOMTouchEvent.h"
 #include "GeckoProfiler.h"
 #include "GeneratedEvents.h"
 #include "mozilla/dom/EventTarget.h"
+#include "mozilla/MutationEvent.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 class ELMCreationDetector
 {
 public:
   ELMCreationDetector() :
--- a/content/events/src/nsEventListenerManager.cpp
+++ b/content/events/src/nsEventListenerManager.cpp
@@ -21,17 +21,17 @@
 #include "nsIJSEventListener.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsINameSpaceManager.h"
 #include "nsIContent.h"
 #include "mozilla/MemoryReporting.h"
 #include "nsCOMPtr.h"
 #include "nsError.h"
 #include "nsIDocument.h"
-#include "nsMutationEvent.h"
+#include "mozilla/MutationEvent.h"
 #include "nsIXPConnect.h"
 #include "nsDOMCID.h"
 #include "nsContentUtils.h"
 #include "nsCxPusher.h"
 #include "nsJSUtils.h"
 #include "nsEventDispatcher.h"
 #include "nsCOMArray.h"
 #include "nsEventListenerService.h"
--- a/content/html/content/src/HTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -53,17 +53,17 @@
 #include "nsIDOMHTMLCollection.h"
 #include "nsLinebreakConverter.h" //to strip out carriage returns
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsEventDispatcher.h"
 #include "nsLayoutUtils.h"
 
 #include "nsIDOMMutationEvent.h"
-#include "nsMutationEvent.h"
+#include "mozilla/MutationEvent.h"
 #include "nsEventListenerManager.h"
 
 #include "nsRuleData.h"
 #include <algorithm>
 
 // input type=radio
 #include "nsIRadioGroupContainer.h"
 
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -62,17 +62,17 @@
 #include "nsITextControlFrame.h"
 #include "nsIForm.h"
 #include "nsIFormControl.h"
 #include "nsIDOMHTMLFormElement.h"
 #include "mozilla/dom/HTMLFormElement.h"
 #include "nsFocusManager.h"
 #include "nsAttrValueOrString.h"
 
-#include "nsMutationEvent.h"
+#include "mozilla/MutationEvent.h"
 #include "nsDOMStringMap.h"
 
 #include "nsIEditor.h"
 #include "nsIEditorIMESupport.h"
 #include "nsEventDispatcher.h"
 #include "nsLayoutUtils.h"
 #include "mozAutoDocUpdate.h"
 #include "nsHtml5Module.h"
--- a/content/svg/content/src/nsSVGElement.cpp
+++ b/content/svg/content/src/nsSVGElement.cpp
@@ -9,17 +9,17 @@
 #include "nsSVGElement.h"
 
 #include "mozilla/dom/SVGSVGElement.h"
 #include "mozilla/dom/SVGTests.h"
 #include "nsContentUtils.h"
 #include "nsICSSDeclaration.h"
 #include "nsIDocument.h"
 #include "nsIDOMMutationEvent.h"
-#include "nsMutationEvent.h"
+#include "mozilla/MutationEvent.h"
 #include "nsError.h"
 #include "nsIPresShell.h"
 #include "nsGkAtoms.h"
 #include "mozilla/css/StyleRule.h"
 #include "nsRuleWalker.h"
 #include "mozilla/css/Declaration.h"
 #include "nsCSSProps.h"
 #include "nsCSSParser.h"
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -68,17 +68,17 @@
 #include "XULDocument.h"
 #include "nsXULPopupListener.h"
 #include "nsRuleWalker.h"
 #include "nsIDOMCSSStyleDeclaration.h"
 #include "nsCSSParser.h"
 #include "nsIListBoxObject.h"
 #include "nsContentUtils.h"
 #include "nsContentList.h"
-#include "nsMutationEvent.h"
+#include "mozilla/MutationEvent.h"
 #include "nsAsyncDOMEvent.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsPIDOMWindow.h"
 #include "nsJSPrincipals.h"
 #include "nsDOMAttributeMap.h"
 #include "nsGkAtoms.h"
 #include "nsXULContentUtils.h"
 #include "nsNodeUtils.h"
--- a/widget/BasicEvents.h
+++ b/widget/BasicEvents.h
@@ -57,18 +57,18 @@ enum nsEventStructType
   NS_TRANSITION_EVENT,               // InternalTransitionEvent
   NS_ANIMATION_EVENT,                // InternalAnimationEvent
 
   // MiscEvents.h
   NS_COMMAND_EVENT,                  // WidgetCommandEvent
   NS_CONTENT_COMMAND_EVENT,          // WidgetContentCommandEvent
   NS_PLUGIN_EVENT,                   // WidgetPluginEvent
 
-  // DOM events
-  NS_MUTATION_EVENT,                 // nsMutationEvent
+  // MutationEvent.h (content/events/public)
+  NS_MUTATION_EVENT,                 // InternalMutationEvent
 
   // Follwoing struct type values are ugly.  They indicate other struct type
   // actually.  However, they are used for distinguishing which DOM event
   // should be created for the event.
   NS_SVGZOOM_EVENT,                  // WidgetGUIEvent
   NS_SMIL_TIME_EVENT                 // InternalUIEvent
 };
 
@@ -188,17 +188,25 @@ enum nsEventStructType
 #define NS_MOUSE_SCROLL_START         1600
 #define NS_MOUSE_SCROLL               (NS_MOUSE_SCROLL_START)
 #define NS_MOUSE_PIXEL_SCROLL         (NS_MOUSE_SCROLL_START + 1)
 
 #define NS_SCROLLPORT_START           1700
 #define NS_SCROLLPORT_UNDERFLOW       (NS_SCROLLPORT_START)
 #define NS_SCROLLPORT_OVERFLOW        (NS_SCROLLPORT_START+1)
 
-// Mutation events defined elsewhere starting at 1800
+#define NS_MUTATION_START                    1800
+#define NS_MUTATION_SUBTREEMODIFIED          (NS_MUTATION_START)
+#define NS_MUTATION_NODEINSERTED             (NS_MUTATION_START+1)
+#define NS_MUTATION_NODEREMOVED              (NS_MUTATION_START+2)
+#define NS_MUTATION_NODEREMOVEDFROMDOCUMENT  (NS_MUTATION_START+3)
+#define NS_MUTATION_NODEINSERTEDINTODOCUMENT (NS_MUTATION_START+4)
+#define NS_MUTATION_ATTRMODIFIED             (NS_MUTATION_START+5)
+#define NS_MUTATION_CHARACTERDATAMODIFIED    (NS_MUTATION_START+6)
+#define NS_MUTATION_END                      (NS_MUTATION_START+6)
 
 #define NS_USER_DEFINED_EVENT         2000
  
 // composition events
 #define NS_COMPOSITION_EVENT_START    2200
 #define NS_COMPOSITION_START          (NS_COMPOSITION_EVENT_START)
 #define NS_COMPOSITION_END            (NS_COMPOSITION_EVENT_START + 1)
 #define NS_COMPOSITION_UPDATE         (NS_COMPOSITION_EVENT_START + 2)
--- a/widget/EventForwards.h
+++ b/widget/EventForwards.h
@@ -92,21 +92,21 @@ class InternalClipboardEvent;
 class InternalFocusEvent;
 class InternalTransitionEvent;
 class InternalAnimationEvent;
 
 // MiscEvents.h
 class WidgetCommandEvent;
 class WidgetContentCommandEvent;
 class WidgetPluginEvent;
+
+// MutationEvent.h (content/events/public)
+class InternalMutationEvent;
 } // namespace mozilla
 
-// content/events/public/nsMutationEvent.h
-class nsMutationEvent;
-
 // TODO: Remove following typedefs
 typedef mozilla::WidgetEvent               nsEvent;
 typedef mozilla::WidgetGUIEvent            nsGUIEvent;
 typedef mozilla::WidgetInputEvent          nsInputEvent;
 typedef mozilla::InternalUIEvent           nsUIEvent;
 typedef mozilla::AlternativeCharCode       nsAlternativeCharCode;
 typedef mozilla::WidgetKeyboardEvent       nsKeyEvent;
 typedef mozilla::TextRangeStyle            nsTextRangeStyle;
@@ -134,10 +134,11 @@ typedef mozilla::InternalScrollAreaEvent
 typedef mozilla::InternalFormEvent         nsFormEvent;
 typedef mozilla::InternalClipboardEvent    nsClipboardEvent;
 typedef mozilla::InternalFocusEvent        nsFocusEvent;
 typedef mozilla::InternalTransitionEvent   nsTransitionEvent;
 typedef mozilla::InternalAnimationEvent    nsAnimationEvent;
 typedef mozilla::WidgetContentCommandEvent nsContentCommandEvent;
 typedef mozilla::WidgetCommandEvent        nsCommandEvent;
 typedef mozilla::WidgetPluginEvent         nsPluginEvent;
+typedef mozilla::InternalMutationEvent     nsMutationEvent;
 
 #endif // mozilla_EventForwards_h__