Bug 1414741 - Hide identity popup shadow using a class name instead of setting inline styles. r=MattN draft
authorJohann Hofmann <jhofmann@mozilla.com>
Thu, 21 Dec 2017 09:36:28 +0100
changeset 714021 e8a6707abd621928752211adaf08b880e54eefb4
parent 713743 62dd5404cf55e29412d5fff8fe9105076b1ca437
child 744489 56f14d3ca7bb6b88095d1231bbc3f19003177f17
push id93812
push userbmo:jhofmann@mozilla.com
push dateThu, 21 Dec 2017 13:31:31 +0000
reviewersMattN
bugs1414741, 1069192
milestone59.0a1
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
browser/themes/shared/controlcenter/panel.inc.css
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ControlCenter.jsm
--- 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();
   }
 }