Bug 1439974. Pass actual keypress events to the finder's keypress method, even in the e10s case. r=felipe

We could also, or in addition, pull the KeyboardEvent thing off the given
docshell in Finder.jsm and not rely on having these constants on the event
object we have.

I did look through the other places I changed in
https://hg.mozilla.org/mozilla-central/rev/b01bd36c3899 and the other ones that
get the constants off events look like they're EventListener instances, so
should have actual events coming via normal event dispatch.
This commit is contained in:
Boris Zbarsky 2018-02-22 21:40:58 -05:00
Родитель bb086de151
Коммит 529fd4ac43
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -209,6 +209,10 @@ function RemoteFinderListener(global) {
this._finder = new Finder(global.docShell);
this._finder.addResultListener(this);
this._global = global;
this.KeyboardEvent =
global.docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow).KeyboardEvent;
for (let msg of this.MESSAGES) {
global.addMessageListener(msg, this);
@ -314,7 +318,7 @@ RemoteFinderListener.prototype = {
break;
case "Finder:KeyPress":
this._finder.keyPress(data);
this._finder.keyPress(new this.KeyboardEvent("keypress", data));
break;
case "Finder:MatchesCount":