Bug 1461522 - Honor ui.popup.disable_autohide setting in HTMLTooltip; r=jdescottes
authorBrian Birtles <birtles@gmail.com>
Thu, 28 Jun 2018 15:13:05 +0900
changeset 424994 7ff43e3acaf73745c2b3003d69771f00981efddf
parent 424993 28e68f45879e0c9b4ad061d043d4b4f241572d60
child 424995 0dead7ce127ba75859381b48ab80d2484ae4451c
push id34231
push userrgurzau@mozilla.com
push dateWed, 04 Jul 2018 16:28:29 +0000
treeherdermozilla-central@a07cf0515fe3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1461522
milestone63.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 1461522 - Honor ui.popup.disable_autohide setting in HTMLTooltip; r=jdescottes MozReview-Commit-ID: ReYYKPYaVm
devtools/client/shared/widgets/tooltip/HTMLTooltip.js
--- a/devtools/client/shared/widgets/tooltip/HTMLTooltip.js
+++ b/devtools/client/shared/widgets/tooltip/HTMLTooltip.js
@@ -7,16 +7,18 @@
 "use strict";
 
 const EventEmitter = require("devtools/shared/event-emitter");
 const {TooltipToggle} = require("devtools/client/shared/widgets/tooltip/TooltipToggle");
 const {focusableSelector} = require("devtools/client/shared/focus");
 const {getCurrentZoom} = require("devtools/shared/layout/utils");
 const {listenOnce} = require("devtools/shared/async-utils");
 
+const Services = require("Services");
+
 const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 const XHTML_NS = "http://www.w3.org/1999/xhtml";
 
 const POSITION = {
   TOP: "top",
   BOTTOM: "bottom",
 };
 
@@ -732,16 +734,21 @@ HTMLTooltip.prototype = {
     return container;
   },
 
   _onClick: function(e) {
     if (this._isInTooltipContainer(e.target)) {
       return;
     }
 
+    // If the disable autohide setting is in effect, ignore.
+    if (Services.prefs.getBoolPref("ui.popup.disable_autohide", false)) {
+      return;
+    }
+
     this.hide();
     if (this.consumeOutsideClicks && e.button === 0) {
       // Consume only left click events (button === 0).
       e.preventDefault();
       e.stopPropagation();
     }
   },