Bug 1414741 - Hide identity popup shadow using a class name instead of setting inline styles. r=MattN
authorJohann Hofmann <jhofmann@mozilla.com>
Thu, 21 Dec 2017 09:36:28 +0100
changeset 449353 49699f5a94f66bc84a073d25ae9f0da4d9b376f6
parent 449352 d4e1ce4601357779d5ca1fa78e4c644b74ca7d46
child 449354 e028f677bc8064dfbed6b752296f6913460a0dca
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1414741, 1069192
milestone59.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 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();
   }
 }