Bug 480953 - Identity button should appear pressed when opening the identity popup. r=gavin
authorDão Gottwald <dao@mozilla.com>
Mon, 02 Mar 2009 21:01:03 +0100
changeset 25675 d4826b6af7a6d39eee7f4a0f141262af73c39d4d
parent 25674 2721b68b4fd7382f83a3fa8c672d99a4946e6d3f
child 25676 7a7326cf8b1f748310ef9d8e8552641bc709a8a7
push id5681
push userdgottwald@mozilla.com
push dateMon, 02 Mar 2009 20:01:41 +0000
treeherdermozilla-central@d4826b6af7a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs480953
milestone1.9.2a1pre
Bug 480953 - Identity button should appear pressed when opening the identity popup. r=gavin
browser/base/content/browser.js
browser/themes/pinstripe/browser/browser.css
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6675,16 +6675,24 @@ var gIdentityHandler = {
     this.setPopupMessages(this._identityBox.className);
     
     // Make sure the identity popup hangs toward the middle of the location bar
     // in RTL builds
     var position = 'after_start';
     if (gURLBar.getAttribute("chromedir") == "rtl")
       position = 'after_end';
 
+    // Add the "open" attribute to the identity box for styling
+    this._identityBox.setAttribute("open", "true");
+    var self = this;
+    this._identityPopup.addEventListener("popuphidden", function (e) {
+      e.currentTarget.removeEventListener("popuphidden", arguments.callee, false);
+      self._identityBox.removeAttribute("open");
+    }, false);
+
     // Now open the popup, anchored off the primary chrome element
     this._identityPopup.openPopup(this._identityBox, position);
   }
 };
 
 let DownloadMonitorPanel = {
   //////////////////////////////////////////////////////////////////////////////
   //// DownloadMonitorPanel Member Variables
--- a/browser/themes/pinstripe/browser/browser.css
+++ b/browser/themes/pinstripe/browser/browser.css
@@ -892,21 +892,16 @@ toolbar[iconsize="small"] #unified-back-
   opacity: 0.5;
 }
 
 #urlbar-throbber {
   list-style-image: url("chrome://browser/skin/places/searching_16.png");
 }
 
 
-#identity-box:active > #page-proxy-stack,
-#identity-box[open="true"] > #page-proxy-stack {
-  opacity: 0.75;
-}
-
 statusbarpanel#statusbar-display {
   -moz-padding-start: 0;
 }
 
 .statusbarpanel-text {
   margin-top: 2px;
   margin-bottom: 0;
 }
@@ -1899,26 +1894,29 @@ tabpanels.plain {
   -moz-box-pack: center;
 }
 
 #identity-box.verifiedDomain > hbox > #identity-icon-label {
   background: url("chrome://browser/skin/urlbar/startcap-secure-end.png") no-repeat center right;
 }
 
 /* - Active state */
+#identity-box.verifiedDomain[open="true"],
 #identity-box.verifiedDomain:hover:active {
   background-image: url("chrome://browser/skin/urlbar/startcap-secure-start-active.png");
 }
 
+#identity-box.verifiedDomain[open="true"] > hbox,
 #identity-box.verifiedDomain:hover:active > hbox {
   padding: 0;
   background: url("chrome://browser/skin/urlbar/startcap-secure-mid-active.png") repeat-x center center;
   -moz-box-pack: center;
 }
 
+#identity-box.verifiedDomain[open="true"] > hbox > #identity-icon-label,
 #identity-box.verifiedDomain:hover:active > hbox > #identity-icon-label {
   background: url("chrome://browser/skin/urlbar/startcap-secure-end-active.png") no-repeat center right;
 }
 
 /* - Focus state */
 #urlbar[focused="true"] > #identity-box.verifiedDomain {
   background-image: url("chrome://browser/skin/urlbar/startcap-secure-start-focused.png");
 }
@@ -1950,24 +1948,27 @@ tabpanels.plain {
   -moz-box-pack: center;
 }
 
 #identity-box.verifiedIdentity > hbox > #identity-icon-label {
   background: url("chrome://browser/skin/urlbar/startcap-verified-end.png") no-repeat center right;
 }
 
 /* - Active state */
+#identity-box.verifiedIdentity[open="true"],
 #identity-box.verifiedIdentity:hover:active {
   background-image: url("chrome://browser/skin/urlbar/startcap-verified-start-active.png");
 }
 
+#identity-box.verifiedIdentity[open="true"] > hbox,
 #identity-box.verifiedIdentity:hover:active > hbox {
   background: url("chrome://browser/skin/urlbar/startcap-verified-mid-active.png") repeat-x center center;
 }
 
+#identity-box.verifiedIdentity[open="true"] > hbox > #identity-icon-label,
 #identity-box.verifiedIdentity:hover:active > hbox > #identity-icon-label {
   background: url("chrome://browser/skin/urlbar/startcap-verified-end-active.png") no-repeat center right;
 }
 
 /* - Focus state */
 #urlbar[focused="true"] > #identity-box.verifiedIdentity {
   background-image: url("chrome://browser/skin/urlbar/startcap-verified-start-focused.png");
 }