Bug 962910 Find bar should use a system key event listener r=Ratty a=IanN BETA_BASE_20150330
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Mon, 30 Mar 2015 00:42:04 +0100
changeset 25830 fbcb4f1fdcf7e86942b4a3f30fa40cdcf4ac1672
parent 25829 aa75723b3cff34bdde86ff8c9f010ac0b8173257
child 25831 0fb1ebfb5415895c7da85374f51f4075845fa220
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [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;