From a4242462f37acca78466f236e85ca71f5dea9dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Thu, 31 Jan 2019 10:13:56 +0000 Subject: [PATCH] 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 --- browser/components/urlbar/UrlbarInput.jsm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/browser/components/urlbar/UrlbarInput.jsm b/browser/components/urlbar/UrlbarInput.jsm index 35c3782d5e5d..6f3cbd8c37b3 100644 --- a/browser/components/urlbar/UrlbarInput.jsm +++ b/browser/components/urlbar/UrlbarInput.jsm @@ -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"); } }