Bug 1414741 - Hide identity popup shadow using a class name instead of setting inline styles. r=MattN
I'm not sure why, but the -moz-window-shadow property seems to be restricted
to chrome style sheets (it may be related to the work done in
bug 1069192, but
I decided to stop going down that rabbit hole at some point and just go for a
simple fix).
MozReview-Commit-ID: Ho4xGLTcFN7
--- a/browser/themes/shared/controlcenter/panel.inc.css
+++ b/browser/themes/shared/controlcenter/panel.inc.css
@@ -6,16 +6,22 @@
%filter substitution
%define identityPopupExpanderWidth 38px
/* Hide all conditional elements by default. */
:-moz-any([when-connection],[when-mixedcontent],[when-ciphers],[when-loginforms]) {
display: none;
}
+/* This is used by screenshots tests to hide intermittently different
+ * identity popup shadows (see bug 1425253). */
+#identity-popup.no-shadow {
+ -moz-window-shadow: none;
+}
+
/* Show the right elements for the right connection states. */
#identity-popup[connection=not-secure] [when-connection~=not-secure],
#identity-popup[connection=secure-cert-user-overridden] [when-connection~=secure-cert-user-overridden],
#identity-popup[connection=secure-ev] [when-connection~=secure-ev],
#identity-popup[connection=secure] [when-connection~=secure],
#identity-popup[connection=chrome] [when-connection~=chrome],
#identity-popup[connection=file] [when-connection~=file],
#identity-popup[connection=extension] [when-connection~=extension],
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ControlCenter.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ControlCenter.jsm
@@ -257,17 +257,17 @@ async function loadPage(url) {
async function openIdentityPopup(expand) {
let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
let gBrowser = browserWindow.gBrowser;
let { gIdentityHandler } = gBrowser.ownerGlobal;
gIdentityHandler._identityPopup.hidePopup();
// Disable the popup shadow on OSX until we have figured out bug 1425253.
if (AppConstants.platform == "macosx") {
- gIdentityHandler._identityPopup.style["-moz-window-shadow"] = "none";
+ gIdentityHandler._identityPopup.classList.add("no-shadow");
}
gIdentityHandler._identityBox.querySelector("#identity-icon").click();
if (expand) {
// give some time for opening to avoid weird style issues
await new Promise((c) => setTimeout(c, 500));
gIdentityHandler._identityPopup.querySelector("#identity-popup-security-expander").click();
}
}