Bug 1203280 - Back out all non-test changes from changeset f460ad2878d9 (bug 1193158);r=MattN draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Wed, 09 Sep 2015 13:37:47 -0700
changeset 291349 a7a4c51873f9ff5ffccae9c802ebdb04e761377f
parent 291348 74dc3b9ecffc3d6ff6c5c671ad86fd8c386edd8a
child 509132 a2bda86b53ac77c788c0e119b27aeb62136ef7b0
push id5242
push userbgrinstead@mozilla.com
push dateWed, 09 Sep 2015 20:37:55 +0000
reviewersMattN
bugs1203280, 1193158
milestone43.0a1
Bug 1203280 - Back out all non-test changes from changeset f460ad2878d9 (bug 1193158);r=MattN
browser/base/content/browser.js
browser/base/content/test/general/browser_permissions.js
browser/components/controlcenter/content/panel.inc.xul
browser/themes/shared/controlcenter/panel.inc.css
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6790,20 +6790,16 @@ var gIdentityHandler = {
   get _permissionsContainer () {
     delete this._permissionsContainer;
     return this._permissionsContainer = document.getElementById("identity-popup-permissions");
   },
   get _permissionList () {
     delete this._permissionList;
     return this._permissionList = document.getElementById("identity-popup-permission-list");
   },
-  get _permissionSubviewList () {
-    delete this._permissionSubviewList;
-    return this._permissionSubviewList = document.getElementById("identity-popup-permission-subview-list");
-  },
 
   /**
    * Rebuild cache of the elements that may or may not exist depending
    * on whether there's a location bar.
    */
   _cacheElements : function() {
     delete this._identityBox;
     delete this._identityIcons;
@@ -6814,17 +6810,16 @@ var gIdentityHandler = {
     delete this._permissionList;
     this._identityBox = document.getElementById("identity-box");
     this._identityIcons = document.getElementById("identity-icons");
     this._identityIconLabel = document.getElementById("identity-icon-label");
     this._identityIconCountryLabel = document.getElementById("identity-icon-country-label");
     this._identityIcon = document.getElementById("page-proxy-favicon");
     this._permissionsContainer = document.getElementById("identity-popup-permissions");
     this._permissionList = document.getElementById("identity-popup-permission-list");
-    this._permissionSubviewList = document.getElementById("identity-popup-permission-subview-list");
   },
 
   /**
    * Handler for mouseclicks on the "More Information" button in the
    * "identity-popup" panel.
    */
   handleMoreInfoClick : function(event) {
     displaySecurityInfo();
@@ -7288,33 +7283,26 @@ var gIdentityHandler = {
     dt.setData("text/html", htmlString);
     dt.setDragImage(gProxyFavIcon, 16, 16);
   },
 
   updateSitePermissions: function () {
     while (this._permissionList.hasChildNodes())
       this._permissionList.removeChild(this._permissionList.lastChild);
 
-    while (this._permissionSubviewList.hasChildNodes())
-      this._permissionSubviewList.removeChild(this._permissionSubviewList.lastChild);
-
     let uri = gBrowser.currentURI;
 
     for (let permission of SitePermissions.listPermissions()) {
       let state = SitePermissions.get(uri, permission);
+
+      if (state == SitePermissions.UNKNOWN)
+        continue;
+
       let item = this._createPermissionItem(permission, state);
-
-      // Add to the main view only if there is a known / non-default
-      // value for the permission for this site.
-      if (state != SitePermissions.UNKNOWN) {
-        this._permissionList.appendChild(item.cloneNode(true));
-      }
-
-      // Add all permissions to the subview.
-      this._permissionSubviewList.appendChild(item);
+      this._permissionList.appendChild(item);
     }
 
     this._permissionsContainer.hidden = !this._permissionList.hasChildNodes();
   },
 
   setPermission: function (aPermission, aState) {
     if (aState == SitePermissions.getDefault(aPermission))
       SitePermissions.remove(gBrowser.currentURI, aPermission);
@@ -7323,40 +7311,30 @@ var gIdentityHandler = {
   },
 
   _createPermissionItem: function (aPermission, aState) {
     let menulist = document.createElement("menulist");
     let menupopup = document.createElement("menupopup");
     for (let state of SitePermissions.getAvailableStates(aPermission)) {
       let menuitem = document.createElement("menuitem");
       menuitem.setAttribute("value", state);
-      let label = SitePermissions.getStateLabel(aPermission, state);
-      menuitem.setAttribute("label", label);
-      menuitem.setAttribute("tooltiptext", label);
+      menuitem.setAttribute("label", SitePermissions.getStateLabel(aPermission, state));
       menupopup.appendChild(menuitem);
     }
     menulist.appendChild(menupopup);
-    let value = aState;
-    if (aState == SitePermissions.UNKNOWN) {
-      value = SitePermissions.getDefault(aPermission);
-    }
-    menulist.setAttribute("value", value);
+    menulist.setAttribute("value", aState);
     menulist.setAttribute("oncommand", "gIdentityHandler.setPermission('" +
                                        aPermission + "', this.value)");
     menulist.setAttribute("id", "identity-popup-permission:" + aPermission);
-    menulist.setAttribute("class", "identity-popup-permission");
 
     let label = document.createElement("label");
-    let labelText = SitePermissions.getPermissionLabel(aPermission);
     label.setAttribute("flex", "1");
     label.setAttribute("class", "identity-popup-permission-label");
     label.setAttribute("control", menulist.getAttribute("id"));
-    label.setAttribute("crop", "end");
-    label.setAttribute("value", labelText);
-    label.setAttribute("tooltiptext", labelText);
+    label.setAttribute("value", SitePermissions.getPermissionLabel(aPermission));
 
     let container = document.createElement("hbox");
     container.setAttribute("align", "center");
     container.appendChild(label);
     container.appendChild(menulist);
     return container;
   }
 };
--- a/browser/base/content/test/general/browser_permissions.js
+++ b/browser/base/content/test/general/browser_permissions.js
@@ -33,34 +33,8 @@ add_task(function* testMainViewVisible()
   gIdentityHandler._identityPopup.hidden = true;
 
   gIdentityHandler.setPermission("install", SitePermissions.getDefault("install"));
 
   gIdentityHandler._identityBox.click();
   ok(is_hidden(gIdentityHandler._permissionsContainer), "The container is hidden");
   gIdentityHandler._identityPopup.hidden = true;
 });
-
-add_task(function* testSubviewListing() {
-  let {gIdentityHandler} = gBrowser.ownerGlobal;
-  gIdentityHandler.setPermission("install", 1);
-
-  info("Opening control center and expanding permissions subview");
-  gIdentityHandler._identityBox.click();
-
-  let menulists = gIdentityHandler._permissionSubviewList.querySelectorAll("menulist");
-  let perms = SitePermissions.listPermissions();
-
-  is(menulists.length, perms.length, "One menulist for each permission");
-
-  for (let i = 0; i < menulists.length; i++) {
-    let menulist = menulists[i];
-    let perm = perms[i];
-    let expectedValue = SitePermissions.get(gBrowser.currentURI, perm);
-    if (expectedValue == SitePermissions.UNKNOWN) {
-      expectedValue = SitePermissions.getDefault(perm);
-    }
-
-    is(menulist.id, "identity-popup-permission:" + perm, "Correct id for menulist: " + perm);
-    is(menulist.value, expectedValue, "Correct value on menulist: " + perm);
-  }
-  gIdentityHandler._identityPopup.hidden = true;
-});
--- a/browser/components/controlcenter/content/panel.inc.xul
+++ b/browser/components/controlcenter/content/panel.inc.xul
@@ -82,22 +82,16 @@
 
       <!-- Permissions Section -->
       <hbox id="identity-popup-permissions" class="identity-popup-section">
         <vbox id="identity-popup-permissions-content" flex="1">
           <label class="identity-popup-headline"
                  value="&identity.permissions;"/>
           <vbox id="identity-popup-permission-list"/>
         </vbox>
-        <button id="identity-popup-permissions-expander"
-                class="identity-popup-expander"
-#ifndef NIGHTLY_BUILD
-                hidden="true"
-#endif
-                oncommand="gIdentityHandler.toggleSubView('permissions', this)"/>
       </hbox>
     </panelview>
 
     <!-- Security SubView -->
     <panelview id="identity-popup-securityView" flex="1">
       <vbox id="identity-popup-securityView-header">
         <label observes="identity-popup-content-host"/>
         <description class="identity-popup-connection-not-secure"
@@ -157,23 +151,10 @@
                 oncommand="gIdentityHandler.enableMixedContentProtection()"/>
 
         <!-- More Security Information -->
         <button label="&identity.moreInfoLinkText2;"
                 oncommand="gIdentityHandler.handleMoreInfoClick(event);"/>
       </vbox>
 
     </panelview>
-
-    <!-- Permissions SubView -->
-    <panelview id="identity-popup-permissionsView" flex="1">
-      <vbox id="identity-popup-permissionsView-header">
-        <label class="identity-popup-headline"
-               value="&identity.permissions;"
-               crop="end"/>
-      </vbox>
-
-      <vbox id="identity-popup-permissionsView-body">
-        <vbox id="identity-popup-permission-subview-list"/>
-      </vbox>
-    </panelview>
   </panelmultiview>
 </panel>
--- a/browser/themes/shared/controlcenter/panel.inc.css
+++ b/browser/themes/shared/controlcenter/panel.inc.css
@@ -283,25 +283,16 @@ description#identity-popup-content-verif
 }
 
 /* PERMISSIONS */
 
 #identity-popup-permissions-content {
   background-image: url(chrome://browser/skin/controlcenter/permissions.svg);
 }
 
-#identity-popup-permissionsView {
-  padding: 0.5em 1em;
-}
-
-#identity-popup-permission-list,
-#identity-popup-permission-subview-list {
+#identity-popup-permission-list {
   margin-top: 5px;
 }
 
-#identity-popup-permission-list menulist.identity-popup-permission,
-#identity-popup-permission-subview-list menulist.identity-popup-permission {
-  max-width: 10em;
-}
-
 .identity-popup-permission-label {
   -moz-margin-start: 0;
 }
+