Bug 962910 Find bar should use a system key event listener r=Ratty a=IanN RELEASE_BASE_20150330
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Mon, 30 Mar 2015 00:42:42 +0100
changeset 21680 5576f057ebbd3e81298c72d4bf55e50a2cacb4b5
parent 21679 0bf9ce4891ac7e4086248973e8007d20f909877b
child 21681 b7b09f85250cb2d32f8ebfcd463fe9bac02ba924
push id1324
push userneil@parkwaycc.co.uk
push dateSun, 29 Mar 2015 23:42:56 +0000
treeherdercomm-beta@5576f057ebbd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRatty, IanN
bugs962910
Bug 962910 Find bar should use a system key event listener r=Ratty a=IanN a=Ratty for checkin to a CLOSED TREE
suite/browser/nsTypeAheadFind.js
--- a/suite/browser/nsTypeAheadFind.js
+++ b/suite/browser/nsTypeAheadFind.js
@@ -85,17 +85,19 @@ typeAheadFind.prototype = {
       // We also need to listen for find again commands
       Components.classes["@mozilla.org/observer-service;1"]
                 .getService(Components.interfaces.nsIObserverService)
                 .addObserver(this, "nsWebBrowserFind_FindAgain", true);
     }
     if (aTopic == "domwindowopened") {
       // Add our listeners. They get automatically removed on window teardown.
       aSubject.controllers.appendController(new findTypeController(this, aSubject));
-      aSubject.addEventListener("keypress", this, false);
+      Components.classes["@mozilla.org/eventlistenerservice;1"]
+                .getService(Components.interfaces.nsIEventListenerService)
+                .addSystemEventListener(aSubject, "keypress", this, false);
     }
     if (aTopic == "nsWebBrowserFind_FindAgain" &&
         aSubject instanceof Components.interfaces.nsISupportsInterfacePointer &&
         aSubject.data instanceof Components.interfaces.nsIDOMWindow &&
         aSubject.data.top == this.mCurrentWindow &&
         this.mSearchString) {
       // It's a find again. Was it one that we just searched for?
       var w = aSubject.data;