Bug 1301342 - add noautohide=true on XUL panel wrapper for HTMLTooltip;r=gl
MozReview-Commit-ID: AL4dc0Lp4GG
--- 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");