Bug 975688 part.28 Rename nsDOMEvent to mozilla::dom::Event r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 05 Mar 2014 09:37:43 +0900
changeset 171900 8b872592e44140baa088e3af474eaca9eb1d2701
parent 171899 0b6d9f0847e9deffdce5986d40327415681045af
child 171901 7d223c2e7fa9fe18c4380679df63cc9db41a63bc
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssmaug
bugs975688
milestone30.0a1
Bug 975688 part.28 Rename nsDOMEvent to mozilla::dom::Event r=smaug
accessible/src/base/DocManager.cpp
accessible/src/generic/RootAccessible.cpp
content/base/public/nsIDocument.h
content/base/src/nsDocument.cpp
content/base/src/nsINode.cpp
content/base/src/nsObjectLoadingContent.cpp
content/html/content/src/UndoManager.cpp
content/html/document/src/nsHTMLDocument.h
content/media/webaudio/AudioProcessingEvent.cpp
content/media/webaudio/AudioProcessingEvent.h
content/media/webaudio/OfflineAudioCompletionEvent.cpp
content/media/webaudio/OfflineAudioCompletionEvent.h
content/xul/content/src/nsXULElement.cpp
content/xul/content/src/nsXULPopupListener.cpp
dom/base/MessagePort.cpp
dom/base/Navigator.cpp
dom/base/nsDOMClassInfoID.h
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
dom/base/nsScreen.cpp
dom/battery/BatteryManager.cpp
dom/bindings/Bindings.conf
dom/bindings/Codegen.py
dom/devicestorage/nsDeviceStorage.cpp
dom/events/AnimationEvent.cpp
dom/events/AnimationEvent.h
dom/events/BeforeUnloadEvent.cpp
dom/events/BeforeUnloadEvent.h
dom/events/ClipboardEvent.cpp
dom/events/ClipboardEvent.h
dom/events/CommandEvent.cpp
dom/events/CommandEvent.h
dom/events/DataContainerEvent.cpp
dom/events/DataContainerEvent.h
dom/events/DeviceMotionEvent.cpp
dom/events/DeviceMotionEvent.h
dom/events/Event.cpp
dom/events/Event.h
dom/events/EventTarget.h
dom/events/MessageEvent.cpp
dom/events/MessageEvent.h
dom/events/MouseEvent.cpp
dom/events/MutationEvent.cpp
dom/events/MutationEvent.h
dom/events/NotifyAudioAvailableEvent.cpp
dom/events/NotifyAudioAvailableEvent.h
dom/events/NotifyPaintEvent.cpp
dom/events/NotifyPaintEvent.h
dom/events/ScrollAreaEvent.cpp
dom/events/ScrollAreaEvent.h
dom/events/SpeechRecognitionError.cpp
dom/events/SpeechRecognitionError.h
dom/events/Touch.cpp
dom/events/TransitionEvent.cpp
dom/events/TransitionEvent.h
dom/events/UIEvent.cpp
dom/events/UIEvent.h
dom/events/XULCommandEvent.h
dom/events/moz.build
dom/events/nsAsyncDOMEvent.cpp
dom/events/nsDOMEvent.cpp
dom/events/nsDOMEvent.h
dom/events/nsEventDispatcher.cpp
dom/events/nsEventListenerManager.cpp
dom/events/nsEventStateManager.cpp
dom/events/nsEventStateManager.h
dom/events/nsJSEventListener.cpp
dom/file/LockedFile.cpp
dom/indexedDB/AsyncConnectionHelper.h
dom/indexedDB/IDBEvents.cpp
dom/indexedDB/IDBEvents.h
dom/indexedDB/OpenDatabaseHelper.cpp
dom/indexedDB/ipc/IndexedDBChild.cpp
dom/interfaces/events/nsIDOMEvent.idl
dom/mobileconnection/src/MobileConnection.cpp
dom/network/src/Connection.cpp
dom/power/WakeLock.cpp
dom/smil/TimeEvent.cpp
dom/smil/TimeEvent.h
dom/speakermanager/SpeakerManager.cpp
dom/src/notification/Notification.cpp
dom/src/offline/nsDOMOfflineResourceList.cpp
dom/src/offline/nsDOMOfflineResourceList.h
dom/telephony/CallEvent.cpp
dom/telephony/CallEvent.h
dom/time/TimeChangeObserver.cpp
dom/voicemail/Voicemail.h
dom/workers/MessagePort.cpp
dom/workers/SharedWorker.cpp
dom/xbl/nsXBLEventHandler.cpp
dom/xbl/nsXBLService.cpp
embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
embedding/components/windowwatcher/src/nsAutoWindowStateHelper.cpp
js/xpconnect/src/event_impl_gen.py
js/xpconnect/src/nsDOMQS.h
layout/base/nsPresShell.cpp
layout/generic/nsImageMap.cpp
layout/printing/nsPrintPreviewListener.cpp
layout/xul/nsXULPopupManager.cpp
layout/xul/nsXULTooltipListener.cpp
toolkit/components/satchel/nsFormFillController.cpp
widget/BasicEvents.h
widget/cocoa/nsMenuUtilsX.mm
xpfe/appshell/src/nsXULWindow.cpp
--- a/accessible/src/base/DocManager.cpp
+++ b/accessible/src/base/DocManager.cpp
@@ -10,19 +10,19 @@
 #include "DocAccessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "RootAccessibleWrap.h"
 
 #ifdef A11Y_LOG
 #include "Logging.h"
 #endif
 
+#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 #include "nsCURILoader.h"
 #include "nsDocShellLoadTypes.h"
-#include "nsDOMEvent.h"
 #include "nsIChannel.h"
 #include "nsIDOMDocument.h"
 #include "nsEventListenerManager.h"
 #include "nsIDOMWindow.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIWebNavigation.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIWebProgress.h"
--- a/accessible/src/generic/RootAccessible.cpp
+++ b/accessible/src/generic/RootAccessible.cpp
@@ -23,28 +23,28 @@
 #include "XULTreeAccessible.h"
 #endif
 
 #include "mozilla/dom/Element.h"
 
 #include "nsIAccessibleRelation.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeOwner.h"
+#include "mozilla/dom/Event.h"
 #include "mozilla/dom/EventTarget.h"
 #include "nsIDOMDataContainerEvent.h"
 #include "nsIDOMXULMultSelectCntrlEl.h"
 #include "nsIDocument.h"
 #include "nsEventListenerManager.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIServiceManager.h"
 #include "nsPIDOMWindow.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsReadableUtils.h"
 #include "nsFocusManager.h"
-#include "nsDOMEvent.h"
 
 #ifdef MOZ_XUL
 #include "nsIXULDocument.h"
 #include "nsIXULWindow.h"
 #endif
 
 using namespace mozilla;
 using namespace mozilla::a11y;
@@ -229,17 +229,17 @@ RootAccessible::DocumentActivated(DocAcc
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIDOMEventListener
 
 NS_IMETHODIMP
 RootAccessible::HandleEvent(nsIDOMEvent* aDOMEvent)
 {
   MOZ_ASSERT(aDOMEvent);
-  nsDOMEvent* event = aDOMEvent->InternalDOMEvent();
+  Event* event = aDOMEvent->InternalDOMEvent();
   nsCOMPtr<nsINode> origTargetNode = do_QueryInterface(event->GetOriginalTarget());
   if (!origTargetNode)
     return NS_OK;
 
 #ifdef A11Y_LOG
   if (logging::IsEnabled(logging::eDOMEvents)) {
     nsAutoString eventType;
     aDOMEvent->GetType(eventType);
@@ -261,17 +261,17 @@ RootAccessible::HandleEvent(nsIDOMEvent*
   return NS_OK;
 }
 
 // RootAccessible protected
 void
 RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
 {
   MOZ_ASSERT(aDOMEvent);
-  nsDOMEvent* event = aDOMEvent->InternalDOMEvent();
+  Event* event = aDOMEvent->InternalDOMEvent();
   nsCOMPtr<nsINode> origTargetNode = do_QueryInterface(event->GetOriginalTarget());
 
   nsAutoString eventType;
   aDOMEvent->GetType(eventType);
 
 #ifdef A11Y_LOG
   if (logging::IsEnabled(logging::eDOMEvents))
     logging::DOMEvent("processed", origTargetNode, eventType);
--- a/content/base/public/nsIDocument.h
+++ b/content/base/public/nsIDocument.h
@@ -75,17 +75,16 @@ class nsRange;
 class nsScriptLoader;
 class nsSMILAnimationController;
 class nsStyleSet;
 class nsTextNode;
 class nsWindowSizes;
 class nsSmallVoidArray;
 class nsDOMCaretPosition;
 class nsViewportInfo;
-class nsDOMEvent;
 class nsIGlobalObject;
 class nsCSSSelectorList;
 
 namespace mozilla {
 class ErrorResult;
 
 namespace css {
 class Loader;
@@ -98,16 +97,17 @@ class CDATASection;
 class Comment;
 struct CustomElementDefinition;
 class DocumentFragment;
 class DocumentType;
 class DOMImplementation;
 class DOMStringList;
 class Element;
 struct ElementRegistrationOptions;
+class Event;
 class EventTarget;
 class FrameRequestCallback;
 class HTMLBodyElement;
 struct LifecycleCallbackArgs;
 class Link;
 class GlobalObject;
 class NodeFilter;
 class NodeIterator;
@@ -2061,18 +2061,18 @@ public:
   already_AddRefed<mozilla::dom::Comment>
     CreateComment(const nsAString& aData) const;
   already_AddRefed<mozilla::dom::ProcessingInstruction>
     CreateProcessingInstruction(const nsAString& target, const nsAString& data,
                                 mozilla::ErrorResult& rv) const;
   already_AddRefed<nsINode>
     ImportNode(nsINode& aNode, bool aDeep, mozilla::ErrorResult& rv) const;
   nsINode* AdoptNode(nsINode& aNode, mozilla::ErrorResult& rv);
-  already_AddRefed<nsDOMEvent> CreateEvent(const nsAString& aEventType,
-                                           mozilla::ErrorResult& rv) const;
+  already_AddRefed<mozilla::dom::Event>
+    CreateEvent(const nsAString& aEventType, mozilla::ErrorResult& rv) const;
   already_AddRefed<nsRange> CreateRange(mozilla::ErrorResult& rv);
   already_AddRefed<mozilla::dom::NodeIterator>
     CreateNodeIterator(nsINode& aRoot, uint32_t aWhatToShow,
                        mozilla::dom::NodeFilter* aFilter,
                        mozilla::ErrorResult& rv) const;
   already_AddRefed<mozilla::dom::NodeIterator>
     CreateNodeIterator(nsINode& aRoot, uint32_t aWhatToShow,
                        const mozilla::dom::NodeFilterHolder& aFilter,
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -188,27 +188,27 @@
 
 #include "imgILoader.h"
 #include "imgRequestProxy.h"
 #include "nsWrapperCacheInlines.h"
 #include "nsSandboxFlags.h"
 #include "nsIAppsService.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/DocumentFragment.h"
+#include "mozilla/dom/Event.h"
 #include "mozilla/dom/HTMLBodyElement.h"
 #include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/dom/NodeFilterBinding.h"
 #include "mozilla/dom/OwningNonNull.h"
 #include "mozilla/dom/UndoManager.h"
 #include "mozilla/dom/WebComponentsBinding.h"
 #include "nsFrame.h"
 #include "nsDOMCaretPosition.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsViewportInfo.h"
-#include "nsDOMEvent.h"
 #include "nsIContentPermissionPrompt.h"
 #include "mozilla/StaticPtr.h"
 #include "nsITextControlElement.h"
 #include "nsIDOMNSEditableElement.h"
 #include "nsIEditor.h"
 #include "nsIDOMCSSStyleRule.h"
 #include "mozilla/css/Rule.h"
 #include "nsIDOMLocation.h"
@@ -7644,17 +7644,17 @@ NS_IMETHODIMP
 nsDocument::CreateEvent(const nsAString& aEventType, nsIDOMEvent** aReturn)
 {
   NS_ENSURE_ARG_POINTER(aReturn);
   ErrorResult rv;
   *aReturn = nsIDocument::CreateEvent(aEventType, rv).get();
   return rv.ErrorCode();
 }
 
-already_AddRefed<nsDOMEvent>
+already_AddRefed<Event>
 nsIDocument::CreateEvent(const nsAString& aEventType, ErrorResult& rv) const
 {
   nsIPresShell *shell = GetShell();
 
   nsPresContext *presContext = nullptr;
 
   if (shell) {
     // Retrieve the context
--- a/content/base/src/nsINode.cpp
+++ b/content/base/src/nsINode.cpp
@@ -13,16 +13,19 @@
 #include "AccessCheck.h"
 #include "jsapi.h"
 #include "mozAutoDocUpdate.h"
 #include "mozilla/CORSMode.h"
 #include "mozilla/InternalMutationEvent.h"
 #include "mozilla/Likely.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Telemetry.h"
+#include "mozilla/dom/Element.h"
+#include "mozilla/dom/Event.h"
+#include "mozilla/dom/ShadowRoot.h"
 #include "nsAsyncDOMEvent.h"
 #include "nsAttrValueOrString.h"
 #include "nsBindingManager.h"
 #include "nsCCUncollectableMarker.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsContentList.h"
 #include "nsContentUtils.h"
 #include "nsCycleCollectionParticipant.h"
@@ -36,17 +39,16 @@
 #include "nsDOMString.h"
 #include "nsDOMTokenList.h"
 #include "nsEventDispatcher.h"
 #include "nsEventListenerManager.h"
 #include "nsEventStateManager.h"
 #include "nsFocusManager.h"
 #include "nsFrameManager.h"
 #include "nsFrameSelection.h"
-#include "mozilla/dom/Element.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsIAnonymousContentCreator.h"
 #include "nsIAtom.h"
 #include "nsIBaseWindow.h"
 #include "nsICategoryManager.h"
 #include "nsIContentIterator.h"
 #include "nsIControllers.h"
@@ -91,21 +93,19 @@
 #include "nsXBLBinding.h"
 #include "nsXBLPrototypeBinding.h"
 #include "prprf.h"
 #include "xpcpublic.h"
 #include "nsCSSRuleProcessor.h"
 #include "nsCSSParser.h"
 #include "HTMLLegendElement.h"
 #include "nsWrapperCacheInlines.h"
-#include "mozilla/dom/ShadowRoot.h"
 #include "WrapperFactory.h"
 #include "DocumentType.h"
 #include <algorithm>
-#include "nsDOMEvent.h"
 #include "nsGlobalWindow.h"
 #include "nsDOMMutationObserver.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsINode::nsSlots::~nsSlots()
 {
@@ -2628,15 +2628,15 @@ nsINode::GetAttributes()
 {
   if (!IsElement()) {
     return nullptr;
   }
   return AsElement()->Attributes();
 }
 
 bool
-EventTarget::DispatchEvent(nsDOMEvent& aEvent,
+EventTarget::DispatchEvent(Event& aEvent,
                            ErrorResult& aRv)
 {
   bool result = false;
   aRv = DispatchEvent(&aEvent, &result);
   return result;
 }
--- a/content/base/src/nsObjectLoadingContent.cpp
+++ b/content/base/src/nsObjectLoadingContent.cpp
@@ -64,28 +64,28 @@
 // Concrete classes
 #include "nsFrameLoader.h"
 
 #include "nsObjectLoadingContent.h"
 #include "mozAutoDocUpdate.h"
 #include "nsIContentSecurityPolicy.h"
 #include "nsIChannelPolicy.h"
 #include "nsChannelPolicy.h"
-#include "mozilla/dom/Element.h"
 #include "GeckoProfiler.h"
 #include "nsObjectFrame.h"
 #include "nsDOMClassInfo.h"
 #include "nsWrapperCacheInlines.h"
 #include "nsDOMJSUtils.h"
-#include "nsDOMEvent.h"
 
 #include "nsWidgetsCID.h"
 #include "nsContentCID.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/dom/BindingUtils.h"
+#include "mozilla/dom/Element.h"
+#include "mozilla/dom/Event.h"
 #include "mozilla/Telemetry.h"
 
 #ifdef XP_WIN
 // Thanks so much, Microsoft! :(
 #ifdef CreateEvent
 #undef CreateEvent
 #endif
 #endif // XP_WIN
@@ -302,17 +302,17 @@ nsPluginCrashedEvent::Run()
 
   nsCOMPtr<nsIDocument> doc = mContent->GetDocument();
   if (!doc) {
     NS_WARNING("Couldn't get document for PluginCrashed event!");
     return NS_OK;
   }
 
   ErrorResult rv;
-  nsRefPtr<nsDOMEvent> event =
+  nsRefPtr<Event> event =
     doc->CreateEvent(NS_LITERAL_STRING("datacontainerevents"), rv);
   nsCOMPtr<nsIDOMDataContainerEvent> containerEvent(do_QueryObject(event));
   if (!containerEvent) {
     NS_WARNING("Couldn't QI event for PluginCrashed event!");
     return NS_OK;
   }
 
   event->InitEvent(NS_LITERAL_STRING("PluginCrashed"), true, true);
--- a/content/html/content/src/UndoManager.cpp
+++ b/content/html/content/src/UndoManager.cpp
@@ -1,18 +1,18 @@
 /* -*- 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 "mozilla/dom/UndoManager.h"
 #include "mozilla/dom/DOMTransactionBinding.h"
 
+#include "mozilla/dom/Event.h"
 #include "nsDOMClassInfoID.h"
-#include "nsDOMEvent.h"
 #include "nsIClassInfo.h"
 #include "nsIDOMDocument.h"
 #include "nsIXPCScriptable.h"
 #include "nsIVariant.h"
 #include "nsVariant.h"
 #include "nsINode.h"
 #include "nsIDOMDOMTransactionEvent.h"
 #include "nsEventDispatcher.h"
@@ -1137,17 +1137,17 @@ UndoManager::DispatchTransactionEvent(JS
                                       ErrorResult& aRv)
 {
   nsTArray<DOMTransaction*> items;
   ItemInternal(aPreviousPosition, items, aRv);
   if (aRv.Failed()) {
     return;
   }
 
-  nsRefPtr<nsDOMEvent> event = mHostNode->OwnerDoc()->CreateEvent(
+  nsRefPtr<Event> event = mHostNode->OwnerDoc()->CreateEvent(
     NS_LITERAL_STRING("domtransaction"), aRv);
   if (aRv.Failed()) {
     return;
   }
 
   nsCOMPtr<nsIWritableVariant> transactions = new nsVariant();
 
   // Unwrap the DOMTransactions into jsvals, then convert
--- a/content/html/document/src/nsHTMLDocument.h
+++ b/content/html/document/src/nsHTMLDocument.h
@@ -15,17 +15,16 @@
 #include "nsTArray.h"
 
 #include "pldhash.h"
 #include "nsIHttpChannel.h"
 #include "nsHTMLStyleSheet.h"
 
 #include "nsICommandManager.h"
 #include "mozilla/dom/HTMLSharedElement.h"
-#include "nsDOMEvent.h"
 
 class nsIEditor;
 class nsIParser;
 class nsIURI;
 class nsIMarkupDocumentViewer;
 class nsIDocShell;
 class nsICachingChannel;
 class nsIWyciwygChannel;
--- a/content/media/webaudio/AudioProcessingEvent.cpp
+++ b/content/media/webaudio/AudioProcessingEvent.cpp
@@ -6,29 +6,29 @@
 
 #include "AudioProcessingEvent.h"
 #include "mozilla/dom/AudioProcessingEventBinding.h"
 #include "AudioContext.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED_3(AudioProcessingEvent, nsDOMEvent,
+NS_IMPL_CYCLE_COLLECTION_INHERITED_3(AudioProcessingEvent, Event,
                                      mInputBuffer, mOutputBuffer, mNode)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(AudioProcessingEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
-NS_IMPL_ADDREF_INHERITED(AudioProcessingEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(AudioProcessingEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(AudioProcessingEvent, Event)
+NS_IMPL_RELEASE_INHERITED(AudioProcessingEvent, Event)
 
 AudioProcessingEvent::AudioProcessingEvent(ScriptProcessorNode* aOwner,
                                            nsPresContext* aPresContext,
                                            WidgetEvent* aEvent)
-  : nsDOMEvent(aOwner, aPresContext, aEvent)
+  : Event(aOwner, aPresContext, aEvent)
   , mPlaybackTime(0.0)
   , mNode(aOwner)
 {
   SetIsDOMBinding();
 }
 
 JSObject*
 AudioProcessingEvent::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
--- a/content/media/webaudio/AudioProcessingEvent.h
+++ b/content/media/webaudio/AudioProcessingEvent.h
@@ -2,33 +2,33 @@
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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 AudioProcessingEvent_h_
 #define AudioProcessingEvent_h_
 
-#include "nsDOMEvent.h"
 #include "AudioBuffer.h"
 #include "ScriptProcessorNode.h"
+#include "mozilla/dom/Event.h"
 
 namespace mozilla {
 namespace dom {
 
-class AudioProcessingEvent : public nsDOMEvent
+class AudioProcessingEvent : public Event
 {
 public:
   AudioProcessingEvent(ScriptProcessorNode* aOwner,
                        nsPresContext* aPresContext,
                        WidgetEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
-  NS_FORWARD_TO_NSDOMEVENT
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioProcessingEvent, nsDOMEvent)
+  NS_FORWARD_TO_EVENT
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioProcessingEvent, Event)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
 
   void InitEvent(AudioBuffer* aInputBuffer,
                  uint32_t aNumberOfInputChannels,
                  double aPlaybackTime)
   {
--- a/content/media/webaudio/OfflineAudioCompletionEvent.cpp
+++ b/content/media/webaudio/OfflineAudioCompletionEvent.cpp
@@ -6,29 +6,29 @@
 
 #include "OfflineAudioCompletionEvent.h"
 #include "mozilla/dom/OfflineAudioCompletionEventBinding.h"
 #include "AudioContext.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED_1(OfflineAudioCompletionEvent, nsDOMEvent,
+NS_IMPL_CYCLE_COLLECTION_INHERITED_1(OfflineAudioCompletionEvent, Event,
                                      mRenderedBuffer)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(OfflineAudioCompletionEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
-NS_IMPL_ADDREF_INHERITED(OfflineAudioCompletionEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(OfflineAudioCompletionEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(OfflineAudioCompletionEvent, Event)
+NS_IMPL_RELEASE_INHERITED(OfflineAudioCompletionEvent, Event)
 
 OfflineAudioCompletionEvent::OfflineAudioCompletionEvent(AudioContext* aOwner,
                                                          nsPresContext* aPresContext,
                                                          WidgetEvent* aEvent)
-  : nsDOMEvent(aOwner, aPresContext, aEvent)
+  : Event(aOwner, aPresContext, aEvent)
 {
   SetIsDOMBinding();
 }
 
 JSObject*
 OfflineAudioCompletionEvent::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
 {
   return OfflineAudioCompletionEventBinding::Wrap(aCx, aScope, this);
--- a/content/media/webaudio/OfflineAudioCompletionEvent.h
+++ b/content/media/webaudio/OfflineAudioCompletionEvent.h
@@ -2,34 +2,34 @@
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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 OfflineAudioCompletionEvent_h_
 #define OfflineAudioCompletionEvent_h_
 
-#include "nsDOMEvent.h"
 #include "AudioBuffer.h"
+#include "mozilla/dom/Event.h"
 
 namespace mozilla {
 namespace dom {
 
 class AudioContext;
 
-class OfflineAudioCompletionEvent : public nsDOMEvent
+class OfflineAudioCompletionEvent : public Event
 {
 public:
   OfflineAudioCompletionEvent(AudioContext* aOwner,
                               nsPresContext* aPresContext,
                               WidgetEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
-  NS_FORWARD_TO_NSDOMEVENT
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(OfflineAudioCompletionEvent, nsDOMEvent)
+  NS_FORWARD_TO_EVENT
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(OfflineAudioCompletionEvent, Event)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
 
   void InitEvent(AudioBuffer* aRenderedBuffer)
   {
     InitEvent(NS_LITERAL_STRING("complete"), false, false);
     mRenderedBuffer = aRenderedBuffer;
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -53,17 +53,17 @@
 #include "nsIStyleSheet.h"
 #include "nsIURL.h"
 #include "nsViewManager.h"
 #include "nsIWidget.h"
 #include "nsIXULDocument.h"
 #include "nsIXULTemplateBuilder.h"
 #include "nsLayoutCID.h"
 #include "nsContentCID.h"
-#include "nsDOMEvent.h"
+#include "mozilla/dom/Event.h"
 #include "nsRDFCID.h"
 #include "nsStyleConsts.h"
 #include "nsXPIDLString.h"
 #include "nsXULControllers.h"
 #include "nsIBoxObject.h"
 #include "nsPIBoxObject.h"
 #include "XULDocument.h"
 #include "nsXULPopupListener.h"
@@ -1180,17 +1180,17 @@ nsXULElement::PreHandleEvent(nsEventChai
             nsCOMPtr<nsIContent> commandContent(do_QueryInterface(commandElt));
             if (commandContent) {
                 // Create a new command event to dispatch to the element
                 // pointed to by the command attribute.  The new event's
                 // sourceEvent will be the original command event that we're
                 // handling.
                 nsCOMPtr<nsIDOMEvent> domEvent = aVisitor.mDOMEvent;
                 while (domEvent) {
-                    nsDOMEvent* event = domEvent->InternalDOMEvent();
+                    Event* event = domEvent->InternalDOMEvent();
                     NS_ENSURE_STATE(!SameCOMIdentity(event->GetOriginalTarget(),
                                                      commandContent));
                     nsCOMPtr<nsIDOMXULCommandEvent> commandEvent =
                         do_QueryInterface(domEvent);
                     if (commandEvent) {
                         commandEvent->GetSourceEvent(getter_AddRefs(domEvent));
                     } else {
                         domEvent = nullptr;
--- a/content/xul/content/src/nsXULPopupListener.cpp
+++ b/content/xul/content/src/nsXULPopupListener.cpp
@@ -27,28 +27,28 @@
 #include "nsServiceManagerUtils.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsLayoutUtils.h"
 #include "nsFrameManager.h"
 #include "nsHTMLReflowState.h"
 #include "nsIObjectLoadingContent.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 #include "mozilla/dom/EventTarget.h"
 #include "mozilla/dom/FragmentOrElement.h"
 
 // for event firing in context menus
 #include "nsPresContext.h"
 #include "nsIPresShell.h"
 #include "nsFocusManager.h"
 #include "nsPIDOMWindow.h"
 #include "nsViewManager.h"
 #include "nsError.h"
 #include "nsMenuFrame.h"
-#include "nsDOMEvent.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 // on win32 and os/2, context menus come up on mouse up. On other platforms,
 // they appear on mouse down. Certain bits of code care about this difference.
 #if defined(XP_WIN)
 #define NS_CONTEXT_MENU_IS_MOUSEUP 1
--- a/dom/base/MessagePort.cpp
+++ b/dom/base/MessagePort.cpp
@@ -1,22 +1,22 @@
 /* -*- 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 "MessagePort.h"
+#include "mozilla/dom/Event.h"
 #include "mozilla/dom/MessageChannel.h"
 #include "mozilla/dom/MessagePortBinding.h"
 #include "mozilla/dom/StructuredCloneTags.h"
 #include "nsGlobalWindow.h"
 #include "nsContentUtils.h"
 #include "nsEventDispatcher.h"
 #include "nsPresContext.h"
-#include "nsDOMEvent.h"
 
 #include "nsIDocument.h"
 #include "nsIDOMFile.h"
 #include "nsIDOMFileList.h"
 #include "nsIDOMMessageEvent.h"
 #include "nsIPresShell.h"
 
 namespace mozilla {
@@ -254,17 +254,17 @@ PostMessageRunnable::Run()
 
   // Create the event
   nsIDocument* doc = mPort->GetOwner()->GetExtantDoc();
   if (!doc) {
     return NS_OK;
   }
 
   ErrorResult error;
-  nsRefPtr<nsDOMEvent> event =
+  nsRefPtr<Event> event =
     doc->CreateEvent(NS_LITERAL_STRING("MessageEvent"), error);
   if (error.Failed()) {
     return NS_OK;
   }
 
   nsCOMPtr<nsIDOMMessageEvent> message = do_QueryInterface(event);
   nsresult rv = message->InitMessageEvent(NS_LITERAL_STRING("message"),
                                           false /* non-bubbling */,
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -30,17 +30,17 @@
 #include "mozilla/dom/power/PowerManagerService.h"
 #include "mozilla/dom/MobileMessageManager.h"
 #include "mozilla/dom/Telephony.h"
 #include "mozilla/Hal.h"
 #include "nsISiteSpecificUserAgent.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/StaticPtr.h"
 #include "Connection.h"
-#include "nsDOMEvent.h"
+#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 #include "nsGlobalWindow.h"
 #ifdef MOZ_B2G_RIL
 #include "mozilla/dom/IccManager.h"
 #include "mozilla/dom/CellBroadcast.h"
 #include "mozilla/dom/MobileConnectionArray.h"
 #include "mozilla/dom/Voicemail.h"
 #endif
 #include "nsIIdleObserver.h"
--- a/dom/base/nsDOMClassInfoID.h
+++ b/dom/base/nsDOMClassInfoID.h
@@ -49,40 +49,41 @@ enum nsDOMClassInfoID {
 #undef DOMCI_CASTABLE_INTERFACE
 #define DOMCI_CASTABLE_INTERFACES(_extra)                                     \
 DOMCI_CASTABLE_INTERFACE(nsINode, nsINode, 0, _extra)                         \
 DOMCI_CASTABLE_NODECL_INTERFACE(mozilla::dom::Element,  mozilla::dom::Element,\
                                 1, _extra)                                    \
 /* If this is ever removed, the IID for EventTarget can go away */            \
 DOMCI_CASTABLE_NODECL_INTERFACE(mozilla::dom::EventTarget,                    \
                                 mozilla::dom::EventTarget, 2, _extra)         \
-DOMCI_CASTABLE_INTERFACE(nsDOMEvent, nsIDOMEvent, 3, _extra)                  \
+DOMCI_CASTABLE_NODECL_INTERFACE(mozilla::dom::Event, nsIDOMEvent, 3, _extra)  \
 DOMCI_CASTABLE_INTERFACE(nsIDocument, nsIDocument, 4, _extra)                 \
 DOMCI_CASTABLE_INTERFACE(nsDocument, nsIDocument, 5, _extra)                  \
 DOMCI_CASTABLE_INTERFACE(nsGenericHTMLElement, nsIContent, 6, _extra)         \
 DOMCI_CASTABLE_INTERFACE(nsHTMLDocument, nsIDocument, 7, _extra)              \
 DOMCI_CASTABLE_INTERFACE(nsStyledElement, nsStyledElement, 8, _extra)         \
 DOMCI_CASTABLE_INTERFACE(nsSVGElement, nsIContent, 9, _extra)                 \
-/* NOTE: When removing the casts below, remove the nsDOMEventBase class */    \
+/* NOTE: When removing the casts below, remove the dom::EventBase class */    \
 DOMCI_CASTABLE_NODECL_INTERFACE(mozilla::dom::MouseEvent,                     \
-                                nsDOMEventBase, 10, _extra)                   \
+                                mozilla::dom::EventBase, 10, _extra)          \
 DOMCI_CASTABLE_NODECL_INTERFACE(mozilla::dom::UIEvent,                        \
-                                nsDOMEventBase, 11, _extra)                   \
+                                mozilla::dom::EventBase, 11, _extra)          \
 DOMCI_CASTABLE_INTERFACE(nsGlobalWindow, nsIDOMEventTarget, 12, _extra)
 
 // Make sure all classes mentioned in DOMCI_CASTABLE_INTERFACES
 // have been declared.
 #define DOMCI_CASTABLE_NODECL_INTERFACE(_interface, _u1, _u2, _u3) /* Nothing */
 #define DOMCI_CASTABLE_INTERFACE(_interface, _u1, _u2, _u3) class _interface;
 DOMCI_CASTABLE_INTERFACES(unused)
 #undef DOMCI_CASTABLE_INTERFACE
 #undef DOMCI_CASTABLE_NODECL_INTERFACE
 namespace mozilla {
 namespace dom {
 class Element;
+class Event;
 class EventTarget;
 class MouseEvent;
 class UIEvent;
 } // namespace dom
 } // namespace mozilla
 
 #define DOMCI_CASTABLE_NODECL_INTERFACE DOMCI_CASTABLE_INTERFACE
 
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -5568,17 +5568,17 @@ nsGlobalWindow::DispatchCustomEvent(cons
   return defaultActionEnabled;
 }
 
 // NOTE: Arguments to this function should be CSS pixels, not device pixels.
 bool
 nsGlobalWindow::DispatchResizeEvent(const nsIntSize& aSize)
 {
   ErrorResult res;
-  nsRefPtr<nsDOMEvent> domEvent =
+  nsRefPtr<Event> domEvent =
     mDoc->CreateEvent(NS_LITERAL_STRING("CustomEvent"), res);
   if (res.Failed()) {
     return false;
   }
 
   AutoSafeJSContext cx;
   JSAutoCompartment ac(cx, mJSObject);
   DOMWindowResizeEventDetail detail;
@@ -13055,29 +13055,29 @@ nsGlobalWindow::GetAttentionWithCycleCou
     aError = widget->GetAttention(aCycleCount);
   }
 }
 
 NS_IMETHODIMP
 nsGlobalChromeWindow::BeginWindowMove(nsIDOMEvent *aMouseDownEvent, nsIDOMElement* aPanel)
 {
   NS_ENSURE_TRUE(aMouseDownEvent, NS_ERROR_FAILURE);
-  nsDOMEvent* mouseDownEvent = aMouseDownEvent->InternalDOMEvent();
+  Event* mouseDownEvent = aMouseDownEvent->InternalDOMEvent();
   NS_ENSURE_TRUE(mouseDownEvent, NS_ERROR_FAILURE);
 
   nsCOMPtr<Element> panel = do_QueryInterface(aPanel);
   NS_ENSURE_TRUE(panel || !aPanel, NS_ERROR_FAILURE);
 
   ErrorResult rv;
   BeginWindowMove(*mouseDownEvent, panel, rv);
   return rv.ErrorCode();
 }
 
 void
-nsGlobalWindow::BeginWindowMove(nsDOMEvent& aMouseDownEvent, Element* aPanel,
+nsGlobalWindow::BeginWindowMove(Event& aMouseDownEvent, Element* aPanel,
                                 ErrorResult& aError)
 {
   nsCOMPtr<nsIWidget> widget;
 
   // if a panel was supplied, use its widget instead.
 #ifdef MOZ_XUL
   if (aPanel) {
     nsIFrame* frame = aPanel->GetPrimaryFrame();
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -970,17 +970,17 @@ public:
                                   mozilla::ErrorResult& aError);
   void SetCursor(const nsAString& aCursor, mozilla::ErrorResult& aError);
   void Maximize(mozilla::ErrorResult& aError);
   void Minimize(mozilla::ErrorResult& aError);
   void Restore(mozilla::ErrorResult& aError);
   void NotifyDefaultButtonLoaded(mozilla::dom::Element& aDefaultButton,
                                  mozilla::ErrorResult& aError);
   nsIMessageBroadcaster* GetMessageManager(mozilla::ErrorResult& aError);
-  void BeginWindowMove(nsDOMEvent& aMouseDownEvent,
+  void BeginWindowMove(mozilla::dom::Event& aMouseDownEvent,
                        mozilla::dom::Element* aPanel,
                        mozilla::ErrorResult& aError);
 
 protected:
   // Array of idle observers that are notified of idle events.
   nsTObserverArray<IdleObserverHolder> mIdleObservers;
 
   // Idle timer used for function callbacks to notify idle observers.
--- a/dom/base/nsScreen.cpp
+++ b/dom/base/nsScreen.cpp
@@ -1,25 +1,25 @@
 /* -*- 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 "mozilla/Hal.h"
+#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
+#include "mozilla/dom/ScreenBinding.h"
 #include "nsScreen.h"
 #include "nsIDocument.h"
 #include "nsIDocShell.h"
 #include "nsIDocument.h"
 #include "nsPresContext.h"
 #include "nsCOMPtr.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsLayoutUtils.h"
-#include "nsDOMEvent.h"
 #include "nsJSUtils.h"
-#include "mozilla/dom/ScreenBinding.h"
 #include "nsDeviceContext.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 /* static */ already_AddRefed<nsScreen>
 nsScreen::Create(nsPIDOMWindow* aWindow)
 {
--- a/dom/battery/BatteryManager.cpp
+++ b/dom/battery/BatteryManager.cpp
@@ -3,17 +3,16 @@
  * 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 <limits>
 #include "mozilla/Hal.h"
 #include "BatteryManager.h"
 #include "nsIDOMClassInfo.h"
 #include "Constants.h"
-#include "nsDOMEvent.h"
 #include "mozilla/Preferences.h"
 #include "nsDOMEventTargetHelper.h"
 #include "mozilla/dom/BatteryManagerBinding.h"
 
 /**
  * We have to use macros here because our leak analysis tool things we are
  * leaking strings when we have |static const nsString|. Sad :(
  */
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -368,17 +368,16 @@ DOMInterfaces = {
     'resultNotAddRefed': [
         'classList', 'attributes', 'children', 'firstElementChild',
         'lastElementChild', 'previousElementSibling', 'nextElementSibling',
         'getAttributeNode', 'getAttributeNodeNS', 'querySelector'
     ]
 },
 
 'Event': {
-    'nativeType': 'nsDOMEvent',
     'implicitJSContext': [ 'defaultPrevented', 'preventDefault' ],
 },
 
 'EventTarget': {
     'hasXPConnectImpls': True,
     'concrete': False,
     'jsImplParent': 'nsDOMEventTargetHelper'
 },
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -12067,17 +12067,17 @@ class CGEventClass(CGBindingImplClass):
                 if m.type.isAny():
                     dropJS += "  " + member + " = JS::UndefinedValue();\n"
                 elif m.type.isObject() or m.type.isSpiderMonkeyInterface():
                     dropJS += "  " + member + " = nullptr;\n"
         if dropJS != "":
             dropJS += "  mozilla::DropJSObjects(this);\n"
         # Just override CGClass and do our own thing
         nativeType = self.descriptor.nativeType.split('::')[-1]
-        ctorParams = ("aOwner, nullptr, nullptr" if self.parentType == "nsDOMEvent"
+        ctorParams = ("aOwner, nullptr, nullptr" if self.parentType == "Event"
                  else "aOwner")
         classImpl = """
 NS_IMPL_CYCLE_COLLECTION_CLASS(${nativeType})
 
 NS_IMPL_ADDREF_INHERITED(${nativeType}, ${parentType})
 NS_IMPL_RELEASE_INHERITED(${nativeType}, ${parentType})
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(${nativeType}, ${parentType})
--- a/dom/devicestorage/nsDeviceStorage.cpp
+++ b/dom/devicestorage/nsDeviceStorage.cpp
@@ -17,17 +17,16 @@
 #include "mozilla/dom/PContentPermissionRequestChild.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "mozilla/LazyIdleThread.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Scoped.h"
 #include "mozilla/Services.h"
 
 #include "nsAutoPtr.h"
-#include "nsDOMEvent.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIFile.h"
 #include "nsIDirectoryEnumerator.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIDOMFile.h"
 #include "nsDOMBlobBuilder.h"
 #include "nsNetUtil.h"
--- a/dom/events/AnimationEvent.cpp
+++ b/dom/events/AnimationEvent.cpp
@@ -8,34 +8,34 @@
 #include "prtime.h"
 
 namespace mozilla {
 namespace dom {
 
 AnimationEvent::AnimationEvent(EventTarget* aOwner,
                                nsPresContext* aPresContext,
                                InternalAnimationEvent* aEvent)
-  : nsDOMEvent(aOwner, aPresContext,
-               aEvent ? aEvent : new InternalAnimationEvent(false, 0))
+  : Event(aOwner, aPresContext,
+          aEvent ? aEvent : new InternalAnimationEvent(false, 0))
 {
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
   }
 }
 
 NS_INTERFACE_MAP_BEGIN(AnimationEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMAnimationEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
-NS_IMPL_ADDREF_INHERITED(AnimationEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(AnimationEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(AnimationEvent, Event)
+NS_IMPL_RELEASE_INHERITED(AnimationEvent, Event)
 
 //static
 already_AddRefed<AnimationEvent>
 AnimationEvent::Constructor(const GlobalObject& aGlobal,
                             const nsAString& aType,
                             const AnimationEventInit& aParam,
                             ErrorResult& aRv)
 {
--- a/dom/events/AnimationEvent.h
+++ b/dom/events/AnimationEvent.h
@@ -1,35 +1,35 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* 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 mozilla_dom_AnimationEvent_h_
 #define mozilla_dom_AnimationEvent_h_
 
-#include "nsDOMEvent.h"
+#include "mozilla/EventForwards.h"
+#include "mozilla/dom/Event.h"
+#include "mozilla/dom/AnimationEventBinding.h"
 #include "nsIDOMAnimationEvent.h"
-#include "mozilla/EventForwards.h"
-#include "mozilla/dom/AnimationEventBinding.h"
 
 class nsAString;
 
 namespace mozilla {
 namespace dom {
 
-class AnimationEvent : public nsDOMEvent,
+class AnimationEvent : public Event,
                        public nsIDOMAnimationEvent
 {
 public:
   AnimationEvent(EventTarget* aOwner,
                  nsPresContext* aPresContext,
                  InternalAnimationEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
-  NS_FORWARD_TO_NSDOMEVENT
+  NS_FORWARD_TO_EVENT
   NS_DECL_NSIDOMANIMATIONEVENT
 
   static already_AddRefed<AnimationEvent>
   Constructor(const GlobalObject& aGlobal,
               const nsAString& aType,
               const AnimationEventInit& aParam,
               ErrorResult& aRv);
 
--- a/dom/events/BeforeUnloadEvent.cpp
+++ b/dom/events/BeforeUnloadEvent.cpp
@@ -3,22 +3,22 @@
  * 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 "mozilla/dom/BeforeUnloadEvent.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_ADDREF_INHERITED(BeforeUnloadEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(BeforeUnloadEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(BeforeUnloadEvent, Event)
+NS_IMPL_RELEASE_INHERITED(BeforeUnloadEvent, Event)
 
 NS_INTERFACE_MAP_BEGIN(BeforeUnloadEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMBeforeUnloadEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
 NS_IMETHODIMP
 BeforeUnloadEvent::SetReturnValue(const nsAString& aReturnValue)
 {
   mText = aReturnValue;
   return NS_OK;  // Don't throw an exception
 }
 
--- a/dom/events/BeforeUnloadEvent.h
+++ b/dom/events/BeforeUnloadEvent.h
@@ -1,44 +1,44 @@
 /* -*- 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 mozilla_dom_BeforeUnloadEvent_h_
 #define mozilla_dom_BeforeUnloadEvent_h_
 
+#include "mozilla/dom/BeforeUnloadEventBinding.h"
+#include "mozilla/dom/Event.h"
 #include "nsIDOMBeforeUnloadEvent.h"
-#include "nsDOMEvent.h"
-#include "mozilla/dom/BeforeUnloadEventBinding.h"
 
 namespace mozilla {
 namespace dom {
 
-class BeforeUnloadEvent : public nsDOMEvent,
+class BeforeUnloadEvent : public Event,
                           public nsIDOMBeforeUnloadEvent
 {
 public:
   BeforeUnloadEvent(EventTarget* aOwner,
                     nsPresContext* aPresContext,
                     WidgetEvent* aEvent)
-    : nsDOMEvent(aOwner, aPresContext, aEvent)
+    : Event(aOwner, aPresContext, aEvent)
   {
   }
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return BeforeUnloadEventBinding::Wrap(aCx, aScope, this);
   }
 
   NS_DECL_ISUPPORTS_INHERITED
 
-  // Forward to nsDOMEvent
-  NS_FORWARD_TO_NSDOMEVENT
+  // Forward to Event
+  NS_FORWARD_TO_EVENT
 
   // nsIDOMBeforeUnloadEvent Interface
   NS_DECL_NSIDOMBEFOREUNLOADEVENT
 
 protected:
   nsString mText;
 };
 
--- a/dom/events/ClipboardEvent.cpp
+++ b/dom/events/ClipboardEvent.cpp
@@ -9,33 +9,33 @@
 #include "nsIClipboard.h"
 
 namespace mozilla {
 namespace dom {
 
 ClipboardEvent::ClipboardEvent(EventTarget* aOwner,
                                nsPresContext* aPresContext,
                                InternalClipboardEvent* aEvent)
-  : nsDOMEvent(aOwner, aPresContext, aEvent ? aEvent :
-               new InternalClipboardEvent(false, 0))
+  : Event(aOwner, aPresContext,
+          aEvent ? aEvent : new InternalClipboardEvent(false, 0))
 {
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
   }
 }
 
 NS_INTERFACE_MAP_BEGIN(ClipboardEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMClipboardEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
-NS_IMPL_ADDREF_INHERITED(ClipboardEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(ClipboardEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(ClipboardEvent, Event)
+NS_IMPL_RELEASE_INHERITED(ClipboardEvent, Event)
 
 nsresult
 ClipboardEvent::InitClipboardEvent(const nsAString& aType,
                                    bool aCanBubble,
                                    bool aCancelable,
                                    nsIDOMDataTransfer* aClipboardData)
 {
   nsCOMPtr<DataTransfer> clipboardData = do_QueryInterface(aClipboardData);
@@ -48,17 +48,17 @@ ClipboardEvent::InitClipboardEvent(const
 }
 
 void
 ClipboardEvent::InitClipboardEvent(const nsAString& aType, bool aCanBubble,
                                    bool aCancelable,
                                    DataTransfer* aClipboardData,
                                    ErrorResult& aError)
 {
-  aError = nsDOMEvent::InitEvent(aType, aCanBubble, aCancelable);
+  aError = Event::InitEvent(aType, aCanBubble, aCancelable);
   if (aError.Failed()) {
     return;
   }
 
   mEvent->AsClipboardEvent()->clipboardData = aClipboardData;
 }
 
 already_AddRefed<ClipboardEvent>
--- a/dom/events/ClipboardEvent.h
+++ b/dom/events/ClipboardEvent.h
@@ -1,39 +1,39 @@
 /* -*- 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 mozilla_dom_ClipboardEvent_h_
 #define mozilla_dom_ClipboardEvent_h_
 
-#include "nsIDOMClipboardEvent.h"
-#include "nsDOMEvent.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/dom/ClipboardEventBinding.h"
+#include "mozilla/dom/Event.h"
+#include "nsIDOMClipboardEvent.h"
 
 namespace mozilla {
 namespace dom {
 class DataTransfer;
 
-class ClipboardEvent : public nsDOMEvent,
+class ClipboardEvent : public Event,
                        public nsIDOMClipboardEvent
 {
 public:
   ClipboardEvent(EventTarget* aOwner,
                  nsPresContext* aPresContext,
                  InternalClipboardEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIDOMCLIPBOARDEVENT
 
   // Forward to base class
-  NS_FORWARD_TO_NSDOMEVENT
+  NS_FORWARD_TO_EVENT
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return ClipboardEventBinding::Wrap(aCx, aScope, this);
   }
 
   static already_AddRefed<ClipboardEvent>
--- a/dom/events/CommandEvent.cpp
+++ b/dom/events/CommandEvent.cpp
@@ -8,33 +8,34 @@
 #include "prtime.h"
 
 namespace mozilla {
 namespace dom {
 
 CommandEvent::CommandEvent(EventTarget* aOwner,
                            nsPresContext* aPresContext,
                            WidgetCommandEvent* aEvent)
-  : nsDOMEvent(aOwner, aPresContext, aEvent ? aEvent :
-               new WidgetCommandEvent(false, nullptr, nullptr, nullptr))
+  : Event(aOwner, aPresContext,
+          aEvent ? aEvent :
+                   new WidgetCommandEvent(false, nullptr, nullptr, nullptr))
 {
   mEvent->time = PR_Now();
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
   }
 }
 
 NS_INTERFACE_MAP_BEGIN(CommandEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMCommandEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
-NS_IMPL_ADDREF_INHERITED(CommandEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(CommandEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(CommandEvent, Event)
+NS_IMPL_RELEASE_INHERITED(CommandEvent, Event)
 
 NS_IMETHODIMP
 CommandEvent::GetCommand(nsAString& aCommand)
 {
   nsIAtom* command = mEvent->AsCommandEvent()->command;
   if (command) {
     command->ToString(aCommand);
   } else {
@@ -44,17 +45,17 @@ CommandEvent::GetCommand(nsAString& aCom
 }
 
 NS_IMETHODIMP
 CommandEvent::InitCommandEvent(const nsAString& aTypeArg,
                                bool aCanBubbleArg,
                                bool aCancelableArg,
                                const nsAString& aCommand)
 {
-  nsresult rv = nsDOMEvent::InitEvent(aTypeArg, aCanBubbleArg, aCancelableArg);
+  nsresult rv = Event::InitEvent(aTypeArg, aCanBubbleArg, aCancelableArg);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mEvent->AsCommandEvent()->command = do_GetAtom(aCommand);
   return NS_OK;
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/events/CommandEvent.h
+++ b/dom/events/CommandEvent.h
@@ -1,38 +1,38 @@
 /* -*- 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 mozilla_dom_CommandEvent_h_
 #define mozilla_dom_CommandEvent_h_
 
+#include "mozilla/EventForwards.h"
+#include "mozilla/dom/CommandEventBinding.h"
+#include "mozilla/dom/Event.h"
 #include "nsIDOMCommandEvent.h"
-#include "nsDOMEvent.h"
-#include "mozilla/dom/CommandEventBinding.h"
-#include "mozilla/EventForwards.h"
 
 namespace mozilla {
 namespace dom {
 
-class CommandEvent : public nsDOMEvent,
+class CommandEvent : public Event,
                      public nsIDOMCommandEvent
 {
 public:
   CommandEvent(EventTarget* aOwner,
                nsPresContext* aPresContext,
                WidgetCommandEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIDOMCOMMANDEVENT
 
   // Forward to base class
-  NS_FORWARD_TO_NSDOMEVENT
+  NS_FORWARD_TO_EVENT
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return CommandEventBinding::Wrap(aCx, aScope, this);
   }
 
   void InitCommandEvent(const nsAString& aType,
--- a/dom/events/DataContainerEvent.cpp
+++ b/dom/events/DataContainerEvent.cpp
@@ -8,37 +8,36 @@
 #include "nsIXPConnect.h"
 
 namespace mozilla {
 namespace dom {
 
 DataContainerEvent::DataContainerEvent(EventTarget* aOwner,
                                        nsPresContext* aPresContext,
                                        WidgetEvent* aEvent)
-  : nsDOMEvent(aOwner, aPresContext, aEvent)
+  : Event(aOwner, aPresContext, aEvent)
 {
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(DataContainerEvent)
 
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(DataContainerEvent, nsDOMEvent)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(DataContainerEvent, Event)
   tmp->mData.Clear();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(DataContainerEvent,
-                                                  nsDOMEvent)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(DataContainerEvent, Event)
   tmp->mData.EnumerateRead(TraverseEntry, &cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(DataContainerEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(DataContainerEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(DataContainerEvent, Event)
+NS_IMPL_RELEASE_INHERITED(DataContainerEvent, Event)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DataContainerEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMDataContainerEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
 NS_IMETHODIMP
 DataContainerEvent::GetData(const nsAString& aKey, nsIVariant** aData)
 {
   NS_ENSURE_ARG_POINTER(aData);
 
   mData.Get(aKey, aData);
   return NS_OK;
--- a/dom/events/DataContainerEvent.h
+++ b/dom/events/DataContainerEvent.h
@@ -1,37 +1,37 @@
 /* -*- 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 mozilla_dom_DataContainerEvent_h_
 #define mozilla_dom_DataContainerEvent_h_
 
+#include "mozilla/dom/DataContainerEventBinding.h"
+#include "mozilla/dom/Event.h"
 #include "nsIDOMDataContainerEvent.h"
-#include "nsDOMEvent.h"
 #include "nsInterfaceHashtable.h"
-#include "mozilla/dom/DataContainerEventBinding.h"
 
 namespace mozilla {
 namespace dom {
 
-class DataContainerEvent : public nsDOMEvent,
+class DataContainerEvent : public Event,
                            public nsIDOMDataContainerEvent
 {
 public:
   DataContainerEvent(EventTarget* aOwner,
                      nsPresContext* aPresContext,
                      WidgetEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DataContainerEvent, nsDOMEvent)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DataContainerEvent, Event)
 
-  NS_FORWARD_TO_NSDOMEVENT
+  NS_FORWARD_TO_EVENT
 
   NS_DECL_NSIDOMDATACONTAINEREVENT
 
   virtual JSObject*
   WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return DataContainerEventBinding::Wrap(aCx, aScope, this);
   }
--- a/dom/events/DeviceMotionEvent.cpp
+++ b/dom/events/DeviceMotionEvent.cpp
@@ -9,39 +9,39 @@
 
 namespace mozilla {
 namespace dom {
 
 /******************************************************************************
  * DeviceMotionEvent
  *****************************************************************************/
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED_3(DeviceMotionEvent, nsDOMEvent,
+NS_IMPL_CYCLE_COLLECTION_INHERITED_3(DeviceMotionEvent, Event,
                                      mAcceleration,
                                      mAccelerationIncludingGravity,
                                      mRotationRate)
 
-NS_IMPL_ADDREF_INHERITED(DeviceMotionEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(DeviceMotionEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(DeviceMotionEvent, Event)
+NS_IMPL_RELEASE_INHERITED(DeviceMotionEvent, Event)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DeviceMotionEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
 void
 DeviceMotionEvent::InitDeviceMotionEvent(
                      const nsAString& aType,
                      bool aCanBubble,
                      bool aCancelable,
                      const DeviceAccelerationInit& aAcceleration,
                      const DeviceAccelerationInit& aAccelIncludingGravity,
                      const DeviceRotationRateInit& aRotationRate,
                      Nullable<double> aInterval,
                      ErrorResult& aRv)
 {
-  aRv = nsDOMEvent::InitEvent(aType, aCanBubble, aCancelable);
+  aRv = Event::InitEvent(aType, aCanBubble, aCancelable);
   if (aRv.Failed()) {
     return;
   }
 
   mAcceleration = new DeviceAcceleration(this, aAcceleration.mX,
                                          aAcceleration.mY,
                                          aAcceleration.mZ);
 
--- a/dom/events/DeviceMotionEvent.h
+++ b/dom/events/DeviceMotionEvent.h
@@ -1,18 +1,18 @@
 /* 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 mozilla_dom_DeviceMotionEvent_h_
 #define mozilla_dom_DeviceMotionEvent_h_
 
-#include "nsDOMEvent.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/DeviceMotionEventBinding.h"
+#include "mozilla/dom/Event.h"
 
 namespace mozilla {
 namespace dom {
 
 class DeviceRotationRate MOZ_FINAL : public nsWrapperCache
 {
 public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DeviceRotationRate)
@@ -83,33 +83,33 @@ public:
 private:
   ~DeviceAcceleration();
 
 protected:
   nsRefPtr<DeviceMotionEvent> mOwner;
   Nullable<double> mX, mY, mZ;
 };
 
-class DeviceMotionEvent MOZ_FINAL : public nsDOMEvent
+class DeviceMotionEvent MOZ_FINAL : public Event
 {
 public:
 
   DeviceMotionEvent(EventTarget* aOwner,
                     nsPresContext* aPresContext,
                     WidgetEvent* aEvent)
-    : nsDOMEvent(aOwner, aPresContext, aEvent)
+    : Event(aOwner, aPresContext, aEvent)
   {
   }
 
   NS_DECL_ISUPPORTS_INHERITED
 
-  // Forward to nsDOMEvent
-  NS_FORWARD_TO_NSDOMEVENT
+  // Forward to Event
+  NS_FORWARD_TO_EVENT
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeviceMotionEvent, nsDOMEvent)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeviceMotionEvent, Event)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return DeviceMotionEventBinding::Wrap(aCx, aScope, this);
   }
 
   DeviceAcceleration* GetAcceleration() const
rename from dom/events/nsDOMEvent.cpp
rename to dom/events/Event.cpp
--- a/dom/events/nsDOMEvent.cpp
+++ b/dom/events/Event.cpp
@@ -1,69 +1,65 @@
 /* -*- 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 "AccessCheck.h"
 #include "base/basictypes.h"
-
-#include "AccessCheck.h"
 #include "ipc/IPCMessageUtils.h"
-#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 "mozilla/dom/Event.h"
 #include "mozilla/ContentEvents.h"
 #include "mozilla/InternalMutationEvent.h"
 #include "mozilla/MiscEvents.h"
 #include "mozilla/MouseEvents.h"
+#include "mozilla/Preferences.h"
 #include "mozilla/TextEvents.h"
 #include "mozilla/TouchEvents.h"
 #include "nsContentUtils.h"
+#include "nsCOMPtr.h"
+#include "nsDeviceContext.h"
+#include "nsDOMEventTargetHelper.h"
+#include "nsError.h"
+#include "nsEventStateManager.h"
+#include "nsGlobalWindow.h"
+#include "nsIFrame.h"
+#include "nsIContent.h"
+#include "nsIDocument.h"
+#include "nsIPresShell.h"
+#include "nsIScrollableFrame.h"
 #include "nsJSEnvironment.h"
-#include "mozilla/Preferences.h"
 #include "nsLayoutUtils.h"
-#include "nsIScrollableFrame.h"
-#include "nsDOMEventTargetHelper.h"
 #include "nsPIWindowRoot.h"
-#include "nsGlobalWindow.h"
-#include "nsDeviceContext.h"
-
-using namespace mozilla;
-using namespace mozilla::dom;
 
 namespace mozilla {
 namespace dom {
+
 namespace workers {
 extern bool IsCurrentThreadRunningChromeWorker();
 } // namespace workers
-} // namespace dom
-} // namespace mozilla
 
 static char *sPopupAllowedEvents;
 
-
-nsDOMEvent::nsDOMEvent(mozilla::dom::EventTarget* aOwner,
-                       nsPresContext* aPresContext, WidgetEvent* aEvent)
+Event::Event(EventTarget* aOwner,
+             nsPresContext* aPresContext,
+             WidgetEvent* aEvent)
 {
   ConstructorInit(aOwner, aPresContext, aEvent);
 }
 
-nsDOMEvent::nsDOMEvent(nsPIDOMWindow* aParent)
+Event::Event(nsPIDOMWindow* aParent)
 {
   ConstructorInit(static_cast<nsGlobalWindow *>(aParent), nullptr, nullptr);
 }
 
 void
-nsDOMEvent::ConstructorInit(mozilla::dom::EventTarget* aOwner,
-                            nsPresContext* aPresContext, WidgetEvent* aEvent)
+Event::ConstructorInit(EventTarget* aOwner,
+                       nsPresContext* aPresContext,
+                       WidgetEvent* aEvent)
 {
   SetIsDOMBinding();
   SetOwner(aOwner);
   mIsMainThreadEvent = mOwner || NS_IsMainThread();
   if (mIsMainThreadEvent) {
     nsJSContext::LikelyShortLivingObjectCreated();
   }
 
@@ -75,23 +71,23 @@ nsDOMEvent::ConstructorInit(mozilla::dom
   }
   else {
     mEventIsInternal = true;
     /*
       A derived class might want to allocate its own type of aEvent
       (derived from WidgetEvent). To do this, it should take care to pass
       a non-nullptr aEvent to this ctor, e.g.:
       
-        nsDOMFooEvent::nsDOMFooEvent(..., WidgetEvent* aEvent)
-        : nsDOMEvent(..., aEvent ? aEvent : new nsFooEvent())
+        FooEvent::FooEvent(..., WidgetEvent* aEvent)
+          : Event(..., aEvent ? aEvent : new WidgetEvent())
       
       Then, to override the mEventIsInternal assignments done by the
       base ctor, it should do this in its own ctor:
 
-        nsDOMFooEvent::nsDOMFooEvent(..., WidgetEvent* aEvent)
+        FooEvent::FooEvent(..., WidgetEvent* aEvent)
         ...
         {
           ...
           if (aEvent) {
             mEventIsInternal = false;
           }
           else {
             mEventIsInternal = true;
@@ -102,54 +98,54 @@ nsDOMEvent::ConstructorInit(mozilla::dom
     mEvent = new WidgetEvent(false, 0);
     mEvent->time = PR_Now();
   }
 
   InitPresContextData(aPresContext);
 }
 
 void
-nsDOMEvent::InitPresContextData(nsPresContext* aPresContext)
+Event::InitPresContextData(nsPresContext* aPresContext)
 {
   mPresContext = aPresContext;
   // Get the explicit original target (if it's anonymous make it null)
   {
     nsCOMPtr<nsIContent> content = GetTargetFromFrame();
     mExplicitOriginalTarget = content;
     if (content && content->IsInAnonymousSubtree()) {
       mExplicitOriginalTarget = nullptr;
     }
   }
 }
 
-nsDOMEvent::~nsDOMEvent() 
+Event::~Event() 
 {
-  NS_ASSERT_OWNINGTHREAD(nsDOMEvent);
+  NS_ASSERT_OWNINGTHREAD(Event);
 
   if (mEventIsInternal && mEvent) {
     delete mEvent;
   }
 }
 
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMEvent)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Event)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_INTERFACE_MAP_ENTRY(nsIDOMEvent)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMEvent)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMEvent)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(Event)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(Event)
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMEvent)
+NS_IMPL_CYCLE_COLLECTION_CLASS(Event)
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMEvent)
+NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Event)
   NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMEvent)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Event)
   if (tmp->mEventIsInternal) {
     tmp->mEvent->target = nullptr;
     tmp->mEvent->currentTarget = nullptr;
     tmp->mEvent->originalTarget = nullptr;
     switch (tmp->mEvent->eventStructType) {
       case NS_MOUSE_EVENT:
       case NS_MOUSE_SCROLL_EVENT:
       case NS_WHEEL_EVENT:
@@ -177,17 +173,17 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ns
     }
   }
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mPresContext);
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mExplicitOriginalTarget);
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwner);
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMEvent)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Event)
   if (tmp->mEventIsInternal) {
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEvent->target)
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEvent->currentTarget)
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEvent->originalTarget)
     switch (tmp->mEvent->eventStructType) {
       case NS_MOUSE_EVENT:
       case NS_MOUSE_SCROLL_EVENT:
       case NS_WHEEL_EVENT:
@@ -222,25 +218,26 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(
   }
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPresContext)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mExplicitOriginalTarget)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 bool
-nsDOMEvent::IsChrome(JSContext* aCx) const
+Event::IsChrome(JSContext* aCx) const
 {
   return mIsMainThreadEvent ?
     xpc::AccessCheck::isChrome(js::GetContextCompartment(aCx)) :
     mozilla::dom::workers::IsCurrentThreadRunningChromeWorker();
 }
 
 // nsIDOMEventInterface
-NS_METHOD nsDOMEvent::GetType(nsAString& aType)
+NS_METHOD
+Event::GetType(nsAString& aType)
 {
   if (!mIsMainThreadEvent || !mEvent->typeString.IsEmpty()) {
     aType = mEvent->typeString;
     return NS_OK;
   }
   const char* name = GetEventName(mEvent->message);
 
   if (name) {
@@ -258,100 +255,100 @@ NS_METHOD nsDOMEvent::GetType(nsAString&
 
 static EventTarget*
 GetDOMEventTarget(nsIDOMEventTarget* aTarget)
 {
   return aTarget ? aTarget->GetTargetForDOMEvent() : nullptr;
 }
 
 EventTarget*
-nsDOMEvent::GetTarget() const
+Event::GetTarget() const
 {
   return GetDOMEventTarget(mEvent->target);
 }
 
 NS_METHOD
-nsDOMEvent::GetTarget(nsIDOMEventTarget** aTarget)
+Event::GetTarget(nsIDOMEventTarget** aTarget)
 {
   NS_IF_ADDREF(*aTarget = GetTarget());
   return NS_OK;
 }
 
 EventTarget*
-nsDOMEvent::GetCurrentTarget() const
+Event::GetCurrentTarget() const
 {
   return GetDOMEventTarget(mEvent->currentTarget);
 }
 
 NS_IMETHODIMP
-nsDOMEvent::GetCurrentTarget(nsIDOMEventTarget** aCurrentTarget)
+Event::GetCurrentTarget(nsIDOMEventTarget** aCurrentTarget)
 {
   NS_IF_ADDREF(*aCurrentTarget = GetCurrentTarget());
   return NS_OK;
 }
 
 //
 // Get the actual event target node (may have been retargeted for mouse events)
 //
 already_AddRefed<nsIContent>
-nsDOMEvent::GetTargetFromFrame()
+Event::GetTargetFromFrame()
 {
   if (!mPresContext) { return nullptr; }
 
   // Get the target frame (have to get the ESM first)
   nsIFrame* targetFrame = mPresContext->EventStateManager()->GetEventTarget();
   if (!targetFrame) { return nullptr; }
 
   // get the real content
   nsCOMPtr<nsIContent> realEventContent;
   targetFrame->GetContentForEvent(mEvent, getter_AddRefs(realEventContent));
   return realEventContent.forget();
 }
 
 EventTarget*
-nsDOMEvent::GetExplicitOriginalTarget() const
+Event::GetExplicitOriginalTarget() const
 {
   if (mExplicitOriginalTarget) {
     return mExplicitOriginalTarget;
   }
   return GetTarget();
 }
 
 NS_IMETHODIMP
-nsDOMEvent::GetExplicitOriginalTarget(nsIDOMEventTarget** aRealEventTarget)
+Event::GetExplicitOriginalTarget(nsIDOMEventTarget** aRealEventTarget)
 {
   NS_IF_ADDREF(*aRealEventTarget = GetExplicitOriginalTarget());
   return NS_OK;
 }
 
 EventTarget*
-nsDOMEvent::GetOriginalTarget() const
+Event::GetOriginalTarget() const
 {
   if (mEvent->originalTarget) {
     return GetDOMEventTarget(mEvent->originalTarget);
   }
 
   return GetTarget();
 }
 
 NS_IMETHODIMP
-nsDOMEvent::GetOriginalTarget(nsIDOMEventTarget** aOriginalTarget)
+Event::GetOriginalTarget(nsIDOMEventTarget** aOriginalTarget)
 {
   NS_IF_ADDREF(*aOriginalTarget = GetOriginalTarget());
   return NS_OK;
 }
 
 NS_IMETHODIMP_(void)
-nsDOMEvent::SetTrusted(bool aTrusted)
+Event::SetTrusted(bool aTrusted)
 {
   mEvent->mFlags.mIsTrusted = aTrusted;
 }
 
 bool
-nsDOMEvent::Init(mozilla::dom::EventTarget* aGlobal)
+Event::Init(mozilla::dom::EventTarget* aGlobal)
 {
   if (!mIsMainThreadEvent) {
     return nsContentUtils::ThreadsafeIsCallerChrome();
   }
   bool trusted = false;
   nsCOMPtr<nsPIDOMWindow> w = do_QueryInterface(aGlobal);
   if (w) {
     nsCOMPtr<nsIDocument> d = w->GetExtantDoc();
@@ -361,33 +358,33 @@ nsDOMEvent::Init(mozilla::dom::EventTarg
       if (s) {
         InitPresContextData(s->GetPresContext());
       }
     }
   }
   return trusted;
 }
 
-//static
-already_AddRefed<nsDOMEvent>
-nsDOMEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
-                        const nsAString& aType,
-                        const mozilla::dom::EventInit& aParam,
-                        mozilla::ErrorResult& aRv)
+// static
+already_AddRefed<Event>
+Event::Constructor(const GlobalObject& aGlobal,
+                   const nsAString& aType,
+                   const EventInit& aParam,
+                   ErrorResult& aRv)
 {
   nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
-  nsRefPtr<nsDOMEvent> e = new nsDOMEvent(t, nullptr, nullptr);
+  nsRefPtr<Event> e = new Event(t, nullptr, nullptr);
   bool trusted = e->Init(t);
   aRv = e->InitEvent(aType, aParam.mBubbles, aParam.mCancelable);
   e->SetTrusted(trusted);
   return e.forget();
 }
 
 uint16_t
-nsDOMEvent::EventPhase() const
+Event::EventPhase() const
 {
   // Note, remember to check that this works also
   // if or when Bug 235441 is fixed.
   if ((mEvent->currentTarget &&
        mEvent->currentTarget == mEvent->target) ||
        mEvent->mFlags.InTargetPhase()) {
     return nsIDOMEvent::AT_TARGET;
   }
@@ -396,88 +393,88 @@ nsDOMEvent::EventPhase() const
   }
   if (mEvent->mFlags.mInBubblingPhase) {
     return nsIDOMEvent::BUBBLING_PHASE;
   }
   return nsIDOMEvent::NONE;
 }
 
 NS_IMETHODIMP
-nsDOMEvent::GetEventPhase(uint16_t* aEventPhase)
+Event::GetEventPhase(uint16_t* aEventPhase)
 {
   *aEventPhase = EventPhase();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMEvent::GetBubbles(bool* aBubbles)
+Event::GetBubbles(bool* aBubbles)
 {
   *aBubbles = Bubbles();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMEvent::GetCancelable(bool* aCancelable)
+Event::GetCancelable(bool* aCancelable)
 {
   *aCancelable = Cancelable();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMEvent::GetTimeStamp(uint64_t* aTimeStamp)
+Event::GetTimeStamp(uint64_t* aTimeStamp)
 {
   *aTimeStamp = TimeStamp();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMEvent::StopPropagation()
+Event::StopPropagation()
 {
   mEvent->mFlags.mPropagationStopped = true;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMEvent::StopImmediatePropagation()
+Event::StopImmediatePropagation()
 {
   mEvent->mFlags.mPropagationStopped = true;
   mEvent->mFlags.mImmediatePropagationStopped = true;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMEvent::GetIsTrusted(bool *aIsTrusted)
+Event::GetIsTrusted(bool* aIsTrusted)
 {
   *aIsTrusted = IsTrusted();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMEvent::PreventDefault()
+Event::PreventDefault()
 {
   // This method is called only from C++ code which must handle default action
   // of this event.  So, pass true always.
   PreventDefaultInternal(true);
   return NS_OK;
 }
 
 void
-nsDOMEvent::PreventDefault(JSContext* aCx)
+Event::PreventDefault(JSContext* aCx)
 {
   MOZ_ASSERT(aCx, "JS context must be specified");
 
   // Note that at handling default action, another event may be dispatched.
   // Then, JS in content mey be call preventDefault()
   // even in the event is in system event group.  Therefore, don't refer
   // mInSystemGroup here.
   PreventDefaultInternal(IsChrome(aCx));
 }
 
 void
-nsDOMEvent::PreventDefaultInternal(bool aCalledByDefaultHandler)
+Event::PreventDefaultInternal(bool aCalledByDefaultHandler)
 {
   if (!mEvent->mFlags.mCancelable) {
     return;
   }
 
   mEvent->mFlags.mDefaultPrevented = true;
 
   // Note that even if preventDefault() has already been called by chrome,
@@ -506,31 +503,33 @@ nsDOMEvent::PreventDefaultInternal(bool 
     node = win->GetExtantDoc();
   }
   if (!nsContentUtils::IsChromeDoc(node->OwnerDoc())) {
     dragEvent->mDefaultPreventedOnContent = true;
   }
 }
 
 void
-nsDOMEvent::SetEventType(const nsAString& aEventTypeArg)
+Event::SetEventType(const nsAString& aEventTypeArg)
 {
   if (mIsMainThreadEvent) {
     mEvent->userType =
       nsContentUtils::GetEventIdAndAtom(aEventTypeArg, mEvent->eventStructType,
                                         &(mEvent->message));
   } else {
     mEvent->userType = nullptr;
     mEvent->message = NS_USER_DEFINED_EVENT;
     mEvent->typeString = aEventTypeArg;
   }
 }
 
 NS_IMETHODIMP
-nsDOMEvent::InitEvent(const nsAString& aEventTypeArg, bool aCanBubbleArg, bool aCancelableArg)
+Event::InitEvent(const nsAString& aEventTypeArg,
+                 bool aCanBubbleArg,
+                 bool aCancelableArg)
 {
   // Make sure this event isn't already being dispatched.
   NS_ENSURE_TRUE(!mEvent->mFlags.mIsBeingDispatched, NS_OK);
 
   if (IsTrusted()) {
     // Ensure the caller is permitted to dispatch trusted DOM events.
     if (!nsContentUtils::ThreadsafeIsCallerChrome()) {
       SetTrusted(false);
@@ -547,72 +546,72 @@ nsDOMEvent::InitEvent(const nsAString& a
   // Clearing the old targets, so that the event is targeted correctly when
   // re-dispatching it.
   mEvent->target = nullptr;
   mEvent->originalTarget = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMEvent::DuplicatePrivateData()
+Event::DuplicatePrivateData()
 {
-  NS_ASSERTION(mEvent, "No WidgetEvent for nsDOMEvent duplication!");
+  NS_ASSERTION(mEvent, "No WidgetEvent for Event duplication!");
   if (mEventIsInternal) {
     return NS_OK;
   }
 
   mEvent = mEvent->Duplicate();
   mPresContext = nullptr;
   mEventIsInternal = true;
   mPrivateDataDuplicated = true;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMEvent::SetTarget(nsIDOMEventTarget* aTarget)
+Event::SetTarget(nsIDOMEventTarget* aTarget)
 {
 #ifdef DEBUG
   {
     nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(aTarget);
 
     NS_ASSERTION(!win || !win->IsInnerWindow(),
                  "Uh, inner window set as event target!");
   }
 #endif
 
   mEvent->target = do_QueryInterface(aTarget);
   return NS_OK;
 }
 
 NS_IMETHODIMP_(bool)
-nsDOMEvent::IsDispatchStopped()
+Event::IsDispatchStopped()
 {
   return mEvent->mFlags.mPropagationStopped;
 }
 
 NS_IMETHODIMP_(WidgetEvent*)
-nsDOMEvent::GetInternalNSEvent()
+Event::GetInternalNSEvent()
 {
   return mEvent;
 }
 
-NS_IMETHODIMP_(nsDOMEvent*)
-nsDOMEvent::InternalDOMEvent()
+NS_IMETHODIMP_(Event*)
+Event::InternalDOMEvent()
 {
   return this;
 }
 
 // return true if eventName is contained within events, delimited by
 // spaces
 static bool
 PopupAllowedForEvent(const char *eventName)
 {
   if (!sPopupAllowedEvents) {
-    nsDOMEvent::PopupAllowedEventsChanged();
+    Event::PopupAllowedEventsChanged();
 
     if (!sPopupAllowedEvents) {
       return false;
     }
   }
 
   nsDependentCString events(sPopupAllowedEvents);
 
@@ -638,90 +637,97 @@ PopupAllowedForEvent(const char *eventNa
     startiter = enditer;
   }
 
   return false;
 }
 
 // static
 PopupControlState
-nsDOMEvent::GetEventPopupControlState(WidgetEvent* aEvent)
+Event::GetEventPopupControlState(WidgetEvent* aEvent)
 {
   // generally if an event handler is running, new windows are disallowed.
   // check for exceptions:
   PopupControlState abuse = openAbused;
 
   switch(aEvent->eventStructType) {
   case NS_EVENT :
     // For these following events only allow popups if they're
     // triggered while handling user input. See
     // nsPresShell::HandleEventInternal() for details.
     if (nsEventStateManager::IsHandlingUserInput()) {
       switch(aEvent->message) {
       case NS_FORM_SELECTED :
-        if (::PopupAllowedForEvent("select"))
+        if (PopupAllowedForEvent("select")) {
           abuse = openControlled;
+        }
         break;
       case NS_FORM_CHANGE :
-        if (::PopupAllowedForEvent("change"))
+        if (PopupAllowedForEvent("change")) {
           abuse = openControlled;
+        }
         break;
       }
     }
     break;
   case NS_GUI_EVENT :
     // For this following event only allow popups if it's triggered
     // while handling user input. See
     // nsPresShell::HandleEventInternal() for details.
     if (nsEventStateManager::IsHandlingUserInput()) {
       switch(aEvent->message) {
       case NS_FORM_INPUT :
-        if (::PopupAllowedForEvent("input"))
+        if (PopupAllowedForEvent("input")) {
           abuse = openControlled;
+        }
         break;
       }
     }
     break;
   case NS_INPUT_EVENT :
     // For this following event only allow popups if it's triggered
     // while handling user input. See
     // nsPresShell::HandleEventInternal() for details.
     if (nsEventStateManager::IsHandlingUserInput()) {
       switch(aEvent->message) {
       case NS_FORM_CHANGE :
-        if (::PopupAllowedForEvent("change"))
+        if (PopupAllowedForEvent("change")) {
           abuse = openControlled;
+        }
         break;
       case NS_XUL_COMMAND:
         abuse = openControlled;
         break;
       }
     }
     break;
   case NS_KEY_EVENT :
     if (aEvent->mFlags.mIsTrusted) {
       uint32_t key = aEvent->AsKeyboardEvent()->keyCode;
       switch(aEvent->message) {
       case NS_KEY_PRESS :
         // return key on focused button. see note at NS_MOUSE_CLICK.
-        if (key == nsIDOMKeyEvent::DOM_VK_RETURN)
+        if (key == nsIDOMKeyEvent::DOM_VK_RETURN) {
           abuse = openAllowed;
-        else if (::PopupAllowedForEvent("keypress"))
+        } else if (PopupAllowedForEvent("keypress")) {
           abuse = openControlled;
+        }
         break;
       case NS_KEY_UP :
         // space key on focused button. see note at NS_MOUSE_CLICK.
-        if (key == nsIDOMKeyEvent::DOM_VK_SPACE)
+        if (key == nsIDOMKeyEvent::DOM_VK_SPACE) {
           abuse = openAllowed;
-        else if (::PopupAllowedForEvent("keyup"))
+        } else if (PopupAllowedForEvent("keyup")) {
           abuse = openControlled;
+        }
         break;
       case NS_KEY_DOWN :
-        if (::PopupAllowedForEvent("keydown"))
+        if (PopupAllowedForEvent("keydown")) {
           abuse = openControlled;
+        }
         break;
       }
     }
     break;
   case NS_TOUCH_EVENT :
     if (aEvent->mFlags.mIsTrusted) {
       switch (aEvent->message) {
       case NS_TOUCH_START :
@@ -737,90 +743,96 @@ nsDOMEvent::GetEventPopupControlState(Wi
       }
     }
     break;
   case NS_MOUSE_EVENT :
     if (aEvent->mFlags.mIsTrusted &&
         aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
       switch(aEvent->message) {
       case NS_MOUSE_BUTTON_UP :
-        if (::PopupAllowedForEvent("mouseup"))
+        if (PopupAllowedForEvent("mouseup")) {
           abuse = openControlled;
+        }
         break;
       case NS_MOUSE_BUTTON_DOWN :
-        if (::PopupAllowedForEvent("mousedown"))
+        if (PopupAllowedForEvent("mousedown")) {
           abuse = openControlled;
+        }
         break;
       case NS_MOUSE_CLICK :
         /* Click events get special treatment because of their
            historical status as a more legitimate event handler. If
            click popups are enabled in the prefs, clear the popup
            status completely. */
-        if (::PopupAllowedForEvent("click"))
+        if (PopupAllowedForEvent("click")) {
           abuse = openAllowed;
+        }
         break;
       case NS_MOUSE_DOUBLECLICK :
-        if (::PopupAllowedForEvent("dblclick"))
+        if (PopupAllowedForEvent("dblclick")) {
           abuse = openControlled;
+        }
         break;
       }
     }
     break;
   case NS_FORM_EVENT :
     // For these following events only allow popups if they're
     // triggered while handling user input. See
     // nsPresShell::HandleEventInternal() for details.
     if (nsEventStateManager::IsHandlingUserInput()) {
       switch(aEvent->message) {
       case NS_FORM_SUBMIT :
-        if (::PopupAllowedForEvent("submit"))
+        if (PopupAllowedForEvent("submit")) {
           abuse = openControlled;
+        }
         break;
       case NS_FORM_RESET :
-        if (::PopupAllowedForEvent("reset"))
+        if (PopupAllowedForEvent("reset")) {
           abuse = openControlled;
+        }
         break;
       }
     }
     break;
   default:
     break;
   }
 
   return abuse;
 }
 
 // static
 void
-nsDOMEvent::PopupAllowedEventsChanged()
+Event::PopupAllowedEventsChanged()
 {
   if (sPopupAllowedEvents) {
     nsMemory::Free(sPopupAllowedEvents);
   }
 
   nsAdoptingCString str = Preferences::GetCString("dom.popup_allowed_events");
 
   // We'll want to do this even if str is empty to avoid looking up
   // this pref all the time if it's not set.
   sPopupAllowedEvents = ToNewCString(str);
 }
 
 // static
 void
-nsDOMEvent::Shutdown()
+Event::Shutdown()
 {
   if (sPopupAllowedEvents) {
     nsMemory::Free(sPopupAllowedEvents);
   }
 }
 
 nsIntPoint
-nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext,
-                            WidgetEvent* aEvent,
-                            LayoutDeviceIntPoint aPoint)
+Event::GetScreenCoords(nsPresContext* aPresContext,
+                       WidgetEvent* aEvent,
+                       LayoutDeviceIntPoint aPoint)
 {
   if (nsEventStateManager::sIsPointerLocked) {
     return nsEventStateManager::sLastScreenPoint;
   }
 
   if (!aEvent || 
        (aEvent->eventStructType != NS_MOUSE_EVENT &&
         aEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
@@ -839,46 +851,44 @@ nsDOMEvent::GetScreenCoords(nsPresContex
 
   LayoutDeviceIntPoint offset = aPoint +
     LayoutDeviceIntPoint::FromUntyped(guiEvent->widget->WidgetToScreenOffset());
   nscoord factor = aPresContext->DeviceContext()->UnscaledAppUnitsPerDevPixel();
   return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor),
                     nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor));
 }
 
-//static
+// static
 CSSIntPoint
-nsDOMEvent::GetPageCoords(nsPresContext* aPresContext,
-                          WidgetEvent* aEvent,
-                          LayoutDeviceIntPoint aPoint,
-                          CSSIntPoint aDefaultPoint)
+Event::GetPageCoords(nsPresContext* aPresContext,
+                     WidgetEvent* aEvent,
+                     LayoutDeviceIntPoint aPoint,
+                     CSSIntPoint aDefaultPoint)
 {
-  CSSIntPoint pagePoint = nsDOMEvent::GetClientCoords(aPresContext,
-                                                      aEvent,
-                                                      aPoint,
-                                                      aDefaultPoint);
+  CSSIntPoint pagePoint =
+    Event::GetClientCoords(aPresContext, aEvent, aPoint, aDefaultPoint);
 
   // If there is some scrolling, add scroll info to client point.
   if (aPresContext && aPresContext->GetPresShell()) {
     nsIPresShell* shell = aPresContext->GetPresShell();
     nsIScrollableFrame* scrollframe = shell->GetRootScrollFrameAsScrollable();
     if (scrollframe) {
       pagePoint += CSSIntPoint::FromAppUnitsRounded(scrollframe->GetScrollPosition());
     }
   }
 
   return pagePoint;
 }
 
 // static
 CSSIntPoint
-nsDOMEvent::GetClientCoords(nsPresContext* aPresContext,
-                            WidgetEvent* aEvent,
-                            LayoutDeviceIntPoint aPoint,
-                            CSSIntPoint aDefaultPoint)
+Event::GetClientCoords(nsPresContext* aPresContext,
+                       WidgetEvent* aEvent,
+                       LayoutDeviceIntPoint aPoint,
+                       CSSIntPoint aDefaultPoint)
 {
   if (nsEventStateManager::sIsPointerLocked) {
     return nsEventStateManager::sLastClientPoint;
   }
 
   if (!aEvent ||
       (aEvent->eventStructType != NS_MOUSE_EVENT &&
        aEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
@@ -903,39 +913,40 @@ nsDOMEvent::GetClientCoords(nsPresContex
   }
   nsPoint pt =
     nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent,
       LayoutDeviceIntPoint::ToUntyped(aPoint), rootFrame);
 
   return CSSIntPoint::FromAppUnitsRounded(pt);
 }
 
-// To be called ONLY by nsDOMEvent::GetType (which has the additional
+// To be called ONLY by Event::GetType (which has the additional
 // logic for handling user-defined events).
 // static
-const char* nsDOMEvent::GetEventName(uint32_t aEventType)
+const char*
+Event::GetEventName(uint32_t aEventType)
 {
   switch(aEventType) {
 #define ID_TO_EVENT(name_, _id, _type, _struct) \
   case _id: return #name_;
 #include "nsEventNameList.h"
 #undef ID_TO_EVENT
   default:
     break;
   }
   // XXXldb We can hit this case for WidgetEvent objects that we didn't
   // create and that are not user defined events since this function and
   // SetEventType are incomplete.  (But fixing that requires fixing the
   // arrays in nsEventListenerManager too, since the events for which
-  // this is a problem generally *are* created by nsDOMEvent.)
+  // this is a problem generally *are* created by Event.)
   return nullptr;
 }
 
 bool
-nsDOMEvent::DefaultPrevented(JSContext* aCx) const
+Event::DefaultPrevented(JSContext* aCx) const
 {
   MOZ_ASSERT(aCx, "JS context must be specified");
 
   NS_ENSURE_TRUE(mEvent, false);
 
   // If preventDefault() has never been called, just return false.
   if (!mEvent->mFlags.mDefaultPrevented) {
     return false;
@@ -943,50 +954,50 @@ nsDOMEvent::DefaultPrevented(JSContext* 
 
   // If preventDefault() has been called by content, return true.  Otherwise,
   // i.e., preventDefault() has been called by chrome, return true only when
   // this is called by chrome.
   return mEvent->mFlags.mDefaultPreventedByContent || IsChrome(aCx);
 }
 
 bool
-nsDOMEvent::GetPreventDefault() const
+Event::GetPreventDefault() const
 {
   if (mOwner) {
     if (nsIDocument* doc = mOwner->GetExtantDoc()) {
       doc->WarnOnceAbout(nsIDocument::eGetPreventDefault);
     }
   }
   // GetPreventDefault() is legacy and Gecko specific method.  Although,
   // the result should be same as defaultPrevented, we don't need to break
   // backward compatibility of legacy method.  Let's behave traditionally.
   return DefaultPrevented();
 }
 
 NS_IMETHODIMP
-nsDOMEvent::GetPreventDefault(bool* aReturn)
+Event::GetPreventDefault(bool* aReturn)
 {
   NS_ENSURE_ARG_POINTER(aReturn);
   *aReturn = GetPreventDefault();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMEvent::GetDefaultPrevented(bool* aReturn)
+Event::GetDefaultPrevented(bool* aReturn)
 {
   NS_ENSURE_ARG_POINTER(aReturn);
   // This method must be called by only event handlers implemented by C++.
   // Then, the handlers must handle default action.  So, this method don't need
   // to check if preventDefault() has been called by content or chrome.
   *aReturn = DefaultPrevented();
   return NS_OK;
 }
 
 NS_IMETHODIMP_(void)
-nsDOMEvent::Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType)
+Event::Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType)
 {
   if (aSerializeInterfaceType) {
     IPC::WriteParam(aMsg, NS_LITERAL_STRING("event"));
   }
 
   nsString type;
   GetType(type);
   IPC::WriteParam(aMsg, type);
@@ -994,17 +1005,17 @@ nsDOMEvent::Serialize(IPC::Message* aMsg
   IPC::WriteParam(aMsg, Bubbles());
   IPC::WriteParam(aMsg, Cancelable());
   IPC::WriteParam(aMsg, IsTrusted());
 
   // No timestamp serialization for now!
 }
 
 NS_IMETHODIMP_(bool)
-nsDOMEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
+Event::Deserialize(const IPC::Message* aMsg, void** aIter)
 {
   nsString type;
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &type), false);
 
   bool bubbles = false;
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &bubbles), false);
 
   bool cancelable = false;
@@ -1016,17 +1027,17 @@ nsDOMEvent::Deserialize(const IPC::Messa
   nsresult rv = InitEvent(type, bubbles, cancelable);
   NS_ENSURE_SUCCESS(rv, false);
   SetTrusted(trusted);
 
   return true;
 }
 
 NS_IMETHODIMP_(void)
-nsDOMEvent::SetOwner(mozilla::dom::EventTarget* aOwner)
+Event::SetOwner(mozilla::dom::EventTarget* aOwner)
 {
   mOwner = nullptr;
 
   if (!aOwner) {
     return;
   }
 
   nsCOMPtr<nsINode> n = do_QueryInterface(aOwner);
@@ -1052,17 +1063,23 @@ nsDOMEvent::SetOwner(mozilla::dom::Event
   }
 
 #ifdef DEBUG
   nsCOMPtr<nsPIWindowRoot> root = do_QueryInterface(aOwner);
   MOZ_ASSERT(root, "Unexpected EventTarget!");
 #endif
 }
 
-nsresult NS_NewDOMEvent(nsIDOMEvent** aInstancePtrResult,
-                        mozilla::dom::EventTarget* aOwner,
-                        nsPresContext* aPresContext,
-                        WidgetEvent* aEvent) 
+} // namespace dom
+} // namespace mozilla
+
+using namespace mozilla;
+using namespace mozilla::dom;
+
+nsresult
+NS_NewDOMEvent(nsIDOMEvent** aInstancePtrResult,
+               EventTarget* aOwner,
+               nsPresContext* aPresContext,
+               WidgetEvent* aEvent) 
 {
-  nsRefPtr<nsDOMEvent> it =
-    new nsDOMEvent(aOwner, aPresContext, aEvent);
+  Event* it = new Event(aOwner, aPresContext, aEvent);
   return CallQueryInterface(it, aInstancePtrResult);
 }
rename from dom/events/nsDOMEvent.h
rename to dom/events/Event.h
--- a/dom/events/nsDOMEvent.h
+++ b/dom/events/Event.h
@@ -1,15 +1,15 @@
 /* -*- 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 nsDOMEvent_h__
-#define nsDOMEvent_h__
+#ifndef mozilla_dom_Event_h_
+#define mozilla_dom_Event_h_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/BasicEvents.h"
 #include "nsIDOMEvent.h"
 #include "nsISupports.h"
 #include "nsCOMPtr.h"
 #include "nsPIDOMWindow.h"
 #include "nsPoint.h"
@@ -21,127 +21,125 @@
 #include "js/TypeDecls.h"
 
 class nsIContent;
 class nsIDOMEventTarget;
 class nsPresContext;
 
 namespace mozilla {
 namespace dom {
+
 class EventTarget;
 class ErrorEvent;
-}
-}
 
 // Dummy class so we can cast through it to get from nsISupports to
-// nsDOMEvent subclasses with only two non-ambiguous static casts.
-class nsDOMEventBase : public nsIDOMEvent
+// Event subclasses with only two non-ambiguous static casts.
+class EventBase : public nsIDOMEvent
 {
 };
 
-class nsDOMEvent : public nsDOMEventBase,
-                   public nsWrapperCache
+class Event : public EventBase,
+              public nsWrapperCache
 {
 public:
-  nsDOMEvent(mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext,
-             mozilla::WidgetEvent* aEvent);
-  nsDOMEvent(nsPIDOMWindow* aWindow);
-  virtual ~nsDOMEvent();
+  Event(EventTarget* aOwner,
+        nsPresContext* aPresContext,
+        WidgetEvent* aEvent);
+  Event(nsPIDOMWindow* aWindow);
+  virtual ~Event();
+
 private:
-  void ConstructorInit(mozilla::dom::EventTarget* aOwner,
+  void ConstructorInit(EventTarget* aOwner,
                        nsPresContext* aPresContext,
-                       mozilla::WidgetEvent* aEvent);
+                       WidgetEvent* aEvent);
+
 public:
   void GetParentObject(nsIScriptGlobalObject** aParentObject)
   {
     if (mOwner) {
       CallQueryInterface(mOwner, aParentObject);
     } else {
       *aParentObject = nullptr;
     }
   }
 
-  static nsDOMEvent* FromSupports(nsISupports* aSupports)
+  static Event* FromSupports(nsISupports* aSupports)
   {
     nsIDOMEvent* event =
       static_cast<nsIDOMEvent*>(aSupports);
 #ifdef DEBUG
     {
       nsCOMPtr<nsIDOMEvent> target_qi =
         do_QueryInterface(aSupports);
 
       // If this assertion fires the QI implementation for the object in
       // question doesn't use the nsIDOMEvent pointer as the
       // nsISupports pointer. That must be fixed, or we'll crash...
       MOZ_ASSERT(target_qi == event, "Uh, fix QI!");
     }
 #endif
-    return static_cast<nsDOMEvent*>(event);
+    return static_cast<Event*>(event);
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMEvent)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Event)
 
   nsISupports* GetParentObject()
   {
     return mOwner;
   }
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
-    return mozilla::dom::EventBinding::Wrap(aCx, aScope, this);
+    return EventBinding::Wrap(aCx, aScope, this);
   }
 
-  virtual mozilla::dom::ErrorEvent* AsErrorEvent()
+  virtual ErrorEvent* AsErrorEvent()
   {
     return nullptr;
   }
 
   // nsIDOMEvent Interface
   NS_DECL_NSIDOMEVENT
 
   void InitPresContextData(nsPresContext* aPresContext);
 
   // Returns true if the event should be trusted.
-  bool Init(mozilla::dom::EventTarget* aGlobal);
+  bool Init(EventTarget* aGlobal);
 
-  static PopupControlState GetEventPopupControlState(
-                             mozilla::WidgetEvent* aEvent);
+  static PopupControlState GetEventPopupControlState(WidgetEvent* aEvent);
 
   static void PopupAllowedEventsChanged();
 
   static void Shutdown();
 
   static const char* GetEventName(uint32_t aEventType);
-  static mozilla::CSSIntPoint
-  GetClientCoords(nsPresContext* aPresContext,
-                  mozilla::WidgetEvent* aEvent,
-                  mozilla::LayoutDeviceIntPoint aPoint,
-                  mozilla::CSSIntPoint aDefaultPoint);
-  static mozilla::CSSIntPoint
-  GetPageCoords(nsPresContext* aPresContext,
-                mozilla::WidgetEvent* aEvent,
-                mozilla::LayoutDeviceIntPoint aPoint,
-                mozilla::CSSIntPoint aDefaultPoint);
-  static nsIntPoint
-  GetScreenCoords(nsPresContext* aPresContext,
-                  mozilla::WidgetEvent* aEvent,
-                  mozilla::LayoutDeviceIntPoint aPoint);
+  static CSSIntPoint GetClientCoords(nsPresContext* aPresContext,
+                                     WidgetEvent* aEvent,
+                                     LayoutDeviceIntPoint aPoint,
+                                     CSSIntPoint aDefaultPoint);
+  static CSSIntPoint GetPageCoords(nsPresContext* aPresContext,
+                                   WidgetEvent* aEvent,
+                                   LayoutDeviceIntPoint aPoint,
+                                   CSSIntPoint aDefaultPoint);
+  static nsIntPoint GetScreenCoords(nsPresContext* aPresContext,
+                                    WidgetEvent* aEvent,
+                                    LayoutDeviceIntPoint aPoint);
 
-  static already_AddRefed<nsDOMEvent> Constructor(const mozilla::dom::GlobalObject& aGlobal,
-                                                  const nsAString& aType,
-                                                  const mozilla::dom::EventInit& aParam,
-                                                  mozilla::ErrorResult& aRv);
+  static already_AddRefed<Event> Constructor(const GlobalObject& aGlobal,
+                                             const nsAString& aType,
+                                             const EventInit& aParam,
+                                             ErrorResult& aRv);
 
   // Implemented as xpidl method
   // void GetType(nsString& aRetval) {}
 
-  mozilla::dom::EventTarget* GetTarget() const;
-  mozilla::dom::EventTarget* GetCurrentTarget() const;
+  EventTarget* GetTarget() const;
+  EventTarget* GetCurrentTarget() const;
 
   uint16_t EventPhase() const;
 
   // xpidl implementation
   // void StopPropagation();
 
   // xpidl implementation
   // void StopImmediatePropagation();
@@ -191,23 +189,23 @@ public:
   }
 
   uint64_t TimeStamp() const
   {
     return mEvent->time;
   }
 
   void InitEvent(const nsAString& aType, bool aBubbles, bool aCancelable,
-                 mozilla::ErrorResult& aRv)
+                 ErrorResult& aRv)
   {
     aRv = InitEvent(aType, aBubbles, aCancelable);
   }
 
-  mozilla::dom::EventTarget* GetOriginalTarget() const;
-  mozilla::dom::EventTarget* GetExplicitOriginalTarget() const;
+  EventTarget* GetOriginalTarget() const;
+  EventTarget* GetExplicitOriginalTarget() const;
 
   bool GetPreventDefault() const;
 
 protected:
 
   // Internal helper functions
   void SetEventType(const nsAString& aEventTypeArg);
   already_AddRefed<nsIContent> GetTargetFromFrame();
@@ -223,25 +221,28 @@ protected:
    *                                    C++ or Chrome.  Otherwise, e.g., called
    *                                    by a call of Event.preventDefault() in
    *                                    content script, false.
    */
   void PreventDefaultInternal(bool aCalledByDefaultHandler);
 
   mozilla::WidgetEvent*       mEvent;
   nsRefPtr<nsPresContext>     mPresContext;
-  nsCOMPtr<mozilla::dom::EventTarget> mExplicitOriginalTarget;
+  nsCOMPtr<EventTarget>       mExplicitOriginalTarget;
   nsCOMPtr<nsPIDOMWindow>     mOwner; // nsPIDOMWindow for now.
   bool                        mEventIsInternal;
   bool                        mPrivateDataDuplicated;
   bool                        mIsMainThreadEvent;
 };
 
-#define NS_FORWARD_TO_NSDOMEVENT \
-  NS_FORWARD_NSIDOMEVENT(nsDOMEvent::)
+} // namespace dom
+} // namespace mozilla
+
+#define NS_FORWARD_TO_EVENT \
+  NS_FORWARD_NSIDOMEVENT(Event::)
 
 #define NS_FORWARD_NSIDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION(_to) \
   NS_IMETHOD GetType(nsAString& aType){ return _to GetType(aType); } \
   NS_IMETHOD GetTarget(nsIDOMEventTarget * *aTarget) { return _to GetTarget(aTarget); } \
   NS_IMETHOD GetCurrentTarget(nsIDOMEventTarget * *aCurrentTarget) { return _to GetCurrentTarget(aCurrentTarget); } \
   NS_IMETHOD GetEventPhase(uint16_t *aEventPhase) { return _to GetEventPhase(aEventPhase); } \
   NS_IMETHOD GetBubbles(bool *aBubbles) { return _to GetBubbles(aBubbles); } \
   NS_IMETHOD GetCancelable(bool *aCancelable) { return _to GetCancelable(aCancelable); } \
@@ -252,29 +253,29 @@ protected:
   NS_IMETHOD GetDefaultPrevented(bool *aDefaultPrevented) { return _to GetDefaultPrevented(aDefaultPrevented); } \
   NS_IMETHOD StopImmediatePropagation(void) { return _to StopImmediatePropagation(); } \
   NS_IMETHOD GetOriginalTarget(nsIDOMEventTarget** aOriginalTarget) { return _to GetOriginalTarget(aOriginalTarget); } \
   NS_IMETHOD GetExplicitOriginalTarget(nsIDOMEventTarget** aExplicitOriginalTarget) { return _to GetExplicitOriginalTarget(aExplicitOriginalTarget); } \
   NS_IMETHOD GetPreventDefault(bool* aRetval) { return _to GetPreventDefault(aRetval); } \
   NS_IMETHOD GetIsTrusted(bool* aIsTrusted) { return _to GetIsTrusted(aIsTrusted); } \
   NS_IMETHOD SetTarget(nsIDOMEventTarget *aTarget) { return _to SetTarget(aTarget); } \
   NS_IMETHOD_(bool) IsDispatchStopped(void) { return _to IsDispatchStopped(); } \
-  NS_IMETHOD_(mozilla::WidgetEvent*) GetInternalNSEvent(void) { return _to GetInternalNSEvent(); } \
+  NS_IMETHOD_(WidgetEvent*) GetInternalNSEvent(void) { return _to GetInternalNSEvent(); } \
   NS_IMETHOD_(void) SetTrusted(bool aTrusted) { _to SetTrusted(aTrusted); } \
-  NS_IMETHOD_(void) SetOwner(mozilla::dom::EventTarget* aOwner) { _to SetOwner(aOwner); } \
-  NS_IMETHOD_(nsDOMEvent *) InternalDOMEvent(void) { return _to InternalDOMEvent(); }
+  NS_IMETHOD_(void) SetOwner(EventTarget* aOwner) { _to SetOwner(aOwner); } \
+  NS_IMETHOD_(Event*) InternalDOMEvent() { return _to InternalDOMEvent(); }
 
-#define NS_FORWARD_TO_NSDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION \
-  NS_FORWARD_NSIDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION(nsDOMEvent::)
+#define NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION \
+  NS_FORWARD_NSIDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION(Event::)
 
 inline nsISupports*
-ToSupports(nsDOMEvent* e)
+ToSupports(mozilla::dom::Event* e)
 {
   return static_cast<nsIDOMEvent*>(e);
 }
 
 inline nsISupports*
-ToCanonicalSupports(nsDOMEvent* e)
+ToCanonicalSupports(mozilla::dom::Event* e)
 {
   return static_cast<nsIDOMEvent*>(e);
 }
 
-#endif // nsDOMEvent_h__
+#endif // mozilla_dom_Event_h_
--- a/dom/events/EventTarget.h
+++ b/dom/events/EventTarget.h
@@ -5,26 +5,26 @@
 
 #ifndef mozilla_dom_EventTarget_h_
 #define mozilla_dom_EventTarget_h_
 
 #include "nsIDOMEventTarget.h"
 #include "nsWrapperCache.h"
 #include "nsIAtom.h"
 
-class nsDOMEvent;
 class nsIDOMWindow;
 class nsIDOMEventListener;
 
 namespace mozilla {
 
 class ErrorResult;
 
 namespace dom {
 
+class Event;
 class EventListener;
 class EventHandlerNonNull;
 template <class T> struct Nullable;
 
 // IID for the dom::EventTarget interface
 #define NS_EVENTTARGET_IID \
 { 0xce3817d0, 0x177b, 0x402f, \
  { 0xae, 0x75, 0xf8, 0x4e, 0xbe, 0x5a, 0x07, 0xc3 } }
@@ -43,17 +43,17 @@ public:
                                 EventListener* aCallback,
                                 bool aCapture,
                                 const Nullable<bool>& aWantsUntrusted,
                                 ErrorResult& aRv) = 0;
   virtual void RemoveEventListener(const nsAString& aType,
                                    EventListener* aCallback,
                                    bool aCapture,
                                    ErrorResult& aRv);
-  bool DispatchEvent(nsDOMEvent& aEvent, ErrorResult& aRv);
+  bool DispatchEvent(Event& aEvent, ErrorResult& aRv);
 
   // Note, this takes the type in onfoo form!
   EventHandlerNonNull* GetEventHandler(const nsAString& aType)
   {
     nsCOMPtr<nsIAtom> type = do_GetAtom(aType);
     return GetEventHandler(type, EmptyString());
   }
 
--- a/dom/events/MessageEvent.cpp
+++ b/dom/events/MessageEvent.cpp
@@ -13,44 +13,44 @@
 #include "mozilla/HoldDropJSObjects.h"
 #include "jsapi.h"
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(MessageEvent)
 
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(MessageEvent, nsDOMEvent)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(MessageEvent, Event)
   tmp->mData = JSVAL_VOID;
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindowSource)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mPortSource)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mPorts)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(MessageEvent, nsDOMEvent)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(MessageEvent, Event)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindowSource)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPortSource)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPorts)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(MessageEvent, nsDOMEvent)
+NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(MessageEvent, Event)
   NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mData)
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(MessageEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMessageEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
-NS_IMPL_ADDREF_INHERITED(MessageEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(MessageEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(MessageEvent, Event)
+NS_IMPL_RELEASE_INHERITED(MessageEvent, Event)
 
 MessageEvent::MessageEvent(EventTarget* aOwner,
                            nsPresContext* aPresContext,
                            WidgetEvent* aEvent)
-  : nsDOMEvent(aOwner, aPresContext, aEvent)
+  : Event(aOwner, aPresContext, aEvent)
   , mData(JSVAL_VOID)
 {
 }
 
 MessageEvent::~MessageEvent()
 {
   mData = JSVAL_VOID;
   DropJSObjects(this);
@@ -151,33 +151,32 @@ MessageEvent::Constructor(const GlobalOb
   }
 
   if (aParam.mPorts.WasPassed() && !aParam.mPorts.Value().IsNull()) {
     nsTArray<nsRefPtr<MessagePortBase>> ports;
     for (uint32_t i = 0, len = aParam.mPorts.Value().Value().Length(); i < len; ++i) {
       ports.AppendElement(aParam.mPorts.Value().Value()[i].get());
     }
 
-    event->mPorts = new MessagePortList(static_cast<nsDOMEventBase*>(event),
-                                        ports);
+    event->mPorts = new MessagePortList(static_cast<EventBase*>(event), ports);
   }
 
   return event.forget();
 }
 
 NS_IMETHODIMP
 MessageEvent::InitMessageEvent(const nsAString& aType,
                                bool aCanBubble,
                                bool aCancelable,
                                JS::Handle<JS::Value> aData,
                                const nsAString& aOrigin,
                                const nsAString& aLastEventId,
                                nsIDOMWindow* aSource)
 {
-  nsresult rv = nsDOMEvent::InitEvent(aType, aCanBubble, aCancelable);
+  nsresult rv = Event::InitEvent(aType, aCanBubble, aCancelable);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mData = aData;
   mozilla::HoldJSObjects(this);
   mOrigin = aOrigin;
   mLastEventId = aLastEventId;
   mWindowSource = aSource;
 
--- a/dom/events/MessageEvent.h
+++ b/dom/events/MessageEvent.h
@@ -1,19 +1,19 @@
 /* -*- 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 mozilla_dom_MessageEvent_h_
 #define mozilla_dom_MessageEvent_h_
 
+#include "mozilla/dom/Event.h"
+#include "nsCycleCollectionParticipant.h"
 #include "nsIDOMMessageEvent.h"
-#include "nsDOMEvent.h"
-#include "nsCycleCollectionParticipant.h"
 
 namespace mozilla {
 namespace dom {
 
 class MessageEventInit;
 class MessagePort;
 class MessagePortBase;
 class MessagePortList;
@@ -21,33 +21,32 @@ class OwningWindowProxyOrMessagePort;
 
 /**
  * Implements the MessageEvent event, used for cross-document messaging and
  * server-sent events.
  *
  * See http://www.whatwg.org/specs/web-apps/current-work/#messageevent for
  * further details.
  */
-class MessageEvent : public nsDOMEvent,
+class MessageEvent : public Event,
                      public nsIDOMMessageEvent
 {
 public:
   MessageEvent(EventTarget* aOwner,
                nsPresContext* aPresContext,
                WidgetEvent* aEvent);
   ~MessageEvent();
 
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(MessageEvent,
-                                                         nsDOMEvent)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(MessageEvent, Event)
 
   NS_DECL_NSIDOMMESSAGEEVENT
 
   // Forward to base class
-  NS_FORWARD_TO_NSDOMEVENT
+  NS_FORWARD_TO_EVENT
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
 
   JS::Value GetData(JSContext* aCx, ErrorResult& aRv);
 
   void GetSource(Nullable<OwningWindowProxyOrMessagePort>& aValue) const;
 
--- a/dom/events/MouseEvent.cpp
+++ b/dom/events/MouseEvent.cpp
@@ -319,70 +319,62 @@ MouseEvent::GetScreenX(int32_t* aScreenX
   NS_ENSURE_ARG_POINTER(aScreenX);
   *aScreenX = ScreenX();
   return NS_OK;
 }
 
 int32_t
 MouseEvent::ScreenX()
 {
-  return nsDOMEvent::GetScreenCoords(mPresContext,
-                                     mEvent,
-                                     mEvent->refPoint).x;
+  return Event::GetScreenCoords(mPresContext, mEvent, mEvent->refPoint).x;
 }
 
 NS_IMETHODIMP
 MouseEvent::GetScreenY(int32_t* aScreenY)
 {
   NS_ENSURE_ARG_POINTER(aScreenY);
   *aScreenY = ScreenY();
   return NS_OK;
 }
 
 int32_t
 MouseEvent::ScreenY()
 {
-  return nsDOMEvent::GetScreenCoords(mPresContext,
-                                     mEvent,
-                                     mEvent->refPoint).y;
+  return Event::GetScreenCoords(mPresContext, mEvent, mEvent->refPoint).y;
 }
 
 
 NS_IMETHODIMP
 MouseEvent::GetClientX(int32_t* aClientX)
 {
   NS_ENSURE_ARG_POINTER(aClientX);
   *aClientX = ClientX();
   return NS_OK;
 }
 
 int32_t
 MouseEvent::ClientX()
 {
-  return nsDOMEvent::GetClientCoords(mPresContext,
-                                     mEvent,
-                                     mEvent->refPoint,
-                                     mClientPoint).x;
+  return Event::GetClientCoords(mPresContext, mEvent, mEvent->refPoint,
+                                mClientPoint).x;
 }
 
 NS_IMETHODIMP
 MouseEvent::GetClientY(int32_t* aClientY)
 {
   NS_ENSURE_ARG_POINTER(aClientY);
   *aClientY = ClientY();
   return NS_OK;
 }
 
 int32_t
 MouseEvent::ClientY()
 {
-  return nsDOMEvent::GetClientCoords(mPresContext,
-                                     mEvent,
-                                     mEvent->refPoint,
-                                     mClientPoint).y;
+  return Event::GetClientCoords(mPresContext, mEvent, mEvent->refPoint,
+                                mClientPoint).y;
 }
 
 bool
 MouseEvent::AltKey()
 {
   return mEvent->AsInputEvent()->IsAlt();
 }
 
--- a/dom/events/MutationEvent.cpp
+++ b/dom/events/MutationEvent.cpp
@@ -10,28 +10,28 @@
 class nsPresContext;
 
 namespace mozilla {
 namespace dom {
 
 MutationEvent::MutationEvent(EventTarget* aOwner,
                              nsPresContext* aPresContext,
                              InternalMutationEvent* aEvent)
-  : nsDOMEvent(aOwner, aPresContext,
-               aEvent ? aEvent : new InternalMutationEvent(false, 0))
+  : Event(aOwner, aPresContext,
+          aEvent ? aEvent : new InternalMutationEvent(false, 0))
 {
   mEventIsInternal = (aEvent == nullptr);
 }
 
 NS_INTERFACE_MAP_BEGIN(MutationEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMutationEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
-NS_IMPL_ADDREF_INHERITED(MutationEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(MutationEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(MutationEvent, Event)
+NS_IMPL_RELEASE_INHERITED(MutationEvent, Event)
 
 already_AddRefed<nsINode>
 MutationEvent::GetRelatedNode()
 {
   nsCOMPtr<nsINode> n =
     do_QueryInterface(mEvent->AsMutationEvent()->mRelatedNode);
   return n.forget();
 }
@@ -90,17 +90,17 @@ MutationEvent::InitMutationEvent(const n
                                  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);
+  nsresult rv = Event::InitEvent(aTypeArg, aCanBubbleArg, aCancelableArg);
   NS_ENSURE_SUCCESS(rv, rv);
 
   InternalMutationEvent* mutation = mEvent->AsMutationEvent();
   mutation->mRelatedNode = aRelatedNodeArg;
   if (!aPrevValueArg.IsEmpty())
     mutation->mPrevAttrValue = do_GetAtom(aPrevValueArg);
   if (!aNewValueArg.IsEmpty())
     mutation->mNewAttrValue = do_GetAtom(aNewValueArg);
--- a/dom/events/MutationEvent.h
+++ b/dom/events/MutationEvent.h
@@ -1,39 +1,39 @@
 /* -*- 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 mozilla_dom_MutationEvent_h_
 #define mozilla_dom_MutationEvent_h_
 
+#include "mozilla/EventForwards.h"
+#include "mozilla/dom/Event.h"
+#include "mozilla/dom/MutationEventBinding.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsINode.h"
-#include "nsDOMEvent.h"
-#include "mozilla/dom/MutationEventBinding.h"
-#include "mozilla/EventForwards.h"
 
 namespace mozilla {
 namespace dom {
 
-class MutationEvent : public nsDOMEvent,
+class MutationEvent : public Event,
                       public nsIDOMMutationEvent
 {
 public:
   MutationEvent(EventTarget* aOwner,
                 nsPresContext* aPresContext,
                 InternalMutationEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIDOMMUTATIONEVENT
 
   // Forward to base class
-  NS_FORWARD_TO_NSDOMEVENT
+  NS_FORWARD_TO_EVENT
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return MutationEventBinding::Wrap(aCx, aScope, this);
   }
 
   // xpidl implementation
--- a/dom/events/NotifyAudioAvailableEvent.cpp
+++ b/dom/events/NotifyAudioAvailableEvent.cpp
@@ -15,54 +15,54 @@ namespace dom {
 NotifyAudioAvailableEvent::NotifyAudioAvailableEvent(
                              EventTarget* aOwner,
                              nsPresContext* aPresContext,
                              WidgetEvent* aEvent,
                              uint32_t aEventType,
                              float* aFrameBuffer,
                              uint32_t aFrameBufferLength,
                              float aTime)
-  : nsDOMEvent(aOwner, aPresContext, aEvent)
+  : Event(aOwner, aPresContext, aEvent)
   , mFrameBuffer(aFrameBuffer)
   , mFrameBufferLength(aFrameBufferLength)
   , mTime(aTime)
   , mCachedArray(nullptr)
   , mAllowAudioData(false)
 {
   MOZ_COUNT_CTOR(NotifyAudioAvailableEvent);
   if (mEvent) {
     mEvent->message = aEventType;
   }
 }
 
-NS_IMPL_ADDREF_INHERITED(NotifyAudioAvailableEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(NotifyAudioAvailableEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(NotifyAudioAvailableEvent, Event)
+NS_IMPL_RELEASE_INHERITED(NotifyAudioAvailableEvent, Event)
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(NotifyAudioAvailableEvent)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(NotifyAudioAvailableEvent,
-                                                nsDOMEvent)
+                                                Event)
   if (tmp->mCachedArray) {
     tmp->mCachedArray = nullptr;
     DropJSObjects(tmp);
   }
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(NotifyAudioAvailableEvent,
-                                                  nsDOMEvent)
+                                                  Event)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(NotifyAudioAvailableEvent,
-                                               nsDOMEvent)
+                                               Event)
   NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mCachedArray)
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(NotifyAudioAvailableEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMNotifyAudioAvailableEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
 NotifyAudioAvailableEvent::~NotifyAudioAvailableEvent()
 {
   MOZ_COUNT_DTOR(NotifyAudioAvailableEvent);
   if (mCachedArray) {
     mCachedArray = nullptr;
     mozilla::DropJSObjects(this);
   }
@@ -112,17 +112,17 @@ NotifyAudioAvailableEvent::InitAudioAvai
                                                    uint32_t aFrameBufferLength,
                                                    float aTime,
                                                    bool aAllowAudioData)
 {
   // Auto manage the memory which stores the frame buffer. This ensures
   // that if we exit due to some error, the memory will be freed. Otherwise,
   // the framebuffer's memory will be freed when this event is destroyed.
   nsAutoArrayPtr<float> frameBuffer(aFrameBuffer);
-  nsresult rv = nsDOMEvent::InitEvent(aType, aCanBubble, aCancelable);
+  nsresult rv = Event::InitEvent(aType, aCanBubble, aCancelable);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mFrameBuffer = frameBuffer.forget();
   mFrameBufferLength = aFrameBufferLength;
   mTime = aTime;
   mAllowAudioData = aAllowAudioData;
   mCachedArray = nullptr;
   return NS_OK;
--- a/dom/events/NotifyAudioAvailableEvent.h
+++ b/dom/events/NotifyAudioAvailableEvent.h
@@ -2,44 +2,44 @@
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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 mozilla_dom_NotifyAudioAvailableEvent_h_
 #define mozilla_dom_NotifyAudioAvailableEvent_h_
 
+#include "mozilla/dom/Event.h"
+#include "mozilla/dom/NotifyAudioAvailableEventBinding.h"
+#include "nsCycleCollectionParticipant.h"
 #include "nsIDOMNotifyAudioAvailableEvent.h"
-#include "nsDOMEvent.h"
-#include "nsCycleCollectionParticipant.h"
-#include "mozilla/dom/NotifyAudioAvailableEventBinding.h"
 
 class nsPresContext;
 
 namespace mozilla {
 namespace dom {
 
-class NotifyAudioAvailableEvent : public nsDOMEvent,
+class NotifyAudioAvailableEvent : public Event,
                                   public nsIDOMNotifyAudioAvailableEvent
 {
 public:
   NotifyAudioAvailableEvent(EventTarget* aOwner,
                             nsPresContext* aPresContext,
                             WidgetEvent* aEvent,
                             uint32_t aEventType,
                             float* aFrameBuffer,
                             uint32_t aFrameBufferLength,
                             float aTime);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
-    NotifyAudioAvailableEvent, nsDOMEvent)
+    NotifyAudioAvailableEvent, Event)
 
   NS_DECL_NSIDOMNOTIFYAUDIOAVAILABLEEVENT
-  NS_FORWARD_NSIDOMEVENT(nsDOMEvent::)
+  NS_FORWARD_NSIDOMEVENT(Event::)
 
   ~NotifyAudioAvailableEvent();
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return NotifyAudioAvailableEventBinding::Wrap(aCx, aScope, this);
   }
--- a/dom/events/NotifyPaintEvent.cpp
+++ b/dom/events/NotifyPaintEvent.cpp
@@ -14,32 +14,32 @@
 namespace mozilla {
 namespace dom {
 
 NotifyPaintEvent::NotifyPaintEvent(EventTarget* aOwner,
                                    nsPresContext* aPresContext,
                                    WidgetEvent* aEvent,
                                    uint32_t aEventType,
                                    nsInvalidateRequestList* aInvalidateRequests)
-: nsDOMEvent(aOwner, aPresContext, aEvent)
+  : Event(aOwner, aPresContext, aEvent)
 {
   if (mEvent) {
     mEvent->message = aEventType;
   }
   if (aInvalidateRequests) {
     mInvalidateRequests.MoveElementsFrom(aInvalidateRequests->mRequests);
   }
 }
 
 NS_INTERFACE_MAP_BEGIN(NotifyPaintEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMNotifyPaintEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
-NS_IMPL_ADDREF_INHERITED(NotifyPaintEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(NotifyPaintEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(NotifyPaintEvent, Event)
+NS_IMPL_RELEASE_INHERITED(NotifyPaintEvent, Event)
 
 nsRegion
 NotifyPaintEvent::GetRegion()
 {
   nsRegion r;
   if (!nsContentUtils::IsCallerChrome()) {
     return r;
   }
@@ -100,17 +100,17 @@ NotifyPaintEvent::GetPaintRequests(nsISu
   nsRefPtr<nsPaintRequestList> requests = PaintRequests();
   requests.forget(aResult);
   return NS_OK;
 }
 
 already_AddRefed<nsPaintRequestList>
 NotifyPaintEvent::PaintRequests()
 {
-  nsDOMEvent* parent = this;
+  Event* parent = this;
   nsRefPtr<nsPaintRequestList> requests = new nsPaintRequestList(parent);
 
   if (nsContentUtils::IsCallerChrome()) {
     for (uint32_t i = 0; i < mInvalidateRequests.Length(); ++i) {
       nsRefPtr<nsPaintRequest> r = new nsPaintRequest(parent);
       r->SetRequest(mInvalidateRequests[i]);
       requests->Append(r);
     }
@@ -122,30 +122,30 @@ NotifyPaintEvent::PaintRequests()
 NS_IMETHODIMP_(void)
 NotifyPaintEvent::Serialize(IPC::Message* aMsg,
                             bool aSerializeInterfaceType)
 {
   if (aSerializeInterfaceType) {
     IPC::WriteParam(aMsg, NS_LITERAL_STRING("notifypaintevent"));
   }
 
-  nsDOMEvent::Serialize(aMsg, false);
+  Event::Serialize(aMsg, false);
 
   uint32_t length = mInvalidateRequests.Length();
   IPC::WriteParam(aMsg, length);
   for (uint32_t i = 0; i < length; ++i) {
     IPC::WriteParam(aMsg, mInvalidateRequests[i].mRect);
     IPC::WriteParam(aMsg, mInvalidateRequests[i].mFlags);
   }
 }
 
 NS_IMETHODIMP_(bool)
 NotifyPaintEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
 {
-  NS_ENSURE_TRUE(nsDOMEvent::Deserialize(aMsg, aIter), false);
+  NS_ENSURE_TRUE(Event::Deserialize(aMsg, aIter), false);
 
   uint32_t length = 0;
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &length), false);
   mInvalidateRequests.SetCapacity(length);
   for (uint32_t i = 0; i < length; ++i) {
     nsInvalidateRequestList::Request req;
     NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &req.mRect), false);
     NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &req.mFlags), false);
--- a/dom/events/NotifyPaintEvent.h
+++ b/dom/events/NotifyPaintEvent.h
@@ -2,49 +2,49 @@
 /* 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 mozilla_dom_NotifyPaintEvent_h_
 #define mozilla_dom_NotifyPaintEvent_h_
 
 #include "mozilla/Attributes.h"
+#include "mozilla/dom/Event.h"
+#include "mozilla/dom/NotifyPaintEventBinding.h"
 #include "nsIDOMNotifyPaintEvent.h"
-#include "nsDOMEvent.h"
 #include "nsPresContext.h"
-#include "mozilla/dom/NotifyPaintEventBinding.h"
 
 class nsPaintRequestList;
 
 namespace mozilla {
 namespace dom {
 
 class DOMRect;
 class DOMRectList;
 
-class NotifyPaintEvent : public nsDOMEvent,
+class NotifyPaintEvent : public Event,
                          public nsIDOMNotifyPaintEvent
 {
 
 public:
   NotifyPaintEvent(EventTarget* aOwner,
                    nsPresContext* aPresContext,
                    WidgetEvent* aEvent,
                    uint32_t aEventType,
                    nsInvalidateRequestList* aInvalidateRequests);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIDOMNOTIFYPAINTEVENT
 
   // Forward to base class
-  NS_FORWARD_TO_NSDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION
+  NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION
   NS_IMETHOD DuplicatePrivateData() MOZ_OVERRIDE
   {
-    return nsDOMEvent::DuplicatePrivateData();
+    return Event::DuplicatePrivateData();
   }
   NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) MOZ_OVERRIDE;
   NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) MOZ_OVERRIDE;
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return NotifyPaintEventBinding::Wrap(aCx, aScope, this);
--- a/dom/events/ScrollAreaEvent.cpp
+++ b/dom/events/ScrollAreaEvent.cpp
@@ -65,28 +65,28 @@ ScrollAreaEvent::InitScrollAreaEvent(con
 NS_IMETHODIMP_(void)
 ScrollAreaEvent::Serialize(IPC::Message* aMsg,
                            bool aSerializeInterfaceType)
 {
   if (aSerializeInterfaceType) {
     IPC::WriteParam(aMsg, NS_LITERAL_STRING("scrollareaevent"));
   }
 
-  nsDOMEvent::Serialize(aMsg, false);
+  Event::Serialize(aMsg, false);
 
   IPC::WriteParam(aMsg, X());
   IPC::WriteParam(aMsg, Y());
   IPC::WriteParam(aMsg, Width());
   IPC::WriteParam(aMsg, Height());
 }
 
 NS_IMETHODIMP_(bool)
 ScrollAreaEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
 {
-  NS_ENSURE_TRUE(nsDOMEvent::Deserialize(aMsg, aIter), false);
+  NS_ENSURE_TRUE(Event::Deserialize(aMsg, aIter), false);
 
   float x, y, width, height;
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &x), false);
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &y), false);
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &width), false);
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &height), false);
   mClientArea.SetRect(x, y, width, height);
 
--- a/dom/events/ScrollAreaEvent.h
+++ b/dom/events/ScrollAreaEvent.h
@@ -25,20 +25,20 @@ public:
                   InternalScrollAreaEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIDOMSCROLLAREAEVENT
 
   NS_FORWARD_NSIDOMUIEVENT(UIEvent::)
 
-  NS_FORWARD_TO_NSDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION
+  NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION
   NS_IMETHOD DuplicatePrivateData()
   {
-    return nsDOMEvent::DuplicatePrivateData();
+    return Event::DuplicatePrivateData();
   }
   NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) MOZ_OVERRIDE;
   NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) MOZ_OVERRIDE;
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return ScrollAreaEventBinding::Wrap(aCx, aScope, this);
--- a/dom/events/SpeechRecognitionError.cpp
+++ b/dom/events/SpeechRecognitionError.cpp
@@ -7,19 +7,20 @@
 
 namespace mozilla {
 namespace dom {
 
 SpeechRecognitionError::SpeechRecognitionError(
                           mozilla::dom::EventTarget* aOwner,
                           nsPresContext* aPresContext,
                           WidgetEvent* aEvent)
-: nsDOMEvent(aOwner, aPresContext, aEvent),
-  mError()
-{}
+  : Event(aOwner, aPresContext, aEvent)
+  , mError()
+{
+}
 
 SpeechRecognitionError::~SpeechRecognitionError() {}
 
 already_AddRefed<SpeechRecognitionError>
 SpeechRecognitionError::Constructor(const GlobalObject& aGlobal,
                                     const nsAString& aType,
                                     const SpeechRecognitionErrorInit& aParam,
                                     ErrorResult& aRv)
@@ -35,17 +36,17 @@ SpeechRecognitionError::Constructor(cons
 void
 SpeechRecognitionError::InitSpeechRecognitionError(const nsAString& aType,
                                                    bool aCanBubble,
                                                    bool aCancelable,
                                                    SpeechRecognitionErrorCode aError,
                                                    const nsAString& aMessage,
                                                    ErrorResult& aRv)
 {
-  aRv = nsDOMEvent::InitEvent(aType, aCanBubble, aCancelable);
+  aRv = Event::InitEvent(aType, aCanBubble, aCancelable);
   NS_ENSURE_SUCCESS_VOID(aRv.ErrorCode());
 
   mError = aError;
   mMessage = aMessage;
   return;
 }
 
 } // namespace dom
--- a/dom/events/SpeechRecognitionError.h
+++ b/dom/events/SpeechRecognitionError.h
@@ -1,23 +1,23 @@
 /* -*- 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 SpeechRecognitionError_h__
 #define SpeechRecognitionError_h__
 
-#include "nsDOMEvent.h"
+#include "mozilla/dom/Event.h"
 #include "mozilla/dom/SpeechRecognitionErrorBinding.h"
 
 namespace mozilla {
 namespace dom {
 
-class SpeechRecognitionError : public nsDOMEvent
+class SpeechRecognitionError : public Event
 {
 public:
   SpeechRecognitionError(mozilla::dom::EventTarget* aOwner,
                          nsPresContext* aPresContext,
                          WidgetEvent* aEvent);
   virtual ~SpeechRecognitionError();
 
   static already_AddRefed<SpeechRecognitionError>
--- a/dom/events/Touch.cpp
+++ b/dom/events/Touch.cpp
@@ -101,23 +101,23 @@ Touch::Target() const
 }
 
 void
 Touch::InitializePoints(nsPresContext* aPresContext, WidgetEvent* aEvent)
 {
   if (mPointsInitialized) {
     return;
   }
-  mClientPoint = nsDOMEvent::GetClientCoords(
+  mClientPoint = Event::GetClientCoords(
     aPresContext, aEvent, LayoutDeviceIntPoint::FromUntyped(mRefPoint),
     mClientPoint);
-  mPagePoint = nsDOMEvent::GetPageCoords(
+  mPagePoint = Event::GetPageCoords(
     aPresContext, aEvent, LayoutDeviceIntPoint::FromUntyped(mRefPoint),
     mClientPoint);
-  mScreenPoint = nsDOMEvent::GetScreenCoords(aPresContext, aEvent,
+  mScreenPoint = Event::GetScreenCoords(aPresContext, aEvent,
     LayoutDeviceIntPoint::FromUntyped(mRefPoint));
   mPointsInitialized = true;
 }
 
 void
 Touch::SetTarget(EventTarget* aTarget)
 {
   mTarget = aTarget;
--- a/dom/events/TransitionEvent.cpp
+++ b/dom/events/TransitionEvent.cpp
@@ -8,34 +8,34 @@
 #include "prtime.h"
 
 namespace mozilla {
 namespace dom {
 
 TransitionEvent::TransitionEvent(EventTarget* aOwner,
                                  nsPresContext* aPresContext,
                                  InternalTransitionEvent* aEvent)
-  : nsDOMEvent(aOwner, aPresContext,
-               aEvent ? aEvent : new InternalTransitionEvent(false, 0))
+  : Event(aOwner, aPresContext,
+          aEvent ? aEvent : new InternalTransitionEvent(false, 0))
 {
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
   }
 }
 
 NS_INTERFACE_MAP_BEGIN(TransitionEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMTransitionEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
-NS_IMPL_ADDREF_INHERITED(TransitionEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(TransitionEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(TransitionEvent, Event)
+NS_IMPL_RELEASE_INHERITED(TransitionEvent, Event)
 
 // static
 already_AddRefed<TransitionEvent>
 TransitionEvent::Constructor(const GlobalObject& aGlobal,
                              const nsAString& aType,
                              const TransitionEventInit& aParam,
                              ErrorResult& aRv)
 {
--- a/dom/events/TransitionEvent.h
+++ b/dom/events/TransitionEvent.h
@@ -1,35 +1,35 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* 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 mozilla_dom_TransitionEvent_h_
 #define mozilla_dom_TransitionEvent_h_
 
-#include "nsDOMEvent.h"
+#include "mozilla/EventForwards.h"
+#include "mozilla/dom/Event.h"
+#include "mozilla/dom/TransitionEventBinding.h"
 #include "nsIDOMTransitionEvent.h"
-#include "mozilla/EventForwards.h"
-#include "mozilla/dom/TransitionEventBinding.h"
 
 class nsAString;
 
 namespace mozilla {
 namespace dom {
 
-class TransitionEvent : public nsDOMEvent,
+class TransitionEvent : public Event,
                         public nsIDOMTransitionEvent
 {
 public:
   TransitionEvent(EventTarget* aOwner,
                   nsPresContext* aPresContext,
                   InternalTransitionEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
-  NS_FORWARD_TO_NSDOMEVENT
+  NS_FORWARD_TO_EVENT
   NS_DECL_NSIDOMTRANSITIONEVENT
 
   static already_AddRefed<TransitionEvent>
   Constructor(const GlobalObject& aGlobal,
               const nsAString& aType,
               const TransitionEventInit& aParam,
               ErrorResult& aRv);
 
--- a/dom/events/UIEvent.cpp
+++ b/dom/events/UIEvent.cpp
@@ -21,18 +21,18 @@
 #include "prtime.h"
 
 namespace mozilla {
 namespace dom {
 
 UIEvent::UIEvent(EventTarget* aOwner,
                  nsPresContext* aPresContext,
                  WidgetGUIEvent* aEvent)
-  : nsDOMEvent(aOwner, aPresContext,
-               aEvent ? aEvent : new InternalUIEvent(false, 0))
+  : Event(aOwner, aPresContext,
+          aEvent ? aEvent : new InternalUIEvent(false, 0))
   , mClientPoint(0, 0)
   , mLayerPoint(0, 0)
   , mPagePoint(0, 0)
   , mMovementPoint(0, 0)
   , mIsPointerLocked(nsEventStateManager::sIsPointerLocked)
   , mLastClientPoint(nsEventStateManager::sLastClientPoint)
 {
   if (aEvent) {
@@ -89,25 +89,25 @@ UIEvent::Constructor(const GlobalObject&
   nsRefPtr<UIEvent> e = new UIEvent(t, nullptr, nullptr);
   bool trusted = e->Init(t);
   aRv = e->InitUIEvent(aType, aParam.mBubbles, aParam.mCancelable, aParam.mView,
                        aParam.mDetail);
   e->SetTrusted(trusted);
   return e.forget();
 }
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED_1(UIEvent, nsDOMEvent,
+NS_IMPL_CYCLE_COLLECTION_INHERITED_1(UIEvent, Event,
                                      mView)
 
-NS_IMPL_ADDREF_INHERITED(UIEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(UIEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(UIEvent, Event)
+NS_IMPL_RELEASE_INHERITED(UIEvent, Event)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(UIEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMUIEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
 static nsIntPoint
 DevPixelsToCSSPixels(const LayoutDeviceIntPoint& aPoint,
                      nsPresContext* aContext)
 {
   return nsIntPoint(aContext->DevPixelsToIntCSSPixels(aPoint.x),
                     aContext->DevPixelsToIntCSSPixels(aPoint.y));
 }
@@ -157,17 +157,17 @@ UIEvent::InitUIEvent(const nsAString& ty
                      bool cancelableArg,
                      nsIDOMWindow* viewArg,
                      int32_t detailArg)
 {
   if (viewArg) {
     nsCOMPtr<nsPIDOMWindow> view = do_QueryInterface(viewArg);
     NS_ENSURE_TRUE(view, NS_ERROR_INVALID_ARG);
   }
-  nsresult rv = nsDOMEvent::InitEvent(typeArg, canBubbleArg, cancelableArg);
+  nsresult rv = Event::InitEvent(typeArg, canBubbleArg, cancelableArg);
   NS_ENSURE_SUCCESS(rv, rv);
   
   mDetail = detailArg;
   mView = viewArg;
 
   return NS_OK;
 }
 
@@ -181,20 +181,18 @@ UIEvent::GetPageX(int32_t* aPageX)
 
 int32_t
 UIEvent::PageX() const
 {
   if (mPrivateDataDuplicated) {
     return mPagePoint.x;
   }
 
-  return nsDOMEvent::GetPageCoords(mPresContext,
-                                   mEvent,
-                                   mEvent->refPoint,
-                                   mClientPoint).x;
+  return Event::GetPageCoords(mPresContext, mEvent, mEvent->refPoint,
+                              mClientPoint).x;
 }
 
 NS_IMETHODIMP
 UIEvent::GetPageY(int32_t* aPageY)
 {
   NS_ENSURE_ARG_POINTER(aPageY);
   *aPageY = PageY();
   return NS_OK;
@@ -202,20 +200,18 @@ UIEvent::GetPageY(int32_t* aPageY)
 
 int32_t
 UIEvent::PageY() const
 {
   if (mPrivateDataDuplicated) {
     return mPagePoint.y;
   }
 
-  return nsDOMEvent::GetPageCoords(mPresContext,
-                                   mEvent,
-                                   mEvent->refPoint,
-                                   mClientPoint).y;
+  return Event::GetPageCoords(mPresContext, mEvent, mEvent->refPoint,
+                              mClientPoint).y;
 }
 
 NS_IMETHODIMP
 UIEvent::GetWhich(uint32_t* aWhich)
 {
   NS_ENSURE_ARG_POINTER(aWhich);
   *aWhich = Which();
   return NS_OK;
@@ -355,55 +351,51 @@ UIEvent::IsChar() const
   }
   WidgetTextEvent* textEvent = mEvent->AsTextEvent();
   return textEvent ? textEvent->isChar : false;
 }
 
 NS_IMETHODIMP
 UIEvent::DuplicatePrivateData()
 {
-  mClientPoint = nsDOMEvent::GetClientCoords(mPresContext,
-                                             mEvent,
-                                             mEvent->refPoint,
-                                             mClientPoint);
+  mClientPoint =
+    Event::GetClientCoords(mPresContext, mEvent, mEvent->refPoint,
+                           mClientPoint);
   mMovementPoint = GetMovementPoint();
   mLayerPoint = GetLayerPoint();
-  mPagePoint = nsDOMEvent::GetPageCoords(mPresContext,
-                                         mEvent,
-                                         mEvent->refPoint,
-                                         mClientPoint);
+  mPagePoint =
+    Event::GetPageCoords(mPresContext, mEvent, mEvent->refPoint, mClientPoint);
   // GetScreenPoint converts mEvent->refPoint to right coordinates.
-  nsIntPoint screenPoint = nsDOMEvent::GetScreenCoords(mPresContext,
-                                                       mEvent,
-                                                       mEvent->refPoint);
-  nsresult rv = nsDOMEvent::DuplicatePrivateData();
+  nsIntPoint screenPoint =
+    Event::GetScreenCoords(mPresContext, mEvent, mEvent->refPoint);
+  nsresult rv = Event::DuplicatePrivateData();
   if (NS_SUCCEEDED(rv)) {
     mEvent->refPoint = LayoutDeviceIntPoint::FromUntyped(screenPoint);
   }
   return rv;
 }
 
 NS_IMETHODIMP_(void)
 UIEvent::Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType)
 {
   if (aSerializeInterfaceType) {
     IPC::WriteParam(aMsg, NS_LITERAL_STRING("uievent"));
   }
 
-  nsDOMEvent::Serialize(aMsg, false);
+  Event::Serialize(aMsg, false);
 
   int32_t detail = 0;
   GetDetail(&detail);
   IPC::WriteParam(aMsg, detail);
 }
 
 NS_IMETHODIMP_(bool)
 UIEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
 {
-  NS_ENSURE_TRUE(nsDOMEvent::Deserialize(aMsg, aIter), false);
+  NS_ENSURE_TRUE(Event::Deserialize(aMsg, aIter), false);
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &mDetail), false);
   return true;
 }
 
 // XXX Following struct and array are used only in
 //     UIEvent::ComputeModifierState(), but if we define them in it,
 //     we fail to build on Mac at calling mozilla::ArrayLength().
 struct ModifierPair
--- a/dom/events/UIEvent.h
+++ b/dom/events/UIEvent.h
@@ -2,44 +2,44 @@
 /* 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 mozilla_dom_UIEvent_h_
 #define mozilla_dom_UIEvent_h_
 
 #include "mozilla/Attributes.h"
+#include "mozilla/dom/Event.h"
+#include "mozilla/dom/UIEventBinding.h"
+#include "nsDeviceContext.h"
 #include "nsIDOMUIEvent.h"
-#include "nsDOMEvent.h"
 #include "nsLayoutUtils.h"
-#include "mozilla/dom/UIEventBinding.h"
 #include "nsPresContext.h"
-#include "nsDeviceContext.h"
 
 class nsINode;
 
 namespace mozilla {
 namespace dom {
 
-class UIEvent : public nsDOMEvent,
+class UIEvent : public Event,
                 public nsIDOMUIEvent
 {
 public:
   UIEvent(EventTarget* aOwner,
           nsPresContext* aPresContext,
           WidgetGUIEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(UIEvent, nsDOMEvent)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(UIEvent, Event)
 
   // nsIDOMUIEvent Interface
   NS_DECL_NSIDOMUIEVENT
 
-  // Forward to nsDOMEvent
-  NS_FORWARD_TO_NSDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION
+  // Forward to Event
+  NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION
   NS_IMETHOD DuplicatePrivateData() MOZ_OVERRIDE;
   NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) MOZ_OVERRIDE;
   NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) MOZ_OVERRIDE;
 
   static nsIntPoint CalculateScreenPoint(nsPresContext* aPresContext,
                                          WidgetEvent* aEvent)
   {
     if (!aEvent ||
@@ -170,17 +170,17 @@ protected:
   bool GetModifierStateInternal(const nsAString& aKey);
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #define NS_FORWARD_TO_UIEVENT                               \
   NS_FORWARD_NSIDOMUIEVENT(UIEvent::)                       \
-  NS_FORWARD_TO_NSDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION  \
+  NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION       \
   NS_IMETHOD DuplicatePrivateData()                         \
   {                                                         \
     return UIEvent::DuplicatePrivateData();                 \
   }                                                         \
   NS_IMETHOD_(void) Serialize(IPC::Message* aMsg,           \
                               bool aSerializeInterfaceType) \
   {                                                         \
     UIEvent::Serialize(aMsg, aSerializeInterfaceType);      \
--- a/dom/events/XULCommandEvent.h
+++ b/dom/events/XULCommandEvent.h
@@ -37,30 +37,30 @@ public:
     return XULCommandEventBinding::Wrap(aCx, aScope, this);
   }
 
   bool AltKey();
   bool CtrlKey();
   bool ShiftKey();
   bool MetaKey();
 
-  already_AddRefed<nsDOMEvent> GetSourceEvent()
+  already_AddRefed<Event> GetSourceEvent()
   {
-    nsRefPtr<nsDOMEvent> e =
+    nsRefPtr<Event> e =
       mSourceEvent ? mSourceEvent->InternalDOMEvent() : nullptr;
     return e.forget();
   }
 
   void InitCommandEvent(const nsAString& aType,
                         bool aCanBubble, bool aCancelable,
                         nsIDOMWindow* aView,
                         int32_t aDetail,
                         bool aCtrlKey, bool aAltKey,
                         bool aShiftKey, bool aMetaKey,
-                        nsDOMEvent* aSourceEvent,
+                        Event* aSourceEvent,
                         ErrorResult& aRv)
   {
     aRv = InitCommandEvent(aType, aCanBubble, aCancelable, aView, aDetail,
                            aCtrlKey, aAltKey, aShiftKey, aMetaKey,
                            aSourceEvent);
   }
 
 protected:
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -10,17 +10,16 @@ MOCHITEST_CHROME_MANIFESTS += ['test/chr
 XPIDL_SOURCES += [
     'nsIEventListenerService.idl',
 ]
 
 XPIDL_MODULE = 'content_events'
 
 EXPORTS += [
     'nsAsyncDOMEvent.h',
-    'nsDOMEvent.h',
     'nsDOMEventTargetHelper.h',
     'nsDOMKeyNameList.h',
     'nsEventDispatcher.h',
     'nsEventListenerManager.h',
     'nsEventNameList.h',
     'nsEventStateManager.h',
     'nsEventStates.h',
     'nsIJSEventListener.h',
@@ -36,16 +35,17 @@ EXPORTS.mozilla.dom += [
     'BeforeUnloadEvent.h',
     'ClipboardEvent.h',
     'CommandEvent.h',
     'CompositionEvent.h',
     'DataContainerEvent.h',
     'DataTransfer.h',
     'DeviceMotionEvent.h',
     'DragEvent.h',
+    'Event.h',
     'EventTarget.h',
     'FocusEvent.h',
     'KeyboardEvent.h',
     'MessageEvent.h',
     'MouseEvent.h',
     'MouseScrollEvent.h',
     'MutationEvent.h',
     'NotifyAudioAvailableEvent.h',
@@ -69,28 +69,28 @@ UNIFIED_SOURCES += [
     'BeforeUnloadEvent.cpp',
     'ClipboardEvent.cpp',
     'CommandEvent.cpp',
     'CompositionEvent.cpp',
     'DataContainerEvent.cpp',
     'DataTransfer.cpp',
     'DeviceMotionEvent.cpp',
     'DragEvent.cpp',
+    'Event.cpp',
     'EventTarget.cpp',
     'FocusEvent.cpp',
     'KeyboardEvent.cpp',
     'MessageEvent.cpp',
     'MouseEvent.cpp',
     'MouseScrollEvent.cpp',
     'MutationEvent.cpp',
     'NotifyAudioAvailableEvent.cpp',
     'NotifyPaintEvent.cpp',
     'nsAsyncDOMEvent.cpp',
     'nsContentEventHandler.cpp',
-    'nsDOMEvent.cpp',
     'nsDOMEventTargetHelper.cpp',
     'nsEventDispatcher.cpp',
     'nsEventListenerManager.cpp',
     'nsEventListenerService.cpp',
     'nsIMEStateManager.cpp',
     'nsJSEventListener.cpp',
     'nsPaintRequest.cpp',
     'PointerEvent.cpp',
--- a/dom/events/nsAsyncDOMEvent.cpp
+++ b/dom/events/nsAsyncDOMEvent.cpp
@@ -2,18 +2,18 @@
 /* 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 "nsAsyncDOMEvent.h"
 #include "nsIDOMEvent.h"
 #include "nsContentUtils.h"
 #include "nsEventDispatcher.h"
-#include "nsDOMEvent.h"
 #include "mozilla/BasicEvents.h"
+#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 #include "mozilla/dom/EventTarget.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsAsyncDOMEvent::nsAsyncDOMEvent(nsINode* aEventNode, WidgetEvent& aEvent)
   : mEventNode(aEventNode), mDispatchChromeOnly(false)
 {
--- a/dom/events/nsEventDispatcher.cpp
+++ b/dom/events/nsEventDispatcher.cpp
@@ -605,17 +605,17 @@ nsEventDispatcher::Dispatch(nsISupports*
 
   // Note, nsEventTargetChainItem objects are deleted when the chain goes out of
   // the scope.
 
   aEvent->mFlags.mIsBeingDispatched = false;
   aEvent->mFlags.mDispatchedAtLeastOnce = true;
 
   if (!externalDOMEvent && preVisitor.mDOMEvent) {
-    // An nsDOMEvent was created while dispatching the event.
+    // An dom::Event was created while dispatching the event.
     // Duplicate private data if someone holds a pointer to it.
     nsrefcnt rc = 0;
     NS_RELEASE2(preVisitor.mDOMEvent, rc);
     if (preVisitor.mDOMEvent) {
       preVisitor.mDOMEvent->DuplicatePrivateData();
     }
   }
 
--- a/dom/events/nsEventListenerManager.cpp
+++ b/dom/events/nsEventListenerManager.cpp
@@ -8,17 +8,17 @@
 #include "mozilla/Hal.h"
 #endif
 #include "mozilla/HalSensor.h"
 
 // Microsoft's API Name hackery sucks
 #undef CreateEvent
 
 #include "nsISupports.h"
-#include "nsDOMEvent.h"
+#include "mozilla/dom/Event.h"
 #include "nsEventListenerManager.h"
 #include "nsIDOMEventListener.h"
 #include "nsGkAtoms.h"
 #include "nsPIDOMWindow.h"
 #include "nsIJSEventListener.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsNameSpaceManager.h"
 #include "nsIContent.h"
@@ -132,17 +132,17 @@ nsEventListenerManager::RemoveAllListene
   mClearingListeners = true;
   mListeners.Clear();
   mClearingListeners = false;
 }
 
 void
 nsEventListenerManager::Shutdown()
 {
-  nsDOMEvent::Shutdown();
+  Event::Shutdown();
 }
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsEventListenerManager, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsEventListenerManager, Release)
 
 inline void
 ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
                             nsListenerStruct& aField,
@@ -986,17 +986,17 @@ nsEventListenerManager::HandleEventInter
   //Set the value of the internal PreventDefault flag properly based on aEventStatus
   if (*aEventStatus == nsEventStatus_eConsumeNoDefault) {
     aEvent->mFlags.mDefaultPrevented = true;
   }
 
   nsAutoTObserverArray<nsListenerStruct, 2>::EndLimitedIterator iter(mListeners);
   Maybe<nsAutoPopupStatePusher> popupStatePusher;
   if (mIsMainThreadELM) {
-    popupStatePusher.construct(nsDOMEvent::GetEventPopupControlState(aEvent));
+    popupStatePusher.construct(Event::GetEventPopupControlState(aEvent));
   }
 
   bool hasListener = false;
   while (iter.HasMore()) {
     if (aEvent->mFlags.mImmediatePropagationStopped) {
       break;
     }
     nsListenerStruct* ls = &iter.GetNext();
--- a/dom/events/nsEventStateManager.cpp
+++ b/dom/events/nsEventStateManager.cpp
@@ -5,32 +5,32 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Attributes.h"
 #include "mozilla/MiscEvents.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/TextEvents.h"
 #include "mozilla/TouchEvents.h"
+#include "mozilla/dom/Event.h"
 #include "mozilla/dom/TabParent.h"
 #include "mozilla/dom/UIEvent.h"
 
 #include "nsCOMPtr.h"
 #include "nsEventStateManager.h"
 #include "nsFocusManager.h"
 #include "nsIMEStateManager.h"
 #include "nsContentEventHandler.h"
 #include "nsIContent.h"
 #include "nsINodeInfo.h"
 #include "nsIDocument.h"
 #include "nsIFrame.h"
 #include "nsIWidget.h"
 #include "nsPresContext.h"
 #include "nsIPresShell.h"
-#include "nsDOMEvent.h"
 #include "nsGkAtoms.h"
 #include "nsIFormControl.h"
 #include "nsIComboboxControlFrame.h"
 #include "nsIScrollableFrame.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMXULControlElement.h"
 #include "nsNameSpaceManager.h"
 #include "nsIBaseWindow.h"
@@ -5913,17 +5913,17 @@ nsEventStateManager::Prefs::Init()
 }
 
 // static
 void
 nsEventStateManager::Prefs::OnChange(const char* aPrefName, void*)
 {
   nsDependentCString prefName(aPrefName);
   if (prefName.EqualsLiteral("dom.popup_allowed_events")) {
-    nsDOMEvent::PopupAllowedEventsChanged();
+    Event::PopupAllowedEventsChanged();
   }
 }
 
 // static
 void
 nsEventStateManager::Prefs::Shutdown()
 {
   Preferences::UnregisterCallback(OnChange, "dom.popup_allowed_events");
--- a/dom/events/nsEventStateManager.h
+++ b/dom/events/nsEventStateManager.h
@@ -214,23 +214,23 @@ public:
   static bool IsRemoteTarget(nsIContent* aTarget);
   static LayoutDeviceIntPoint GetChildProcessOffset(
                                 nsFrameLoader* aFrameLoader,
                                 const mozilla::WidgetEvent& aEvent);
 
   // Holds the point in screen coords that a mouse event was dispatched to,
   // before we went into pointer lock mode. This is constantly updated while
   // the pointer is not locked, but we don't update it while the pointer is
-  // locked. This is used by nsDOMEvent::GetScreenCoords() to make mouse
+  // locked. This is used by dom::Event::GetScreenCoords() to make mouse
   // events' screen coord appear frozen at the last mouse position while
   // the pointer is locked.
   static nsIntPoint sLastScreenPoint;
 
   // Holds the point in client coords of the last mouse event. Used by
-  // nsDOMEvent::GetClientCoords() to make mouse events' client coords appear
+  // dom::Event::GetClientCoords() to make mouse events' client coords appear
   // frozen at the last mouse position while the pointer is locked.
   static mozilla::CSSIntPoint sLastClientPoint;
 
   static bool sIsPointerLocked;
   static nsWeakPtr sPointerLockedElement;
   static nsWeakPtr sPointerLockedDoc;
 
 protected:
--- a/dom/events/nsJSEventListener.cpp
+++ b/dom/events/nsJSEventListener.cpp
@@ -16,17 +16,16 @@
 #include "nsGkAtoms.h"
 #include "xpcpublic.h"
 #include "nsJSEnvironment.h"
 #include "nsDOMJSUtils.h"
 #include "mozilla/ContentEvents.h"
 #include "mozilla/Likely.h"
 #include "mozilla/dom/ErrorEvent.h"
 #include "mozilla/dom/UnionTypes.h"
-#include "nsDOMEvent.h"
 
 #ifdef DEBUG
 
 #include "nspr.h" // PR_fprintf
 
 class EventListenerCounter
 {
 public:
--- a/dom/file/LockedFile.cpp
+++ b/dom/file/LockedFile.cpp
@@ -2,25 +2,25 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* 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 "LockedFile.h"
 
 #include "nsIAppShell.h"
+#include "nsIDOMEvent.h"
 #include "nsIDOMFile.h"
 #include "nsIFileStorage.h"
 #include "nsISeekableStream.h"
 
 #include "jsfriendapi.h"
 #include "nsEventDispatcher.h"
 #include "nsNetUtil.h"
 #include "nsDOMClassInfoID.h"
-#include "nsDOMEvent.h"
 #include "nsJSUtils.h"
 #include "nsStringStream.h"
 #include "nsWidgetsCID.h"
 #include "xpcpublic.h"
 
 #include "AsyncHelper.h"
 #include "DOMFileRequest.h"
 #include "FileHandle.h"
--- a/dom/indexedDB/AsyncConnectionHelper.h
+++ b/dom/indexedDB/AsyncConnectionHelper.h
@@ -12,18 +12,16 @@
 #include "IndexedDatabase.h"
 #include "IDBDatabase.h"
 #include "IDBRequest.h"
 
 #include "mozIStorageProgressHandler.h"
 #include "nsIEventTarget.h"
 #include "nsIRunnable.h"
 
-#include "nsDOMEvent.h"
-
 class mozIStorageConnection;
 
 BEGIN_INDEXEDDB_NAMESPACE
 
 class AutoSetCurrentTransaction;
 class IDBTransaction;
 
 namespace ipc {
--- a/dom/indexedDB/IDBEvents.cpp
+++ b/dom/indexedDB/IDBEvents.cpp
@@ -79,22 +79,22 @@ IDBVersionChangeEvent::CreateInternal(mo
 
 // static
 already_AddRefed<nsIRunnable>
 IDBVersionChangeEvent::CreateRunnableInternal(mozilla::dom::EventTarget* aTarget,
                                               const nsAString& aType,
                                               uint64_t aOldVersion,
                                               uint64_t aNewVersion)
 {
-  nsRefPtr<nsDOMEvent> event =
+  nsRefPtr<Event> event =
     CreateInternal(aTarget, aType, aOldVersion, aNewVersion);
   NS_ENSURE_TRUE(event, nullptr);
 
   nsCOMPtr<nsIRunnable> runnable(new EventFiringRunnable(aTarget, event));
   return runnable.forget();
 }
 
-NS_IMPL_ADDREF_INHERITED(IDBVersionChangeEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(IDBVersionChangeEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(IDBVersionChangeEvent, Event)
+NS_IMPL_RELEASE_INHERITED(IDBVersionChangeEvent, Event)
 
 NS_INTERFACE_MAP_BEGIN(IDBVersionChangeEvent)
   NS_INTERFACE_MAP_ENTRY(IDBVersionChangeEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
--- a/dom/indexedDB/IDBEvents.h
+++ b/dom/indexedDB/IDBEvents.h
@@ -6,17 +6,17 @@
 
 #ifndef mozilla_dom_indexeddb_idbevents_h__
 #define mozilla_dom_indexeddb_idbevents_h__
 
 #include "mozilla/dom/indexedDB/IndexedDatabase.h"
 
 #include "nsIRunnable.h"
 
-#include "nsDOMEvent.h"
+#include "mozilla/dom/Event.h"
 #include "mozilla/dom/Nullable.h"
 #include "mozilla/dom/indexedDB/IDBObjectStore.h"
 #include "mozilla/dom/IDBVersionChangeEventBinding.h"
 
 #define SUCCESS_EVT_STR "success"
 #define ERROR_EVT_STR "error"
 #define COMPLETE_EVT_STR "complete"
 #define ABORT_EVT_STR "abort"
@@ -41,21 +41,21 @@ enum Cancelable {
 };
 
 already_AddRefed<nsIDOMEvent>
 CreateGenericEvent(mozilla::dom::EventTarget* aOwner,
                    const nsAString& aType,
                    Bubbles aBubbles,
                    Cancelable aCancelable);
 
-class IDBVersionChangeEvent : public nsDOMEvent
+class IDBVersionChangeEvent : public Event
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_FORWARD_TO_NSDOMEVENT
+  NS_FORWARD_TO_EVENT
   NS_DECLARE_STATIC_IID_ACCESSOR(IDBVERSIONCHANGEEVENT_IID)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return mozilla::dom::IDBVersionChangeEventBinding::Wrap(aCx, aScope, this);
   }
 
@@ -80,36 +80,36 @@ public:
 
   mozilla::dom::Nullable<uint64_t> GetNewVersion()
   {
     return mNewVersion
       ? mozilla::dom::Nullable<uint64_t>(mNewVersion)
       : mozilla::dom::Nullable<uint64_t>();
   }
 
-  inline static already_AddRefed<nsDOMEvent>
+  inline static already_AddRefed<Event>
   Create(mozilla::dom::EventTarget* aOwner,
          int64_t aOldVersion,
          int64_t aNewVersion)
   {
     return CreateInternal(aOwner,
                           NS_LITERAL_STRING(VERSIONCHANGE_EVT_STR),
                           aOldVersion, aNewVersion);
   }
 
-  inline static already_AddRefed<nsDOMEvent>
+  inline static already_AddRefed<Event>
   CreateBlocked(mozilla::dom::EventTarget* aOwner,
                 uint64_t aOldVersion,
                 uint64_t aNewVersion)
   {
     return CreateInternal(aOwner, NS_LITERAL_STRING(BLOCKED_EVT_STR),
                           aOldVersion, aNewVersion);
   }
 
-  inline static already_AddRefed<nsDOMEvent>
+  inline static already_AddRefed<Event>
   CreateUpgradeNeeded(mozilla::dom::EventTarget* aOwner,
                       uint64_t aOldVersion,
                       uint64_t aNewVersion)
   {
     return CreateInternal(aOwner,
                           NS_LITERAL_STRING(UPGRADENEEDED_EVT_STR),
                           aOldVersion, aNewVersion);
   }
@@ -131,17 +131,17 @@ public:
   {
     return CreateRunnableInternal(aTarget,
                                   NS_LITERAL_STRING(BLOCKED_EVT_STR),
                                   aOldVersion, aNewVersion);
   }
 
 protected:
   IDBVersionChangeEvent(mozilla::dom::EventTarget* aOwner)
-  : nsDOMEvent(aOwner, nullptr, nullptr)
+    : Event(aOwner, nullptr, nullptr)
   {
     SetIsDOMBinding();
   }
   virtual ~IDBVersionChangeEvent() { }
 
   static already_AddRefed<IDBVersionChangeEvent>
   CreateInternal(mozilla::dom::EventTarget* aOwner,
                  const nsAString& aType,
--- a/dom/indexedDB/OpenDatabaseHelper.cpp
+++ b/dom/indexedDB/OpenDatabaseHelper.cpp
@@ -1667,29 +1667,29 @@ public:
 
         NS_ASSERTION(database->IsClosed(),
                    "AbortCloseStoragesForWindow should have closed database");
         ownerDoc->DisallowBFCaching();
         continue;
       }
 
       // Otherwise fire a versionchange event.
-      nsRefPtr<nsDOMEvent> event = 
+      nsRefPtr<Event> event = 
         IDBVersionChangeEvent::Create(database, mOldVersion, mNewVersion);
       NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
 
       bool dummy;
       database->DispatchEvent(event, &dummy);
     }
 
     // Now check to see if any didn't close. If there are some running still
     // then fire the blocked event.
     for (uint32_t index = 0; index < count; index++) {
       if (!mWaitingDatabases[index]->IsClosed()) {
-        nsRefPtr<nsDOMEvent> event =
+        nsRefPtr<Event> event =
           IDBVersionChangeEvent::CreateBlocked(mRequest,
                                                mOldVersion, mNewVersion);
         NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
 
         bool dummy;
         mRequest->DispatchEvent(event, &dummy);
 
         break;
--- a/dom/indexedDB/ipc/IndexedDBChild.cpp
+++ b/dom/indexedDB/ipc/IndexedDBChild.cpp
@@ -136,17 +136,17 @@ public:
   }
 
   NS_IMETHOD Run() MOZ_OVERRIDE
   {
     if (mDatabase->IsClosed()) {
       return NS_OK;
     }
 
-    nsRefPtr<nsDOMEvent> event =
+    nsRefPtr<Event> event =
       IDBVersionChangeEvent::Create(mDatabase, mOldVersion, mNewVersion);
     MOZ_ASSERT(event);
 
     bool dummy;
     nsresult rv = mDatabase->DispatchEvent(event, &dummy);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return NS_OK;
--- a/dom/interfaces/events/nsIDOMEvent.idl
+++ b/dom/interfaces/events/nsIDOMEvent.idl
@@ -3,34 +3,34 @@
  * 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 "domstubs.idl"
 
 interface nsIDOMEventTarget;
 
 [ptr] native WidgetEventPtr(mozilla::WidgetEvent);
-[ptr] native nsDOMEventPtr(nsDOMEvent);
+[ptr] native DOMEventPtr(mozilla::dom::Event);
 [ptr] native IPCMessagePtr(IPC::Message);
 [ptr] native ConstIPCMessagePtr(const IPC::Message);
 [ptr] native EventTargetPtr(mozilla::dom::EventTarget);
 %{C++
 #ifdef ERROR
 #undef ERROR
 #endif
 
 #include "mozilla/EventForwards.h"
-class nsDOMEvent;
 class nsPresContext;
 class nsInvalidateRequestList;
 namespace IPC {
 class Message;
 }
 namespace mozilla {
 namespace dom {
+class Event;
 class EventTarget;
 } // namespace dom
 } // namespace mozilla
 %}
 
 /**
  * The nsIDOMEvent interface is the primary datatype for all events in
  * the Document Object Model.
@@ -207,17 +207,17 @@ interface nsIDOMEvent : nsISupports
   [noscript] void setTarget(in nsIDOMEventTarget aTarget);
   [notxpcom] boolean IsDispatchStopped();
   [notxpcom] WidgetEventPtr GetInternalNSEvent();
   [noscript,notxpcom] void SetTrusted(in boolean aTrusted);
   [notxpcom] void Serialize(in IPCMessagePtr aMsg,
                             in boolean aSerializeInterfaceType);
   [notxpcom] boolean Deserialize(in ConstIPCMessagePtr aMsg, out voidPtr aIter);
   [noscript,notxpcom] void SetOwner(in EventTargetPtr aOwner);
-  [notxpcom] nsDOMEventPtr InternalDOMEvent();
+  [notxpcom] DOMEventPtr InternalDOMEvent();
 };
 
 dictionary EventInit
 {
   boolean bubbles;
   boolean cancelable;
 };
 
--- a/dom/mobileconnection/src/MobileConnection.cpp
+++ b/dom/mobileconnection/src/MobileConnection.cpp
@@ -6,17 +6,16 @@
 
 #include "GeneratedEvents.h"
 #include "mozilla/dom/CFStateChangeEvent.h"
 #include "mozilla/dom/DataErrorEvent.h"
 #include "mozilla/dom/MozEmergencyCbModeEvent.h"
 #include "mozilla/dom/MozOtaStatusEvent.h"
 #include "mozilla/dom/USSDReceivedEvent.h"
 #include "mozilla/Preferences.h"
-#include "nsDOMEvent.h"
 #include "nsIDOMClassInfo.h"
 #include "nsIDOMDOMRequest.h"
 #include "nsIPermissionManager.h"
 #include "nsIVariant.h"
 
 #include "nsJSUtils.h"
 #include "nsJSON.h"
 #include "mozilla/Services.h"
--- a/dom/network/src/Connection.cpp
+++ b/dom/network/src/Connection.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <limits>
 #include "mozilla/Hal.h"
 #include "mozilla/dom/network/Connection.h"
 #include "mozilla/dom/MozConnectionBinding.h"
 #include "nsIDOMClassInfo.h"
 #include "mozilla/Preferences.h"
-#include "nsDOMEvent.h"
 #include "Constants.h"
 
 /**
  * We have to use macros here because our leak analysis tool things we are
  * leaking strings when we have |static const nsString|. Sad :(
  */
 #define CHANGE_EVENT_NAME NS_LITERAL_STRING("change")
 
--- a/dom/power/WakeLock.cpp
+++ b/dom/power/WakeLock.cpp
@@ -1,19 +1,19 @@
 /* -*- Mode: C++; tab-width: 40; 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 "WakeLock.h"
 #include "mozilla/dom/ContentParent.h"
+#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 #include "mozilla/dom/MozWakeLockBinding.h"
 #include "mozilla/Hal.h"
 #include "mozilla/HalWakeLock.h"
-#include "nsDOMEvent.h"
 #include "nsError.h"
 #include "nsIDocument.h"
 #include "nsIDOMWindow.h"
 #include "nsIDOMEvent.h"
 #include "nsPIDOMWindow.h"
 #include "nsIPropertyBag2.h"
 
 using namespace mozilla::hal;
--- a/dom/smil/TimeEvent.cpp
+++ b/dom/smil/TimeEvent.cpp
@@ -9,19 +9,19 @@
 #include "nsPresContext.h"
 
 namespace mozilla {
 namespace dom {
 
 TimeEvent::TimeEvent(EventTarget* aOwner,
                      nsPresContext* aPresContext,
                      WidgetEvent* aEvent)
-  : nsDOMEvent(aOwner, aPresContext,
-               aEvent ? aEvent : new InternalUIEvent(false, 0)),
-    mDetail(0)
+  : Event(aOwner, aPresContext,
+          aEvent ? aEvent : new InternalUIEvent(false, 0))
+  , mDetail(0)
 {
   SetIsDOMBinding();
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
     mEvent->eventStructType = NS_SMIL_TIME_EVENT;
   }
@@ -39,25 +39,25 @@ TimeEvent::TimeEvent(EventTarget* aOwner
       nsCOMPtr<nsIDOMWindow> window = do_GetInterface(container);
       if (window) {
         mView = do_QueryInterface(window);
       }
     }
   }
 }
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED_1(TimeEvent, nsDOMEvent,
+NS_IMPL_CYCLE_COLLECTION_INHERITED_1(TimeEvent, Event,
                                      mView)
 
-NS_IMPL_ADDREF_INHERITED(TimeEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(TimeEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(TimeEvent, Event)
+NS_IMPL_RELEASE_INHERITED(TimeEvent, Event)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(TimeEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMTimeEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
 NS_IMETHODIMP
 TimeEvent::GetView(nsIDOMWindow** aView)
 {
   *aView = mView;
   NS_IF_ADDREF(*aView);
   return NS_OK;
 }
@@ -69,18 +69,18 @@ TimeEvent::GetDetail(int32_t* aDetail)
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TimeEvent::InitTimeEvent(const nsAString& aTypeArg,
                          nsIDOMWindow* aViewArg,
                          int32_t aDetailArg)
 {
-  nsresult rv = nsDOMEvent::InitEvent(aTypeArg, false /*doesn't bubble*/,
-                                                false /*can't cancel*/);
+  nsresult rv = Event::InitEvent(aTypeArg, false /*doesn't bubble*/,
+                                           false /*can't cancel*/);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mDetail = aDetailArg;
   mView = aViewArg;
 
   return NS_OK;
 }
 
--- a/dom/smil/TimeEvent.h
+++ b/dom/smil/TimeEvent.h
@@ -1,40 +1,40 @@
 /* -*- 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 mozilla_dom_TimeEvent_h_
 #define mozilla_dom_TimeEvent_h_
 
+#include "mozilla/dom/Event.h"
+#include "mozilla/dom/TimeEventBinding.h"
 #include "nsIDOMTimeEvent.h"
-#include "nsDOMEvent.h"
-#include "mozilla/dom/TimeEventBinding.h"
 
 namespace mozilla {
 namespace dom {
 
-class TimeEvent MOZ_FINAL : public nsDOMEvent,
+class TimeEvent MOZ_FINAL : public Event,
                             public nsIDOMTimeEvent
 {
 public:
   TimeEvent(EventTarget* aOwner,
             nsPresContext* aPresContext,
             WidgetEvent* aEvent);
 
   // nsISupports interface:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TimeEvent, nsDOMEvent)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TimeEvent, Event)
 
   // nsIDOMTimeEvent interface:
   NS_DECL_NSIDOMTIMEEVENT
 
   // Forward to base class
-  NS_FORWARD_TO_NSDOMEVENT
+  NS_FORWARD_TO_EVENT
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return TimeEventBinding::Wrap(aCx, aScope, this);
   }
 
   int32_t Detail() const
--- a/dom/speakermanager/SpeakerManager.cpp
+++ b/dom/speakermanager/SpeakerManager.cpp
@@ -1,20 +1,20 @@
 /* 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 "SpeakerManager.h"
 #include "nsIDOMClassInfo.h"
+#include "nsIDOMEvent.h"
 #include "nsIDOMEventListener.h"
 #include "SpeakerManagerService.h"
 #include "nsIPermissionManager.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIDocShell.h"
-#include "nsDOMEvent.h"
 #include "AudioChannelService.h"
 
 using namespace mozilla::dom;
 
 NS_IMPL_QUERY_INTERFACE_INHERITED1(SpeakerManager, nsDOMEventTargetHelper,
                                    nsIDOMEventListener)
 NS_IMPL_ADDREF_INHERITED(SpeakerManager, nsDOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(SpeakerManager, nsDOMEventTargetHelper)
--- a/dom/src/notification/Notification.cpp
+++ b/dom/src/notification/Notification.cpp
@@ -5,17 +5,16 @@
 #include "PCOMContentPermissionRequestChild.h"
 #include "mozilla/dom/Notification.h"
 #include "mozilla/dom/AppNotificationServiceOptionsBinding.h"
 #include "mozilla/dom/OwningNonNull.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/Preferences.h"
 #include "TabChild.h"
 #include "nsContentUtils.h"
-#include "nsDOMEvent.h"
 #include "nsIAlertsService.h"
 #include "nsIAppsService.h"
 #include "nsIContentPermissionPrompt.h"
 #include "nsIDocument.h"
 #include "nsINotificationStorage.h"
 #include "nsIPermissionManager.h"
 #include "nsIUUIDGenerator.h"
 #include "nsServiceManagerUtils.h"
--- a/dom/src/offline/nsDOMOfflineResourceList.cpp
+++ b/dom/src/offline/nsDOMOfflineResourceList.cpp
@@ -1,14 +1,15 @@
 /* -*- 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 "nsDOMOfflineResourceList.h"
+#include "nsIDOMEvent.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsError.h"
 #include "mozilla/dom/DOMStringList.h"
 #include "nsIPrefetchService.h"
 #include "nsCPrefetchService.h"
 #include "nsNetUtil.h"
 #include "nsNetCID.h"
 #include "nsICacheSession.h"
--- a/dom/src/offline/nsDOMOfflineResourceList.h
+++ b/dom/src/offline/nsDOMOfflineResourceList.h
@@ -14,17 +14,16 @@
 #include "nsIOfflineCacheUpdate.h"
 #include "nsTArray.h"
 #include "nsString.h"
 #include "nsIURI.h"
 #include "nsCOMPtr.h"
 #include "nsWeakReference.h"
 #include "nsCOMArray.h"
 #include "nsIDOMEventListener.h"
-#include "nsDOMEvent.h"
 #include "nsIObserver.h"
 #include "nsIScriptContext.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsPIDOMWindow.h"
 #include "nsDOMEventTargetHelper.h"
 #include "mozilla/ErrorResult.h"
 
 class nsIDOMWindow;
--- a/dom/telephony/CallEvent.cpp
+++ b/dom/telephony/CallEvent.cpp
@@ -27,29 +27,29 @@ CallEvent::Create(EventTarget* aOwner, c
 JSObject*
 CallEvent::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
 {
   return CallEventBinding::Wrap(aCx, aScope, this);
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(CallEvent)
 
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(CallEvent, nsDOMEvent)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(CallEvent, Event)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mCall)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(CallEvent, nsDOMEvent)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(CallEvent, Event)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCall)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(CallEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(CallEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(CallEvent, Event)
+NS_IMPL_RELEASE_INHERITED(CallEvent, Event)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(CallEvent)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
 
 // WebIDL
 
 /* static */
 already_AddRefed<CallEvent>
 CallEvent::Constructor(const GlobalObject& aGlobal, const nsAString& aType,
                        const CallEventInit& aOptions, ErrorResult& aRv)
 {
--- a/dom/telephony/CallEvent.h
+++ b/dom/telephony/CallEvent.h
@@ -2,33 +2,32 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 mozilla_dom_telephony_callevent_h
 #define mozilla_dom_telephony_callevent_h
 
+#include "mozilla/dom/Event.h"
 #include "mozilla/dom/telephony/TelephonyCommon.h"
 
-#include "nsDOMEvent.h"
-
 namespace mozilla {
 namespace dom {
 
 struct CallEventInit;
 
-class CallEvent MOZ_FINAL : public nsDOMEvent
+class CallEvent MOZ_FINAL : public Event
 {
   nsRefPtr<TelephonyCall> mCall;
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CallEvent, nsDOMEvent)
-  NS_FORWARD_TO_NSDOMEVENT
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CallEvent, Event)
+  NS_FORWARD_TO_EVENT
 
   virtual JSObject*
   WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
 
   // WebIDL
   static already_AddRefed<CallEvent>
   Constructor(const GlobalObject& aGlobal, const nsAString& aType,
               const CallEventInit& aOptions, ErrorResult& aRv);
@@ -39,17 +38,17 @@ public:
   static already_AddRefed<CallEvent>
   Create(EventTarget* aOwner, const nsAString& aType, TelephonyCall* aCall,
          bool aCanBubble, bool aCancelable);
 
 private:
   CallEvent(EventTarget* aOwner,
             nsPresContext* aPresContext,
             WidgetEvent* aEvent)
-  : nsDOMEvent(aOwner, aPresContext, aEvent)
+    : Event(aOwner, aPresContext, aEvent)
   {
     SetIsDOMBinding();
   }
 
   virtual ~CallEvent()
   { }
 };
 
--- a/dom/time/TimeChangeObserver.cpp
+++ b/dom/time/TimeChangeObserver.cpp
@@ -8,17 +8,16 @@
 #include "mozilla/Observer.h"
 #include "mozilla/HalTypes.h"
 #include "nsWeakPtr.h"
 #include "nsTObserverArray.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPtr.h"
 #include "nsPIDOMWindow.h"
-#include "nsDOMEvent.h"
 #include "nsContentUtils.h"
 #include "nsIObserverService.h"
 #include "nsIDocument.h"
 
 using namespace mozilla;
 using namespace mozilla::hal;
 using namespace mozilla::services;
 
--- a/dom/voicemail/Voicemail.h
+++ b/dom/voicemail/Voicemail.h
@@ -4,17 +4,16 @@
  * 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 mozilla_dom_voicemail_voicemail_h__
 #define mozilla_dom_voicemail_voicemail_h__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/ErrorResult.h"
-#include "nsDOMEvent.h"
 #include "nsDOMEventTargetHelper.h"
 #include "nsIVoicemailProvider.h"
 
 class JSObject;
 struct JSContext;
 
 class nsPIDOMWindow;
 class nsIDOMMozVoicemailStatus;
--- a/dom/workers/MessagePort.cpp
+++ b/dom/workers/MessagePort.cpp
@@ -1,18 +1,18 @@
 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
 /* 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 "MessagePort.h"
 
 #include "mozilla/dom/MessagePortBinding.h"
-#include "nsDOMEvent.h"
 #include "nsEventDispatcher.h"
+#include "nsIDOMEvent.h"
 
 #include "SharedWorker.h"
 #include "WorkerPrivate.h"
 #include "WorkerRunnable.h"
 
 using mozilla::dom::EventHandlerNonNull;
 using mozilla::dom::MessagePortBase;
 using mozilla::dom::Optional;
--- a/dom/workers/SharedWorker.cpp
+++ b/dom/workers/SharedWorker.cpp
@@ -5,19 +5,19 @@
 
 #include "SharedWorker.h"
 
 #include "nsPIDOMWindow.h"
 
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/SharedWorkerBinding.h"
 #include "nsContentUtils.h"
-#include "nsDOMEvent.h"
 #include "nsEventDispatcher.h"
 #include "nsIClassInfoImpl.h"
+#include "nsIDOMEvent.h"
 
 #include "MessagePort.h"
 #include "RuntimeService.h"
 #include "WorkerPrivate.h"
 
 using mozilla::dom::Optional;
 using mozilla::dom::Sequence;
 
--- a/dom/xbl/nsXBLEventHandler.cpp
+++ b/dom/xbl/nsXBLEventHandler.cpp
@@ -1,21 +1,21 @@
 /* -*- 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 "nsDOMEvent.h"
 #include "nsIAtom.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsXBLPrototypeHandler.h"
 #include "nsContentUtils.h"
+#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 #include "mozilla/dom/EventTarget.h"
 
 using namespace mozilla::dom;
 
 nsXBLEventHandler::nsXBLEventHandler(nsXBLPrototypeHandler* aHandler)
   : mProtoHandler(aHandler)
 {
 }
--- a/dom/xbl/nsXBLService.cpp
+++ b/dom/xbl/nsXBLService.cpp
@@ -40,26 +40,26 @@
 
 #include "nsIPresShell.h"
 #include "nsIDocumentObserver.h"
 #include "nsFrameManager.h"
 #include "nsStyleContext.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIScriptError.h"
 #include "nsXBLSerialize.h"
-#include "nsDOMEvent.h"
 #include "nsEventListenerManager.h"
 
 #ifdef MOZ_XUL
 #include "nsXULPrototypeCache.h"
 #endif
 #include "nsIDOMEventListener.h"
+#include "mozilla/Attributes.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/dom/Event.h"
 #include "mozilla/dom/Element.h"
-#include "mozilla/Attributes.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 #define NS_MAX_XBL_BINDING_RECURSION 20
 
 nsXBLService* nsXBLService::gInstance = nullptr;
 
@@ -282,17 +282,17 @@ nsresult
 nsXBLStreamListener::HandleEvent(nsIDOMEvent* aEvent)
 {
   nsresult rv = NS_OK;
   uint32_t i;
   uint32_t count = mBindingRequests.Length();
 
   // Get the binding document; note that we don't hold onto it in this object
   // to avoid creating a cycle
-  nsDOMEvent* event = aEvent->InternalDOMEvent();
+  Event* event = aEvent->InternalDOMEvent();
   EventTarget* target = event->GetCurrentTarget();
   nsCOMPtr<nsIDocument> bindingDocument = do_QueryInterface(target);
   NS_ASSERTION(bindingDocument, "Event not targeted at document?!");
 
   // See if we're still alive.
   nsCOMPtr<nsIDocument> doc(do_QueryReferent(mBoundDocument));
   if (!doc) {
     NS_WARNING("XBL load did not complete until after document went away! Modal dialog bug?\n");
--- a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
+++ b/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
@@ -60,17 +60,17 @@
 #include "nsContextMenuInfo.h"
 #include "nsPresContext.h"
 #include "nsViewManager.h"
 #include "nsView.h"
 #include "nsEventListenerManager.h"
 #include "nsIDOMDragEvent.h"
 #include "nsIConstraintValidation.h"
 #include "mozilla/Attributes.h"
-#include "nsDOMEvent.h"
+#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 //
 // GetEventReceiver
 //
 // A helper routine that navigates the tricky path from a |nsWebBrowser| to
--- a/embedding/components/windowwatcher/src/nsAutoWindowStateHelper.cpp
+++ b/embedding/components/windowwatcher/src/nsAutoWindowStateHelper.cpp
@@ -1,16 +1,16 @@
 /* -*- 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 "nsAutoWindowStateHelper.h"
 
-#include "nsDOMEvent.h"
+#include "mozilla/dom/Event.h"
 #include "nsIDocument.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMWindow.h"
 #include "nsPIDOMWindow.h"
 #include "nsString.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
@@ -54,17 +54,17 @@ nsAutoWindowStateHelper::DispatchEventTo
   // The functions of nsContentUtils do not provide the required behavior,
   // so the following is inlined.
   nsIDocument* doc = window->GetExtantDoc();
   if (!doc) {
     return true;
   }
 
   ErrorResult rv;
-  nsRefPtr<nsDOMEvent> event = doc->CreateEvent(NS_LITERAL_STRING("Events"), rv);
+  nsRefPtr<Event> event = doc->CreateEvent(NS_LITERAL_STRING("Events"), rv);
   if (rv.Failed()) {
     return false;
   }
   NS_ENSURE_TRUE(NS_SUCCEEDED(event->InitEvent(NS_ConvertASCIItoUTF16(aEventName), true, true)), false);
   event->SetTrusted(true);
   event->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
 
   nsCOMPtr<EventTarget> target = do_QueryInterface(window);
--- a/js/xpconnect/src/event_impl_gen.py
+++ b/js/xpconnect/src/event_impl_gen.py
@@ -53,20 +53,17 @@ class Configuration:
 
 def readConfigFile(filename):
     return Configuration(filename)
 
 def firstCap(str):
     return str[0].upper() + str[1:]
 
 def getBaseName(iface):
-    basename = ("%s" % iface.base[6:])
-    if (basename == "Event"):
-        basename = "nsDOMEvent"
-    return basename
+    return ("%s" % iface.base[6:])
 
 def print_header_file(fd, conf):
     fd.write("#ifndef _gen_mozilla_idl_generated_events_h_\n"
              "#define _gen_mozilla_idl_generated_events_h_\n\n")
     fd.write("/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n")
     fd.write("#include \"nscore.h\"\n")
     fd.write("class nsIDOMEvent;\n")
     fd.write("class nsPresContext;\n")
@@ -83,17 +80,17 @@ def print_header_file(fd, conf):
         fd.write("nsPresContext* aPresContext, mozilla::WidgetEvent* aEvent);\n")
 
     fd.write("\n#endif\n")
 
 def print_classes_file(fd, conf):
     fd.write("#ifndef _gen_mozilla_idl_generated_event_declarations_h_\n")
     fd.write("#define _gen_mozilla_idl_generated_event_declarations_h_\n\n")
 
-    fd.write("#include \"nsDOMEvent.h\"\n");
+    fd.write("#include \"mozilla/dom/Event.h\"\n");
     includes = []
     for s in conf.special_includes:
         if not s in includes:
             includes.append(strip_end(s, ".h"))
 
     for e in conf.simple_events:
         if not e in includes:
             includes.append(("nsIDOM%s" % e))
@@ -149,22 +146,20 @@ def print_class_declaration(eventname, i
     fd.write("\nclass %s : public %s, public %s\n" % (classname, basename, iface.name))
     fd.write("{\n")
     fd.write("public:\n")
     fd.write("  %s(mozilla::dom::EventTarget* aOwner, " % classname)
     fd.write("nsPresContext* aPresContext = nullptr, mozilla::WidgetEvent* aEvent = nullptr);\n");
     fd.write("  virtual ~%s();\n\n" % classname)
     fd.write("  NS_DECL_ISUPPORTS_INHERITED\n")
     fd.write("  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(%s, %s)\n" % (classname, basename))
-    fd.write("  NS_FORWARD_TO_NSDOMEVENT\n")
+    fd.write("  NS_FORWARD_TO_EVENT\n")
 
     for baseiface in baseinterfaces:
         baseimpl = ("%s" % baseiface.name[6:])
-        if (baseimpl == "Event"):
-            baseimpl = "nsDOMEvent"
         fd.write("  NS_FORWARD_%s(%s::)\n" % (baseiface.name.upper(), baseimpl))
 
     fd.write("  NS_DECL_%s\n" % iface.name.upper())
 
     hasVariant = False
     for a in allattributes:
         if a.type == "nsIVariant":
             hasVariant = True
@@ -246,17 +241,17 @@ def print_cpp(idl, fd, conf, eventname):
     for p in idl.productions:
         if p.kind == 'interface':
             write_cpp(eventname, p, fd, conf)
 
 def print_cpp_file(fd, conf):
     fd.write("/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n\n")
     fd.write('#include "GeneratedEventClasses.h"\n')
     fd.write('#include "xpcprivate.h"\n');
-    fd.write('#include "nsDOMEvent.h"\n');
+    fd.write('#include "mozilla/dom/Event.h"\n');
     fd.write('#include "mozilla/dom/EventTarget.h"\n');
 
     for e in conf.simple_events:
         idl = loadEventIDL(p, options.incdirs, e)
         print_cpp(idl, fd, conf, e)
 
 def init_value(attribute):
     realtype = attribute.realtype.nativeType('in')
--- a/js/xpconnect/src/nsDOMQS.h
+++ b/js/xpconnect/src/nsDOMQS.h
@@ -11,17 +11,17 @@
 #include "mozilla/dom/HTMLFormElement.h"
 #include "mozilla/dom/HTMLImageElement.h"
 #include "mozilla/dom/HTMLOptionElement.h"
 #include "HTMLOptGroupElement.h"
 #include "mozilla/dom/HTMLVideoElement.h"
 #include "nsHTMLDocument.h"
 #include "nsICSSDeclaration.h"
 #include "nsSVGElement.h"
-#include "nsDOMEvent.h"
+#include "mozilla/dom/Event.h"
 #include "mozilla/dom/UIEvent.h"
 #include "mozilla/dom/MouseEvent.h"
 #include "mozilla/dom/EventTargetBinding.h"
 #include "mozilla/dom/NodeBinding.h"
 #include "mozilla/dom/ElementBinding.h"
 #include "mozilla/dom/HTMLElementBinding.h"
 #include "mozilla/dom/DocumentBinding.h"
 #include "mozilla/dom/SVGElementBinding.h"
@@ -52,17 +52,17 @@ struct ProtoIDAndDepth<_native>         
 NEW_BINDING(mozilla::dom::EventTarget, EventTarget);
 NEW_BINDING(nsINode, Node);
 NEW_BINDING(mozilla::dom::Element, Element);
 NEW_BINDING(nsGenericHTMLElement, HTMLElement);
 NEW_BINDING(nsIDocument, Document);
 NEW_BINDING(nsDocument, Document);
 NEW_BINDING(nsHTMLDocument, HTMLDocument);
 NEW_BINDING(nsSVGElement, SVGElement);
-NEW_BINDING(nsDOMEvent, Event);
+NEW_BINDING(mozilla::dom::Event, Event);
 NEW_BINDING(mozilla::dom::UIEvent, UIEvent);
 NEW_BINDING(mozilla::dom::MouseEvent, MouseEvent);
 
 #define DEFINE_UNWRAP_CAST(_interface, _base, _bit)                           \
 template <>                                                                   \
 MOZ_ALWAYS_INLINE bool                                                        \
 xpc_qsUnwrapThis<_interface>(JSContext *cx,                                   \
                              JS::HandleObject obj,                            \
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -35,32 +35,32 @@
 #ifdef XP_WIN
 #include "winuser.h"
 #endif
 
 #include "nsPresShell.h"
 #include "nsPresContext.h"
 #include "nsIContent.h"
 #include "mozilla/dom/Element.h"
+#include "mozilla/dom/Event.h" // for Event::GetEventPopupControlState()
 #include "mozilla/dom/ShadowRoot.h"
 #include "nsIDocument.h"
 #include "nsCSSStyleSheet.h"
 #include "nsAnimationManager.h"
 #include "nsNameSpaceManager.h"  // for Pref-related rule management (bugs 22963,20760,31816)
 #include "nsFrame.h"
 #include "FrameLayerBuilder.h"
 #include "nsViewManager.h"
 #include "nsView.h"
 #include "nsCRTGlue.h"
 #include "prprf.h"
 #include "prinrval.h"
 #include "nsTArray.h"
 #include "nsCOMArray.h"
 #include "nsContainerFrame.h"
-#include "nsDOMEvent.h"
 #include "nsISelection.h"
 #include "mozilla/Selection.h"
 #include "nsGkAtoms.h"
 #include "nsIDOMRange.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMElement.h"
@@ -7208,17 +7208,18 @@ PresShell::HandleEventInternal(WidgetEve
     AutoHandlingUserInputStatePusher userInpStatePusher(isHandlingUserInput,
                                                         aEvent, mDocument);
 
     if (aEvent->mFlags.mIsTrusted && aEvent->message == NS_MOUSE_MOVE) {
       nsIPresShell::AllowMouseCapture(
         nsEventStateManager::GetActiveEventStateManager() == manager);
     }
 
-    nsAutoPopupStatePusher popupStatePusher(nsDOMEvent::GetEventPopupControlState(aEvent));
+    nsAutoPopupStatePusher popupStatePusher(
+                             Event::GetEventPopupControlState(aEvent));
 
     // FIXME. If the event was reused, we need to clear the old target,
     // bug 329430
     aEvent->target = nullptr;
 
     // 1. Give event to event manager for pre event state changes and
     //    generation of synthetic events.
     rv = manager->PreHandleEvent(mPresContext, aEvent, mCurrentEventFrame, aStatus);
--- a/layout/generic/nsImageMap.cpp
+++ b/layout/generic/nsImageMap.cpp
@@ -2,22 +2,22 @@
 /* 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/. */
 
 /* code for HTML client-side image maps */
 
 #include "nsImageMap.h"
 
+#include "mozilla/dom/Element.h"
+#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 #include "nsString.h"
-#include "nsDOMEvent.h"
 #include "nsReadableUtils.h"
 #include "nsRenderingContext.h"
 #include "nsPresContext.h"
-#include "mozilla/dom/Element.h"
 #include "nsNameSpaceManager.h"
 #include "nsGkAtoms.h"
 #include "nsImageFrame.h"
 #include "nsCoord.h"
 #include "nsIScriptError.h"
 #include "nsIStringBundle.h"
 #include "nsContentUtils.h"
 
--- a/layout/printing/nsPrintPreviewListener.cpp
+++ b/layout/printing/nsPrintPreviewListener.cpp
@@ -3,17 +3,17 @@
  * 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 "nsPrintPreviewListener.h"
 
 #include "mozilla/TextEvents.h"
 #include "mozilla/dom/Element.h"
-#include "nsDOMEvent.h"
+#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 #include "nsIDOMWindow.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMEvent.h"
 #include "nsIDocument.h"
 #include "nsIDocShell.h"
 #include "nsPresContext.h"
--- a/layout/xul/nsXULPopupManager.cpp
+++ b/layout/xul/nsXULPopupManager.cpp
@@ -7,17 +7,16 @@
 #include "nsXULPopupManager.h"
 #include "nsMenuFrame.h"
 #include "nsMenuPopupFrame.h"
 #include "nsMenuBarFrame.h"
 #include "nsIPopupBoxObject.h"
 #include "nsMenuBarListener.h"
 #include "nsContentUtils.h"
 #include "nsIDOMDocument.h"
-#include "nsDOMEvent.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMXULElement.h"
 #include "nsIXULDocument.h"
 #include "nsIXULTemplateBuilder.h"
 #include "nsEventDispatcher.h"
 #include "nsEventStateManager.h"
 #include "nsCSSFrameConstructor.h"
 #include "nsLayoutUtils.h"
@@ -32,16 +31,17 @@
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsCaret.h"
 #include "nsIDocument.h"
 #include "nsPIWindowRoot.h"
 #include "nsFrameManager.h"
 #include "nsIObserverService.h"
 #include "mozilla/dom/Element.h"
+#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/Services.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 static_assert(nsIDOMKeyEvent::DOM_VK_HOME  == nsIDOMKeyEvent::DOM_VK_END + 1 &&
--- a/layout/xul/nsXULTooltipListener.cpp
+++ b/layout/xul/nsXULTooltipListener.cpp
@@ -1,16 +1,15 @@
 /* -*- 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 "nsXULTooltipListener.h"
 
-#include "nsDOMEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIDOMXULDocument.h"
 #include "nsIDOMXULElement.h"
 #include "nsIDocument.h"
 #include "nsGkAtoms.h"
 #include "nsIPopupBoxObject.h"
 #include "nsMenuPopupFrame.h"
 #include "nsIServiceManager.h"
@@ -25,16 +24,17 @@
 #include "nsXULPopupManager.h"
 #endif
 #include "nsIRootBox.h"
 #include "nsIBoxObject.h"
 #include "nsEventDispatcher.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/dom/Element.h"
+#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsXULTooltipListener* nsXULTooltipListener::mInstance = nullptr;
 
 //////////////////////////////////////////////////////////////////////////
 //// nsISupports
--- a/toolkit/components/satchel/nsFormFillController.cpp
+++ b/toolkit/components/satchel/nsFormFillController.cpp
@@ -1,15 +1,17 @@
 /* -*- 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 "nsFormFillController.h"
 
+#include "mozilla/dom/Element.h"
+#include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 #include "nsIFormAutoComplete.h"
 #include "nsIInputListAutoComplete.h"
 #include "nsIAutoCompleteSimpleResult.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsIServiceManager.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
@@ -27,19 +29,17 @@
 #include "nsRect.h"
 #include "nsIDOMHTMLFormElement.h"
 #include "nsILoginManager.h"
 #include "nsIDOMMouseEvent.h"
 #include "mozilla/ModuleUtils.h"
 #include "nsToolkitCompsCID.h"
 #include "nsEmbedCID.h"
 #include "nsIDOMNSEditableElement.h"
-#include "mozilla/dom/Element.h"
 #include "nsContentUtils.h"
-#include "nsDOMEvent.h"
 #include "nsILoadContext.h"
 
 using namespace mozilla::dom;
 
 NS_IMPL_ISUPPORTS6(nsFormFillController,
                    nsIFormFillController,
                    nsIAutoCompleteInput,
                    nsIAutoCompleteSearch,
--- a/widget/BasicEvents.h
+++ b/widget/BasicEvents.h
@@ -494,30 +494,30 @@ public:
   // If mInBubblingPhase is true, the event is in bubbling phase or target
   // phase.
   bool    mInBubblingPhase : 1;
   // If mInCapturePhase is true, the event is in capture phase or target phase.
   bool    mInCapturePhase : 1;
   // If mInSystemGroup is true, the event is being dispatched in system group.
   bool    mInSystemGroup: 1;
   // If mCancelable is true, the event can be consumed.  I.e., calling
-  // nsDOMEvent::PreventDefault() can prevent the default action.
+  // dom::Event::PreventDefault() can prevent the default action.
   bool    mCancelable : 1;
   // If mBubbles is true, the event can bubble.  Otherwise, cannot be handled
   // in bubbling phase.
   bool    mBubbles : 1;
-  // If mPropagationStopped is true, nsDOMEvent::StopPropagation() or
-  // nsDOMEvent::StopImmediatePropagation() has been called.
+  // If mPropagationStopped is true, dom::Event::StopPropagation() or
+  // dom::Event::StopImmediatePropagation() has been called.
   bool    mPropagationStopped : 1;
   // If mImmediatePropagationStopped is true,
-  // nsDOMEvent::StopImmediatePropagation() has been called.
+  // dom::Event::StopImmediatePropagation() has been called.
   // Note that mPropagationStopped must be true when this is true.
   bool    mImmediatePropagationStopped : 1;
   // If mDefaultPrevented is true, the event has been consumed.
-  // E.g., nsDOMEvent::PreventDefault() has been called or
+  // E.g., dom::Event::PreventDefault() has been called or
   // the default action has been performed.
   bool    mDefaultPrevented : 1;
   // If mDefaultPreventedByContent is true, the event has been
   // consumed by content.
   // Note that mDefaultPrevented must be true when this is true.
   bool    mDefaultPreventedByContent : 1;
   // mMultipleActionsPrevented may be used when default handling don't want to
   // be prevented, but only one of the event targets should handle the event.
--- a/widget/cocoa/nsMenuUtilsX.mm
+++ b/widget/cocoa/nsMenuUtilsX.mm
@@ -1,38 +1,38 @@
 /* -*- 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 "mozilla/dom/Event.h"
 #include "nsMenuUtilsX.h"
 #include "nsMenuBarX.h"
 #include "nsMenuX.h"
 #include "nsMenuItemX.h"
 #include "nsStandaloneNativeMenu.h"
 #include "nsObjCExceptions.h"
 #include "nsCocoaUtils.h"
 #include "nsCocoaWindow.h"
-#include "nsDOMEvent.h"
 #include "nsGkAtoms.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMXULCommandEvent.h"
 #include "nsPIDOMWindow.h"
 
 using namespace mozilla;
 
 void nsMenuUtilsX::DispatchCommandTo(nsIContent* aTargetContent)
 {
   NS_PRECONDITION(aTargetContent, "null ptr");
 
   nsIDocument* doc = aTargetContent->OwnerDoc();
   if (doc) {
     ErrorResult rv;
-    nsRefPtr<nsDOMEvent> event =
+    nsRefPtr<dom::Event> event =
       doc->CreateEvent(NS_LITERAL_STRING("xulcommandevent"), rv);
     nsCOMPtr<nsIDOMXULCommandEvent> command = do_QueryObject(event);
 
     // FIXME: Should probably figure out how to init this with the actual
     // pressed keys, but this is a big old edge case anyway. -dwh
     if (command &&
         NS_SUCCEEDED(command->InitCommandEvent(NS_LITERAL_STRING("command"),
                                                true, true,
--- a/xpfe/appshell/src/nsXULWindow.cpp
+++ b/xpfe/appshell/src/nsXULWindow.cpp
@@ -46,24 +46,24 @@
 #include "nsIURI.h"
 #include "nsIDOMCSSStyleDeclaration.h"
 #include "nsAppShellCID.h"
 #include "nsReadableUtils.h"
 #include "nsStyleConsts.h"
 #include "nsPresContext.h"
 #include "nsContentUtils.h"
 #include "nsWebShellWindow.h" // get rid of this one, too...
-#include "nsDOMEvent.h"
 #include "nsGlobalWindow.h"
 
 #include "prenv.h"
 #include "mozilla/AutoRestore.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/BarProps.h"
 #include "mozilla/dom/Element.h"
+#include "mozilla/dom/Event.h"
 #include "mozilla/dom/ScriptSettings.h"
 
 using namespace mozilla;
 using dom::AutoSystemCaller;
 
 #define SIZEMODE_NORMAL     NS_LITERAL_STRING("normal")
 #define SIZEMODE_MAXIMIZED  NS_LITERAL_STRING("maximized")
 #define SIZEMODE_MINIMIZED  NS_LITERAL_STRING("minimized")
@@ -225,17 +225,18 @@ NS_IMETHODIMP nsXULWindow::SetZLevel(uin
   SavePersistentAttributes();
 
   nsCOMPtr<nsIContentViewer> cv;
   mDocShell->GetContentViewer(getter_AddRefs(cv));
   if (cv) {
     nsCOMPtr<nsIDocument> doc = cv->GetDocument();
     if (doc) {
       ErrorResult rv;
-      nsRefPtr<nsDOMEvent> event = doc->CreateEvent(NS_LITERAL_STRING("Events"),rv);
+      nsRefPtr<dom::Event> event =
+        doc->CreateEvent(NS_LITERAL_STRING("Events"),rv);
       if (event) {
         event->InitEvent(NS_LITERAL_STRING("windowZLevel"), true, false);
 
         event->SetTrusted(true);
 
         bool defaultActionEnabled;
         doc->DispatchEvent(event, &defaultActionEnabled);
       }