Bug 1428581 - Make labels of the permission prompt checkboxes clickable. r?johannh draft
authorPrathiksha <prathikshaprasadsuman@gmail.com>
Tue, 09 Jan 2018 18:11:50 +0530
changeset 717744 0162c641f5fe08d287450b056c1e6a8e429615e2
parent 716638 9099a6ed993f0113c47c0d9e800bf0ff6e1a1dc1
child 745327 9b1b04e4d810c9f596fc67b6920501cd4907cc6a
push id94757
push userbmo:prathikshaprasadsuman@gmail.com
push dateTue, 09 Jan 2018 12:35:57 +0000
reviewersjohannh
bugs1428581
milestone59.0a1
Bug 1428581 - Make labels of the permission prompt checkboxes clickable. r?johannh MozReview-Commit-ID: GPPmYqOX3Jb
browser/components/preferences/sitePermissions.css
browser/components/preferences/sitePermissions.js
browser/components/preferences/sitePermissions.xul
--- a/browser/components/preferences/sitePermissions.css
+++ b/browser/components/preferences/sitePermissions.css
@@ -17,23 +17,18 @@
   min-height: 35px;
 }
 
 .website-status {
   margin: 1px;
   margin-inline-end: 5px;
 }
 
-#permissionsDisableLabel {
-  padding-top: 14px;
-  font-weight: bold;
-}
-
 #permissionsDisableDescription {
-  margin-inline-start: 37px;
+  margin-inline-start: 32px;
   color: #737373;
   line-height: 110%;
 }
 
 #permissionsDisableCheckbox {
   margin-inline-start: 4px;
   padding-top: 10px;
 }
--- a/browser/components/preferences/sitePermissions.js
+++ b/browser/components/preferences/sitePermissions.js
@@ -50,34 +50,31 @@ var gSitePermissionsManager = {
     this._searchBox = document.getElementById("searchBox");
     this._checkbox = document.getElementById("permissionsDisableCheckbox");
 
     let permissionsText = document.getElementById("permissionsText");
     while (permissionsText.hasChildNodes())
       permissionsText.firstChild.remove();
     permissionsText.appendChild(document.createTextNode(params.introText));
 
-    let permissionsDisableLabel = document.getElementById("permissionsDisableLabel");
-    permissionsDisableLabel.value = params.disablePermissionsLabel;
-
+    this._checkbox.setAttribute("label", params.disablePermissionsLabel);
     let permissionsDisableDescription = document.getElementById("permissionsDisableDescription");
     permissionsDisableDescription.appendChild(document.createTextNode(params.disablePermissionsDescription));
 
     document.title = params.windowTitle;
 
     // Initialize the checkbox state.
     this._defaultPermissionStatePrefName = "permissions.default." + this._type;
     let pref = Services.prefs.getPrefType(this._defaultPermissionStatePrefName);
     if (pref != Services.prefs.PREF_INVALID) {
       this._currentDefaultPermissionsState = Services.prefs.getIntPref(this._defaultPermissionStatePrefName);
     }
 
     if (this._currentDefaultPermissionsState === null) {
       this._checkbox.setAttribute("hidden", true);
-      permissionsDisableLabel.setAttribute("hidden", true);
       permissionsDisableDescription.setAttribute("hidden", true);
     } else if (this._currentDefaultPermissionsState == SitePermissions.BLOCK) {
       this._checkbox.checked = true;
     } else {
       this._checkbox.checked = false;
     }
 
     this._loadPermissions();
--- a/browser/components/preferences/sitePermissions.xul
+++ b/browser/components/preferences/sitePermissions.xul
@@ -57,23 +57,18 @@
               icon="remove" label="&removepermission2.label;"
               oncommand="gSitePermissionsManager.onPermissionDelete();"/>
       <button id="removeAllPermissions"
               icon="clear" label="&removeallpermissions2.label;"
               accesskey="&removeallpermissions2.accesskey;"
               oncommand="gSitePermissionsManager.onAllPermissionsDelete();"/>
     </hbox>
     <spacer flex="1"/>
-    <vbox align="start">
-      <hbox align="start">
-        <checkbox id="permissionsDisableCheckbox"/>
-        <label for="permissionsDisableCheckbox" id="permissionsDisableLabel"/>
-      </hbox>
-      <description id="permissionsDisableDescription"/>
-    </vbox>
+    <checkbox id="permissionsDisableCheckbox"/>
+    <description id="permissionsDisableDescription"/>
     <spacer flex="1"/>
     <hbox class="actionButtons" align="right" flex="1">
       <button oncommand="close();" icon="close" id="cancel"
               label="&button.cancel.label;" accesskey="&button.cancel.accesskey;" />
       <button id="btnApplyChanges" oncommand="gSitePermissionsManager.onApplyChanges();" icon="save"
               label="&button.ok.label;" accesskey="&button.ok.accesskey;"/>
     </hbox>
   </vbox>