Bug 1301342 - add noautohide=true on XUL panel wrapper for HTMLTooltip;r=gl draft
authorJulian Descottes <jdescottes@mozilla.com>
Tue, 11 Oct 2016 16:50:35 +0200
changeset 425143 1969b9a404eb4a7cd9e26d93b086930eddc24905
parent 424914 7452437b3ab571b1d60aed4e973d82a1471f72b2
child 425342 7e2abfc4742e856fd2087a79b80c54afa8a4bcac
push id32365
push userjdescottes@mozilla.com
push dateFri, 14 Oct 2016 09:43:14 +0000
reviewersgl
bugs1301342
milestone52.0a1
Bug 1301342 - add noautohide=true on XUL panel wrapper for HTMLTooltip;r=gl MozReview-Commit-ID: AL4dc0Lp4GG
devtools/client/shared/test/browser_html_tooltip-03.js
devtools/client/shared/widgets/tooltip/HTMLTooltip.js
--- a/devtools/client/shared/test/browser_html_tooltip-03.js
+++ b/devtools/client/shared/test/browser_html_tooltip-03.js
@@ -38,17 +38,24 @@ add_task(function* () {
   let [, , doc] = yield createHost("bottom", TEST_URI);
 
   info("Run tests for a Tooltip without using a XUL panel");
   useXulWrapper = false;
   yield runTests(doc);
 
   info("Run tests for a Tooltip with a XUL panel");
   useXulWrapper = true;
-  yield runTests(doc);
+
+  let isLinux = Services.appinfo.OS === "Linux";
+  if (!isLinux) {
+    // Skip these tests on linux when using a XUL Panel wrapper because some linux window
+    // manager don't support nicely XUL Panels with noautohide _and_ noautofocus.
+    // See https://bugzilla.mozilla.org/show_bug.cgi?id=1301342#c11
+    yield runTests(doc);
+  }
 });
 
 function* runTests(doc) {
   yield testNoAutoFocus(doc);
   yield testAutoFocus(doc);
   yield testAutoFocusPreservesFocusChange(doc);
 }
 
--- a/devtools/client/shared/widgets/tooltip/HTMLTooltip.js
+++ b/devtools/client/shared/widgets/tooltip/HTMLTooltip.js
@@ -567,16 +567,17 @@ HTMLTooltip.prototype = {
   _createXulPanelWrapper: function () {
     let panel = this.doc.createElementNS(XUL_NS, "panel");
 
     // XUL panel is only a way to display DOM elements outside of the document viewport,
     // so disable all features that impact the behavior.
     panel.setAttribute("animate", false);
     panel.setAttribute("consumeoutsideclicks", false);
     panel.setAttribute("noautofocus", true);
+    panel.setAttribute("noautohide", true);
     panel.setAttribute("ignorekeys", true);
 
     // Use type="arrow" to prevent side effects (see Bug 1285206)
     panel.setAttribute("type", "arrow");
 
     panel.setAttribute("level", "top");
     panel.setAttribute("class", "tooltip-xul-wrapper");