diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index cab6f3f184ec..1a0c89ee418a 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -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; } }; diff --git a/browser/base/content/test/general/browser_permissions.js b/browser/base/content/test/general/browser_permissions.js index ed612cc0eafc..87a8d3b4ba94 100644 --- a/browser/base/content/test/general/browser_permissions.js +++ b/browser/base/content/test/general/browser_permissions.js @@ -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"); diff --git a/browser/themes/shared/controlcenter/panel.inc.css b/browser/themes/shared/controlcenter/panel.inc.css index f56c8ea4c6f8..b5cc4cdb2f31 100644 --- a/browser/themes/shared/controlcenter/panel.inc.css +++ b/browser/themes/shared/controlcenter/panel.inc.css @@ -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; }