Bug 1203280 - Back out all non-test changes from changeset f460ad2878d9 (bug 1193158);r=MattN
authorBrian Grinstead <bgrinstead@mozilla.com>
Wed, 09 Sep 2015 15:19:36 -0700
changeset 261804 a92f1dd74ec093dc87923097f60756c252cfc4db
parent 261803 017ff4f3fea09c40f225d9105e515cf9a89e15cd
child 261805 619a307029d6cc27e733b862cc38cbb1fead09ff
push id64859
push userphilringnalda@gmail.com
push dateThu, 10 Sep 2015 22:30:45 +0000
treeherdermozilla-inbound@0a18e5db95a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1203280, 1193158
milestone43.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 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
@@ -6806,20 +6806,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;
@@ -6830,17 +6826,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();
@@ -7304,33 +7299,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);
@@ -7339,40 +7327,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;
 }
+