Backed out changeset 0d049666e764 (bug 1451024) for browser chrome failures on browser_privacypane_1.js CLOSED TREE
authorBrindusan Cristian <cbrindusan@mozilla.com>
Tue, 10 Apr 2018 00:22:42 +0300
changeset 779666 085c62e04558eea099732b66fbbde71625cbb772
parent 779665 c318860e517952a8b6726b2df179c63cf22d171a
child 779667 90a305d9c6cf68962eaeb0d019b7f87be30d75fa
push id105836
push userbmo:ato@sny.no
push dateTue, 10 Apr 2018 12:07:22 +0000
bugs1451024
milestone61.0a1
backs out0d049666e764901e4e7a6ec915caa74f59bcc477
Backed out changeset 0d049666e764 (bug 1451024) for browser chrome failures on browser_privacypane_1.js CLOSED TREE
browser/components/preferences/in-content/privacy.js
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -834,40 +834,33 @@ var gPrivacyPane = {
       return Ci.nsICookieService.ACCEPT_NORMALLY;
     }
 
     return lifetimePolicy;
   },
 
   /**
    * Reads the network.cookie.cookieBehavior preference value and
-   * disables parts of the cookie UI if appropriate.
-   *
-   * Returns "0" if cookies are accepted and "2" if they are entirely disabled.
+   * enables/disables the rest of the cookie UI accordingly, returning true
+   * if cookies are enabled.
    */
   readAcceptCookies() {
-    let pref = Preferences.get("network.cookie.cookieBehavior");
-    let acceptThirdPartyLabel = document.getElementById("acceptThirdPartyLabel");
-    let acceptThirdPartyMenu = document.getElementById("acceptThirdPartyMenu");
-    let keepUntilLabel = document.getElementById("keepUntil");
-    let keepUntilMenu = document.getElementById("keepCookiesUntil");
+    var pref = Preferences.get("network.cookie.cookieBehavior");
+    var acceptThirdPartyLabel = document.getElementById("acceptThirdPartyLabel");
+    var acceptThirdPartyMenu = document.getElementById("acceptThirdPartyMenu");
+    var keepUntil = document.getElementById("keepUntil");
+    var menu = document.getElementById("keepCookiesUntil");
 
     // enable the rest of the UI for anything other than "disable all cookies"
-    let acceptCookies = (pref.value != 2);
+    var acceptCookies = (pref.value != 2);
 
-    if (!acceptThirdPartyMenu.disabled) {
-      acceptThirdPartyMenu.disabled = !acceptCookies;
-    }
-    acceptThirdPartyLabel.disabled = acceptThirdPartyMenu.disabled;
+    acceptThirdPartyLabel.disabled = acceptThirdPartyMenu.disabled = !acceptCookies;
 
     let privateBrowsing = Preferences.get("browser.privatebrowsing.autostart").value;
-    if (!keepUntilMenu.disabled) {
-      keepUntilMenu.disabled = privateBrowsing || !acceptCookies;
-    }
-    keepUntilLabel.disabled = keepUntilMenu.disabled;
+    keepUntil.disabled = menu.disabled = privateBrowsing || !acceptCookies;
 
     // Our top-level setting is a radiogroup that only sets "enable all"
     // and "disable all", so convert the pref value accordingly.
     return acceptCookies ? "0" : "2";
   },
 
   /**
    * Updates the "accept third party cookies" menu based on whether the