Bug 1206916 - Crop permissions labels if there isn't enough space in the Control Center;r=paolo

--HG--
extra : commitid : Ii05UJF4eA3
This commit is contained in:
Brian Grinstead 2015-09-30 12:03:27 -07:00
parent 0b2ce2f493
commit c71400c85e
3 changed files with 18 additions and 1 deletions

View File

@ -7327,12 +7327,19 @@ var gIdentityHandler = {
label.setAttribute("flex", "1");
label.setAttribute("class", "identity-popup-permission-label");
label.setAttribute("control", menulist.getAttribute("id"));
label.setAttribute("value", SitePermissions.getPermissionLabel(aPermission));
label.textContent = SitePermissions.getPermissionLabel(aPermission);
let container = document.createElement("hbox");
container.setAttribute("align", "center");
container.appendChild(label);
container.appendChild(menulist);
// The menuitem text can be long and we don't want the dropdown
// to expand to the width of unselected labels.
// Need to set this attribute after it's appended, otherwise it gets
// overridden with sizetopopup="pref".
menulist.setAttribute("sizetopopup", "none");
return container;
}
};

View File

@ -30,6 +30,11 @@ add_task(function* testMainViewVisible() {
gIdentityHandler._identityBox.click();
ok(is_hidden(emptyLabel), "List of permissions is not empty");
let labelText = SitePermissions.getPermissionLabel("install");
let labels = permissionsList.querySelectorAll(".identity-popup-permission-label");
is(labels.length, 1, "One permission visible in main view");
is(labels[0].textContent, labelText, "Correct value");
let menulists = permissionsList.querySelectorAll("menulist");
is(menulists.length, 1, "One permission visible in main view");
is(menulists[0].id, "identity-popup-permission:install", "Install permission visible");

View File

@ -289,6 +289,10 @@ description#identity-popup-content-verifier,
background-image: url(chrome://browser/skin/controlcenter/permissions.svg);
}
#identity-popup-permission-list menulist {
min-width: 60px;
}
#identity-popup-permission-list:not(:empty) {
margin-top: 5px;
}
@ -299,5 +303,6 @@ description#identity-popup-content-verifier,
.identity-popup-permission-label {
-moz-margin-start: 0;
word-wrap: break-word;
}