Bug 1524203 - UrlbarInput: Correctly handle multiple override action keys being pressed. r=mak

Differential Revision: https://phabricator.services.mozilla.com/D18188

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dão Gottwald 2019-01-31 10:13:56 +00:00
Родитель dfea86595f
Коммит a4242462f3
1 изменённых файлов: 4 добавлений и 1 удалений

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

@ -60,6 +60,7 @@ class UrlbarInput {
this.lastQueryContextPromise = Promise.resolve();
this._untrimmedValue = "";
this._suppressStartQuery = false;
this._actionOverrideKeyCount = 0;
// Forward textbox methods and properties.
const METHODS = ["addEventListener", "removeEventListener",
@ -634,8 +635,10 @@ class UrlbarInput {
KeyEvent.DOM_VK_META :
KeyEvent.DOM_VK_CONTROL)) {
if (event.type == "keydown") {
this._actionOverrideKeyCount++;
this.setAttribute("noactions", "true");
} else {
} else if (this._actionOverrideKeyCount &&
--this._actionOverrideKeyCount == 0) {
this.removeAttribute("noactions");
}
}