Bug 1596486 - Remove XBL workaround for setting checkbox disabled state in privacy.js r=bgrins
authorChristoph Walcher <christoph-wa@gmx.de>
Mon, 17 Feb 2020 12:05:35 +0000
changeset 514517 e38eb610af5e3d8e9e93dbfd481132f2a721151f
parent 514516 cb8677cbf5c63e6c06f6e7010a3f98adfb985bb7
child 514518 6a223fd98993d20ae954ccce1970dbe1c75095c6
push id37136
push useropoprus@mozilla.com
push dateWed, 19 Feb 2020 04:34:03 +0000
treeherdermozilla-central@28cf163158a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1596486
milestone75.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 1596486 - Remove XBL workaround for setting checkbox disabled state in privacy.js r=bgrins Differential Revision: https://phabricator.services.mozilla.com/D61085
browser/components/preferences/in-content/privacy.js
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -217,27 +217,18 @@ function dataCollectionCheckboxHandler({
         checkbox.removeAttribute("checked");
       }
       checkbox.setAttribute("preference", pref);
     } else {
       checkbox.removeAttribute("preference");
       checkbox.removeAttribute("checked");
     }
 
-    // We can't use checkbox.disabled here because the XBL binding may not be present,
-    // in which case setting the property won't work properly.
-    if (
-      !collectionEnabled ||
-      Services.prefs.prefIsLocked(pref) ||
-      isDisabled()
-    ) {
-      checkbox.setAttribute("disabled", "true");
-    } else {
-      checkbox.removeAttribute("disabled");
-    }
+    checkbox.disabled =
+      !collectionEnabled || Services.prefs.prefIsLocked(pref) || isDisabled();
   }
 
   Preferences.get(PREF_UPLOAD_ENABLED).on("change", updateCheckbox);
   updateCheckbox();
 }
 
 // Sets the "Learn how" SUMO link in the Strict/Custom options of Content Blocking.
 function addCustomBlockingLearnMore() {