Bug 1455052 part 12. Remove JS uses of nsIDOMEvent. r=masayuki,kmag
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 20 Apr 2018 12:55:31 -0400
changeset 414727 b52ecaafe0df2f53a61c8179c49fb5742a2933a4
parent 414726 9c8bb777529631a14072b9a17345f5a58db65bdf
child 414728 27df0b6428b644d3a28092ccc6251d2fcfe655f0
push id102409
push userbzbarsky@mozilla.com
push dateFri, 20 Apr 2018 16:56:05 +0000
treeherdermozilla-inbound@27df0b6428b6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki, kmag
bugs1455052
milestone61.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 1455052 part 12. Remove JS uses of nsIDOMEvent. r=masayuki,kmag MozReview-Commit-ID: 5g0H3rzxTXt
accessible/tests/mochitest/common.js
accessible/tests/mochitest/events.js
browser/base/content/test/general/browser_gestureSupport.js
browser/modules/BrowserUsageTelemetry.jsm
devtools/client/performance/docs/markers.md
devtools/client/performance/modules/marker-formatters.js
devtools/client/performance/test/unit/test_marker-utils.js
devtools/client/scratchpad/scratchpad.js
devtools/client/shared/developer-toolbar.js
devtools/client/webconsole/components/JSTerm.js
devtools/server/actors/object/previewers.js
devtools/shared/builtin-modules.js
js/xpconnect/src/Sandbox.cpp
js/xpconnect/src/xpcprivate.h
js/xpconnect/tests/mochitest/test_bug790732.html
toolkit/modules/FinderHighlighter.jsm
toolkit/mozapps/update/nsUpdateService.js
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -40,17 +40,16 @@ const nsIAccessibleSelectable = Ci.nsIAc
 const nsIAccessibleTable = Ci.nsIAccessibleTable;
 const nsIAccessibleTableCell = Ci.nsIAccessibleTableCell;
 const nsIAccessibleTraversalRule = Ci.nsIAccessibleTraversalRule;
 const nsIAccessibleValue = Ci.nsIAccessibleValue;
 
 const nsIObserverService = Ci.nsIObserverService;
 
 const nsIDOMDocument = Ci.nsIDOMDocument;
-const nsIDOMEvent = Ci.nsIDOMEvent;
 const nsIDOMNode = Ci.nsIDOMNode;
 const nsIDOMWindow = Ci.nsIDOMWindow;
 
 const nsIPropertyElement = Ci.nsIPropertyElement;
 
 // //////////////////////////////////////////////////////////////////////////////
 // OS detect
 
--- a/accessible/tests/mochitest/events.js
+++ b/accessible/tests/mochitest/events.js
@@ -824,32 +824,33 @@ function eventQueue(aEventType) {
 // eventQueue static members and constants
 
 const kInvokerNotScheduled = 0;
 const kInvokerPending = 1;
 const kInvokerCanceled = 2;
 
 eventQueue.getEventTypeAsString =
   function eventQueue_getEventTypeAsString(aEventOrChecker) {
-  if (aEventOrChecker instanceof nsIDOMEvent)
+  if (Event.isInstance(aEventOrChecker))
     return aEventOrChecker.type;
 
   if (aEventOrChecker instanceof nsIAccessibleEvent)
     return eventTypeToString(aEventOrChecker.eventType);
 
   return (typeof aEventOrChecker.type == "string") ?
     aEventOrChecker.type : eventTypeToString(aEventOrChecker.type);
 };
 
 eventQueue.getEventTargetDescr =
   function eventQueue_getEventTargetDescr(aEventOrChecker, aDontForceTarget) {
-  if (aEventOrChecker instanceof nsIDOMEvent)
+  if (Event.isInstance(aEventOrChecker))
     return prettyName(aEventOrChecker.originalTarget);
 
-  if (aEventOrChecker instanceof nsIDOMEvent)
+  // XXXbz this block doesn't seem to be reachable...
+  if (Event.isInstance(aEventOrChecker))
     return prettyName(aEventOrChecker.accessible);
 
   var descr = aEventOrChecker.targetDescr;
   if (descr)
     return descr;
 
   if (aDontForceTarget)
     return "no target description";
@@ -872,41 +873,41 @@ eventQueue.getEventTarget = function eve
         return aChecker.target.ownerDocument;
     }
   }
   return aChecker.target.ownerDocument;
 };
 
 eventQueue.compareEventTypes =
   function eventQueue_compareEventTypes(aChecker, aEvent) {
-  var eventType = (aEvent instanceof nsIDOMEvent) ?
+  var eventType = Event.isInstance(aEvent) ?
     aEvent.type : aEvent.eventType;
   return aChecker.type == eventType;
 };
 
 eventQueue.compareEvents = function eventQueue_compareEvents(aChecker, aEvent) {
   if (!eventQueue.compareEventTypes(aChecker, aEvent))
     return false;
 
   // If checker provides "match" function then allow the checker to decide
   // whether event is matched.
   if ("match" in aChecker)
     return aChecker.match(aEvent);
 
   var target1 = aChecker.target;
   if (target1 instanceof nsIAccessible) {
-    var target2 = (aEvent instanceof nsIDOMEvent) ?
+    var target2 = Event.isInstance(aEvent) ?
       getAccessible(aEvent.target) : aEvent.accessible;
 
     return target1 == target2;
   }
 
   // If original target isn't suitable then extend interface to support target
   // (original target is used in test_elm_media.html).
-  var target2 = (aEvent instanceof nsIDOMEvent) ?
+  var target2 = Event.isInstance(aEvent) ?
     aEvent.originalTarget : aEvent.DOMNode;
   return target1 == target2;
 };
 
 eventQueue.isSameEvent = function eventQueue_isSameEvent(aChecker, aEvent) {
   // We don't have stored info about handled event other than its type and
   // target, thus we should filter text change and state change events since
   // they may occur on the same element because of complex changes.
@@ -937,17 +938,17 @@ eventQueue.invokerStatusToMsg =
 };
 
 eventQueue.logEvent = function eventQueue_logEvent(aOrigEvent, aMatchedChecker,
                                                    aScenarioIdx, aEventIdx,
                                                    aAreExpectedEventsLeft,
                                                    aInvokerStatus) {
   // Dump DOM event information. Skip a11y event since it is dumped by
   // gA11yEventObserver.
-  if (aOrigEvent instanceof nsIDOMEvent) {
+  if (Event.isInstance(aOrigEvent)) {
     var info = "Event type: " + eventQueue.getEventTypeAsString(aOrigEvent);
     info += ". Target: " + eventQueue.getEventTargetDescr(aOrigEvent);
     gLogger.logToDOM(info);
   }
 
   var infoMsg = "unhandled expected events: " + aAreExpectedEventsLeft +
     ", " + eventQueue.invokerStatusToMsg(aInvokerStatus);
 
--- a/browser/base/content/test/general/browser_gestureSupport.js
+++ b/browser/base/content/test/general/browser_gestureSupport.js
@@ -60,23 +60,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 & Ci.nsIDOMEvent.SHIFT_MASK) != 0,
+  is(evt.shiftKey, (test_expectedModifiers & Event.SHIFT_MASK) != 0,
      "evt.shiftKey did not match expected value");
-  is(evt.ctrlKey, (test_expectedModifiers & Ci.nsIDOMEvent.CONTROL_MASK) != 0,
+  is(evt.ctrlKey, (test_expectedModifiers & Event.CONTROL_MASK) != 0,
      "evt.ctrlKey did not match expected value");
-  is(evt.altKey, (test_expectedModifiers & Ci.nsIDOMEvent.ALT_MASK) != 0,
+  is(evt.altKey, (test_expectedModifiers & Event.ALT_MASK) != 0,
      "evt.altKey did not match expected value");
-  is(evt.metaKey, (test_expectedModifiers & Ci.nsIDOMEvent.META_MASK) != 0,
+  is(evt.metaKey, (test_expectedModifiers & Event.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++;
 }
@@ -158,29 +158,29 @@ function test_TestEventListeners() {
   test_clicks("MozPressTapGesture", 1);
 
   // simple delivery test for edgeui gestures
   e("MozEdgeUIStarted", 0, 0, 0);
   e("MozEdgeUICanceled", 0, 0, 0);
   e("MozEdgeUICompleted", 0, 0, 0);
 
   // event.shiftKey
-  let modifier = Ci.nsIDOMEvent.SHIFT_MASK;
+  let modifier = Event.SHIFT_MASK;
   e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
 
   // event.metaKey
-  modifier = Ci.nsIDOMEvent.META_MASK;
+  modifier = Event.META_MASK;
   e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
 
   // event.altKey
-  modifier = Ci.nsIDOMEvent.ALT_MASK;
+  modifier = Event.ALT_MASK;
   e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
 
   // event.ctrlKey
-  modifier = Ci.nsIDOMEvent.CONTROL_MASK;
+  modifier = Event.CONTROL_MASK;
   e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
 }
 
 function test_eventDispatchListener(evt) {
   test_eventCount++;
   evt.stopPropagation();
 }
 
--- a/browser/modules/BrowserUsageTelemetry.jsm
+++ b/browser/modules/BrowserUsageTelemetry.jsm
@@ -505,17 +505,17 @@ let BrowserUsageTelemetry = {
 
     // The search signal was generated by typing something and pressing enter.
     this._recordSearch(engine, sourceName, "enter");
   },
 
   /**
    * Records the method by which the user selected a urlbar result.
    *
-   * @param {nsIDOMEvent} event
+   * @param {Event} event
    *        The event that triggered the selection.
    * @param {string} userSelectionBehavior
    *        How the user cycled through results before picking the current match.
    *        Could be one of "tab", "arrow" or "none".
    */
   recordUrlbarSelectedResultMethod(event, userSelectionBehavior = "none") {
     // The reason this method relies on urlbarListener instead of having the
     // caller pass in an index is that by the time the urlbar handles a
@@ -529,17 +529,17 @@ let BrowserUsageTelemetry = {
       "FX_URLBAR_SELECTED_RESULT_METHOD",
       userSelectionBehavior
     );
   },
 
   /**
    * Records the method by which the user selected a searchbar result.
    *
-   * @param {nsIDOMEvent} event
+   * @param {Event} event
    *        The event that triggered the selection.
    * @param {number} highlightedIndex
    *        The index that the user chose in the popup, or -1 if there wasn't a
    *        selection.
    */
   recordSearchbarSelectedResultMethod(event, highlightedIndex) {
     this._recordUrlOrSearchbarSelectedResultMethod(
       event, highlightedIndex,
--- a/devtools/client/performance/docs/markers.md
+++ b/devtools/client/performance/docs/markers.md
@@ -17,17 +17,17 @@ Additionally, markers may be created fro
 common type of marker is probably going to be from a GeckoProcessType_Content's
 main thread when debugging content.
 
 ## DOMEvent
 
 Triggered when a DOM event occurs, like a click or a keypress.
 
 * unsigned short eventPhase - a number indicating what phase this event is
-  in (target, bubbling, capturing, maps to Ci.nsIDOMEvent constants)
+  in (target, bubbling, capturing, maps to Event constants)
 * DOMString type - the type of event, like "keypress" or "click"
 
 ## Reflow
 
 Reflow markers (labeled as "Layout") indicate when a change has occurred to
 a DOM element's positioning that requires the frame tree (rendering
 representation of the DOM) to figure out the new position of a handful of
 elements. Fired via `PresShell::DoReflow`
--- a/devtools/client/performance/modules/marker-formatters.js
+++ b/devtools/client/performance/modules/marker-formatters.js
@@ -2,17 +2,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 /**
  * This file contains utilities for creating elements for markers to be displayed,
  * and parsing out the blueprint to generate correct values for markers.
  */
-const { Ci } = require("chrome");
 const { L10N, PREFS } = require("devtools/client/performance/modules/global");
 
 // String used to fill in platform data when it should be hidden.
 const GECKO_SYMBOL = "(Gecko)";
 
 /**
  * Mapping of JS marker causes to a friendlier form. Only
  * markers that are considered "from content" should be labeled here.
@@ -63,23 +62,23 @@ exports.Formatters = {
 
     if ("type" in marker) {
       fields[L10N.getStr("marker.field.DOMEventType")] = marker.type;
     }
 
     if ("eventPhase" in marker) {
       let label;
       switch (marker.eventPhase) {
-        case Ci.nsIDOMEvent.AT_TARGET:
+        case Event.AT_TARGET:
           label = L10N.getStr("marker.value.DOMEventTargetPhase");
           break;
-        case Ci.nsIDOMEvent.CAPTURING_PHASE:
+        case Event.CAPTURING_PHASE:
           label = L10N.getStr("marker.value.DOMEventCapturingPhase");
           break;
-        case Ci.nsIDOMEvent.BUBBLING_PHASE:
+        case Event.BUBBLING_PHASE:
           label = L10N.getStr("marker.value.DOMEventBubblingPhase");
           break;
       }
       fields[L10N.getStr("marker.field.DOMEventPhase")] = label;
     }
 
     return fields;
   },
--- a/devtools/client/performance/test/unit/test_marker-utils.js
+++ b/devtools/client/performance/test/unit/test_marker-utils.js
@@ -39,17 +39,17 @@ add_task(function() {
   equal(fields.length, 1,
         "getMarkerFields() ignores fields that are not found on marker");
   equal(fields[0].label, "Event Type:",
         "getMarkerFields() returns an array with proper label");
   equal(fields[0].value, "mouseclick",
         "getMarkerFields() returns an array with proper value");
 
   fields = MarkerBlueprintUtils.getMarkerFields(
-    { name: "DOMEvent", eventPhase: Ci.nsIDOMEvent.AT_TARGET, type: "mouseclick" });
+    { name: "DOMEvent", eventPhase: Event.AT_TARGET, type: "mouseclick" });
   equal(fields.length, 2,
         "getMarkerFields() returns multiple fields when using a fields function");
   equal(fields[0].label, "Event Type:",
         "getMarkerFields() correctly returns fields via function (1)");
   equal(fields[0].value, "mouseclick",
         "getMarkerFields() correctly returns fields via function (2)");
   equal(fields[1].label, "Phase:",
         "getMarkerFields() correctly returns fields via function (3)");
--- a/devtools/client/scratchpad/scratchpad.js
+++ b/devtools/client/scratchpad/scratchpad.js
@@ -1586,17 +1586,17 @@ var Scratchpad = {
     statusBarField.textContent = this.strings.formatStringFromName(
       "scratchpad.statusBarLineCol", [ line + 1, ch + 1], 2);
   },
 
   /**
    * The Scratchpad window load event handler. This method
    * initializes the Scratchpad window and source editor.
    *
-   * @param nsIDOMEvent aEvent
+   * @param Event aEvent
    */
   onLoad: function SP_onLoad(aEvent) {
     if (aEvent.target != document) {
       return;
     }
 
     let chrome = Services.prefs.getBoolPref(DEVTOOLS_CHROME_ENABLED);
     if (chrome) {
@@ -1723,17 +1723,17 @@ var Scratchpad = {
   redo: function SP_redo() {
     this.editor.redo();
   },
 
   /**
    * The Scratchpad window unload event handler. This method unloads/destroys
    * the source editor.
    *
-   * @param nsIDOMEvent aEvent
+   * @param Event aEvent
    */
   onUnload: function SP_onUnload(aEvent) {
     if (aEvent.target != document) {
       return;
     }
 
     // This event is created only after user uses 'reload and run' feature.
     if (this._reloadAndRunEvent && this.gBrowser) {
@@ -1817,17 +1817,17 @@ var Scratchpad = {
     }
     return true;
   },
 
   /**
    * Handler for window close event. Prompts to save scratchpad if
    * there are unsaved changes.
    *
-   * @param nsIDOMEvent aEvent
+   * @param Event aEvent
    * @param function aCallback
    *        Optional function you want to call when file is saved/closed.
    *        Used mainly for tests.
    */
   onClose: function SP_onClose(aEvent, aCallback) {
     aEvent.preventDefault();
     this.close(aCallback);
   },
--- a/devtools/client/shared/developer-toolbar.js
+++ b/devtools/client/shared/developer-toolbar.js
@@ -700,17 +700,17 @@ DeveloperToolbar.prototype._onPageError 
   this._updateErrorsCount(tabId);
 };
 
 /**
  * The |beforeunload| event handler. This function resets the errors count when
  * a different page starts loading.
  *
  * @private
- * @param nsIDOMEvent ev the beforeunload DOM event.
+ * @param Event ev the beforeunload DOM event.
  */
 DeveloperToolbar.prototype._onPageBeforeUnload = function(ev) {
   let window = ev.target.defaultView;
   if (window.top !== window) {
     return;
   }
 
   let tabs = this._chromeWindow.gBrowser.tabs;
--- a/devtools/client/webconsole/components/JSTerm.js
+++ b/devtools/client/webconsole/components/JSTerm.js
@@ -614,17 +614,17 @@ class JSTerm extends Component {
     }
   }
 
   /* eslint-disable complexity */
   /**
    * The inputNode "keypress" event handler.
    *
    * @private
-   * @param nsIDOMEvent event
+   * @param Event event
    */
   _keyPress(event) {
     let inputNode = this.inputNode;
     let inputValue = this.getInputValue();
     let inputUpdated = false;
 
     if (event.ctrlKey) {
       switch (event.charCode) {
--- a/devtools/server/actors/object/previewers.js
+++ b/devtools/server/actors/object/previewers.js
@@ -641,17 +641,17 @@ previewers.Object = [
                obj.class == "Comment") {
       preview.textContent = hooks.createValueGrip(rawObj.textContent);
     }
 
     return true;
   },
 
   function DOMEvent({obj, hooks}, grip, rawObj) {
-    if (isWorker || !rawObj || !(rawObj instanceof Ci.nsIDOMEvent)) {
+    if (isWorker || !rawObj || !Event.isInstance(rawObj)) {
       return false;
     }
 
     let preview = grip.preview = {
       kind: "DOMEvent",
       type: rawObj.type,
       properties: Object.create(null),
     };
--- a/devtools/shared/builtin-modules.js
+++ b/devtools/shared/builtin-modules.js
@@ -27,31 +27,33 @@ const {
 // Create a single Sandbox to access global properties needed in this module.
 // Sandbox are memory expensive, so we should create as little as possible.
 const {
   atob,
   btoa,
   ChromeUtils,
   CSS,
   CSSRule,
+  Event,
   FileReader,
   FormData,
   indexedDB,
   InspectorUtils,
   TextDecoder,
   TextEncoder,
   URL,
   XMLHttpRequest,
 } = Cu.Sandbox(CC("@mozilla.org/systemprincipal;1", "nsIPrincipal")(), {
   wantGlobalProperties: [
     "atob",
     "btoa",
     "ChromeUtils",
     "CSS",
     "CSSRule",
+    "Event",
     "FileReader",
     "FormData",
     "indexedDB",
     "TextDecoder",
     "TextEncoder",
     "InspectorUtils",
     "URL",
     "XMLHttpRequest",
@@ -258,16 +260,17 @@ exports.globals = {
   //   });
   //
   // Bug 1248830 will work out a better plan here for our content module
   // loading needs, especially as we head towards devtools.html.
   define(factory) {
     factory(this.require, this.exports, this.module);
   },
   Element: Ci.nsIDOMElement,
+  Event,
   FormData,
   isWorker: false,
   loader: {
     lazyGetter: defineLazyGetter,
     lazyImporter: defineLazyModuleGetter,
     lazyServiceGetter: defineLazyServiceGetter,
     lazyRequireGetter: lazyRequireGetter,
     // Defined by Loader.jsm
--- a/js/xpconnect/src/Sandbox.cpp
+++ b/js/xpconnect/src/Sandbox.cpp
@@ -30,16 +30,17 @@
 #include "Crypto.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/BlobBinding.h"
 #include "mozilla/dom/cache/CacheStorage.h"
 #include "mozilla/dom/CSSBinding.h"
 #include "mozilla/dom/CSSRuleBinding.h"
 #include "mozilla/dom/DirectoryBinding.h"
 #include "mozilla/dom/DOMPrefs.h"
+#include "mozilla/dom/EventBinding.h"
 #include "mozilla/dom/IndexedDatabaseManager.h"
 #include "mozilla/dom/Fetch.h"
 #include "mozilla/dom/FileBinding.h"
 #include "mozilla/dom/InspectorUtilsBinding.h"
 #include "mozilla/dom/MessageChannelBinding.h"
 #include "mozilla/dom/MessagePortBinding.h"
 #include "mozilla/dom/NodeFilterBinding.h"
 #include "mozilla/dom/PromiseBinding.h"
@@ -806,16 +807,18 @@ xpc::GlobalProperties::Parse(JSContext* 
         } else if (!strcmp(name.ptr(), "ChromeUtils")) {
             ChromeUtils = true;
         } else if (!strcmp(name.ptr(), "CSS")) {
             CSS = true;
         } else if (!strcmp(name.ptr(), "CSSRule")) {
             CSSRule = true;
         } else if (!strcmp(name.ptr(), "Directory")) {
             Directory = true;
+        } else if (!strcmp(name.ptr(), "Event")) {
+            Event = true;
         } else if (!strcmp(name.ptr(), "File")) {
             File = true;
         } else if (!strcmp(name.ptr(), "FileReader")) {
             FileReader = true;
         } else if (!strcmp(name.ptr(), "FormData")) {
             FormData = true;
         } else if (!strcmp(name.ptr(), "InspectorUtils")) {
             InspectorUtils = true;
@@ -880,16 +883,20 @@ xpc::GlobalProperties::Define(JSContext*
 
     if (CSSRule && !dom::CSSRuleBinding::GetConstructorObject(cx))
         return false;
 
     if (Directory &&
         !dom::DirectoryBinding::GetConstructorObject(cx))
         return false;
 
+    if (Event &&
+        !dom::EventBinding::GetConstructorObject(cx))
+        return false;
+
     if (File &&
         !dom::FileBinding::GetConstructorObject(cx))
         return false;
 
     if (FileReader && !dom::FileReaderBinding::GetConstructorObject(cx))
         return false;
 
     if (FormData &&
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -2595,16 +2595,17 @@ struct GlobalProperties {
     bool DefineInSandbox(JSContext* cx, JS::HandleObject obj);
 
     // Interface objects we can expose.
     bool Blob : 1;
     bool ChromeUtils : 1;
     bool CSS : 1;
     bool CSSRule : 1;
     bool Directory : 1;
+    bool Event : 1;
     bool File : 1;
     bool FileReader: 1;
     bool FormData : 1;
     bool InspectorUtils : 1;
     bool MessageChannel: 1;
     bool NodeFilter : 1;
     bool TextDecoder : 1;
     bool TextEncoder : 1;
--- a/js/xpconnect/tests/mochitest/test_bug790732.html
+++ b/js/xpconnect/tests/mochitest/test_bug790732.html
@@ -21,18 +21,16 @@ async function doTest() {
   is(typeof Components.classes, 'undefined', "Shouldn't have a Cc");
 
   // Check each interface that we shim. We start by checking specific
   // constants for a couple of interfaces, and then once it's pretty clear that
   // it's working as intended we just check that the objects themselves are the
   // same.
   is(Ci.nsIXMLHttpRequest.HEADERS_RECEIVED, XMLHttpRequest.HEADERS_RECEIVED);
   is(Ci.nsIDOMNode.DOCUMENT_NODE, Node.DOCUMENT_NODE);
-  is(Ci.nsIDOMEvent.FOCUS, Event.FOCUS);
-  is(Ci.nsIDOMNSEvent.CLICK, Event.CLICK);
   is(Ci.nsIDOMKeyEvent, KeyEvent);
   is(Ci.nsIDOMMouseEvent, MouseEvent);
   is(Ci.nsIDOMMouseScrollEvent, MouseScrollEvent);
   is(Ci.nsIDOMMutationEvent, MutationEvent);
   is(Ci.nsIDOMUIEvent, UIEvent);
   is(Ci.nsIDOMHTMLMediaElement, HTMLMediaElement);
   is(Ci.nsIDOMRange, Range);
   is(Ci.nsIDOMNodeFilter, NodeFilter);
--- a/toolkit/modules/FinderHighlighter.jsm
+++ b/toolkit/modules/FinderHighlighter.jsm
@@ -328,17 +328,17 @@ FinderHighlighter.prototype = {
   /**
    * Clear all highlighted matches. If modal highlighting is enabled and
    * the outline + dimmed background is currently visible, both will be hidden.
    *
    * @param {nsIDOMWindow} window    The dimmed background will overlay this window.
    *                                 Optional, defaults to the finder window.
    * @param {nsIDOMRange}  skipRange A range that should not be removed from the
    *                                 find selection.
-   * @param {nsIDOMEvent}  event     When called from an event handler, this will
+   * @param {Event}        event     When called from an event handler, this will
    *                                 be the triggering event.
    */
   hide(window, skipRange = null, event = null) {
     try {
       window = window.top;
     } catch (ex) {
       Cu.reportError(ex);
       return;
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -3067,17 +3067,17 @@ Checker.prototype = {
 
   _isHttpStatusCode: function UC__isHttpStatusCode(status) {
     return status >= 100 && status <= 599;
   },
 
   /**
    * The XMLHttpRequest succeeded and the document was loaded.
    * @param   event
-   *          The nsIDOMEvent for the load
+   *          The Event for the load
    */
   onLoad: function UC_onLoad(event) {
     LOG("Checker:onLoad - request completed downloading document");
     Services.prefs.clearUserPref("security.pki.mitm_canary_issuer");
 
     try {
       // Analyze the resulting DOM and determine the set of updates.
       var updates = this._updates;
@@ -3108,17 +3108,17 @@ Checker.prototype = {
 
     this._callback = null;
     this._request = null;
   },
 
   /**
    * There was an error of some kind during the XMLHttpRequest
    * @param   event
-   *          The nsIDOMEvent for the error
+   *          The Event for the error
    */
   onError: function UC_onError(event) {
     var request = event.target;
     var status = this._getChannelStatus(request);
     LOG("Checker:onError - request.status: " + status);
 
     // Set MitM pref.
     try {