Bug 716822 - Move attributes and methods on nsIDOMNSEvent to nsIDOMEvent; r=smaug
authorMs2ger <ms2ger@gmail.com>
Sat, 04 Aug 2012 09:44:00 +0200
changeset 106933 df072441c8bb0512e4c43f12b15508c86f7554bc
parent 106932 b0e43ce07b18db421d3cc139eddd195b5990f526
child 106934 1a4ffaef8acd07a1c20e4c2dd2807d17fedcbfbc
push id1490
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 18:29:50 +0000
treeherdermozilla-beta@f335e7dacdc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs716822
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 716822 - Move attributes and methods on nsIDOMNSEvent to nsIDOMEvent; r=smaug
accessible/src/generic/RootAccessible.cpp
browser/base/content/test/browser_gestureSupport.js
content/base/src/nsContentAreaDragDrop.cpp
content/base/src/nsContentUtils.cpp
content/base/src/nsXMLHttpRequest.cpp
content/base/src/nsXMLHttpRequest.h
content/events/src/nsDOMEvent.cpp
content/events/src/nsDOMEvent.h
content/events/src/nsDOMUIEvent.h
content/events/src/nsEventDispatcher.cpp
content/events/src/nsEventListenerManager.cpp
content/events/src/nsIMEStateManager.cpp
content/events/test/Makefile.in
content/events/test/test_bug238987.html
content/events/test/test_bug409604.html
content/events/test/test_bug617528.xul
content/events/test/test_bug716822.html
content/html/content/src/nsGenericHTMLElement.cpp
content/html/content/src/nsHTMLButtonElement.cpp
content/html/content/src/nsHTMLInputElement.cpp
content/xbl/src/nsXBLEventHandler.cpp
content/xbl/src/nsXBLPrototypeHandler.cpp
content/xbl/src/nsXBLWindowKeyHandler.cpp
content/xul/content/src/nsXULElement.cpp
content/xul/content/src/nsXULPopupListener.cpp
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMWindowUtils.cpp
dom/bluetooth/nsIDOMBluetoothDeviceEvent.idl
dom/bluetooth/nsIDOMBluetoothPropertyEvent.idl
dom/indexedDB/nsIIDBVersionChangeEvent.idl
dom/interfaces/apps/nsIDOMMozApplicationEvent.idl
dom/interfaces/contacts/nsIDOMMozContactChangeEvent.idl
dom/interfaces/devicestorage/nsIDOMDeviceStorageChangeEvent.idl
dom/interfaces/events/nsIDOMAnimationEvent.idl
dom/interfaces/events/nsIDOMBeforeUnloadEvent.idl
dom/interfaces/events/nsIDOMCloseEvent.idl
dom/interfaces/events/nsIDOMCommandEvent.idl
dom/interfaces/events/nsIDOMCompositionEvent.idl
dom/interfaces/events/nsIDOMCustomEvent.idl
dom/interfaces/events/nsIDOMDataContainerEvent.idl
dom/interfaces/events/nsIDOMDeviceLightEvent.idl
dom/interfaces/events/nsIDOMDeviceMotionEvent.idl
dom/interfaces/events/nsIDOMDeviceOrientationEvent.idl
dom/interfaces/events/nsIDOMDeviceProximityEvent.idl
dom/interfaces/events/nsIDOMDragEvent.idl
dom/interfaces/events/nsIDOMEvent.idl
dom/interfaces/events/nsIDOMHashChangeEvent.idl
dom/interfaces/events/nsIDOMKeyEvent.idl
dom/interfaces/events/nsIDOMMessageEvent.idl
dom/interfaces/events/nsIDOMMouseEvent.idl
dom/interfaces/events/nsIDOMMouseScrollEvent.idl
dom/interfaces/events/nsIDOMMozTouchEvent.idl
dom/interfaces/events/nsIDOMMutationEvent.idl
dom/interfaces/events/nsIDOMNSEvent.idl
dom/interfaces/events/nsIDOMNotifyAudioAvailableEvent.idl
dom/interfaces/events/nsIDOMNotifyPaintEvent.idl
dom/interfaces/events/nsIDOMPageTransitionEvent.idl
dom/interfaces/events/nsIDOMPopStateEvent.idl
dom/interfaces/events/nsIDOMPopupBlockedEvent.idl
dom/interfaces/events/nsIDOMProgressEvent.idl
dom/interfaces/events/nsIDOMScrollAreaEvent.idl
dom/interfaces/events/nsIDOMSimpleGestureEvent.idl
dom/interfaces/events/nsIDOMSmartCardEvent.idl
dom/interfaces/events/nsIDOMTouchEvent.idl
dom/interfaces/events/nsIDOMTransitionEvent.idl
dom/interfaces/events/nsIDOMUIEvent.idl
dom/interfaces/events/nsIDOMUserProximityEvent.idl
dom/interfaces/load-save/nsIDOMLSProgressEvent.idl
dom/interfaces/settings/nsIDOMMozSettingsEvent.idl
dom/interfaces/smil/nsIDOMTimeEvent.idl
dom/interfaces/storage/nsIDOMStorageEvent.idl
dom/interfaces/svg/nsIDOMSVGEvent.idl
dom/interfaces/svg/nsIDOMSVGZoomEvent.idl
dom/interfaces/xul/nsIDOMXULCommandEvent.idl
dom/network/interfaces/nsIDOMUSSDReceivedEvent.idl
dom/sms/interfaces/nsIDOMSmsEvent.idl
dom/telephony/nsIDOMCallEvent.idl
dom/telephony/nsIDOMVoicemailEvent.idl
dom/wifi/nsIWifi.idl
editor/libeditor/base/nsEditor.cpp
editor/libeditor/base/nsEditor.h
editor/libeditor/base/nsEditorEventListener.cpp
editor/libeditor/html/nsHTMLEditorEventListener.cpp
embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
extensions/widgetutils/src/nsWidgetUtils.cpp
js/xpconnect/src/dom_quickstubs.qsconf
layout/forms/nsFileControlFrame.cpp
layout/forms/nsListControlFrame.cpp
layout/forms/nsTextControlFrame.cpp
layout/forms/test/test_bug348236.html
layout/generic/nsObjectFrame.cpp
layout/printing/nsPrintPreviewListener.cpp
layout/xul/base/src/nsMenuBarListener.cpp
layout/xul/base/src/nsMenuBoxObject.cpp
layout/xul/base/src/nsXULPopupManager.cpp
mobile/xul/chrome/content/Util.js
mobile/xul/chrome/content/content.js
security/manager/ssl/src/nsSmartCardEvent.cpp
security/manager/ssl/src/nsSmartCardEvent.h
toolkit/components/passwordmgr/test/test_basic_form_autocomplete.html
toolkit/components/satchel/nsFormFillController.cpp
toolkit/components/satchel/test/test_form_autocomplete.html
toolkit/components/satchel/test/test_form_autocomplete_with_list.html
toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
--- a/accessible/src/generic/RootAccessible.cpp
+++ b/accessible/src/generic/RootAccessible.cpp
@@ -21,31 +21,21 @@
 #include "States.h"
 #ifdef MOZ_XUL
 #include "XULTreeAccessible.h"
 #endif
 
 #include "mozilla/dom/Element.h"
 
 #include "nsIAccessibleRelation.h"
-#include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
-#include "nsIDocShellTreeNode.h"
 #include "nsIDocShellTreeOwner.h"
-#include "nsIDOMElement.h"
-#include "nsIDOMEventListener.h"
 #include "nsIDOMEventTarget.h"
-#include "nsIDOMHTMLAnchorElement.h"
-#include "nsIDOMHTMLImageElement.h"
-#include "nsIDOMHTMLInputElement.h"
-#include "nsIDOMHTMLSelectElement.h"
 #include "nsIDOMDataContainerEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsIDOMXULMultSelectCntrlEl.h"
-#include "nsIDOMXULPopupElement.h"
 #include "nsIDocument.h"
 #include "nsEventListenerManager.h"
 #include "nsIFrame.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIServiceManager.h"
 #include "nsPIDOMWindow.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsReadableUtils.h"
@@ -257,19 +247,19 @@ RootAccessible::DocumentActivated(DocAcc
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIDOMEventListener
 
 NS_IMETHODIMP
 RootAccessible::HandleEvent(nsIDOMEvent* aDOMEvent)
 {
-  nsCOMPtr<nsIDOMNSEvent> DOMNSEvent(do_QueryInterface(aDOMEvent));
+  MOZ_ASSERT(aDOMEvent);
   nsCOMPtr<nsIDOMEventTarget> DOMEventTarget;
-  DOMNSEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
+  aDOMEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
   nsCOMPtr<nsINode> origTargetNode(do_QueryInterface(DOMEventTarget));
   if (!origTargetNode)
     return NS_OK;
 
   DocAccessible* document =
     GetAccService()->GetDocAccessible(origTargetNode->OwnerDoc());
 
   if (document) {
@@ -294,19 +284,19 @@ RootAccessible::HandleEvent(nsIDOMEvent*
 
   return NS_OK;
 }
 
 // RootAccessible protected
 void
 RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
 {
-  nsCOMPtr<nsIDOMNSEvent> DOMNSEvent(do_QueryInterface(aDOMEvent));
+  MOZ_ASSERT(aDOMEvent);
   nsCOMPtr<nsIDOMEventTarget> DOMEventTarget;
-  DOMNSEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
+  aDOMEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
   nsCOMPtr<nsINode> origTargetNode(do_QueryInterface(DOMEventTarget));
 
   nsAutoString eventType;
   aDOMEvent->GetType(eventType);
 
   if (eventType.EqualsLiteral("popuphiding")) {
     HandlePopupHidingEvent(origTargetNode);
     return;
--- a/browser/base/content/test/browser_gestureSupport.js
+++ b/browser/base/content/test/browser_gestureSupport.js
@@ -62,23 +62,23 @@ function test_gestureListener(evt)
   isnot(evt.screenY, 0,
         "evt.screenY (" + evt.screenY + ") does not match expected value");
 
   is(evt.direction, test_expectedDirection,
      "evt.direction (" + evt.direction + ") does not match expected value");
   is(evt.delta, test_expectedDelta,
      "evt.delta (" + evt.delta + ") does not match expected value");
 
-  is(evt.shiftKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.SHIFT_MASK) != 0,
+  is(evt.shiftKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.SHIFT_MASK) != 0,
      "evt.shiftKey did not match expected value");
-  is(evt.ctrlKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.CONTROL_MASK) != 0,
+  is(evt.ctrlKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.CONTROL_MASK) != 0,
      "evt.ctrlKey did not match expected value");
-  is(evt.altKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.ALT_MASK) != 0,
+  is(evt.altKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.ALT_MASK) != 0,
      "evt.altKey did not match expected value");
-  is(evt.metaKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.META_MASK) != 0,
+  is(evt.metaKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.META_MASK) != 0,
      "evt.metaKey did not match expected value");
 
   if (evt.type == "MozTapGesture") {
     is(evt.clickCount, test_expectedClickCount, "evt.clickCount does not match");
   }
 
   test_eventCount++;
 }
@@ -153,29 +153,29 @@ function test_TestEventListeners()
   test_clicks("MozTapGesture", 2);
   test_clicks("MozTapGesture", 3);
   test_clicks("MozPressTapGesture", 1);
 
   // simple delivery test for edgeui gesture
   e("MozEdgeUIGesture", 0, 0, 0);
 
   // event.shiftKey
-  let modifier = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
+  let modifier = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
   e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
 
   // event.metaKey
-  modifier = Components.interfaces.nsIDOMNSEvent.META_MASK;
+  modifier = Components.interfaces.nsIDOMEvent.META_MASK;
   e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
 
   // event.altKey
-  modifier = Components.interfaces.nsIDOMNSEvent.ALT_MASK;
+  modifier = Components.interfaces.nsIDOMEvent.ALT_MASK;
   e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
 
   // event.ctrlKey
-  modifier = Components.interfaces.nsIDOMNSEvent.CONTROL_MASK;
+  modifier = Components.interfaces.nsIDOMEvent.CONTROL_MASK;
   e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
 }
 
 function test_eventDispatchListener(evt)
 {
   test_eventCount++;
   evt.stopPropagation();
 }
--- a/content/base/src/nsContentAreaDragDrop.cpp
+++ b/content/base/src/nsContentAreaDragDrop.cpp
@@ -14,17 +14,16 @@
 // Interfaces needed to be included
 #include "nsCopySupport.h"
 #include "nsIDOMUIEvent.h"
 #include "nsISelection.h"
 #include "nsISelectionController.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsIDOMDragEvent.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMRange.h"
 #include "nsIFormControl.h"
 #include "nsIDOMHTMLAreaElement.h"
 #include "nsIDOMHTMLAnchorElement.h"
 #include "nsITransferable.h"
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -83,17 +83,16 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_
 #include "nsAttrName.h"
 #include "nsIDOMUserDataHandler.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsMutationEvent.h"
 #include "nsIMEStateManager.h"
 #include "nsContentErrors.h"
 #include "nsUnicharUtilCIID.h"
 #include "nsINativeKeyBindings.h"
-#include "nsIDOMNSEvent.h"
 #include "nsXULPopupManager.h"
 #include "nsIPermissionManager.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsNullPrincipal.h"
 #include "nsIRunnable.h"
 #include "nsDOMJSUtils.h"
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValue.h"
@@ -4684,24 +4683,23 @@ nsContentUtils::GetNativeEvent(nsIDOMEve
 }
 
 //static
 bool
 nsContentUtils::DOMEventToNativeKeyEvent(nsIDOMKeyEvent* aKeyEvent,
                                          nsNativeKeyEvent* aNativeEvent,
                                          bool aGetCharCode)
 {
-  nsCOMPtr<nsIDOMNSEvent> nsevent = do_QueryInterface(aKeyEvent);
   bool defaultPrevented;
-  nsevent->GetPreventDefault(&defaultPrevented);
+  aKeyEvent->GetPreventDefault(&defaultPrevented);
   if (defaultPrevented)
     return false;
 
   bool trusted = false;
-  nsevent->GetIsTrusted(&trusted);
+  aKeyEvent->GetIsTrusted(&trusted);
   if (!trusted)
     return false;
 
   if (aGetCharCode) {
     aKeyEvent->GetCharCode(&aNativeEvent->charCode);
   } else {
     aNativeEvent->charCode = 0;
   }
--- a/content/base/src/nsXMLHttpRequest.cpp
+++ b/content/base/src/nsXMLHttpRequest.cpp
@@ -4006,17 +4006,16 @@ nsXMLHttpProgressEvent::~nsXMLHttpProgre
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsXMLHttpProgressEvent)
 
 DOMCI_DATA(XMLHttpProgressEvent, nsXMLHttpProgressEvent)
 
 // QueryInterface implementation for nsXMLHttpProgressEvent
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsXMLHttpProgressEvent)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMProgressEvent)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEvent, nsIDOMProgressEvent)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMNSEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMProgressEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMLSProgressEvent)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(XMLHttpProgressEvent)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsXMLHttpProgressEvent)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsXMLHttpProgressEvent)
 
--- a/content/base/src/nsXMLHttpRequest.h
+++ b/content/base/src/nsXMLHttpRequest.h
@@ -21,32 +21,31 @@
 #include "nsIInterfaceRequestor.h"
 #include "nsIHttpHeaderVisitor.h"
 #include "nsIProgressEventSink.h"
 #include "nsCOMArray.h"
 #include "nsJSUtils.h"
 #include "nsTArray.h"
 #include "nsIJSNativeInitializer.h"
 #include "nsIDOMLSProgressEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsITimer.h"
 #include "nsDOMProgressEvent.h"
 #include "nsDOMEventTargetHelper.h"
 #include "nsContentUtils.h"
 #include "nsDOMFile.h"
 #include "nsDOMBlobBuilder.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptObjectPrincipal.h"
+
+#include "mozilla/Assertions.h"
 #include "mozilla/dom/BindingUtils.h"
+#include "mozilla/dom/TypedArray.h"
 #include "mozilla/dom/XMLHttpRequestBinding.h"
 #include "mozilla/dom/XMLHttpRequestUploadBinding.h"
 
-#include "mozilla/Assertions.h"
-#include "mozilla/dom/TypedArray.h"
-
 class nsILoadGroup;
 class AsyncVerifyRedirectCallbackForwarder;
 class nsIUnicodeDecoder;
 class nsIDOMFormData;
 
 #define IMPL_EVENT_HANDLER(_lowercase, _capitalized)                    \
   JSObject* GetOn##_lowercase(JSContext* /* unused */ )                 \
   {                                                                     \
@@ -705,30 +704,28 @@ protected:
   nsTArray<RequestHeader> mModifiedRequestHeaders;
 };
 
 #undef IMPL_EVENT_HANDLER
 
 // helper class to expose a progress DOM Event
 
 class nsXMLHttpProgressEvent : public nsIDOMProgressEvent,
-                               public nsIDOMLSProgressEvent,
-                               public nsIDOMNSEvent
+                               public nsIDOMLSProgressEvent
 {
 public:
   nsXMLHttpProgressEvent(nsIDOMProgressEvent* aInner,
                          PRUint64 aCurrentProgress,
                          PRUint64 aMaxProgress,
                          nsPIDOMWindow* aWindow);
   virtual ~nsXMLHttpProgressEvent();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXMLHttpProgressEvent, nsIDOMNSEvent)
+  NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXMLHttpProgressEvent, nsIDOMProgressEvent)
   NS_FORWARD_NSIDOMEVENT(mInner->)
-  NS_FORWARD_NSIDOMNSEVENT(mInner->)
   NS_FORWARD_NSIDOMPROGRESSEVENT(mInner->)
   NS_DECL_NSIDOMLSPROGRESSEVENT
 
 protected:
   void WarnAboutLSProgressEvent(nsIDocument::DeprecatedOperations);
 
   // Use nsDOMProgressEvent so that we can forward
   // most of the method calls easily.
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -170,17 +170,16 @@ nsDOMEvent::~nsDOMEvent()
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMEvent)
 
 DOMCI_DATA(Event, nsDOMEvent)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMEvent)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMEvent)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMNSEvent)
   NS_INTERFACE_MAP_ENTRY(nsIJSNativeInitializer)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Event)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMEvent)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMEvent)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMEvent)
--- a/content/events/src/nsDOMEvent.h
+++ b/content/events/src/nsDOMEvent.h
@@ -2,34 +2,32 @@
 /* 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__
 
 #include "nsIDOMEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsISupports.h"
 #include "nsCOMPtr.h"
 #include "nsIDOMEventTarget.h"
 #include "nsPIDOMWindow.h"
 #include "nsPoint.h"
 #include "nsGUIEvent.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsAutoPtr.h"
 #include "nsIJSNativeInitializer.h"
 
 class nsIContent;
 class nsPresContext;
 struct JSContext;
 struct JSObject;
  
 class nsDOMEvent : public nsIDOMEvent,
-                   public nsIDOMNSEvent,
                    public nsIJSNativeInitializer
 {
 public:
 
   // Note: this enum must be kept in sync with sEventNames in nsDOMEvent.cpp
   enum nsDOMEvents {
     eDOMEvents_mousedown=0,
     eDOMEvents_mouseup,
@@ -186,19 +184,16 @@ public:
   virtual ~nsDOMEvent();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDOMEvent, nsIDOMEvent)
 
   // nsIDOMEvent Interface
   NS_DECL_NSIDOMEVENT
 
-  // nsIDOMNSEvent Interface
-  NS_DECL_NSIDOMNSEVENT
-
   // nsIJSNativeInitializer
   NS_IMETHOD Initialize(nsISupports* aOwner, JSContext* aCx, JSObject* aObj,
                         PRUint32 aArgc, jsval* aArgv);
 
   virtual nsresult InitFromCtor(const nsAString& aType,
                                 JSContext* aCx, jsval* aVal);
 
   void InitPresContextData(nsPresContext* aPresContext);
@@ -246,16 +241,22 @@ protected:
   NS_IMETHOD GetBubbles(bool *aBubbles) { return _to GetBubbles(aBubbles); } \
   NS_IMETHOD GetCancelable(bool *aCancelable) { return _to GetCancelable(aCancelable); } \
   NS_IMETHOD GetTimeStamp(DOMTimeStamp *aTimeStamp) { return _to GetTimeStamp(aTimeStamp); } \
   NS_IMETHOD StopPropagation(void) { return _to StopPropagation(); } \
   NS_IMETHOD PreventDefault(void) { return _to PreventDefault(); } \
   NS_IMETHOD InitEvent(const nsAString & eventTypeArg, bool canBubbleArg, bool cancelableArg) { return _to InitEvent(eventTypeArg, canBubbleArg, cancelableArg); } \
   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 PreventBubble() { return _to PreventBubble(); } \
+  NS_IMETHOD PreventCapture() { return _to PreventCapture(); } \
+  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_(nsEvent *) GetInternalNSEvent(void) { return _to GetInternalNSEvent(); } \
   NS_IMETHOD SetTrusted(bool aTrusted) { return _to SetTrusted(aTrusted); }
 
 #define NS_FORWARD_TO_NSDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION \
   NS_FORWARD_NSIDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION(nsDOMEvent::)
 
--- a/content/events/src/nsDOMUIEvent.h
+++ b/content/events/src/nsDOMUIEvent.h
@@ -24,18 +24,16 @@ public:
   NS_DECL_NSIDOMUIEVENT
   
   // Forward to nsDOMEvent
   NS_FORWARD_TO_NSDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION
   NS_IMETHOD DuplicatePrivateData();
   NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType);
   NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter);
 
-  NS_FORWARD_NSIDOMNSEVENT(nsDOMEvent::)
-
   virtual nsresult InitFromCtor(const nsAString& aType,
                                 JSContext* aCx, jsval* aVal);
 
   static nsIntPoint CalculateScreenPoint(nsPresContext* aPresContext,
                                          nsEvent* aEvent)
   {
     if (!aEvent ||
         (aEvent->eventStructType != NS_MOUSE_EVENT &&
--- a/content/events/src/nsEventDispatcher.cpp
+++ b/content/events/src/nsEventDispatcher.cpp
@@ -540,17 +540,17 @@ nsEventDispatcher::Dispatch(nsISupports*
   nsEventTargetChainItem* targetEtci =
     nsEventTargetChainItem::Create(pool.GetPool(), target);
   NS_ENSURE_TRUE(targetEtci, NS_ERROR_OUT_OF_MEMORY);
   if (!targetEtci->IsValid()) {
     nsEventTargetChainItem::Destroy(pool.GetPool(), targetEtci);
     return NS_ERROR_FAILURE;
   }
 
-  // Make sure that nsIDOMEvent::target and nsIDOMNSEvent::originalTarget
+  // Make sure that nsIDOMEvent::target and nsIDOMEvent::originalTarget
   // point to the last item in the chain.
   if (!aEvent->target) {
     // Note, CurrentTarget() points always to the object returned by
     // GetTargetForEventTargetChain().
     aEvent->target = targetEtci->CurrentTarget();
   } else {
     // XXX But if the target is already set, use that. This is a hack
     //     for the 'load', 'beforeunload' and 'unload' events,
@@ -677,20 +677,18 @@ nsEventDispatcher::DispatchDOMEvent(nsIS
   if (aDOMEvent) {
     nsEvent* innerEvent = aDOMEvent->GetInternalNSEvent();
     NS_ENSURE_TRUE(innerEvent, NS_ERROR_ILLEGAL_VALUE);
 
     bool dontResetTrusted = false;
     if (innerEvent->flags & NS_EVENT_DISPATCHED) {
       innerEvent->target = nullptr;
       innerEvent->originalTarget = nullptr;
-    }
-    else {
-      nsCOMPtr<nsIDOMNSEvent> nsevent(do_QueryInterface(aDOMEvent));
-      nsevent->GetIsTrusted(&dontResetTrusted);
+    } else {
+      aDOMEvent->GetIsTrusted(&dontResetTrusted);
     }
 
     if (!dontResetTrusted) {
       //Check security state to determine if dispatcher is trusted
       aDOMEvent->SetTrusted(nsContentUtils::IsCallerTrustedForWrite());
     }
 
     return nsEventDispatcher::Dispatch(aTarget, aPresContext, innerEvent,
--- a/content/events/src/nsEventListenerManager.cpp
+++ b/content/events/src/nsEventListenerManager.cpp
@@ -9,17 +9,16 @@
 // Microsoft's API Name hackery sucks
 #undef CreateEvent
 
 #include "nsISupports.h"
 #include "nsGUIEvent.h"
 #include "nsDOMEvent.h"
 #include "nsEventListenerManager.h"
 #include "nsCaret.h"
-#include "nsIDOMNSEvent.h"
 #include "nsIDOMEventListener.h"
 #include "nsITextControlFrame.h"
 #include "nsGkAtoms.h"
 #include "nsPIDOMWindow.h"
 #include "nsIJSEventListener.h"
 #include "prmem.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIScriptRuntime.h"
--- a/content/events/src/nsIMEStateManager.cpp
+++ b/content/events/src/nsIMEStateManager.cpp
@@ -12,17 +12,16 @@
 #include "nsPIDOMWindow.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIEditorDocShell.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsPresContext.h"
 #include "nsIDOMWindow.h"
 #include "nsIDOMMouseEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsContentUtils.h"
 #include "nsINode.h"
 #include "nsIFrame.h"
 #include "nsRange.h"
 #include "nsIDOMRange.h"
 #include "nsISelection.h"
 #include "nsISelectionPrivate.h"
 #include "nsISelectionListener.h"
@@ -197,18 +196,17 @@ nsIMEStateManager::OnClickInEditor(nsPre
   if (sPresContext != aPresContext || sContent != aContent) {
     return;
   }
 
   nsCOMPtr<nsIWidget> widget = GetWidget(aPresContext);
   NS_ENSURE_TRUE(widget, );
 
   bool isTrusted;
-  nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aMouseEvent);
-  nsresult rv = NSEvent->GetIsTrusted(&isTrusted);
+  nsresult rv = aMouseEvent->GetIsTrusted(&isTrusted);
   NS_ENSURE_SUCCESS(rv, );
   if (!isTrusted) {
     return; // ignore untrusted event.
   }
 
   PRUint16 button;
   rv = aMouseEvent->GetButton(&button);
   NS_ENSURE_SUCCESS(rv, );
--- a/content/events/test/Makefile.in
+++ b/content/events/test/Makefile.in
@@ -79,18 +79,19 @@ MOCHITEST_FILES = \
 		empty.js \
 		test_bug689564.html \
 		test_bug698929.html \
 		test_eventctors.html \
 		test_bug635465.html \
 		test_bug741666.html \
 		test_dom_keyboard_event.html \
 		test_dom_mouse_event.html \
+		test_bug603008.html \
+		test_bug716822.html \
 		test_bug742376.html \
-		test_bug603008.html \
 		$(NULL)
 
 #bug 585630
 ifneq (mobile,$(MOZ_BUILD_APP))
 MOCHITEST_FILES += \
 		test_dragstart.html \
 		$(NULL)
 endif
--- a/content/events/test/test_bug238987.html
+++ b/content/events/test/test_bug238987.html
@@ -48,17 +48,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
   function handleFocus(e) {
     if (e.target.id == "begin") {
       // if the modifier is set, the test is coming back from the end.
       if (modifier) {
         shouldStop = true;
       }
     } else if (e.target.id == "end") {
-      modifier = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
+      modifier = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
     } else if (modifier) {
       var expected = backwardFocusArray.pop();
       ok(expected == e.target.id,
          "(focus) Backward tabbing, expected [" +
          expected + "], got [" + e.target.id + "]");
     } else {
       var expected = forwardFocusArray.shift();
       is(e.target, document.activeElement, "Wrong activeElement!");
--- a/content/events/test/test_bug409604.html
+++ b/content/events/test/test_bug409604.html
@@ -14,18 +14,18 @@ https://bugzilla.mozilla.org/show_bug.cg
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
   /** Test for Bug 409604 **/
 
-  var modifier = Components.interfaces.nsIDOMNSEvent.ALT_MASK |
-                 Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
+  var modifier = Components.interfaces.nsIDOMEvent.ALT_MASK |
+                 Components.interfaces.nsIDOMEvent.SHIFT_MASK;
   var expectedFocus = "a,c,d,e,f,g,h,i,j,k,l,m,n,p,x,y";
   // XXX the "map" test is causing trouble, see bug 433089
   var focusArray = expectedFocus.split(",");
   var unfocusableElementId = "invalid";
   var unfocusableTags = [
       {tag: "abbr", content: "text", attribs: {title: "something"}},
       {tag: "acronym", content: "text", attribs: {title: "something"}},
       {tag: "address", content: "text"},
--- a/content/events/test/test_bug617528.xul
+++ b/content/events/test/test_bug617528.xul
@@ -76,17 +76,17 @@ https://bugzilla.mozilla.org/show_bug.cg
       var wu = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
         .getInterface(Components.interfaces.nsIDOMWindowUtils);
 
       browser.addEventListener("contextmenu", onContextMenu1, false);
       wu.sendMouseEvent("contextmenu", left, top, 2, 1, 0);
       browser.removeEventListener("contextmenu", onContextMenu1, false);
 
       browser.addEventListener("contextmenu", onContextMenu2, false);
-      var shiftMask = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
+      var shiftMask = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
       wu.sendMouseEvent("contextmenu", left, top, 2, 1, shiftMask);
       browser.removeEventListener("contextmenu", onContextMenu2, false);
 
       _window.close();
       SimpleTest.finish();
     }
 
     addLoadEvent(start);
new file mode 100644
--- /dev/null
+++ b/content/events/test/test_bug716822.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=716822
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 716822</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=716822">Mozilla Bug 716822</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+  
+</div>
+<pre id="test">
+<script type="application/javascript">
+/** Test for Bug 716822 **/
+for (var p in window.NSEvent) {
+  ok(p in window.Event, p + " should be in Event.");
+  is(window.NSEvent[p], window.Event[p], "Value of " + p);
+}
+</script>
+</pre>
+</body>
+</html>
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -53,17 +53,16 @@
 
 #include "nsHTMLParts.h"
 #include "nsContentUtils.h"
 #include "nsString.h"
 #include "nsUnicharUtils.h"
 #include "nsGkAtoms.h"
 #include "nsEventStateManager.h"
 #include "nsIDOMEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsDOMCSSDeclaration.h"
 #include "nsITextControlFrame.h"
 #include "nsIForm.h"
 #include "nsIFormControl.h"
 #include "nsIDOMHTMLFormElement.h"
 #include "nsHTMLFormElement.h"
 #include "nsFocusManager.h"
 
--- a/content/html/content/src/nsHTMLButtonElement.cpp
+++ b/content/html/content/src/nsHTMLButtonElement.cpp
@@ -14,17 +14,16 @@
 #include "nsIForm.h"
 #include "nsFormSubmission.h"
 #include "nsFormSubmissionConstants.h"
 #include "nsIURL.h"
 #include "nsEventStateManager.h"
 #include "nsIFrame.h"
 #include "nsIFormControlFrame.h"
 #include "nsIDOMEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsIDocument.h"
 #include "nsGUIEvent.h"
 #include "nsUnicharUtils.h"
 #include "nsLayoutUtils.h"
 #include "nsEventDispatcher.h"
 #include "nsPresState.h"
 #include "nsLayoutErrors.h"
 #include "nsFocusManager.h"
--- a/content/html/content/src/nsHTMLInputElement.cpp
+++ b/content/html/content/src/nsHTMLInputElement.cpp
@@ -41,17 +41,16 @@
 #include "nsGUIEvent.h"
 #include "nsIIOService.h"
 #include "nsDocument.h"
 #include "nsAttrValueOrString.h"
 
 #include "nsPresState.h"
 #include "nsLayoutErrors.h"
 #include "nsIDOMEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMHTMLCollection.h"
 #include "nsLinebreakConverter.h" //to strip out carriage returns
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsEventDispatcher.h"
 #include "nsLayoutUtils.h"
 
--- a/content/xbl/src/nsXBLEventHandler.cpp
+++ b/content/xbl/src/nsXBLEventHandler.cpp
@@ -5,17 +5,16 @@
 
 #include "nsCOMPtr.h"
 #include "nsIAtom.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsXBLPrototypeHandler.h"
-#include "nsIDOMNSEvent.h"
 #include "nsGUIEvent.h"
 #include "nsContentUtils.h"
 
 nsXBLEventHandler::nsXBLEventHandler(nsXBLPrototypeHandler* aHandler)
   : mProtoHandler(aHandler)
 {
 }
 
@@ -81,20 +80,18 @@ nsXBLKeyEventHandler::~nsXBLKeyEventHand
 
 NS_IMPL_ISUPPORTS1(nsXBLKeyEventHandler, nsIDOMEventListener)
 
 bool
 nsXBLKeyEventHandler::ExecuteMatchedHandlers(nsIDOMKeyEvent* aKeyEvent,
                                              PRUint32 aCharCode,
                                              bool aIgnoreShiftKey)
 {
-  nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
   bool trustedEvent = false;
-  if (domNSEvent)
-    domNSEvent->GetIsTrusted(&trustedEvent);
+  aKeyEvent->GetIsTrusted(&trustedEvent);
 
   nsCOMPtr<nsIDOMEventTarget> target;
   aKeyEvent->GetCurrentTarget(getter_AddRefs(target));
 
   bool executed = false;
   for (PRUint32 i = 0; i < mProtoHandlers.Length(); ++i) {
     nsXBLPrototypeHandler* handler = mProtoHandlers[i];
     bool hasAllowUntrustedAttr = handler->HasAllowUntrustedAttr();
--- a/content/xbl/src/nsXBLPrototypeHandler.cpp
+++ b/content/xbl/src/nsXBLPrototypeHandler.cpp
@@ -22,17 +22,16 @@
 #include "nsIDOMXULElement.h"
 #include "nsIURI.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsFocusManager.h"
 #include "nsEventListenerManager.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMEventListener.h"
-#include "nsIDOMNSEvent.h"
 #include "nsPIDOMWindow.h"
 #include "nsPIWindowRoot.h"
 #include "nsIDOMWindow.h"
 #include "nsIServiceManager.h"
 #include "nsIScriptError.h"
 #include "nsXPIDLString.h"
 #include "nsReadableUtils.h"
 #include "nsGkAtoms.h"
@@ -205,21 +204,18 @@ nsXBLPrototypeHandler::ExecuteHandler(ns
   bool isXULKey = !!(mType & NS_HANDLER_TYPE_XUL);
   bool isXBLCommand = !!(mType & NS_HANDLER_TYPE_XBL_COMMAND);
   NS_ASSERTION(!(isXULKey && isXBLCommand),
                "can't be both a key and xbl command handler");
 
   // XUL handlers and commands shouldn't be triggered by non-trusted
   // events.
   if (isXULKey || isXBLCommand) {
-    nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aEvent);
     bool trustedEvent = false;
-    if (domNSEvent) {
-      domNSEvent->GetIsTrusted(&trustedEvent);
-    }
+    aEvent->GetIsTrusted(&trustedEvent);
 
     if (!trustedEvent)
       return NS_OK;
   }
     
   if (isXBLCommand) {
     return DispatchXBLCommand(aTarget, aEvent);
   }
@@ -355,30 +351,27 @@ nsXBLPrototypeHandler::EnsureEventHandle
 }
 
 nsresult
 nsXBLPrototypeHandler::DispatchXBLCommand(nsIDOMEventTarget* aTarget, nsIDOMEvent* aEvent)
 {
   // This is a special-case optimization to make command handling fast.
   // It isn't really a part of XBL, but it helps speed things up.
 
-  // See if preventDefault has been set.  If so, don't execute.
-  bool preventDefault = false;
-  nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aEvent);
-  if (domNSEvent) {
-    domNSEvent->GetPreventDefault(&preventDefault);
-  }
-
-  if (preventDefault)
-    return NS_OK;
-
   if (aEvent) {
+    // See if preventDefault has been set.  If so, don't execute.
+    bool preventDefault = false;
+    aEvent->GetPreventDefault(&preventDefault);
+    if (preventDefault) {
+      return NS_OK;
+    }
     bool dispatchStopped = aEvent->IsDispatchStopped();
-    if (dispatchStopped)
+    if (dispatchStopped) {
       return NS_OK;
+    }
   }
 
   // Instead of executing JS, let's get the controller for the bound
   // element and call doCommand on it.
   nsCOMPtr<nsIController> controller;
 
   nsCOMPtr<nsPIDOMWindow> privateWindow;
   nsCOMPtr<nsPIWindowRoot> windowRoot(do_QueryInterface(aTarget));
--- a/content/xbl/src/nsXBLWindowKeyHandler.cpp
+++ b/content/xbl/src/nsXBLWindowKeyHandler.cpp
@@ -5,17 +5,16 @@
 
 #include "nsCOMPtr.h"
 #include "nsXBLPrototypeHandler.h"
 #include "nsXBLWindowKeyHandler.h"
 #include "nsIContent.h"
 #include "nsIAtom.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMEventTarget.h"
-#include "nsIDOMNSEvent.h"
 #include "nsXBLService.h"
 #include "nsIServiceManager.h"
 #include "nsGkAtoms.h"
 #include "nsXBLDocumentInfo.h"
 #include "nsIDOMElement.h"
 #include "nsINativeKeyBindings.h"
 #include "nsIController.h"
 #include "nsIControllers.h"
@@ -275,40 +274,37 @@ DoCommandCallback(const char *aCommand, 
       controller->DoCommand(aCommand);
     }
   }
 }
 
 nsresult
 nsXBLWindowKeyHandler::WalkHandlers(nsIDOMKeyEvent* aKeyEvent, nsIAtom* aEventType)
 {
-  nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
   bool prevent;
-  domNSEvent->GetPreventDefault(&prevent);
+  aKeyEvent->GetPreventDefault(&prevent);
   if (prevent)
     return NS_OK;
 
   bool trustedEvent = false;
-  if (domNSEvent) {
-    //Don't process the event if it was not dispatched from a trusted source
-    domNSEvent->GetIsTrusted(&trustedEvent);
-  }
+  // Don't process the event if it was not dispatched from a trusted source
+  aKeyEvent->GetIsTrusted(&trustedEvent);
 
   if (!trustedEvent)
     return NS_OK;
 
   bool isEditor;
   nsresult rv = EnsureHandlers(&isEditor);
   NS_ENSURE_SUCCESS(rv, rv);
   
   nsCOMPtr<nsIDOMElement> el = GetElement();
   if (!el) {
     if (mUserHandler) {
       WalkHandlersInternal(aKeyEvent, aEventType, mUserHandler);
-      domNSEvent->GetPreventDefault(&prevent);
+      aKeyEvent->GetPreventDefault(&prevent);
       if (prevent)
         return NS_OK; // Handled by the user bindings. Our work here is done.
     }
   }
 
   nsCOMPtr<nsIContent> content = do_QueryInterface(el);
   // skip keysets that are disabled
   if (content && content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled,
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -94,17 +94,16 @@
 
 #include "nsReadableUtils.h"
 #include "nsIFrame.h"
 #include "nsNodeInfoManager.h"
 #include "nsXBLBinding.h"
 #include "nsEventDispatcher.h"
 #include "mozAutoDocUpdate.h"
 #include "nsIDOMXULCommandEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsCCUncollectableMarker.h"
 
 namespace css = mozilla::css;
 
 //----------------------------------------------------------------------
 
 static NS_DEFINE_CID(kXULPopupListenerCID,        NS_XULPOPUPLISTENER_CID);
 
@@ -1131,29 +1130,28 @@ nsXULElement::PreHandleEvent(nsEventChai
             nsCOMPtr<nsIDOMElement> commandElt;
             domDoc->GetElementById(command, getter_AddRefs(commandElt));
             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<nsIDOMNSEvent> nsevent =
-                    do_QueryInterface(aVisitor.mDOMEvent);
-                while (nsevent) {
+                nsCOMPtr<nsIDOMEvent> domEvent = aVisitor.mDOMEvent;
+                while (domEvent) {
                     nsCOMPtr<nsIDOMEventTarget> oTarget;
-                    nsevent->GetOriginalTarget(getter_AddRefs(oTarget));
+                    domEvent->GetOriginalTarget(getter_AddRefs(oTarget));
                     NS_ENSURE_STATE(!SameCOMIdentity(oTarget, commandContent));
-                    nsCOMPtr<nsIDOMEvent> tmp;
                     nsCOMPtr<nsIDOMXULCommandEvent> commandEvent =
-                        do_QueryInterface(nsevent);
+                        do_QueryInterface(domEvent);
                     if (commandEvent) {
-                        commandEvent->GetSourceEvent(getter_AddRefs(tmp));
+                        commandEvent->GetSourceEvent(getter_AddRefs(domEvent));
+                    } else {
+                        domEvent = NULL;
                     }
-                    nsevent = do_QueryInterface(tmp);
                 }
 
                 nsInputEvent* orig =
                     static_cast<nsInputEvent*>(aVisitor.mEvent);
                 nsContentUtils::DispatchXULCommand(
                   commandContent,
                   NS_IS_TRUSTED_EVENT(aVisitor.mEvent),
                   aVisitor.mDOMEvent,
--- a/content/xul/content/src/nsXULPopupListener.cpp
+++ b/content/xul/content/src/nsXULPopupListener.cpp
@@ -20,17 +20,16 @@
 #include "nsContentUtils.h"
 #include "nsXULPopupManager.h"
 #include "nsEventStateManager.h"
 #include "nsIScriptContext.h"
 #include "nsIDOMWindow.h"
 #include "nsIDOMXULDocument.h"
 #include "nsIDocument.h"
 #include "nsIDOMEventTarget.h"
-#include "nsIDOMNSEvent.h"
 #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"
@@ -88,22 +87,16 @@ nsXULPopupListener::HandleEvent(nsIDOMEv
   PRUint16 button;
 
   nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aEvent);
   if (!mouseEvent) {
     //non-ui event passed in.  bad things.
     return NS_OK;
   }
 
-  // check if someone has attempted to prevent this action.
-  nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(mouseEvent);
-  if (!domNSEvent) {
-    return NS_OK;
-  }
-
   // Get the node that was clicked on.
   nsCOMPtr<nsIDOMEventTarget> target;
   mouseEvent->GetTarget(getter_AddRefs(target));
   nsCOMPtr<nsIDOMNode> targetNode = do_QueryInterface(target);
 
   if (!targetNode && mIsContext) {
     // Not a DOM node, see if it's the DOM window (bug 380818).
     nsCOMPtr<nsIDOMWindow> domWin = do_QueryInterface(target);
@@ -118,17 +111,17 @@ nsXULPopupListener::HandleEvent(nsIDOMEv
     if (doc)
       targetNode = do_QueryInterface(doc->GetRootElement());
     if (!targetNode) {
       return NS_ERROR_FAILURE;
     }
   }
 
   bool preventDefault;
-  domNSEvent->GetPreventDefault(&preventDefault);
+  mouseEvent->GetPreventDefault(&preventDefault);
   if (preventDefault && targetNode && mIsContext) {
     // Someone called preventDefault on a context menu.
     // Let's make sure they are allowed to do so.
     bool eventEnabled =
       Preferences::GetBool("dom.event.contextmenu.enabled", true);
     if (!eventEnabled) {
       // If the target node is for plug-in, we should not open XUL context
       // menu on windowless plug-ins.
@@ -168,18 +161,16 @@ nsXULPopupListener::HandleEvent(nsIDOMEv
   // submenu of an already-showing popup.  We don't need to do anything at all.
   nsCOMPtr<nsIContent> targetContent = do_QueryInterface(target);
   if (!mIsContext) {
     nsIAtom *tag = targetContent ? targetContent->Tag() : nullptr;
     if (tag == nsGkAtoms::menu || tag == nsGkAtoms::menuitem)
       return NS_OK;
   }
 
-  nsCOMPtr<nsIDOMNSEvent> nsevent = do_QueryInterface(aEvent);
-
   if (mIsContext) {
 #ifndef NS_CONTEXT_MENU_IS_MOUSEUP
     // If the context menu launches on mousedown,
     // we have to fire focus on the content we clicked on
     FireFocusOnTargetContent(targetNode);
 #endif
   }
   else {
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -59,17 +59,16 @@
 #include "nsGlobalWindow.h"
 #include "nsHistory.h"
 #include "nsIContent.h"
 #include "nsIAttribute.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMXMLDocument.h"
 #include "nsIDOMEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMEventListener.h"
 #include "nsContentUtils.h"
 #include "nsDOMWindowUtils.h"
 #include "nsIDOMGlobalPropertyInitializer.h"
 #include "mozilla/Preferences.h"
 #include "nsLocation.h"
 #include "mozilla/Attributes.h"
@@ -2370,17 +2369,16 @@ nsDOMClassInfo::RegisterExternalClasses(
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)                                \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeSelector)                               \
     DOM_CLASSINFO_MAP_ENTRY(nsIInlineEventHandlers)                           \
     DOM_CLASSINFO_MAP_CONDITIONAL_ENTRY(nsITouchEventReceiver,                \
                                         nsDOMTouchEvent::PrefEnabled())
 
 #define DOM_CLASSINFO_EVENT_MAP_ENTRIES                                       \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent)                                      \
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEvent)                                    \
 
 #define DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES                                    \
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMUIEvent)                                    \
     DOM_CLASSINFO_EVENT_MAP_ENTRIES
 
 #define DOM_CLASSINFO_WINDOW_MAP_ENTRIES(_support_indexed_db)                  \
   DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow)                                        \
   DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow)                                      \
@@ -6391,24 +6389,16 @@ nsDOMConstructor::ResolveInterfaceConsta
     class_iid = class_name_struct->mData->mProtoChainInterface;
   } else {
     return NS_OK;
   }
 
   nsresult rv = DefineInterfaceConstants(cx, obj, class_iid);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  // Special case for |Event|, Event needs constants from NSEvent
-  // too for backwards compatibility.
-  if (class_iid->Equals(NS_GET_IID(nsIDOMEvent))) {
-    rv = DefineInterfaceConstants(cx, obj,
-                                  &NS_GET_IID(nsIDOMNSEvent));
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
   // Special case for |IDBKeyRange| which gets funny "static" functions.
   if (class_iid->Equals(NS_GET_IID(nsIIDBKeyRange)) &&
       !indexedDB::IDBKeyRange::DefineConstructors(cx, obj)) {
     return NS_ERROR_FAILURE;
   }
 
   // Special case a few IDB interfaces which for now are getting transitional
   // constants.
@@ -6543,24 +6533,16 @@ ResolvePrototype(nsIXPConnect *aXPConnec
 
     if (!ac.enter(cx, class_obj)) {
       return NS_ERROR_FAILURE;
     }
 
     rv = DefineInterfaceConstants(cx, class_obj, primary_iid);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    // Special case for |Event|, Event needs constants from NSEvent
-    // too for backwards compatibility.
-    if (primary_iid->Equals(NS_GET_IID(nsIDOMEvent))) {
-      rv = DefineInterfaceConstants(cx, class_obj,
-                                    &NS_GET_IID(nsIDOMNSEvent));
-      NS_ENSURE_SUCCESS(rv, rv);
-    }
-
     // Special case for |IDBKeyRange| which gets funny "static" functions.
     if (primary_iid->Equals(NS_GET_IID(nsIIDBKeyRange)) &&
         !indexedDB::IDBKeyRange::DefineConstructors(cx, class_obj)) {
       return NS_ERROR_FAILURE;
     }
 
     // Special case a few IDB interfaces which for now are getting transitional
     // constants.
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2,17 +2,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 "nsIDocShell.h"
 #include "nsPresContext.h"
 #include "nsDOMClassInfoID.h"
 #include "nsDOMError.h"
-#include "nsIDOMNSEvent.h"
+#include "nsIDOMEvent.h"
 #include "nsDOMWindowUtils.h"
 #include "nsQueryContentEventResult.h"
 #include "nsGlobalWindow.h"
 #include "nsIDocument.h"
 #include "nsFocusManager.h"
 #include "nsEventStateManager.h"
 #include "nsFrameManager.h"
 #include "nsRefreshDriver.h"
--- a/dom/bluetooth/nsIDOMBluetoothDeviceEvent.idl
+++ b/dom/bluetooth/nsIDOMBluetoothDeviceEvent.idl
@@ -3,13 +3,13 @@
 /* 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 "nsIDOMEvent.idl"
 
 interface nsIDOMBluetoothDevice;
 
-[scriptable, builtinclass, uuid(49294da3-b698-4a7f-aca2-3f9bc44c7625)]
+[scriptable, builtinclass, uuid(819b4683-23a9-4af9-96b9-2c40a14ecb0b)]
 interface nsIDOMBluetoothDeviceEvent : nsIDOMEvent
 {
   readonly attribute nsIDOMBluetoothDevice device;
 };
--- a/dom/bluetooth/nsIDOMBluetoothPropertyEvent.idl
+++ b/dom/bluetooth/nsIDOMBluetoothPropertyEvent.idl
@@ -1,13 +1,13 @@
 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
 /* vim: set ts=2 et sw=2 tw=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 "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(2604ce78-abaa-4af4-b456-daa4c6386a11)]
+[scriptable, builtinclass, uuid(5927bb1f-e8eb-4b40-ae20-cd02f34412ce)]
 interface nsIDOMBluetoothPropertyEvent : nsIDOMEvent
 {
   readonly attribute DOMString property;
 };
--- a/dom/indexedDB/nsIIDBVersionChangeEvent.idl
+++ b/dom/indexedDB/nsIIDBVersionChangeEvent.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(4eea27c9-a831-40ce-8dbd-e97df9f11b8f)]
+[scriptable, builtinclass, uuid(bb9797ae-6959-47cb-893e-73d3a7018d6d)]
 interface nsIIDBVersionChangeEvent : nsIDOMEvent
 {
   readonly attribute unsigned long long oldVersion;
 
   [implicit_jscontext]
   readonly attribute jsval newVersion;
 };
--- a/dom/interfaces/apps/nsIDOMMozApplicationEvent.idl
+++ b/dom/interfaces/apps/nsIDOMMozApplicationEvent.idl
@@ -1,17 +1,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 "nsIDOMEvent.idl"
 
 interface mozIDOMApplication;
 
-[scriptable, builtinclass, uuid(8f2bfba8-f10e-4f63-a5e0-7a7056e1dbe6)]
+[scriptable, builtinclass, uuid(dae640fb-0a14-42d8-88d3-541c6f077820)]
 interface nsIDOMMozApplicationEvent : nsIDOMEvent
 {
   readonly attribute mozIDOMApplication application;
 
   [noscript] void initMozApplicationEvent(in DOMString aType,
                                           in boolean aCanBubble,
                                           in boolean aCancelable,
                                           in mozIDOMApplication aApplication);
--- a/dom/interfaces/contacts/nsIDOMMozContactChangeEvent.idl
+++ b/dom/interfaces/contacts/nsIDOMMozContactChangeEvent.idl
@@ -1,15 +1,15 @@
 /* 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 "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(6ed26570-b640-11e1-afa6-0800200c9a66)]
+[scriptable, builtinclass, uuid(b05dd60a-bfb8-4428-982e-c7f20e77b673)]
 interface nsIDOMMozContactChangeEvent : nsIDOMEvent
 {
   readonly attribute DOMString contactID;
   readonly attribute DOMString reason;
 
   [noscript] void initMozContactChangeEvent(in DOMString aType,
                                             in boolean aCanBubble,
                                             in boolean aCancelable,
--- a/dom/interfaces/devicestorage/nsIDOMDeviceStorageChangeEvent.idl
+++ b/dom/interfaces/devicestorage/nsIDOMDeviceStorageChangeEvent.idl
@@ -1,16 +1,16 @@
 /* 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 "domstubs.idl"
 #include "nsIDOMEvent.idl"
 
-[scriptable, uuid(468304d6-aab6-4e1e-8ab2-569d9e703431), builtinclass]
+[scriptable, uuid(49bdda6f-430a-4cf8-b535-b97b5b1ed575), builtinclass]
 interface nsIDOMDeviceStorageChangeEvent : nsIDOMEvent
 {
 
   [noscript] void initDeviceStorageChangeEvent(in DOMString eventTypeArg,
                                                in boolean canBubbleArg,
                                                in boolean cancelableArg,
                                                in DOMString path,
                                                in DOMString reason);
--- a/dom/interfaces/events/nsIDOMAnimationEvent.idl
+++ b/dom/interfaces/events/nsIDOMAnimationEvent.idl
@@ -6,17 +6,17 @@
 #include "nsIDOMEvent.idl"
 
 /**
  * Animation events are defined in:
  * http://www.w3.org/TR/css3-animations/#animation-events-
  * http://dev.w3.org/csswg/css3-animations/#animation-events-
  */
 
-[scriptable, builtinclass, uuid(861e0be7-695a-4627-919f-13bccb9eb115)]
+[scriptable, builtinclass, uuid(ecb06edb-8e90-43ce-8f4b-3d1021222e3a)]
 interface nsIDOMAnimationEvent : nsIDOMEvent {
   readonly attribute DOMString          animationName;
   readonly attribute float              elapsedTime;
   void               initAnimationEvent(in DOMString typeArg,
                                         in boolean canBubbleArg,
                                         in boolean cancelableArg,
                                         in DOMString propertyNameArg,
                                         in float elapsedTimeArg);
--- a/dom/interfaces/events/nsIDOMBeforeUnloadEvent.idl
+++ b/dom/interfaces/events/nsIDOMBeforeUnloadEvent.idl
@@ -10,17 +10,17 @@
  * sent to handlers of the "beforeunload" event. This event is
  * non-standard. Interface derived from Microsoft IE's event
  * implementation.
  *
  * http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/events.asp
  *
  */
 
-[scriptable, builtinclass, uuid(f2aafd86-e3e3-461f-96c4-8ad3b5f10e6a)]
+[scriptable, builtinclass, uuid(e5c281d9-ce73-4f95-bc4d-e00d537b63cb)]
 interface nsIDOMBeforeUnloadEvent : nsIDOMEvent
 {
   /**
    * Attribute used to pass back a return value from a beforeunload
    * handler
    */
            attribute DOMString          returnValue;
 };
--- a/dom/interfaces/events/nsIDOMCloseEvent.idl
+++ b/dom/interfaces/events/nsIDOMCloseEvent.idl
@@ -7,17 +7,17 @@
 
 /**
  * The nsIDOMCloseEvent interface is the interface to the event
  * close on a WebSocket object.
  *
  * For more information on this interface, please see
  * http://dev.w3.org/html5/websockets/#closeevent
  */
-[scriptable, builtinclass, uuid(0e3f4687-921c-4141-9615-0fca9e3b02f4)]
+[scriptable, builtinclass, uuid(028a92e8-54ab-42ba-938a-9118d339164f)]
 interface nsIDOMCloseEvent : nsIDOMEvent
 {
   readonly attribute boolean wasClean;
   readonly attribute unsigned short code;
   readonly attribute DOMString reason;
 
   void initCloseEvent(in DOMString aType,
                       in boolean aCanBubble,
--- a/dom/interfaces/events/nsIDOMCommandEvent.idl
+++ b/dom/interfaces/events/nsIDOMCommandEvent.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; 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 "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(588d57f8-e8b0-4abc-b94f-5ba8628b024a)]
+[scriptable, builtinclass, uuid(e2516013-4552-4638-b47b-9f0c24609e02)]
 interface nsIDOMCommandEvent : nsIDOMEvent
 {
   readonly attribute DOMString command;
 
   void initCommandEvent(in DOMString typeArg,
                         in boolean canBubbleArg,
                         in boolean canCancelArg,
                         in DOMString command);
--- a/dom/interfaces/events/nsIDOMCompositionEvent.idl
+++ b/dom/interfaces/events/nsIDOMCompositionEvent.idl
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 "nsIDOMUIEvent.idl"
 
-[scriptable, builtinclass, uuid(681563fa-7b3a-4d1d-a6a4-8f06287560fa)]
+[scriptable, builtinclass, uuid(858d898a-33a8-4c0b-a9ff-fa9a81a5ce09)]
 interface nsIDOMCompositionEvent : nsIDOMUIEvent
 {
   readonly attribute DOMString data;
   readonly attribute DOMString locale;
 
   void initCompositionEvent(in DOMString typeArg,
                             in boolean canBubbleArg,
                             in boolean cancelableArg,
--- a/dom/interfaces/events/nsIDOMCustomEvent.idl
+++ b/dom/interfaces/events/nsIDOMCustomEvent.idl
@@ -1,17 +1,17 @@
 /* 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/. */
 
 #include "nsIDOMEvent.idl"
 interface nsIVariant;
 
-[scriptable, builtinclass, uuid(90277f74-1383-4da8-8748-c7abd420cf06)]
+[scriptable, builtinclass, uuid(86e1b9ee-8080-4217-b3fa-025556d83597)]
 interface nsIDOMCustomEvent : nsIDOMEvent
 {
 
   readonly attribute nsIVariant detail;
 
   void initCustomEvent(in DOMString  typeArg, 
                        in boolean    canBubbleArg, 
                        in boolean    cancelableArg, 
--- a/dom/interfaces/events/nsIDOMDataContainerEvent.idl
+++ b/dom/interfaces/events/nsIDOMDataContainerEvent.idl
@@ -1,17 +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 "nsIDOMEvent.idl"
 #include "nsIVariant.idl"
 
-[scriptable, builtinclass, uuid(2bad4fcf-a56c-447f-bf51-fa39efaac1fc)]
+[scriptable, builtinclass, uuid(8d70345a-144d-48d8-a64d-7a61a15b453c)]
 interface nsIDOMDataContainerEvent : nsIDOMEvent
 {
   /**
    * Return the data associated with the given key.
    *
    * @param  key  the key
    * @return      the data associated with the key
    */
--- a/dom/interfaces/events/nsIDOMDeviceLightEvent.idl
+++ b/dom/interfaces/events/nsIDOMDeviceLightEvent.idl
@@ -1,15 +1,15 @@
 /* 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 "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(4d37e578-9469-4067-8de3-34e6f01f11f3)]
+[scriptable, builtinclass, uuid(9cc7684c-a239-428c-b4f1-34c510c98a1c)]
 interface nsIDOMDeviceLightEvent : nsIDOMEvent
 {
   [noscript] void initDeviceLightEvent(in DOMString eventTypeArg,
                                        in boolean canBubbleArg,
                                        in boolean cancelableArg,
                                        in double value);
 
   readonly attribute double value;
--- a/dom/interfaces/events/nsIDOMDeviceMotionEvent.idl
+++ b/dom/interfaces/events/nsIDOMDeviceMotionEvent.idl
@@ -16,17 +16,17 @@ interface nsIDOMDeviceAcceleration : nsI
 interface nsIDOMDeviceRotationRate : nsISupports
 {
   readonly attribute double alpha;
   readonly attribute double beta;
   readonly attribute double gamma;
 };
 
 
-[scriptable, builtinclass, uuid(cdf9bfef-dd71-4780-889b-edb4780d00da)]
+[scriptable, builtinclass, uuid(1b3d39f2-8f8b-454f-83ad-acbdd32fa2c3)]
 interface nsIDOMDeviceMotionEvent : nsIDOMEvent
 {
   void initDeviceMotionEvent(in DOMString eventTypeArg,
                              in boolean canBubbleArg,
                              in boolean cancelableArg,
                              in nsIDOMDeviceAcceleration acceleration,
                              in nsIDOMDeviceAcceleration accelerationIncludingGravity,
                              in nsIDOMDeviceRotationRate rotationRate,
--- a/dom/interfaces/events/nsIDOMDeviceOrientationEvent.idl
+++ b/dom/interfaces/events/nsIDOMDeviceOrientationEvent.idl
@@ -1,15 +1,15 @@
 /* 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 "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(a2d63af8-966a-443f-ac78-082b06d2878f)]
+[scriptable, builtinclass, uuid(8e37040a-dbbb-41d8-a019-eb687e5e8ec7)]
 interface nsIDOMDeviceOrientationEvent : nsIDOMEvent
 {
   void initDeviceOrientationEvent(in DOMString eventTypeArg,
                                   in boolean canBubbleArg,
                                   in boolean cancelableArg,
                                   in double alpha,
                                   in double beta,
                                   in double gamma,
--- a/dom/interfaces/events/nsIDOMDeviceProximityEvent.idl
+++ b/dom/interfaces/events/nsIDOMDeviceProximityEvent.idl
@@ -1,15 +1,15 @@
 /* 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 "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(de5ac415-5ae9-44ce-ab48-a533cbbef37c)]
+[scriptable, builtinclass, uuid(c33bec2d-5a0b-44ae-b035-d74cd519ec16)]
 interface nsIDOMDeviceProximityEvent : nsIDOMEvent
 {
   [noscript] void initDeviceProximityEvent(in DOMString eventTypeArg,
                                            in boolean canBubbleArg,
                                            in boolean cancelableArg,
                                            in double value,
                                            in double min,
                                            in double max);
--- a/dom/interfaces/events/nsIDOMDragEvent.idl
+++ b/dom/interfaces/events/nsIDOMDragEvent.idl
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "domstubs.idl"
 #include "nsIDOMMouseEvent.idl"
 
 interface nsIDOMDataTransfer;
 
-[scriptable, builtinclass, uuid(25e7df11-dbfe-4b9e-bd75-35090d913865)]
+[scriptable, builtinclass, uuid(2b3b587d-6426-415f-a6f0-4f86eaa562f1)]
 interface nsIDOMDragEvent : nsIDOMMouseEvent
 {
   readonly attribute nsIDOMDataTransfer dataTransfer;
 
   void initDragEvent(in DOMString typeArg,
                      in boolean canBubbleArg,
                      in boolean cancelableArg,
                      in nsIDOMWindow aView,
--- a/dom/interfaces/events/nsIDOMEvent.idl
+++ b/dom/interfaces/events/nsIDOMEvent.idl
@@ -6,16 +6,20 @@
 #include "domstubs.idl"
 
 interface nsIDOMEventTarget;
 
 [ptr] native nsEventPtr(nsEvent);
 [ptr] native IPCMessagePtr(IPC::Message);
 [ptr] native ConstIPCMessagePtr(const IPC::Message);
 %{C++
+#ifdef ERROR
+#undef ERROR
+#endif
+
 class nsEvent;
 class nsCommandEvent;
 class nsPresContext;
 class nsInvalidateRequestList;
 namespace IPC {
 class Message;
 }
 %}
@@ -24,17 +28,17 @@ class Message;
  * The nsIDOMEvent interface is the primary datatype for all events in
  * the Document Object Model.
  *
  * For more information on this interface please see 
  * http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html and
  * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
  */
 
-[scriptable, builtinclass, uuid(a7dc0284-5832-4034-a8a5-d860ce0f21d3)]
+[scriptable, builtinclass, uuid(270c945b-8a65-4170-bc0b-4ec1443cd39f)]
 interface nsIDOMEvent : nsISupports
 {
   // PhaseType
   /**
    * The event isn't being dispatched.
    */
   const unsigned short      NONE                           = 0;
   /**
@@ -160,16 +164,85 @@ interface nsIDOMEvent : nsISupports
   readonly attribute boolean defaultPrevented;
 
   /**
    * Prevents other event listeners from being triggered and,
    * unlike Event.stopPropagation() its effect is immediate.
    */
   void                       stopImmediatePropagation();
 
+  const long MOUSEDOWN    = 0x00000001;
+  const long MOUSEUP      = 0x00000002;
+  const long MOUSEOVER    = 0x00000004;
+  const long MOUSEOUT     = 0x00000008;
+  const long MOUSEMOVE    = 0x00000010;
+  const long MOUSEDRAG    = 0x00000020;
+  const long CLICK        = 0x00000040;
+  const long DBLCLICK     = 0x00000080;
+  const long KEYDOWN      = 0x00000100;
+  const long KEYUP        = 0x00000200;
+  const long KEYPRESS     = 0x00000400;
+  const long DRAGDROP     = 0x00000800;
+  const long FOCUS        = 0x00001000;
+  const long BLUR         = 0x00002000;
+  const long SELECT       = 0x00004000;
+  const long CHANGE       = 0x00008000;
+  const long RESET        = 0x00010000;
+  const long SUBMIT       = 0x00020000;
+  const long SCROLL       = 0x00040000;
+  const long LOAD         = 0x00080000;
+  const long UNLOAD       = 0x00100000;
+  const long XFER_DONE    = 0x00200000;
+  const long ABORT        = 0x00400000;
+  const long ERROR        = 0x00800000;
+  const long LOCATE       = 0x01000000;
+  const long MOVE         = 0x02000000;
+  const long RESIZE       = 0x04000000;
+  const long FORWARD      = 0x08000000;
+  const long HELP         = 0x10000000;
+  const long BACK         = 0x20000000;
+  const long TEXT         = 0x40000000;
+
+  const long ALT_MASK     = 0x00000001;
+  const long CONTROL_MASK = 0x00000002;
+  const long SHIFT_MASK   = 0x00000004;
+  const long META_MASK    = 0x00000008;
+
+  /** The original target of the event, before any retargetings. */
+  readonly attribute nsIDOMEventTarget  originalTarget;
+  /**
+   * The explicit original target of the event.  If the event was retargeted
+   * for some reason other than an anonymous boundary crossing, this will be set
+   * to the target before the retargeting occurs.  For example, mouse events
+   * are retargeted to their parent node when they happen over text nodes (bug
+   * 185889), and in that case .target will show the parent and
+   * .explicitOriginalTarget will show the text node.
+   * .explicitOriginalTarget differs from .originalTarget in that it will never
+   * contain anonymous content.
+   */
+  readonly attribute nsIDOMEventTarget  explicitOriginalTarget;
+
+  /**
+   * @deprecated Use nsIDOMEvent::stopPropagation.
+   */
+  void                      preventBubble();
+
+  /**
+   * @deprecated Use nsIDOMEvent::stopPropagation.
+   */
+  void                      preventCapture();
+
+  /**
+   * @deprecated Use nsIDOMEvent::defaultPrevented.
+   * To be removed in bug 691151.
+   */
+  boolean                   getPreventDefault();
+
+  readonly attribute boolean isTrusted;
+
   [noscript] void duplicatePrivateData();
   [noscript] void setTarget(in nsIDOMEventTarget aTarget);
   [notxpcom] boolean IsDispatchStopped();
   [notxpcom] nsEventPtr GetInternalNSEvent();
   [noscript] void SetTrusted(in boolean aTrusted);
   [notxpcom] void Serialize(in IPCMessagePtr aMsg,
                             in boolean aSerializeInterfaceType);
   [notxpcom] boolean Deserialize(in ConstIPCMessagePtr aMsg, out voidPtr aIter);
--- a/dom/interfaces/events/nsIDOMHashChangeEvent.idl
+++ b/dom/interfaces/events/nsIDOMHashChangeEvent.idl
@@ -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 "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(83a9bc2d-d82d-45cc-8f11-4c919519f6e0)]
+[scriptable, builtinclass, uuid(bf5ce408-971a-4e74-bc57-178f0f8781f3)]
 interface nsIDOMHashChangeEvent : nsIDOMEvent
 {
   readonly attribute DOMString oldURL;
   readonly attribute DOMString newURL;
 
   void initHashChangeEvent(in DOMString typeArg,
                            in boolean canBubbleArg,
                            in boolean cancelableArg,
--- a/dom/interfaces/events/nsIDOMKeyEvent.idl
+++ b/dom/interfaces/events/nsIDOMKeyEvent.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; 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 "nsIDOMUIEvent.idl"
 
-[scriptable, builtinclass, uuid(c43c4852-5bb6-409f-82cd-4f5e842b7208)]
+[scriptable, builtinclass, uuid(5d116380-8432-48cb-a717-200f04c39d2f)]
 interface nsIDOMKeyEvent : nsIDOMUIEvent
 {
   const unsigned long DOM_VK_CANCEL         = 0x03;
   const unsigned long DOM_VK_HELP           = 0x06;
   const unsigned long DOM_VK_BACK_SPACE     = 0x08;
   const unsigned long DOM_VK_TAB            = 0x09;
   const unsigned long DOM_VK_CLEAR          = 0x0C;
   const unsigned long DOM_VK_RETURN         = 0x0D;
--- a/dom/interfaces/events/nsIDOMMessageEvent.idl
+++ b/dom/interfaces/events/nsIDOMMessageEvent.idl
@@ -7,17 +7,17 @@
 
 /**
  * The nsIDOMMessageEvent interface is used for server-sent events and for
  * cross-domain messaging.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#messageevent
  */
-[scriptable, builtinclass, uuid(de8ce1da-220b-4a09-bce7-5c65a80f33c3)]
+[scriptable, builtinclass, uuid(ba747c2b-ec12-4e0d-8de4-d749a6b572e6)]
 interface nsIDOMMessageEvent : nsIDOMEvent
 {
   /**
    * Custom string data associated with this event.
    */
   [implicit_jscontext]
   readonly attribute jsval data;
   
--- a/dom/interfaces/events/nsIDOMMouseEvent.idl
+++ b/dom/interfaces/events/nsIDOMMouseEvent.idl
@@ -8,17 +8,17 @@
 /**
  * The nsIDOMMouseEvent interface is the datatype for all mouse events
  * in the Document Object Model.
  *
  * For more information on this interface please see
  * http://www.w3.org/TR/DOM-Level-2-Events/
  */
 
-[scriptable, builtinclass, uuid(6f4bc64b-1aac-4251-82d3-fd2dc76654a0)]
+[scriptable, builtinclass, uuid(796c3436-5f89-4145-be3a-49808c09fdc6)]
 interface nsIDOMMouseEvent : nsIDOMUIEvent
 {
   readonly attribute long               screenX;
   readonly attribute long               screenY;
 
   readonly attribute long               mozMovementX;
   readonly attribute long               mozMovementY;
 
--- a/dom/interfaces/events/nsIDOMMouseScrollEvent.idl
+++ b/dom/interfaces/events/nsIDOMMouseScrollEvent.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; 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 "nsIDOMMouseEvent.idl"
 
-[scriptable, builtinclass, uuid(44281a27-b48f-47bc-96c9-966f1cab6ae0)]
+[scriptable, builtinclass, uuid(bd3ab39d-eca0-4e2f-889d-4641a2e5d87d)]
 interface nsIDOMMouseScrollEvent : nsIDOMMouseEvent
 {
   const long HORIZONTAL_AXIS = 1;
   const long VERTICAL_AXIS = 2;
 
   readonly attribute long axis;
 
   void                initMouseScrollEvent(in DOMString typeArg,
--- a/dom/interfaces/events/nsIDOMMozTouchEvent.idl
+++ b/dom/interfaces/events/nsIDOMMozTouchEvent.idl
@@ -2,17 +2,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 "nsIDOMMouseEvent.idl"
 
 
-[scriptable, builtinclass, uuid(045b4fd3-c15d-4c76-9d28-9df6f870525a)]
+[scriptable, builtinclass, uuid(58795094-bb6c-488e-af4d-ea029b07869a)]
 interface nsIDOMMozTouchEvent : nsIDOMMouseEvent
 {
   readonly attribute unsigned long streamId;
 
   void initMozTouchEvent(in DOMString typeArg,
                          in boolean canBubbleArg,
                          in boolean cancelableArg,
                          in nsIDOMWindow viewArg,
--- a/dom/interfaces/events/nsIDOMMutationEvent.idl
+++ b/dom/interfaces/events/nsIDOMMutationEvent.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; 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 "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(f5afec28-e7c0-4c1b-9cf4-8f3a5f0634d5)]
+[scriptable, builtinclass, uuid(85e7c0c0-4dbd-40f4-9f58-8050071dcaae)]
 interface nsIDOMMutationEvent : nsIDOMEvent
 {
   const unsigned short      MODIFICATION       = 1;
   const unsigned short      ADDITION           = 2;
   const unsigned short      REMOVAL            = 3;
 
   readonly attribute nsIDOMNode       relatedNode;
   readonly attribute DOMString        prevValue;
--- a/dom/interfaces/events/nsIDOMNSEvent.idl
+++ b/dom/interfaces/events/nsIDOMNSEvent.idl
@@ -6,17 +6,17 @@
 #include "domstubs.idl"
 
 %{C++
 #ifdef ERROR
 #undef ERROR
 #endif
 %}
 
-[scriptable, uuid(07F905C1-9170-4103-86CA-766374DA149A)]
+[scriptable, uuid(2580b4a2-6d85-4ca6-9be2-98f3406ad296)]
 interface nsIDOMNSEvent : nsISupports
 {
   const long MOUSEDOWN    = 0x00000001;
   const long MOUSEUP      = 0x00000002;
   const long MOUSEOVER    = 0x00000004;
   const long MOUSEOUT     = 0x00000008;
   const long MOUSEMOVE    = 0x00000010;
   const long MOUSEDRAG    = 0x00000020;
@@ -45,37 +45,9 @@ interface nsIDOMNSEvent : nsISupports
   const long HELP         = 0x10000000;
   const long BACK         = 0x20000000;
   const long TEXT         = 0x40000000;
 
   const long ALT_MASK     = 0x00000001;
   const long CONTROL_MASK = 0x00000002;
   const long SHIFT_MASK   = 0x00000004;
   const long META_MASK    = 0x00000008;
-
-  /** The original target of the event, before any retargetings. */
-  readonly attribute nsIDOMEventTarget  originalTarget;
-  /**
-   * The explicit original target of the event.  If the event was retargeted
-   * for some reason other than an anonymous boundary crossing, this will be set
-   * to the target before the retargeting occurs.  For example, mouse events
-   * are retargeted to their parent node when they happen over text nodes (bug
-   * 185889), and in that case .target will show the parent and
-   * .explicitOriginalTarget will show the text node.
-   * .explicitOriginalTarget differs from .originalTarget in that it will never
-   * contain anonymous content.
-   */
-  readonly attribute nsIDOMEventTarget  explicitOriginalTarget;
-
-  /**
-   * @deprecated Use nsIDOMEvent::stopPropagation.
-   */
-  void                      preventBubble();
-
-  /**
-   * @deprecated Use nsIDOMEvent::stopPropagation.
-   */
-  void                      preventCapture();
-
-  boolean                   getPreventDefault();
-
-  readonly attribute boolean isTrusted;
 };
--- a/dom/interfaces/events/nsIDOMNotifyAudioAvailableEvent.idl
+++ b/dom/interfaces/events/nsIDOMNotifyAudioAvailableEvent.idl
@@ -2,17 +2,17 @@
 /* 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/. */
 
 #include "nsIDOMEvent.idl"
 #include "nsIVariant.idl"
 
-[scriptable, builtinclass, uuid(8e69e120-5dfc-4327-99e3-003a905a1504)]
+[scriptable, builtinclass, uuid(34139b4f-ac78-4372-98d3-12d6dcf478ef)]
 interface nsIDOMNotifyAudioAvailableEvent : nsIDOMEvent
 {
   [implicit_jscontext]
   readonly attribute jsval  frameBuffer;
 
   readonly attribute float  time;
 
   void initAudioAvailableEvent(in DOMString typeArg,
--- a/dom/interfaces/events/nsIDOMNotifyPaintEvent.idl
+++ b/dom/interfaces/events/nsIDOMNotifyPaintEvent.idl
@@ -7,17 +7,17 @@
 
 interface nsIDOMPaintRequestList;
 
 /**
  * The nsIDOMNotifyPaintEvent interface is used for the MozDOMAfterPaint
  * event, which fires at a window when painting has happened in
  * that window.
  */
-[scriptable, builtinclass, uuid(de7dc0df-8914-4598-8b2a-8c222f4d52d5)]
+[scriptable, builtinclass, uuid(a61dc375-6631-4404-8205-b551afe826c3)]
 interface nsIDOMNotifyPaintEvent : nsIDOMEvent
 {
   /**
    * Get a list of rectangles which are affected. The rectangles are in CSS pixels
    * relative to the viewport origin.
    * If the caller is not trusted (e.g., regular Web content) then only painting
    * caused by the current document is reported; in particular, painting in subdocuments
    * is not reported.
--- a/dom/interfaces/events/nsIDOMPageTransitionEvent.idl
+++ b/dom/interfaces/events/nsIDOMPageTransitionEvent.idl
@@ -6,17 +6,17 @@
 #include "nsIDOMEvent.idl"
 
 /**
  * The nsIDOMPageTransitionEvent interface is used for the pageshow and
  * pagehide events, which are generic events that apply to both page
  * load/unload and saving/restoring a document from session history.
  */
 
-[scriptable, builtinclass, uuid(06910e55-a9fc-4194-bd6e-57a302a7ea2d)]
+[scriptable, builtinclass, uuid(9f3ffe42-bbd2-428d-97f1-6c158c6eb2f9)]
 interface nsIDOMPageTransitionEvent : nsIDOMEvent
 {
   /**
    * Set to true if the document has been or will be persisted across
    * firing of the event.  For example, if a document is being cached in
    * session history, |persisted| is true for the PageHide event.
    */
   readonly attribute boolean persisted;
--- a/dom/interfaces/events/nsIDOMPopStateEvent.idl
+++ b/dom/interfaces/events/nsIDOMPopStateEvent.idl
@@ -2,17 +2,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 "nsIDOMEvent.idl"
 
 interface nsIVariant;
 
-[scriptable, builtinclass, uuid(f7cfe6a2-da6f-4894-affe-e03b39251767)]
+[scriptable, builtinclass, uuid(17ab1333-6fc7-46f9-8513-a82dc6548642)]
 interface nsIDOMPopStateEvent : nsIDOMEvent
 {
   /**
    * The state associated with this popstate event
    */
   readonly attribute nsIVariant state;
 
   void initPopStateEvent(in DOMString typeArg,
--- a/dom/interfaces/events/nsIDOMPopupBlockedEvent.idl
+++ b/dom/interfaces/events/nsIDOMPopupBlockedEvent.idl
@@ -7,17 +7,17 @@
 
 interface nsIURI;
 
 /**
  * The nsIDOMPopupBlockedEvent interface is the datatype for events
  * posted when a popup window is blocked.
  */
 
-[scriptable, builtinclass, uuid(f3a2bae2-291d-43eb-b7f0-bc1b69a890fe)]
+[scriptable, builtinclass, uuid(4eec5417-1687-46ef-9e41-e0a6fbb18927)]
 interface nsIDOMPopupBlockedEvent : nsIDOMEvent
 {
   /**
    * The window object that attempted to open the blocked popup
    * (i.e. the window object on which open() was called).
    */
   readonly attribute nsIDOMWindow requestingWindow;
 
--- a/dom/interfaces/events/nsIDOMProgressEvent.idl
+++ b/dom/interfaces/events/nsIDOMProgressEvent.idl
@@ -8,17 +8,17 @@
 
 /**
  * The nsIDOMProgressEvent is used in the media elements (<video> and <audio>
  * to inform of the progress of the media download. It is currently undefined
  * in the HTML5 specification. This implementation is a placeholder until
  * the specification is complete and is compatible with the WebKit ProgressEvent.
  */
 
-[scriptable, builtinclass, uuid(1b1842f0-b586-4990-9f6a-057e92483a4b)]
+[scriptable, builtinclass, uuid(c5b7ec31-b846-4a9f-b81e-859e76a74f6b)]
 interface nsIDOMProgressEvent : nsIDOMEvent
 {
   readonly attribute boolean lengthComputable;
   readonly attribute unsigned long long loaded;
   readonly attribute unsigned long long total;
   void initProgressEvent(in DOMString typeArg,
                          in boolean canBubbleArg,
                          in boolean cancelableArg,
--- a/dom/interfaces/events/nsIDOMScrollAreaEvent.idl
+++ b/dom/interfaces/events/nsIDOMScrollAreaEvent.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; 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 "nsIDOMUIEvent.idl"
 
-[scriptable, builtinclass, uuid(b1febd2a-fc87-40cd-832d-772a74e0d261)]
+[scriptable, builtinclass, uuid(d38655dd-3be4-4c91-a3b1-0818d396ddf0)]
 interface nsIDOMScrollAreaEvent : nsIDOMUIEvent
 {
   // Scroll area client rect
   readonly attribute float x;
   readonly attribute float y;
   readonly attribute float width;
   readonly attribute float height;
 
--- a/dom/interfaces/events/nsIDOMSimpleGestureEvent.idl
+++ b/dom/interfaces/events/nsIDOMSimpleGestureEvent.idl
@@ -64,17 +64,17 @@
  * Default behavior:
  *
  * Some operating systems support default behaviors for gesture events
  * when they are not handled by the application. Consumers should
  * use event.preventDefault() to prevent default behavior when
  * consuming events.
  */
 
-[scriptable, builtinclass, uuid(5e2a88ce-5032-4758-8578-37c6d7f87d7b)]
+[scriptable, builtinclass, uuid(0748e618-6612-45d7-8d34-1f56d546e04a)]
 interface nsIDOMSimpleGestureEvent : nsIDOMMouseEvent
 {
   /* Swipe direction constants */
   const unsigned long DIRECTION_UP = 1;
   const unsigned long DIRECTION_DOWN = 2;
   const unsigned long DIRECTION_LEFT = 4;
   const unsigned long DIRECTION_RIGHT = 8;
   
--- a/dom/interfaces/events/nsIDOMSmartCardEvent.idl
+++ b/dom/interfaces/events/nsIDOMSmartCardEvent.idl
@@ -1,13 +1,13 @@
 /* -*- Mode: IDL; 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 "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(788edd11-0d81-4b2b-aaaa-f7d38246b0de)]
+[scriptable, builtinclass, uuid(88ae203d-12b8-4a85-a69f-6f83a8b5c226)]
 interface nsIDOMSmartCardEvent : nsIDOMEvent
 {
   readonly attribute DOMString   tokenName;
   [noscript] void Init(in nsIDOMEvent event);
 };
--- a/dom/interfaces/events/nsIDOMTouchEvent.idl
+++ b/dom/interfaces/events/nsIDOMTouchEvent.idl
@@ -40,17 +40,17 @@ interface nsIDOMTouch : nsISupports {
 
 [scriptable, uuid(60706eb7-d50d-4379-b01c-e78e6af84213)]
 interface nsIDOMTouchList : nsISupports {
   readonly attribute unsigned long length;
   nsIDOMTouch item(in unsigned long index);
   nsIDOMTouch identifiedTouch(in long identifier);
 };
 
-[scriptable, builtinclass, uuid(57809468-7c03-4e8a-b080-4e30f157db21)]
+[scriptable, builtinclass, uuid(dfaac0c6-9c4a-4a95-8872-1d58f19d5768)]
 interface nsIDOMTouchEvent : nsIDOMUIEvent {
   readonly attribute nsIDOMTouchList touches;
   readonly attribute nsIDOMTouchList targetTouches;
   readonly attribute nsIDOMTouchList changedTouches;
   readonly attribute boolean         altKey;
   readonly attribute boolean         metaKey;
   readonly attribute boolean         ctrlKey;
   readonly attribute boolean         shiftKey;
--- a/dom/interfaces/events/nsIDOMTransitionEvent.idl
+++ b/dom/interfaces/events/nsIDOMTransitionEvent.idl
@@ -6,17 +6,17 @@
 #include "nsIDOMEvent.idl"
 
 /**
  * Transition events are defined in:
  * http://www.w3.org/TR/css3-transitions/#transition-events-
  * http://dev.w3.org/csswg/css3-transitions/#transition-events-
  */
 
-[scriptable, builtinclass, uuid(208c038e-dbed-42a1-9974-da204e6672f8)]
+[scriptable, builtinclass, uuid(dd6b6318-a69b-4daf-99ad-617876782dfd)]
 interface nsIDOMTransitionEvent : nsIDOMEvent {
   readonly attribute DOMString           propertyName;
   readonly attribute float               elapsedTime;
   void               initTransitionEvent(in DOMString typeArg, 
                                          in boolean canBubbleArg, 
                                          in boolean cancelableArg, 
                                          in DOMString propertyNameArg,
                                          in float elapsedTimeArg);
--- a/dom/interfaces/events/nsIDOMUIEvent.idl
+++ b/dom/interfaces/events/nsIDOMUIEvent.idl
@@ -8,17 +8,17 @@
 /**
  * The nsIDOMUIEvent interface is the datatype for all UI events in the
  * Document Object Model.
  *
  * For more information on this interface please see
  * http://www.w3.org/TR/DOM-Level-2-Events/
  */
 
-[scriptable, builtinclass, uuid(6e6f00c2-29d9-452c-b804-5abb2dc429f3)]
+[scriptable, builtinclass, uuid(415453e6-132a-4902-9a99-cc480f0311b6)]
 interface nsIDOMUIEvent : nsIDOMEvent
 {
   readonly attribute nsIDOMWindow       view;
   readonly attribute long               detail;
   void                      initUIEvent(in DOMString typeArg,
                                         in boolean canBubbleArg,
                                         in boolean cancelableArg,
                                         in nsIDOMWindow viewArg,
--- a/dom/interfaces/events/nsIDOMUserProximityEvent.idl
+++ b/dom/interfaces/events/nsIDOMUserProximityEvent.idl
@@ -1,15 +1,15 @@
 /* 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 "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(caf39525-b0f9-46d1-91d2-59f31dd6e206)]
+[scriptable, builtinclass, uuid(ae59b379-1c58-4baa-bef4-21fca57fc4c2)]
 interface nsIDOMUserProximityEvent : nsIDOMEvent
 {
   [noscript] void initUserProximityEvent(in DOMString eventTypeArg,
                                          in boolean canBubbleArg,
                                          in boolean cancelableArg,
                                          in boolean near);
 
   readonly attribute boolean near;
--- a/dom/interfaces/load-save/nsIDOMLSProgressEvent.idl
+++ b/dom/interfaces/load-save/nsIDOMLSProgressEvent.idl
@@ -2,15 +2,15 @@
 /* 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 "nsIDOMEvent.idl"
 
 interface nsIDOMLSInput;
 
-[scriptable, builtinclass, uuid(068ddb48-1093-4973-800a-7f475f89b788)]
+[scriptable, builtinclass, uuid(522fb528-f550-4e0c-8745-f784bba7cfbe)]
 interface nsIDOMLSProgressEvent : nsIDOMEvent
 {
   readonly attribute nsIDOMLSInput   input;
   readonly attribute unsigned long   position;
   readonly attribute unsigned long   totalSize;
 };
--- a/dom/interfaces/settings/nsIDOMMozSettingsEvent.idl
+++ b/dom/interfaces/settings/nsIDOMMozSettingsEvent.idl
@@ -1,16 +1,16 @@
 /* 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 "nsIDOMEvent.idl"
 interface nsIVariant;
 
-[scriptable, builtinclass, uuid(5e304193-af49-4546-8329-bf7c9159ed98)]
+[scriptable, builtinclass, uuid(109d5b5c-48b2-4d10-a881-72dcf4c27969)]
 interface nsIDOMMozSettingsEvent : nsIDOMEvent
 {
   readonly attribute DOMString  settingName;
   readonly attribute nsIVariant settingValue;
 
   [noscript] void initMozSettingsEvent(in DOMString aType,
                                        in boolean aCanBubble,
                                        in boolean aCancelable,
--- a/dom/interfaces/smil/nsIDOMTimeEvent.idl
+++ b/dom/interfaces/smil/nsIDOMTimeEvent.idl
@@ -8,17 +8,17 @@
 /**
  * The SMIL TimeEvent interface.
  *
  * For more information please refer to:
  * http://www.w3.org/TR/SMIL/smil-timing.html#Events-TimeEvent
  * http://www.w3.org/TR/SVG/animate.html#InterfaceTimeEvent
  */
 
-[scriptable, builtinclass, uuid(988c5b1d-55fc-49a3-87a4-7aa588ee7ed3)]
+[scriptable, builtinclass, uuid(a7ddd388-5fdf-4af8-b3ee-7e1baa636b66)]
 interface nsIDOMTimeEvent : nsIDOMEvent
 {
   readonly attribute long detail;
   readonly attribute nsIDOMWindow view;
   
   void initTimeEvent(in DOMString typeArg,
                      in nsIDOMWindow viewArg,
                      in long detailArg);
--- a/dom/interfaces/storage/nsIDOMStorageEvent.idl
+++ b/dom/interfaces/storage/nsIDOMStorageEvent.idl
@@ -11,17 +11,17 @@
  * http://dev.w3.org/html5/webstorage/#the-storage-event
  * for more information.
  *
  * Event sent to a window when a storage area changes.
  */
 
 interface nsIDOMStorage;
 
-[scriptable, builtinclass, uuid(acb10e76-860f-4a49-8083-661a152ae1b2)]
+[scriptable, builtinclass, uuid(0929c378-2ad6-4fde-a0db-8cd61bbb080c)]
 interface nsIDOMStorageEvent : nsIDOMEvent
 {
   /**
    * Attribute represents the key being changed. The key attribute is null
    * when change has been invoked by the storage clear() method.
    */
   readonly attribute DOMString key;
 
--- a/dom/interfaces/svg/nsIDOMSVGEvent.idl
+++ b/dom/interfaces/svg/nsIDOMSVGEvent.idl
@@ -5,12 +5,12 @@
 
 #include "nsIDOMEvent.idl"
 
 /**
  * For more information on this interface please see
  * http://www.w3.org/TR/SVG11/script.html#InterfaceSVGEvent
  */
 
-[scriptable, builtinclass, uuid(850f465e-1bb9-4cbd-a973-c1283ec70422)]
+[scriptable, builtinclass, uuid(85c1aba6-6ab1-4b7d-b200-2c8ef39267ad)]
 interface nsIDOMSVGEvent : nsIDOMEvent
 {
 };
--- a/dom/interfaces/svg/nsIDOMSVGZoomEvent.idl
+++ b/dom/interfaces/svg/nsIDOMSVGZoomEvent.idl
@@ -8,17 +8,17 @@
 /**
  * For more information on this interface please see
  * http://www.w3.org/TR/SVG11/script.html#InterfaceSVGZoomEvent
  */
 
 interface nsIDOMSVGRect;
 interface nsIDOMSVGPoint;
 
-[scriptable, builtinclass, uuid(8bd39d5a-6a01-4bcf-bb9b-02653ed6d794)]
+[scriptable, builtinclass, uuid(77a0b46e-54cf-4e6e-a962-a2f52389da34)]
 interface nsIDOMSVGZoomEvent : nsIDOMUIEvent
 {
   readonly attribute nsIDOMSVGRect  zoomRectScreen;
   readonly attribute float          previousScale;
   readonly attribute nsIDOMSVGPoint previousTranslate;
   readonly attribute float          newScale;
   readonly attribute nsIDOMSVGPoint newTranslate;
 };
--- a/dom/interfaces/xul/nsIDOMXULCommandEvent.idl
+++ b/dom/interfaces/xul/nsIDOMXULCommandEvent.idl
@@ -6,17 +6,17 @@
 
 /**
  * This interface is supported by command events, which are dispatched to
  * XUL elements as a result of mouse or keyboard activation.
  */
 
 #include "nsIDOMUIEvent.idl"
 
-[scriptable, builtinclass, uuid(b7b54fe0-9983-49bc-bb79-1d8ffcb2260c)]
+[scriptable, builtinclass, uuid(bb7f2758-9a71-4701-984f-eb66f08c4356)]
 interface nsIDOMXULCommandEvent : nsIDOMUIEvent
 {
   /**
    * Command events support the same set of modifier keys as mouse and key
    * events.
    */
   readonly attribute boolean ctrlKey;
   readonly attribute boolean shiftKey;
--- a/dom/network/interfaces/nsIDOMUSSDReceivedEvent.idl
+++ b/dom/network/interfaces/nsIDOMUSSDReceivedEvent.idl
@@ -1,11 +1,11 @@
 /* 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 "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(7a6723d3-2165-4aa6-a4a3-697e7b7af673)]
+[scriptable, builtinclass, uuid(1b8ea6e4-8142-4aba-b174-4d580b5bc294)]
 interface nsIDOMUSSDReceivedEvent : nsIDOMEvent
 {
   readonly attribute DOMString message;
 };
--- a/dom/sms/interfaces/nsIDOMSmsEvent.idl
+++ b/dom/sms/interfaces/nsIDOMSmsEvent.idl
@@ -2,14 +2,14 @@
  * 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 "nsISupports.idl"
 #include "nsIDOMEvent.idl"
 
 interface nsIDOMMozSmsMessage;
 
-[scriptable, builtinclass, uuid(6db4d0d3-6708-47e8-be0f-06e4cdc0b062)]
+[scriptable, builtinclass, uuid(3bde920e-6552-479c-919a-d66589a85a28)]
 interface nsIDOMMozSmsEvent : nsIDOMEvent
 {
   [binaryname(MessageMoz)]
   readonly attribute nsIDOMMozSmsMessage message;
 };
--- a/dom/telephony/nsIDOMCallEvent.idl
+++ b/dom/telephony/nsIDOMCallEvent.idl
@@ -3,13 +3,13 @@
 /* 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 "nsIDOMEvent.idl"
 
 interface nsIDOMTelephonyCall;
 
-[scriptable, builtinclass, uuid(afd4b154-e8ca-46d0-8d1f-eef9b5ffe23f)]
+[scriptable, builtinclass, uuid(d836f0e6-7305-4fdd-966e-ee261fa44001)]
 interface nsIDOMCallEvent : nsIDOMEvent
 {
   readonly attribute nsIDOMTelephonyCall call;
 };
--- a/dom/telephony/nsIDOMVoicemailEvent.idl
+++ b/dom/telephony/nsIDOMVoicemailEvent.idl
@@ -3,16 +3,16 @@
 /* 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 "nsIDOMEvent.idl"
 
 interface nsIDOMMozVoicemailStatus;
 
-[scriptable, builtinclass, uuid(4642f196-1a30-4a9b-986f-7f1574d5cee1)]
+[scriptable, builtinclass, uuid(b2208967-2231-45e4-9a40-57b97908adf8)]
 interface nsIDOMMozVoicemailEvent : nsIDOMEvent
 {
   /**
    * The voicemail status that caused this event to fire
    */
   readonly attribute nsIDOMMozVoicemailStatus status;
 };
--- a/dom/wifi/nsIWifi.idl
+++ b/dom/wifi/nsIWifi.idl
@@ -115,17 +115,17 @@ interface nsIDOMWifiManager : nsISupport
     /**
      * These two events fire when the wifi system is brought online or taken
      * offline.
      */
     attribute nsIDOMEventListener onenabled;
     attribute nsIDOMEventListener ondisabled;
 };
 
-[scriptable, builtinclass, uuid(ba1dab70-b70d-11e1-afa6-0800200c9a66)]
+[scriptable, builtinclass, uuid(f3ef70b0-b2d3-4eb5-8ea4-008f8d330cd6)]
 interface nsIDOMMozWifiStatusChangeEvent : nsIDOMEvent
 {
     /**
      * Network object with a SSID field describing the network affected by
      * this change. This might be null.
      */
     readonly attribute nsIVariant network;
 
@@ -137,17 +137,17 @@ interface nsIDOMMozWifiStatusChangeEvent
 
     [noscript] void initMozWifiStatusChangeEvent(in DOMString aType,
                                                  in boolean aCanBubble,
                                                  in boolean aCancelable,
                                                  in nsIVariant aNetwork,
                                                  in DOMString status);
 };
 
-[scriptable, builtinclass, uuid(b383e950-b70d-11e1-afa6-0800200c9a66)]
+[scriptable, builtinclass, uuid(34994296-d694-4aed-953d-fc25ee25c050)]
 interface nsIDOMMozWifiConnectionInfoEvent : nsIDOMEvent
 {
     /**
      * Network object with an SSID field.
      */
     readonly attribute nsIVariant network;
 
     /**
--- a/editor/libeditor/base/nsEditor.cpp
+++ b/editor/libeditor/base/nsEditor.cpp
@@ -57,17 +57,16 @@
 #include "nsIDOMDocument.h"             // for nsIDOMDocument
 #include "nsIDOMElement.h"              // for nsIDOMElement
 #include "nsIDOMEvent.h"                // for nsIDOMEvent
 #include "nsIDOMEventListener.h"        // for nsIDOMEventListener
 #include "nsIDOMEventTarget.h"          // for nsIDOMEventTarget
 #include "nsIDOMHTMLElement.h"          // for nsIDOMHTMLElement
 #include "nsIDOMKeyEvent.h"             // for nsIDOMKeyEvent, etc
 #include "nsIDOMMouseEvent.h"           // for nsIDOMMouseEvent
-#include "nsIDOMNSEvent.h"              // for nsIDOMNSEvent
 #include "nsIDOMNamedNodeMap.h"         // for nsIDOMNamedNodeMap
 #include "nsIDOMNode.h"                 // for nsIDOMNode, etc
 #include "nsIDOMNodeList.h"             // for nsIDOMNodeList
 #include "nsIDOMRange.h"                // for nsIDOMRange
 #include "nsIDOMText.h"                 // for nsIDOMText
 #include "nsIDocument.h"                // for nsIDocument
 #include "nsIDocumentStateListener.h"   // for nsIDocumentStateListener
 #include "nsIEditActionListener.h"      // for nsIEditActionListener
@@ -5329,31 +5328,30 @@ nsEditor::IsActiveInDOMWindow()
                                          getter_AddRefs(win));
   return SameCOMIdentity(content, piTarget);
 }
 
 bool
 nsEditor::IsAcceptableInputEvent(nsIDOMEvent* aEvent)
 {
   // If the event is trusted, the event should always cause input.
-  nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aEvent);
-  NS_ENSURE_TRUE(NSEvent, false);
+  NS_ENSURE_TRUE(aEvent, false);
 
   // If this is mouse event but this editor doesn't have focus, we shouldn't
   // handle it.
   nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aEvent);
   if (mouseEvent) {
     nsCOMPtr<nsIContent> focusedContent = GetFocusedContent();
     if (!focusedContent) {
       return false;
     }
   }
 
   bool isTrusted;
-  nsresult rv = NSEvent->GetIsTrusted(&isTrusted);
+  nsresult rv = aEvent->GetIsTrusted(&isTrusted);
   NS_ENSURE_SUCCESS(rv, false);
   if (isTrusted) {
     return true;
   }
 
   // Ignore untrusted mouse event.
   // XXX Why are we handling other untrusted input events?
   if (mouseEvent) {
@@ -5385,16 +5383,16 @@ nsEditor::GetSuppressDispatchingInputEve
 NS_IMETHODIMP
 nsEditor::SetSuppressDispatchingInputEvent(bool aSuppress)
 {
   mDispatchInputEvent = !aSuppress;
   return NS_OK;
 }
 
 nsEditor::HandlingTrustedAction::HandlingTrustedAction(nsEditor* aSelf,
-                                                       nsIDOMNSEvent* aEvent)
+                                                       nsIDOMEvent* aEvent)
 {
   MOZ_ASSERT(aEvent);
 
   bool isTrusted = false;
   aEvent->GetIsTrusted(&isTrusted);
   Init(aSelf, isTrusted);
 }
--- a/editor/libeditor/base/nsEditor.h
+++ b/editor/libeditor/base/nsEditor.h
@@ -44,17 +44,16 @@ class nsIContent;
 class nsIDOMCharacterData;
 class nsIDOMDataTransfer;
 class nsIDOMDocument;
 class nsIDOMElement;
 class nsIDOMEvent;
 class nsIDOMEventListener;
 class nsIDOMEventTarget;
 class nsIDOMKeyEvent;
-class nsIDOMNSEvent;
 class nsIDOMNode;
 class nsIDOMRange;
 class nsIDocument;
 class nsIDocumentStateListener;
 class nsIEditActionListener;
 class nsIEditorObserver;
 class nsIInlineSpellChecker;
 class nsINode;
@@ -793,17 +792,17 @@ public:
   NS_STACK_CLASS class HandlingTrustedAction
   {
   public:
     explicit HandlingTrustedAction(nsEditor* aSelf, bool aIsTrusted = true)
     {
       Init(aSelf, aIsTrusted);
     }
 
-    HandlingTrustedAction(nsEditor* aSelf, nsIDOMNSEvent* aEvent);
+    HandlingTrustedAction(nsEditor* aSelf, nsIDOMEvent* aEvent);
 
     ~HandlingTrustedAction()
     {
       mEditor->mHandlingTrustedAction = mWasHandlingTrustedAction;
       mEditor->mHandlingActionCount--;
     }
 
   private:
--- a/editor/libeditor/base/nsEditorEventListener.cpp
+++ b/editor/libeditor/base/nsEditorEventListener.cpp
@@ -22,17 +22,16 @@
 #include "nsIDOMDataTransfer.h"         // for nsIDOMDataTransfer
 #include "nsIDOMDocument.h"             // for nsIDOMDocument
 #include "nsIDOMDragEvent.h"            // for nsIDOMDragEvent
 #include "nsIDOMElement.h"              // for nsIDOMElement
 #include "nsIDOMEvent.h"                // for nsIDOMEvent
 #include "nsIDOMEventTarget.h"          // for nsIDOMEventTarget
 #include "nsIDOMKeyEvent.h"             // for nsIDOMKeyEvent
 #include "nsIDOMMouseEvent.h"           // for nsIDOMMouseEvent
-#include "nsIDOMNSEvent.h"              // for nsIDOMNSEvent
 #include "nsIDOMNode.h"                 // for nsIDOMNode
 #include "nsIDOMRange.h"                // for nsIDOMRange
 #include "nsIDocument.h"                // for nsIDocument
 #include "nsIEditor.h"                  // for nsEditor::GetSelection, etc
 #include "nsIEditorIMESupport.h"
 #include "nsIEditorMailSupport.h"       // for nsIEditorMailSupport
 #include "nsIFocusManager.h"            // for nsIFocusManager
 #include "nsIFormControl.h"             // for nsIFormControl, etc
@@ -448,18 +447,17 @@ nsEditorEventListener::KeyPress(nsIDOMEv
 {
   NS_ENSURE_TRUE(mEditor, NS_ERROR_NOT_AVAILABLE);
 
   if (!mEditor->IsAcceptableInputEvent(aKeyEvent)) {
     return NS_OK;
   }
 
   // Transfer the event's trusted-ness to our editor
-  nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aKeyEvent);
-  nsEditor::HandlingTrustedAction operation(mEditor, NSEvent);
+  nsEditor::HandlingTrustedAction operation(mEditor, aKeyEvent);
 
   // DOM event handling happens in two passes, the client pass and the system
   // pass.  We do all of our processing in the system pass, to allow client
   // handlers the opportunity to cancel events and prevent typing in the editor.
   // If the client pass cancelled the event, defaultPrevented will be true
   // below.
 
   bool defaultPrevented;
@@ -603,18 +601,17 @@ nsEditorEventListener::HandleText(nsIDOM
   textRangeList = textEvent->GetInputRange();
 
   // if we are readonly or disabled, then do nothing.
   if (mEditor->IsReadonly() || mEditor->IsDisabled()) {
     return NS_OK;
   }
 
   // Transfer the event's trusted-ness to our editor
-  nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aTextEvent);
-  nsEditor::HandlingTrustedAction operation(mEditor, NSEvent);
+  nsEditor::HandlingTrustedAction operation(mEditor, aTextEvent);
 
   return mEditor->UpdateIMEComposition(composedText, textRangeList);
 }
 
 /**
  * Drag event implementation
  */
 
@@ -845,18 +842,17 @@ void
 nsEditorEventListener::HandleEndComposition(nsIDOMEvent* aCompositionEvent)
 {
   MOZ_ASSERT(mEditor);
   if (!mEditor->IsAcceptableInputEvent(aCompositionEvent)) {
     return;
   }
 
   // Transfer the event's trusted-ness to our editor
-  nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aCompositionEvent);
-  nsEditor::HandlingTrustedAction operation(mEditor, NSEvent);
+  nsEditor::HandlingTrustedAction operation(mEditor, aCompositionEvent);
 
   mEditor->EndIMEComposition();
 }
 
 NS_IMETHODIMP
 nsEditorEventListener::Focus(nsIDOMEvent* aEvent)
 {
   NS_ENSURE_TRUE(mEditor, NS_ERROR_NOT_AVAILABLE);
--- a/editor/libeditor/html/nsHTMLEditorEventListener.cpp
+++ b/editor/libeditor/html/nsHTMLEditorEventListener.cpp
@@ -9,17 +9,16 @@
 #include "nsError.h"
 #include "nsHTMLEditUtils.h"
 #include "nsHTMLEditor.h"
 #include "nsHTMLEditorEventListener.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMMouseEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMRange.h"
 #include "nsIEditor.h"
 #include "nsIHTMLEditor.h"
 #include "nsIHTMLInlineTableEditor.h"
 #include "nsIHTMLObjectResizer.h"
 #include "nsISelection.h"
 #include "nsISupportsImpl.h"
@@ -99,18 +98,17 @@ nsHTMLEditorEventListener::MouseDown(nsI
 
   bool isContextClick = buttonNumber == 2;
 
   PRInt32 clickCount;
   res = mouseEvent->GetDetail(&clickCount);
   NS_ENSURE_SUCCESS(res, res);
 
   nsCOMPtr<nsIDOMEventTarget> target;
-  nsCOMPtr<nsIDOMNSEvent> internalEvent = do_QueryInterface(aMouseEvent);
-  res = internalEvent->GetExplicitOriginalTarget(getter_AddRefs(target));
+  res = aMouseEvent->GetExplicitOriginalTarget(getter_AddRefs(target));
   NS_ENSURE_SUCCESS(res, res);
   NS_ENSURE_TRUE(target, NS_ERROR_NULL_POINTER);
   nsCOMPtr<nsIDOMElement> element = do_QueryInterface(target);
 
   // Contenteditable should disregard mousedowns outside it
   if (element && !htmlEditor->IsDescendantOfEditorRoot(element)) {
     return NS_OK;
   }
--- a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
+++ b/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
@@ -31,18 +31,16 @@
 #include "nsIDOMDocument.h"
 #include "nsIDOMDocumentType.h"
 #include "nsIDOMElement.h"
 #include "Link.h"
 #include "nsIDOMSVGElement.h"
 #include "nsIDOMSVGTitleElement.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMMouseEvent.h"
-#include "nsIDOMNSEvent.h"
-#include "nsIDOMNamedNodeMap.h"
 #include "nsIFormControl.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIDOMHTMLHtmlElement.h"
 #include "nsIDOMHTMLAppletElement.h"
 #include "nsIDOMHTMLObjectElement.h"
 #include "nsIDOMHTMLEmbedElement.h"
 #include "nsIDOMHTMLDocument.h"
@@ -894,22 +892,20 @@ nsDocShellTreeOwner::RemoveChromeListene
 }
 
 NS_IMETHODIMP
 nsDocShellTreeOwner::HandleEvent(nsIDOMEvent* aEvent)
 {
   nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
   NS_ENSURE_TRUE(dragEvent, NS_ERROR_INVALID_ARG);
 
-  nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aEvent);
-  if (domNSEvent) {
-    bool defaultPrevented;
-    domNSEvent->GetPreventDefault(&defaultPrevented);
-    if (defaultPrevented)
-      return NS_OK;
+  bool defaultPrevented;
+  aEvent->GetPreventDefault(&defaultPrevented);
+  if (defaultPrevented) {
+    return NS_OK;
   }
 
   nsCOMPtr<nsIDroppedLinkHandler> handler = do_GetService("@mozilla.org/content/dropped-link-handler;1");
   if (handler) {
     nsAutoString eventType;
     aEvent->GetType(eventType);
     if (eventType.EqualsLiteral("dragover")) {
       bool canDropLink;
@@ -1642,25 +1638,20 @@ ChromeContextMenuListener::RemoveChromeL
 // end chrome.
 //
 NS_IMETHODIMP
 ChromeContextMenuListener::HandleEvent(nsIDOMEvent* aMouseEvent)
 {
   nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
   NS_ENSURE_TRUE(mouseEvent, NS_ERROR_UNEXPECTED);
 
-  nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aMouseEvent);
-
-  if (domNSEvent) {
-    bool isDefaultPrevented = false;
-    domNSEvent->GetPreventDefault(&isDefaultPrevented);
-
-    if (isDefaultPrevented) {
-      return NS_OK;
-    }
+  bool isDefaultPrevented = false;
+  aMouseEvent->GetPreventDefault(&isDefaultPrevented);
+  if (isDefaultPrevented) {
+    return NS_OK;
   }
 
   nsCOMPtr<nsIDOMEventTarget> targetNode;
   nsresult res = aMouseEvent->GetTarget(getter_AddRefs(targetNode));
   if (NS_FAILED(res))
     return res;
   if (!targetNode)
     return NS_ERROR_NULL_POINTER;
@@ -1674,18 +1665,16 @@ ChromeContextMenuListener::HandleEvent(n
   aMouseEvent->PreventDefault();
   
   // If the listener is a nsIContextMenuListener2, create the info object
   nsCOMPtr<nsIContextMenuListener2> menuListener2(do_QueryInterface(mWebBrowserChrome));
   nsContextMenuInfo *menuInfoImpl = nullptr;
   nsCOMPtr<nsIContextMenuInfo> menuInfo;
   if (menuListener2) {
     menuInfoImpl = new nsContextMenuInfo;
-    if (!menuInfoImpl)
-      return NS_ERROR_OUT_OF_MEMORY;
     menuInfo = menuInfoImpl; 
   }
 
   PRUint32 flags = nsIContextMenuListener::CONTEXT_NONE;
   PRUint32 flags2 = nsIContextMenuListener2::CONTEXT_NONE;
 
   // XXX test for selected text
 
--- a/extensions/widgetutils/src/nsWidgetUtils.cpp
+++ b/extensions/widgetutils/src/nsWidgetUtils.cpp
@@ -28,17 +28,16 @@
 #include "nsIWebBrowser.h"
 #include "nsIObserverService.h"
 #include "nsIDOMEventTarget.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMWindow.h"
 #include "nsIDOMCompositionListener.h"
 #include "nsIDOMTextListener.h"
 #include "nsIDOMMouseEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsIView.h"
 #include "nsGUIEvent.h"
 #include "nsIViewManager.h"
 #include "nsIContentPolicy.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIContent.h"
 #include "nsITimer.h"
 
@@ -109,35 +108,32 @@ nsWidgetUtils::Init()
   rv = obsSvc->AddObserver(this, "domwindowclosed", false);
   NS_ENSURE_SUCCESS(rv, rv);
   mTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
 }
 
 nsresult
 nsWidgetUtils::UpdateFromEvent(nsIDOMEvent *aDOMEvent)
 {
-  nsCOMPtr <nsIDOMMouseEvent> mouseEvent;
-  mouseEvent = do_QueryInterface(aDOMEvent);
+  nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aDOMEvent);
   if (!mouseEvent)
     return NS_OK;
 
-  ((nsIDOMMouseEvent*)mouseEvent)->GetScreenX(&g_lastX);
-  ((nsIDOMMouseEvent*)mouseEvent)->GetScreenY(&g_lastY);
+  mouseEvent->GetScreenX(&g_lastX);
+  mouseEvent->GetScreenY(&g_lastY);
 
   nsCOMPtr<nsIDOMWindow> mWindow;
   nsCOMPtr<nsIDOMNode> mNode;
   nsCOMPtr<nsIDOMNode> mOrigNode;
 
   PRUint32 type = 0;
   bool isXul = false;
   {
-    nsCOMPtr <nsIDOMNSEvent> aEvent = do_QueryInterface(aDOMEvent);
     nsCOMPtr<nsIDOMEventTarget> eventOrigTarget;
-    if (aEvent)
-      aEvent->GetOriginalTarget(getter_AddRefs(eventOrigTarget));
+    aDOMEvent->GetOriginalTarget(getter_AddRefs(eventOrigTarget));
     if (eventOrigTarget)
       mOrigNode = do_QueryInterface(eventOrigTarget);
     isXul = IsXULNode(mOrigNode, &type);
 
   }
   if (isXul)
     return NS_ERROR_FAILURE;
 
--- a/js/xpconnect/src/dom_quickstubs.qsconf
+++ b/js/xpconnect/src/dom_quickstubs.qsconf
@@ -171,18 +171,16 @@ members = [
     'nsIDOMScrollAreaEvent.*',
     'nsIDOMNotifyPaintEvent.*',
     'nsIDOMMessageEvent.*',
     'nsIDOMMouseScrollEvent.*',
     'nsIDOMProgressEvent.lengthComputable',
     'nsIDOMProgressEvent.loaded',
     'nsIDOMProgressEvent.total',
     #XXX Can't quickstub initProgressEvent because it has long long parameters.
-    'nsIDOMNSEvent.originalTarget',
-    'nsIDOMNSEvent.getPreventDefault',
     'nsIDOMUIEvent.which',
     'nsIDOMUIEvent.rangeParent',
     'nsIDOMUIEvent.rangeOffset',
     'nsIDOMUIEvent.pageX',
     'nsIDOMUIEvent.pageY',
     'nsIDOMUIEvent.isChar',
 
     'nsIDOMTouch.*',
--- a/layout/forms/nsFileControlFrame.cpp
+++ b/layout/forms/nsFileControlFrame.cpp
@@ -28,17 +28,16 @@
 #include "nsINodeInfo.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIFile.h"
 #include "nsHTMLInputElement.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsContentUtils.h"
 #include "nsDisplayList.h"
-#include "nsIDOMNSEvent.h"
 #include "nsEventListenerManager.h"
 #ifdef ACCESSIBILITY
 #include "nsAccessibilityService.h"
 #endif
 
 #include "nsInterfaceHashtable.h"
 #include "nsURIHashKey.h"
 #include "nsNetCID.h"
@@ -270,20 +269,19 @@ void
 nsFileControlFrame::SetFocus(bool aOn, bool aRepaint)
 {
 }
 
 bool ShouldProcessMouseClick(nsIDOMEvent* aMouseEvent)
 {
   // only allow the left button
   nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
-  nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aMouseEvent);
-  NS_ENSURE_TRUE(mouseEvent && domNSEvent, false);
+  NS_ENSURE_TRUE(mouseEvent, false);
   bool defaultPrevented = false;
-  domNSEvent->GetPreventDefault(&defaultPrevented);
+  aMouseEvent->GetPreventDefault(&defaultPrevented);
   if (defaultPrevented) {
     return false;
   }
 
   PRUint16 whichButton;
   if (NS_FAILED(mouseEvent->GetButton(&whichButton)) || whichButton != 0) {
     return false;
   }
@@ -398,20 +396,18 @@ nsFileControlFrame::BrowseMouseListener:
     if (!ShouldProcessMouseClick(aEvent))
       return NS_OK;
     
     nsHTMLInputElement* input =
       nsHTMLInputElement::FromContent(mFrame->GetContent());
     return input ? input->FireAsyncClickHandler() : NS_OK;
   }
 
-  nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aEvent);
-  NS_ENSURE_STATE(domNSEvent);
   bool defaultPrevented = false;
-  domNSEvent->GetPreventDefault(&defaultPrevented);
+  aEvent->GetPreventDefault(&defaultPrevented);
   if (defaultPrevented) {
     return NS_OK;
   }
   
   nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
   if (!dragEvent || !IsValidDropData(dragEvent)) {
     return NS_OK;
   }
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -28,17 +28,16 @@
 #include "nsEventListenerManager.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIComponentManager.h"
 #include "nsFontMetrics.h"
 #include "nsIScrollableFrame.h"
-#include "nsIDOMNSEvent.h"
 #include "nsGUIEvent.h"
 #include "nsIServiceManager.h"
 #include "nsINodeInfo.h"
 #ifdef ACCESSIBILITY
 #include "nsAccessibilityService.h"
 #endif
 #include "nsHTMLSelectElement.h"
 #include "nsCSSRendering.h"
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -46,17 +46,16 @@
 #include "nsBoxLayoutState.h"
 //for keylistener for "return" check
 #include "nsIDOMEventTarget.h"
 #include "nsIDocument.h" //observe documents to send onchangenotifications
 #include "nsIStyleSheet.h"//observe documents to send onchangenotifications
 #include "nsIStyleRule.h"//observe documents to send onchangenotifications
 #include "nsIDOMEventListener.h"//observe documents to send onchangenotifications
 #include "nsGUIEvent.h"
-#include "nsIDOMNSEvent.h"
 
 #include "nsIDOMCharacterData.h" //for selection setting helper func
 #include "nsIDOMNodeList.h" //for selection setting helper func
 #include "nsIDOMRange.h" //for selection setting helper func
 #include "nsPIDOMWindow.h" //needed for notify selection changed to update the menus ect.
 #ifdef ACCESSIBILITY
 #include "nsAccessibilityService.h"
 #endif
--- a/layout/forms/test/test_bug348236.html
+++ b/layout/forms/test/test_bug348236.html
@@ -38,17 +38,17 @@ addLoadEvent(function test() {
 
     var
         CI = Components.interfaces,
         WinUtils = window
                    .QueryInterface(CI.nsIInterfaceRequestor)
                    .getInterface(CI.nsIDOMWindowUtils),
         sec = netscape.security,
         eSelect = $("eSelect"),
-        IDOMNSEvent = CI.nsIDOMNSEvent,
+        IDOMEvent = CI.nsIDOMEvent,
         IDOMKeyEvent = CI.nsIDOMKeyEvent,
         timeout = 0 // Choose a larger value like 500 ms if you want to see what's happening.
 
     function keypressOnSelect(key, modifiers) {
         sec.PrivilegeManager.enablePrivilege("UniversalXPConnect")
         WinUtils.focus(eSelect)
         WinUtils.sendKeyEvent("keyup", key, 0, modifiers, WinUtils.KEY_FLAG_PREVENT_DEFAULT)
         WinUtils.sendKeyEvent("keypress", key, 0, modifiers, WinUtils.KEY_FLAG_PREVENT_DEFAULT)
@@ -100,20 +100,20 @@ addLoadEvent(function test() {
     is(eSelect.value, "1", "SELECT value should be 1 after load.")
     is(eSelect.selectedIndex, 0, "SELECT selectedIndex should be 0 after load.")
 
     // Check if sending key events works.
     keypressOnSelect(IDOMKeyEvent.DOM_VK_DOWN, 0)
     is(eSelect.value, "2", "SELECT value should be 2 after pressing Down.")
       
     // Test ALT-Down.
-    testKey(IDOMKeyEvent.DOM_VK_DOWN, IDOMNSEvent.ALT_MASK, "ALT-Down", nextKey1)
+    testKey(IDOMKeyEvent.DOM_VK_DOWN, IDOMEvent.ALT_MASK, "ALT-Down", nextKey1)
     function nextKey1() {
         // Test ALT-Up.
-        testKey(IDOMKeyEvent.DOM_VK_UP, IDOMNSEvent.ALT_MASK, "ALT-Up", nextKey2)
+        testKey(IDOMKeyEvent.DOM_VK_UP, IDOMEvent.ALT_MASK, "ALT-Up", nextKey2)
     }
     function nextKey2() {
         // Test the F4 key on OS/2 and Windows.
         if (/OS\/2|Win/i.test(navigator.platform))
             testKey(IDOMKeyEvent.DOM_VK_F4, 0, "F4", finished)
         else
             finished()
     }
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -40,17 +40,16 @@
 #include "nsIWebBrowserChrome.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMHTMLObjectElement.h"
 #include "nsIDOMHTMLEmbedElement.h"
 #include "nsIDOMHTMLAppletElement.h"
 #include "nsIDOMWindow.h"
 #include "nsIDOMEventTarget.h"
-#include "nsIDOMNSEvent.h"
 #include "nsIDocumentEncoder.h"
 #include "nsXPIDLString.h"
 #include "nsIDOMRange.h"
 #include "nsIPluginWidget.h"
 #include "nsGUIEvent.h"
 #include "nsRenderingContext.h"
 #include "npapi.h"
 #include "nsTransform2D.h"
--- a/layout/printing/nsPrintPreviewListener.cpp
+++ b/layout/printing/nsPrintPreviewListener.cpp
@@ -6,17 +6,17 @@
 
 #include "nsPrintPreviewListener.h"
 
 #include "mozilla/dom/Element.h"
 #include "nsIDOMWindow.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMKeyEvent.h"
-#include "nsIDOMNSEvent.h"
+#include "nsIDOMEvent.h"
 #include "nsIDocument.h"
 #include "nsIDocShell.h"
 #include "nsPresContext.h"
 #include "nsFocusManager.h"
 #include "nsLiteralString.h"
 
 using namespace mozilla;
 
@@ -134,19 +134,18 @@ GetActionForEvent(nsIDOMEvent* aEvent)
   }
   return eEventAction_Suppress;
 }
 
 NS_IMETHODIMP
 nsPrintPreviewListener::HandleEvent(nsIDOMEvent* aEvent)
 {
   nsCOMPtr<nsIDOMEventTarget> target;
-  nsCOMPtr<nsIDOMNSEvent> nsEvent = do_QueryInterface(aEvent);
-  if (nsEvent)
-    nsEvent->GetOriginalTarget(getter_AddRefs(target));
+  if (aEvent)
+    aEvent->GetOriginalTarget(getter_AddRefs(target));
   nsCOMPtr<nsIContent> content(do_QueryInterface(target));
   if (content && !content->IsXUL()) {
     eEventAction action = ::GetActionForEvent(aEvent);
     switch (action) {
       case eEventAction_Tab:
       case eEventAction_ShiftTab:
       {
         nsAutoString eventString;
--- a/layout/xul/base/src/nsMenuBarListener.cpp
+++ b/layout/xul/base/src/nsMenuBarListener.cpp
@@ -1,17 +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 "nsMenuBarListener.h"
 #include "nsMenuBarFrame.h"
 #include "nsMenuPopupFrame.h"
-#include "nsIDOMNSEvent.h"
+#include "nsIDOMEvent.h"
 #include "nsGUIEvent.h"
 
 // Drag & Drop, Clipboard
 #include "nsIServiceManager.h"
 #include "nsWidgetsCID.h"
 #include "nsCOMPtr.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIContent.h"
@@ -112,26 +112,23 @@ nsMenuBarListener::KeyUp(nsIDOMEvent* aK
   nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aKeyEvent);
   if (!keyEvent) {
     return NS_OK;
   }
 
   InitAccessKey();
 
   //handlers shouldn't be triggered by non-trusted events.
-  nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
   bool trustedEvent = false;
+  aKeyEvent->GetIsTrusted(&trustedEvent);
 
-  if (domNSEvent) {
-    domNSEvent->GetIsTrusted(&trustedEvent);
+  if (!trustedEvent) {
+    return NS_OK;
   }
 
-  if (!trustedEvent)
-    return NS_OK;
-
   if (mAccessKey && mAccessKeyFocuses)
   {
     bool defaultPrevented = false;
     aKeyEvent->GetDefaultPrevented(&defaultPrevented);
 
     // On a press of the ALT key by itself, we toggle the menu's 
     // active/inactive state.
     // Get the ascii key code.
@@ -162,42 +159,41 @@ nsMenuBarListener::KeyUp(nsIDOMEvent* aK
   return NS_OK; // means I am NOT consuming event
 }
 
 ////////////////////////////////////////////////////////////////////////
 nsresult
 nsMenuBarListener::KeyPress(nsIDOMEvent* aKeyEvent)
 {
   // if event has already been handled, bail
-  nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
-  if (domNSEvent) {
+  if (aKeyEvent) {
     bool eventHandled = false;
-    domNSEvent->GetPreventDefault(&eventHandled);
+    aKeyEvent->GetPreventDefault(&eventHandled);
     if (eventHandled) {
       return NS_OK;       // don't consume event
     }
   }
 
   //handlers shouldn't be triggered by non-trusted events.
   bool trustedEvent = false;
-  if (domNSEvent) {
-    domNSEvent->GetIsTrusted(&trustedEvent);
+  if (aKeyEvent) {
+    aKeyEvent->GetIsTrusted(&trustedEvent);
   }
 
   if (!trustedEvent)
     return NS_OK;
 
   nsresult retVal = NS_OK;  // default is to not consume event
   
   InitAccessKey();
 
   if (mAccessKey)
   {
     bool preventDefault;
-    domNSEvent->GetPreventDefault(&preventDefault);
+    aKeyEvent->GetPreventDefault(&preventDefault);
     if (!preventDefault) {
       nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aKeyEvent);
       PRUint32 keyCode, charCode;
       keyEvent->GetKeyCode(&keyCode);
       keyEvent->GetCharCode(&charCode);
 
       bool hasAccessKeyCandidates = charCode != 0;
       if (!hasAccessKeyCandidates) {
@@ -302,21 +298,19 @@ nsMenuBarListener::GetModifiers(nsIDOMKe
 
 ////////////////////////////////////////////////////////////////////////
 nsresult
 nsMenuBarListener::KeyDown(nsIDOMEvent* aKeyEvent)
 {
   InitAccessKey();
 
   //handlers shouldn't be triggered by non-trusted events.
-  nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
   bool trustedEvent = false;
-
-  if (domNSEvent) {
-    domNSEvent->GetIsTrusted(&trustedEvent);
+  if (aKeyEvent) {
+    aKeyEvent->GetIsTrusted(&trustedEvent);
   }
 
   if (!trustedEvent)
     return NS_OK;
 
   if (mAccessKey && mAccessKeyFocuses)
   {
     bool defaultPrevented = false;
--- a/layout/xul/base/src/nsMenuBoxObject.cpp
+++ b/layout/xul/base/src/nsMenuBoxObject.cpp
@@ -2,17 +2,16 @@
 /* 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 "nsISupportsUtils.h"
 #include "nsIMenuBoxObject.h"
 #include "nsBoxObject.h"
 #include "nsIFrame.h"
 #include "nsGUIEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsMenuBarFrame.h"
 #include "nsMenuBarListener.h"
 #include "nsMenuFrame.h"
 #include "nsMenuPopupFrame.h"
 
 class nsMenuBoxObject : public nsIMenuBoxObject,
                         public nsBoxObject
 {
@@ -82,22 +81,18 @@ NS_IMETHODIMP nsMenuBoxObject::HandleKey
   *aHandledFlag = false;
   NS_ENSURE_ARG(aKeyEvent);
 
   nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
   if (!pm)
     return NS_OK;
 
   // if event has already been handled, bail
-  nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
-  if (!domNSEvent)
-    return NS_OK;
-
   bool eventHandled = false;
-  domNSEvent->GetPreventDefault(&eventHandled);
+  aKeyEvent->GetPreventDefault(&eventHandled);
   if (eventHandled)
     return NS_OK;
 
   if (nsMenuBarListener::IsAccessKeyPressed(aKeyEvent))
     return NS_OK;
 
   nsMenuFrame* menu = do_QueryFrame(GetFrame(false));
   if (!menu)
--- a/layout/xul/base/src/nsXULPopupManager.cpp
+++ b/layout/xul/base/src/nsXULPopupManager.cpp
@@ -7,17 +7,17 @@
 #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 "nsIDOMNSEvent.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"
 #include "nsIViewManager.h"
@@ -2105,21 +2105,19 @@ nsXULPopupManager::KeyPress(nsIDOMKeyEve
   // When a menu is open, the prevent default flag on a keypress is always set, so
   // that no one else uses the key event.
 
   nsMenuChainItem* item = GetTopVisibleMenu();
   if (item && item->Frame()->IsMenuLocked())
     return NS_OK;
 
   //handlers shouldn't be triggered by non-trusted events.
-  nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
   bool trustedEvent = false;
-
-  if (domNSEvent) {
-    domNSEvent->GetIsTrusted(&trustedEvent);
+  if (aKeyEvent) {
+    aKeyEvent->GetIsTrusted(&trustedEvent);
   }
 
   if (!trustedEvent)
     return NS_OK;
 
   nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aKeyEvent);
   NS_ENSURE_TRUE(keyEvent, NS_ERROR_UNEXPECTED);
   PRUint32 theChar;
--- a/mobile/xul/chrome/content/Util.js
+++ b/mobile/xul/chrome/content/Util.js
@@ -174,20 +174,20 @@ let Util = {
 #elifdef ANDROID
     return (screen.width <= screen.height);
 #else
     return (window.innerWidth <= window.innerHeight);
 #endif
   },
 
   modifierMaskFromEvent: function modifierMaskFromEvent(aEvent) {
-    return (aEvent.altKey   ? Ci.nsIDOMNSEvent.ALT_MASK     : 0) |
-           (aEvent.ctrlKey  ? Ci.nsIDOMNSEvent.CONTROL_MASK : 0) |
-           (aEvent.shiftKey ? Ci.nsIDOMNSEvent.SHIFT_MASK   : 0) |
-           (aEvent.metaKey  ? Ci.nsIDOMNSEvent.META_MASK    : 0);
+    return (aEvent.altKey   ? Ci.nsIDOMEvent.ALT_MASK     : 0) |
+           (aEvent.ctrlKey  ? Ci.nsIDOMEvent.CONTROL_MASK : 0) |
+           (aEvent.shiftKey ? Ci.nsIDOMEvent.SHIFT_MASK   : 0) |
+           (aEvent.metaKey  ? Ci.nsIDOMEvent.META_MASK    : 0);
   },
 
   get displayDPI() {
     delete this.displayDPI;
     return this.displayDPI = this.getWindowUtils(window).displayDPI;
   },
 
   LOCALE_DIR_RTL: -1,
--- a/mobile/xul/chrome/content/content.js
+++ b/mobile/xul/chrome/content/content.js
@@ -489,17 +489,17 @@ let Content = {
         event.y = y;
         element.dispatchEvent(event);
         break;
       }
 
       case "Browser:MouseClick": {
         this.formAssistant.focusSync = true;
         let element = elementFromPoint(x, y);
-        if (modifiers == Ci.nsIDOMNSEvent.CONTROL_MASK) {
+        if (modifiers == Ci.nsIDOMEvent.CONTROL_MASK) {
           let uri = Util.getHrefForElement(element);
           if (uri)
             sendAsyncMessage("Browser:OpenURI", { uri: uri,
                                                   referrer: element.ownerDocument.documentURIObject.spec });
           break;
         }
 
         if (!this.formAssistant.open(element, x, y))
@@ -1513,29 +1513,29 @@ var SelectionHandler = {
         if (elemUnder && elemUnder.ownerDocument.defaultView != this.contentWindow)
           return;
         
         // Use fake mouse events to update the selection
         if (json.type == "end") {
           // Keep the cache in "client" coordinates, but translate for the mouse event
           this.cache.end = { x: json.x, y: json.y };
           let end = { x: this.cache.end.x - scrollOffset.x, y: this.cache.end.y - scrollOffset.y };
-          utils.sendMouseEventToWindow("mousedown", end.x, end.y, 0, 1, Ci.nsIDOMNSEvent.SHIFT_MASK, true);
-          utils.sendMouseEventToWindow("mouseup", end.x, end.y, 0, 1, Ci.nsIDOMNSEvent.SHIFT_MASK, true);
+          utils.sendMouseEventToWindow("mousedown", end.x, end.y, 0, 1, Ci.nsIDOMEvent.SHIFT_MASK, true);
+          utils.sendMouseEventToWindow("mouseup", end.x, end.y, 0, 1, Ci.nsIDOMEvent.SHIFT_MASK, true);
         } else {
           // Keep the cache in "client" coordinates, but translate for the mouse event
           this.cache.start = { x: json.x, y: json.y };
           let start = { x: this.cache.start.x - scrollOffset.x, y: this.cache.start.y - scrollOffset.y };
           let end = { x: this.cache.end.x - scrollOffset.x, y: this.cache.end.y - scrollOffset.y };
         
           utils.sendMouseEventToWindow("mousedown", start.x, start.y, 0, 0, 0, true);
           utils.sendMouseEventToWindow("mouseup", start.x, start.y, 0, 0, 0, true);
         
-          utils.sendMouseEventToWindow("mousedown", end.x, end.y, 0, 1, Ci.nsIDOMNSEvent.SHIFT_MASK, true);
-          utils.sendMouseEventToWindow("mouseup", end.x, end.y, 0, 1, Ci.nsIDOMNSEvent.SHIFT_MASK, true);
+          utils.sendMouseEventToWindow("mousedown", end.x, end.y, 0, 1, Ci.nsIDOMEvent.SHIFT_MASK, true);
+          utils.sendMouseEventToWindow("mouseup", end.x, end.y, 0, 1, Ci.nsIDOMEvent.SHIFT_MASK, true);
         }
 
         // Cache the selected text since the selection might be gone by the time we get the "end" message
         let selection = this.contentWindow.getSelection()
         this.selectedText = selection.toString().trim();
 
         // Update the rect we use to test when finishing the clipboard operation
         let range = selection.getRangeAt(0)
--- a/security/manager/ssl/src/nsSmartCardEvent.cpp
+++ b/security/manager/ssl/src/nsSmartCardEvent.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 "nsSmartCardEvent.h"
 #include "nsIDOMSmartCardEvent.h"
 #include "nsIDOMClassInfo.h"
-#include "nsIDOMNSEvent.h"
 #include "nsIDOMEvent.h"
 #include "nsXPCOM.h"
 
 // DOM event class to handle progress notifications
 nsSmartCardEvent::nsSmartCardEvent(const nsAString &aTokenName) 
     : mInner(nullptr), mTokenName(aTokenName)
 {
 }
@@ -18,47 +17,41 @@ nsSmartCardEvent::nsSmartCardEvent(const
 nsSmartCardEvent::~nsSmartCardEvent()
 {}
 
 //NS_DECL_DOM_CLASSINFO(SmartCardEvent)
 
 NS_INTERFACE_MAP_BEGIN(nsSmartCardEvent)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMSmartCardEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMSmartCardEvent)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMNSEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMEvent)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SmartCardEvent)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_ADDREF(nsSmartCardEvent)
 NS_IMPL_RELEASE(nsSmartCardEvent)
 
 //
 // Init must be called before we do anything with the event.
 //
 NS_IMETHODIMP nsSmartCardEvent::Init(nsIDOMEvent * aInner)
 {
-  nsresult rv;
-
   NS_ASSERTION(aInner, "SmartCardEvent initialized with a null Event");
   mInner = aInner;
-  mNSEvent = do_QueryInterface(mInner, &rv);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
   return mInner->SetTrusted(true);
 }
 
 // nsSmartCard Specific methods
 NS_IMETHODIMP nsSmartCardEvent::GetTokenName(nsAString &aTokenName)
 {
   aTokenName = mTokenName;
   return NS_OK;
 }
 
+// nsIDOMEvent maps
 NS_IMETHODIMP nsSmartCardEvent::DuplicatePrivateData(void)
 {
   NS_ASSERTION(mInner, "SmartCardEvent called without Init");
   return mInner->DuplicatePrivateData();
 }
 
 NS_IMETHODIMP nsSmartCardEvent::SetTarget(nsIDOMEventTarget *aTarget)
 {
@@ -94,55 +87,53 @@ nsSmartCardEvent::Serialize(IPC::Message
 
 bool
 nsSmartCardEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
 {
   NS_ASSERTION(mInner, "SmartCardEvent called without Init");
   return mInner->Deserialize(aMsg, aIter);
 }
 
-// IDOMNSEvent maps
 NS_IMETHODIMP nsSmartCardEvent::GetOriginalTarget(nsIDOMEventTarget * *aOriginalTarget)
 {
-  NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
-  return mNSEvent->GetOriginalTarget(aOriginalTarget);
+  NS_ASSERTION(mInner, "SmartCardEvent called without Init");
+  return mInner->GetOriginalTarget(aOriginalTarget);
 }
 
 NS_IMETHODIMP nsSmartCardEvent::GetExplicitOriginalTarget(nsIDOMEventTarget * *aTarget)
 {
-  NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
-  return mNSEvent->GetExplicitOriginalTarget(aTarget);
+  NS_ASSERTION(mInner, "SmartCardEvent called without Init");
+  return mInner->GetExplicitOriginalTarget(aTarget);
 }
 
 NS_IMETHODIMP nsSmartCardEvent::PreventBubble(void)
 {
-  NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
-  return mNSEvent->PreventBubble();
+  NS_ASSERTION(mInner, "SmartCardEvent called without Init");
+  return mInner->PreventBubble();
 }
 
 NS_IMETHODIMP nsSmartCardEvent::PreventCapture(void)
 {
-  NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
-  return mNSEvent->PreventCapture();
+  NS_ASSERTION(mInner, "SmartCardEvent called without Init");
+  return mInner->PreventCapture();
 }
 
 NS_IMETHODIMP nsSmartCardEvent::GetIsTrusted(bool *aIsTrusted)
 {
-  NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
-  return mNSEvent->GetIsTrusted(aIsTrusted);
+  NS_ASSERTION(mInner, "SmartCardEvent called without Init");
+  return mInner->GetIsTrusted(aIsTrusted);
 }
 
 NS_IMETHODIMP
 nsSmartCardEvent::GetPreventDefault(bool* aReturn)
 {
-  NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
-  return mNSEvent->GetPreventDefault(aReturn);
+  NS_ASSERTION(mInner, "SmartCardEvent called without Init");
+  return mInner->GetPreventDefault(aReturn);
 }
 
-// IDOMEvent maps
 NS_IMETHODIMP nsSmartCardEvent::GetType(nsAString & aType)
 {
   NS_ASSERTION(mInner, "SmartCardEvent called without Init");
   return mInner->GetType(aType);
 }
 
 NS_IMETHODIMP nsSmartCardEvent::GetTarget(nsIDOMEventTarget * *aTarget)
 {
--- a/security/manager/ssl/src/nsSmartCardEvent.h
+++ b/security/manager/ssl/src/nsSmartCardEvent.h
@@ -2,37 +2,33 @@
 /* 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 nsSmartCardEvent_h_
 #define nsSmartCardEvent_h_
 
 #include "nsIDOMSmartCardEvent.h"
 #include "nsIDOMEvent.h"
-#include "nsIDOMNSEvent.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsXPCOM.h"
 
 // Expose SmartCard Specific paramenters to smart card events.
-class nsSmartCardEvent : public nsIDOMSmartCardEvent,
-                         public nsIDOMNSEvent
+class nsSmartCardEvent : public nsIDOMSmartCardEvent
 {
 public:
   nsSmartCardEvent(const nsAString &aTokenName);
   virtual ~nsSmartCardEvent();
 
 
   NS_DECL_ISUPPORTS
+  NS_DECL_NSIDOMEVENT
   NS_DECL_NSIDOMSMARTCARDEVENT
-  NS_DECL_NSIDOMNSEVENT
-  NS_DECL_NSIDOMEVENT
 
 protected:
   nsCOMPtr<nsIDOMEvent> mInner;
-  nsCOMPtr<nsIDOMNSEvent> mNSEvent;
   nsString mTokenName;
 };
 
 #define SMARTCARDEVENT_INSERT "smartcard-insert"
 #define SMARTCARDEVENT_REMOVE "smartcard-remove"
 
 #endif
--- a/toolkit/components/passwordmgr/test/test_basic_form_autocomplete.html
+++ b/toolkit/components/passwordmgr/test/test_basic_form_autocomplete.html
@@ -79,17 +79,17 @@ Login Manager test: multiple login autoc
 <script class="testbody" type="text/javascript">
 
 /** Test for Login Manager: multiple login autocomplete. **/
 
 commonInit();
 
 var uname = $_(1, "uname");
 var pword = $_(1, "pword");
-const shiftModifier = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
+const shiftModifier = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
 
 // Get the pwmgr service
 var pwmgr = SpecialPowers.wrap(Components)
                          .classes["@mozilla.org/login-manager;1"]
                          .getService(Components.interfaces.nsILoginManager);
 ok(pwmgr != null, "nsLoginManager service");
 
 // Create some logins just for this form, since we'll be deleting them.
--- a/toolkit/components/satchel/nsFormFillController.cpp
+++ b/toolkit/components/satchel/nsFormFillController.cpp
@@ -29,17 +29,16 @@
 #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 "nsIDOMNSEvent.h"
 #include "mozilla/dom/Element.h"
 #include "nsContentUtils.h"
 
 NS_IMPL_ISUPPORTS5(nsFormFillController,
                    nsIFormFillController,
                    nsIAutoCompleteInput,
                    nsIAutoCompleteSearch,
                    nsIDOMEventListener,
--- a/toolkit/components/satchel/test/test_form_autocomplete.html
+++ b/toolkit/components/satchel/test/test_form_autocomplete.html
@@ -97,17 +97,17 @@ Form History test: form field autocomple
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Form History autocomplete **/
 
 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
 
 var input = $_(1, "field1");
-const shiftModifier = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
+const shiftModifier = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
 
 // Get the form history service
 var fh = Components.classes["@mozilla.org/satchel/form-history;1"].
          getService(Components.interfaces.nsIFormHistory2);
 ok(fh != null, "got form history service");
 
 fh.removeAllEntries();
 fh.addEntry("field1", "value1");
--- a/toolkit/components/satchel/test/test_form_autocomplete_with_list.html
+++ b/toolkit/components/satchel/test/test_form_autocomplete_with_list.html
@@ -42,17 +42,17 @@ Form History test: form field autocomple
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Form History autocomplete **/
 
 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
 
 var input = $_(1, "field1");
-const shiftModifier = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
+const shiftModifier = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
 
 // Get the form history service
 var fh = Components.classes["@mozilla.org/satchel/form-history;1"].
     getService(Components.interfaces.nsIFormHistory2);
 ok(fh != null, "got form history service");
 
 fh.removeAllEntries();
 fh.addEntry("field1", "historyvalue");
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -12,17 +12,16 @@
 #include "nsNetUtil.h"
 #include "nsIURL.h"
 #include "nsIURI.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIEditorDocShell.h"
 #include "nsISimpleEnumerator.h"
 #include "nsPIDOMWindow.h"
-#include "nsIDOMNSEvent.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefService.h"
 #include "nsString.h"
 #include "nsCRT.h"
 
 #include "nsIDOMNode.h"
 #include "mozilla/dom/Element.h"
 #include "nsIFrame.h"