Bug 1533366 - UrlbarInput's blur handling should respect ui.popup.disable_autohide preference. r=dao
authorMark Banner <standard8@mozilla.com>
Thu, 07 Mar 2019 14:10:40 +0000
changeset 520762 75921acaaf148933460e88631b0a0b95b234fed5
parent 520761 b7e35dab3ad56566cf69bd6930db6967ff985d64
child 520763 728658e02de5947d27e2aebd75b45de94b42e5d0
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1533366
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1533366 - UrlbarInput's blur handling should respect ui.popup.disable_autohide preference. r=dao Differential Revision: https://phabricator.services.mozilla.com/D22500
browser/components/urlbar/UrlbarInput.jsm
browser/components/urlbar/UrlbarPrefs.jsm
--- a/browser/components/urlbar/UrlbarInput.jsm
+++ b/browser/components/urlbar/UrlbarInput.jsm
@@ -999,17 +999,21 @@ class UrlbarInput {
 
     insertLocation.insertAdjacentElement("afterend", pasteAndGo);
   }
 
   // Event handlers below.
 
   _on_blur(event) {
     this.formatValue();
-    this.view.close(UrlbarUtils.CANCEL_REASON.BLUR);
+    // Respect the autohide preference for easier inspecting/debugging via
+    // the browser toolbox.
+    if (!UrlbarPrefs.get("ui.popup.disable_autohide")) {
+      this.view.close(UrlbarUtils.CANCEL_REASON.BLUR);
+    }
   }
 
   _on_focus(event) {
     this._updateUrlTooltip();
 
     this.formatValue();
   }
 
--- a/browser/components/urlbar/UrlbarPrefs.jsm
+++ b/browser/components/urlbar/UrlbarPrefs.jsm
@@ -135,16 +135,17 @@ const PREF_URLBAR_DEFAULTS = new Map([
   // When true, URLs in the user's history that look like search result pages
   // are styled to look like search engine results instead of the usual history
   // results.
   ["restyleSearches", false],
 ]);
 const PREF_OTHER_DEFAULTS = new Map([
   ["keyword.enabled", true],
   ["browser.search.suggest.enabled", true],
+  ["ui.popup.disable_autohide", false],
 ]);
 
 // Maps preferences under browser.urlbar.suggest to behavior names, as defined
 // in mozIPlacesAutoComplete.
 const SUGGEST_PREF_TO_BEHAVIOR = {
   history: "history",
   bookmark: "bookmark",
   openpage: "openpage",