Backed out 5 changesets (bug 1483378) for bc failures on browser_policy_cookie_settings.js. CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Mon, 20 Aug 2018 18:38:29 +0300
changeset 487517 89e493ded9845fa3c95fad2e45f6fd17eba165d2
parent 487516 e167871cd22039f9ca633dce0ce30cfc155b0062
child 487518 7784d3275ff735261a8953fc17779223f476023b
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1483378
milestone63.0a1
backs out5794c6564567b8269fd8c37f7885d0968c5264bc
9c75236893debfe6aa69e04259a13944459cee34
374d33355d31aea35b9312feee4218cb5cdedde4
26bc4e3382d47344027382a2c0951d000c442f41
625b9010085c869daf2bdcae8e9172ebe23a1e05
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
Backed out 5 changesets (bug 1483378) for bc failures on browser_policy_cookie_settings.js. CLOSED TREE Backed out changeset 5794c6564567 (bug 1483378) Backed out changeset 9c75236893de (bug 1483378) Backed out changeset 374d33355d31 (bug 1483378) Backed out changeset 26bc4e3382d4 (bug 1483378) Backed out changeset 625b9010085c (bug 1483378)
browser/app/profile/firefox.js
browser/components/preferences/in-content/privacy.js
browser/components/preferences/in-content/privacy.xul
browser/components/preferences/in-content/tests/browser.ini
browser/components/preferences/in-content/tests/browser_privacypane_1.js
browser/components/preferences/in-content/tests/browser_privacypane_2.js
browser/components/preferences/in-content/tests/browser_privacypane_3.js
browser/components/preferences/in-content/tests/browser_privacypane_4.js
browser/components/preferences/in-content/tests/browser_privacypane_8.js
browser/components/preferences/in-content/tests/privacypane_tests_perwindow.js
browser/locales/en-US/browser/preferences/preferences.ftl
browser/themes/shared/incontentprefs/preferences.inc.css
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1483,23 +1483,20 @@ pref("browser.ping-centre.telemetry", tr
 pref("browser.ping-centre.log", false);
 pref("browser.ping-centre.staging.endpoint", "https://onyx_tiles.stage.mozaws.net/v3/links/ping-centre");
 pref("browser.ping-centre.production.endpoint", "https://tiles.services.mozilla.com/v3/links/ping-centre");
 
 // Enable GMP support in the addon manager.
 pref("media.gmp-provider.enabled", true);
 
 pref("browser.contentblocking.enabled", true);
-pref("browser.contentblocking.cookies-site-data.ui.reject-trackers.recommended", true);
 #ifdef NIGHTLY_BUILD
 pref("browser.contentblocking.ui.enabled", true);
-pref("browser.contentblocking.cookies-site-data.ui.reject-trackers.enabled", true);
 #else
 pref("browser.contentblocking.ui.enabled", false);
-pref("browser.contentblocking.cookies-site-data.ui.reject-trackers.enabled", false);
 #endif
 #ifdef NIGHTLY_BUILD
 pref("browser.contentblocking.reportBreakage.enabled", true);
 #else
 pref("browser.contentblocking.reportBreakage.enabled", false);
 #endif
 pref("browser.contentblocking.reportBreakage.url", "https://tracking-protection-issues.herokuapp.com/new");
 
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -18,22 +18,16 @@ ChromeUtils.defineModuleGetter(this, "Lo
 ChromeUtils.defineModuleGetter(this, "SiteDataManager",
   "resource:///modules/SiteDataManager.jsm");
 
 ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingUiEnabled",
                                       "browser.contentblocking.ui.enabled");
 
-XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingCookiesAndSiteDataRejectTrackersRecommended",
-                                      "browser.contentblocking.cookies-site-data.ui.reject-trackers.recommended");
-
-XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingCookiesAndSiteDataRejectTrackersEnabled",
-                                      "browser.contentblocking.cookies-site-data.ui.reject-trackers.enabled");
-
 XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingEnabled",
                                       "browser.contentblocking.enabled");
 
 const PREF_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
 
 const TRACKING_PROTECTION_KEY = "websites.trackingProtectionMode";
 const TRACKING_PROTECTION_PREFS = ["privacy.trackingprotection.enabled",
                                    "privacy.trackingprotection.pbmode.enabled"];
@@ -268,34 +262,25 @@ var gPrivacyPane = {
 
     if (contentBlockingUiEnabled) {
       this.initContentBlocking();
     } else {
       this._initTrackingProtection();
     }
 
     this.trackingProtectionReadPrefs();
-    this.networkCookieBehaviorReadPrefs();
     this._initTrackingProtectionExtensionControl();
 
     this.updateContentBlockingVisibility();
 
     Preferences.get("privacy.trackingprotection.enabled").on("change",
       gPrivacyPane.trackingProtectionReadPrefs.bind(gPrivacyPane));
     Preferences.get("privacy.trackingprotection.pbmode.enabled").on("change",
       gPrivacyPane.trackingProtectionReadPrefs.bind(gPrivacyPane));
 
-    // Watch all of the prefs that the new Cookies & Site Data UI depends on
-    Preferences.get("network.cookie.cookieBehavior").on("change",
-      gPrivacyPane.networkCookieBehaviorReadPrefs.bind(gPrivacyPane));
-    Preferences.get("network.cookie.lifetimePolicy").on("change",
-      gPrivacyPane.networkCookieBehaviorReadPrefs.bind(gPrivacyPane));
-    Preferences.get("browser.privatebrowsing.autostart").on("change",
-      gPrivacyPane.networkCookieBehaviorReadPrefs.bind(gPrivacyPane));
-
     setEventListener("trackingProtectionExceptions", "command",
       gPrivacyPane.showTrackingProtectionExceptions);
 
     Preferences.get("privacy.sanitize.sanitizeOnShutdown").on("change",
       gPrivacyPane._updateSanitizeSettingsButton.bind(gPrivacyPane));
     Preferences.get("browser.privatebrowsing.autostart").on("change",
       gPrivacyPane.updatePrivacyMicroControls.bind(gPrivacyPane));
     Preferences.get("media.autoplay.enabled.ask-permission").on("change",
@@ -486,43 +471,31 @@ var gPrivacyPane = {
     }
   },
 
   /**
    * Changes the visibility of elements in the TP/CB section depending on the
    * content blocking UI pref.
    */
   updateContentBlockingVisibility() {
-    // First, update the content blocking UI.
     let visibleState = {
       "contentBlockingHeader": true,
       "contentBlockingDescription": true,
       "contentBlockingLearnMore": true,
       "contentBlockingRestoreDefaults": true,
       "contentBlockingCheckboxContainer": true,
       "contentBlockingCategories": true,
 
       "trackingProtectionHeader": false,
       "trackingProtectionDescription": false,
       "trackingProtectionBox": false,
     };
     for (let id in visibleState) {
       document.getElementById(id).hidden = contentBlockingUiEnabled != visibleState[id];
     }
-
-    // Allow turning off the "(recommended)" label using a pref
-    let blockCookiesFromTrackers = document.getElementById("blockCookiesFromTrackers");
-    if (contentBlockingCookiesAndSiteDataRejectTrackersRecommended) {
-      document.l10n.setAttributes(blockCookiesFromTrackers, "sitedata-block-trackers-option-recommended");
-    }
-
-    // Allow hiding the Reject Trackers option based on a pref
-    if (!contentBlockingCookiesAndSiteDataRejectTrackersEnabled) {
-      blockCookiesFromTrackers.remove();
-    }
   },
 
   /**
    * Updates the preferences UI to reflect the browser.contentblocking.enabled pref.
    * This affects the button to toggle the pref and the disabled state of the dependent controls.
    */
   updateContentBlockingToggle() {
     let onOrOff = contentBlockingEnabled ? "on" : "off";
@@ -589,61 +562,16 @@ var gPrivacyPane = {
     } else if (pbmPref.value) {
       tpControl.value = "private";
     } else {
       tpControl.value = "never";
     }
   },
 
   /**
-   * Selects the right items of the new Cookies & Site Data UI.
-   */
-  networkCookieBehaviorReadPrefs() {
-    let behavior = Preferences.get("network.cookie.cookieBehavior").value;
-    let blockCookiesCtrl = document.getElementById("blockCookies");
-    let blockCookiesLabel = document.getElementById("blockCookiesLabel");
-    let blockCookiesMenu = document.getElementById("blockCookiesMenu");
-    let keepUntilLabel = document.getElementById("keepUntil");
-    let keepUntilMenu = document.getElementById("keepCookiesUntil");
-
-    let blockCookies = (behavior != 0);
-    let cookieBehaviorLocked = Services.prefs.prefIsLocked("network.cookie.cookieBehavior");
-    let blockCookiesControlsDisabled = !blockCookies || cookieBehaviorLocked;
-    blockCookiesLabel.disabled = blockCookiesMenu.disabled = blockCookiesControlsDisabled;
-
-    let completelyBlockCookies = (behavior == 2);
-    let privateBrowsing = Preferences.get("browser.privatebrowsing.autostart").value;
-    let cookieExpirationLocked = Services.prefs.prefIsLocked("network.cookie.lifetimePolicy");
-    let keepUntilControlsDisabled = privateBrowsing || completelyBlockCookies || cookieExpirationLocked;
-    keepUntilLabel.disabled = keepUntilMenu.disabled = keepUntilControlsDisabled;
-
-    switch (behavior) {
-      case Ci.nsICookieService.BEHAVIOR_ACCEPT:
-        blockCookiesCtrl.value = "allow";
-        break;
-      case Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN:
-        blockCookiesCtrl.value = "disallow";
-        blockCookiesMenu.value = "all-third-parties";
-        break;
-      case Ci.nsICookieService.BEHAVIOR_REJECT:
-        blockCookiesCtrl.value = "disallow";
-        blockCookiesMenu.value = "always";
-        break;
-      case Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN:
-        blockCookiesCtrl.value = "disallow";
-        blockCookiesMenu.value = "unvisited";
-        break;
-      case Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER:
-        blockCookiesCtrl.value = "disallow";
-        blockCookiesMenu.value = "trackers";
-        break;
-    }
-  },
-
-  /**
    * Sets the pref values based on the selected item of the radiogroup.
    */
   trackingProtectionWritePrefs() {
     let enabledPref = Preferences.get("privacy.trackingprotection.enabled");
     let pbmPref = Preferences.get("privacy.trackingprotection.pbmode.enabled");
     let tpControl;
     if (contentBlockingUiEnabled) {
       tpControl = document.getElementById("trackingProtectionMenu");
@@ -786,16 +714,17 @@ var gPrivacyPane = {
   /**
    * Update the privacy micro-management controls based on the
    * value of the private browsing auto-start preference.
    */
   updatePrivacyMicroControls() {
     // Set "Keep cookies until..." to "I close Nightly" and disable the setting
     // when we're in auto private mode (or reset it back otherwise).
     document.getElementById("keepCookiesUntil").value = this.readKeepCookiesUntil();
+    this.readAcceptCookies();
 
     let clearDataSettings = document.getElementById("clearDataSettings");
 
     if (document.getElementById("historyMode").value == "custom") {
       let disabled = Preferences.get("browser.privatebrowsing.autostart").value;
       this.dependentControls.forEach(function(aElement) {
         let control = document.getElementById(aElement);
         let preferenceId = control.getAttribute("preference");
@@ -991,78 +920,87 @@ var gPrivacyPane = {
 
     // network.cookie.lifetimePolicy can be set to any value, but we just
     // support ACCEPT_SESSION and ACCEPT_NORMALLY. Let's force ACCEPT_NORMALLY.
     return Ci.nsICookieService.ACCEPT_NORMALLY;
   },
 
   /**
    * Reads the network.cookie.cookieBehavior preference value and
-   * enables/disables the rest of the new cookie & site data UI accordingly.
+   * enables/disables the rest of the cookie UI accordingly.
    *
-   * Returns "allow" if cookies are accepted and "disallow" if they are entirely
-   * disabled.
+   * Returns "0" if cookies are accepted and "2" if they are entirely disabled.
    */
-  readBlockCookies() {
-    // enable the rest of the UI for anything other than "accept all cookies"
+  readAcceptCookies() {
     let pref = Preferences.get("network.cookie.cookieBehavior");
-    let blockCookies = (pref.value != 0);
+    let acceptThirdPartyLabel = document.getElementById("acceptThirdPartyLabel");
+    let acceptThirdPartyMenu = document.getElementById("acceptThirdPartyMenu");
+    let keepUntilLabel = document.getElementById("keepUntil");
+    let keepUntilMenu = document.getElementById("keepCookiesUntil");
+
+    // enable the rest of the UI for anything other than "disable all cookies"
+    let acceptCookies = (pref.value != 2);
+    let cookieBehaviorLocked = Services.prefs.prefIsLocked("network.cookie.cookieBehavior");
+    const acceptThirdPartyControlsDisabled = !acceptCookies || cookieBehaviorLocked;
+
+    acceptThirdPartyLabel.disabled = acceptThirdPartyMenu.disabled = acceptThirdPartyControlsDisabled;
+
+    let privateBrowsing = Preferences.get("browser.privatebrowsing.autostart").value;
+    let cookieExpirationLocked = Services.prefs.prefIsLocked("network.cookie.lifetimePolicy");
+    const keepUntilControlsDisabled = privateBrowsing || !acceptCookies || cookieExpirationLocked;
+    keepUntilLabel.disabled = keepUntilMenu.disabled = keepUntilControlsDisabled;
 
     // Our top-level setting is a radiogroup that only sets "enable all"
     // and "disable all", so convert the pref value accordingly.
-    return blockCookies ? "disallow" : "allow";
+    return acceptCookies ? "0" : "2";
   },
 
   /**
    * Updates the "accept third party cookies" menu based on whether the
    * "accept cookies" or "block cookies" radio buttons are selected.
    */
-  writeBlockCookies() {
-    let block = document.getElementById("blockCookies");
-    let blockCookiesMenu = document.getElementById("blockCookiesMenu");
+  writeAcceptCookies() {
+    var accept = document.getElementById("acceptCookies");
+    var acceptThirdPartyMenu = document.getElementById("acceptThirdPartyMenu");
 
-    // if we're disabling cookies, automatically select 'third-party trackers'
-    if (block.value == "disallow") {
-      blockCookiesMenu.selectedIndex = 0;
-      return this.writeBlockCookiesFrom();
-    }
+    // if we're enabling cookies, automatically select 'accept third party always'
+    if (accept.value == "0")
+      acceptThirdPartyMenu.selectedIndex = 0;
 
-    return Ci.nsICookieService.BEHAVIOR_ACCEPT;
+    return parseInt(accept.value, 10);
   },
 
   /**
-   * Converts between network.cookie.cookieBehavior and the new third-party cookies UI
+   * Converts between network.cookie.cookieBehavior and the third-party cookie UI
    */
-  readBlockCookiesFrom() {
-    let pref = Preferences.get("network.cookie.cookieBehavior");
+  readAcceptThirdPartyCookies() {
+    var pref = Preferences.get("network.cookie.cookieBehavior");
     switch (pref.value) {
-      case Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN:
-        return "all-third-parties";
-      case Ci.nsICookieService.BEHAVIOR_REJECT:
+      case 0:
         return "always";
-      case Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN:
-        return "unvisited";
-      case Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER:
-        return "trackers";
+      case 1:
+        return "never";
+      case 2:
+        return "never";
+      case 3:
+        return "visited";
       default:
         return undefined;
     }
   },
 
-  writeBlockCookiesFrom() {
-    let block = document.getElementById("blockCookiesMenu").selectedItem;
-    switch (block.value) {
-      case "trackers":
-        return Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER;
-      case "unvisited":
-        return Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN;
+  writeAcceptThirdPartyCookies() {
+    var accept = document.getElementById("acceptThirdPartyMenu").selectedItem;
+    switch (accept.value) {
       case "always":
-        return Ci.nsICookieService.BEHAVIOR_REJECT;
-      case "all-third-parties":
-        return Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN;
+        return 0;
+      case "visited":
+        return 3;
+      case "never":
+        return 1;
       default:
         return undefined;
     }
   },
 
   /**
    * Displays fine-grained, per-site preferences for cookies.
    */
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -167,62 +167,64 @@
 
   <hbox data-subcategory="sitedata" align="baseline">
     <vbox flex="1">
       <description class="description-with-side-element" flex="1">
         <html:span id="totalSiteDataSize" class="tail-with-learn-more"></html:span>
         <label id="siteDataLearnMoreLink"
           class="learnMore text-link" data-l10n-id="sitedata-learn-more"/>
       </description>
-      <radiogroup id="blockCookies"
+      <radiogroup id="acceptCookies"
                   preference="network.cookie.cookieBehavior"
-                  onsyncfrompreference="return gPrivacyPane.readBlockCookies();"
-                  onsynctopreference="return gPrivacyPane.writeBlockCookies();">
-        <radio value="allow"
-               data-l10n-id="sitedata-allow-cookies-option"
-               flex="1" />
-        <radio value="disallow"
-               data-l10n-id="sitedata-disallow-cookies-option"
-               flex="1" />
-        <hbox id="blockThirdPartyRow"
-              class="indent"
-              align="center">
-          <label id="blockCookiesLabel" control="blockCookiesMenu"
-                 data-l10n-id="sitedata-block-desc"/>
-          <!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
-          <hbox>
-            <menulist id="blockCookiesMenu" preference="network.cookie.cookieBehavior"
-                      onsyncfrompreference="return gPrivacyPane.readBlockCookiesFrom();"
-                      onsynctopreference="return gPrivacyPane.writeBlockCookiesFrom();">
-              <menupopup>
-                <menuitem id="blockCookiesFromTrackers" data-l10n-id="sitedata-block-trackers-option" value="trackers"/>
-                <menuitem data-l10n-id="sitedata-block-unvisited-option" value="unvisited"/>
-                <menuitem data-l10n-id="sitedata-block-all-third-parties-option" value="all-third-parties"/>
-                <menuitem data-l10n-id="sitedata-block-always-option" value="always"/>
-              </menupopup>
-            </menulist>
-          </hbox>
+                  onsyncfrompreference="return gPrivacyPane.readAcceptCookies();"
+                  onsynctopreference="return gPrivacyPane.writeAcceptCookies();">
+        <hbox id="cookiesBox">
+          <radio value="0"
+                 data-l10n-id="sitedata-accept-cookies-option"
+                 flex="1" />
         </hbox>
         <hbox id="keepRow"
+              class="indent"
               align="center">
           <label id="keepUntil"
                  control="keepCookiesUntil"
                  data-l10n-id="sitedata-keep-until"/>
           <!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
           <hbox>
             <menulist id="keepCookiesUntil"
                       onsyncfrompreference="return gPrivacyPane.readKeepCookiesUntil();"
                       preference="network.cookie.lifetimePolicy">
               <menupopup>
                 <menuitem data-l10n-id="sitedata-keep-until-expire" value="0"/>
                 <menuitem data-l10n-id="sitedata-keep-until-closed" value="2"/>
               </menupopup>
             </menulist>
           </hbox>
         </hbox>
+        <hbox id="acceptThirdPartyRow"
+              class="indent"
+              align="center">
+          <label id="acceptThirdPartyLabel" control="acceptThirdPartyMenu"
+                 data-l10n-id="sitedata-accept-third-party-desc"/>
+          <!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
+          <hbox>
+            <menulist id="acceptThirdPartyMenu" preference="network.cookie.cookieBehavior"
+            onsyncfrompreference="return gPrivacyPane.readAcceptThirdPartyCookies();"
+            onsynctopreference="return gPrivacyPane.writeAcceptThirdPartyCookies();">
+              <menupopup>
+                <menuitem data-l10n-id="sitedata-accept-third-party-always-option" value="always"/>
+                <menuitem data-l10n-id="sitedata-accept-third-party-visited-option" value="visited"/>
+                <menuitem data-l10n-id="sitedata-accept-third-party-never-option" value="never"/>
+              </menupopup>
+            </menulist>
+          </hbox>
+        </hbox>
+        <radio data-l10n-id="sitedata-block-cookies-option"
+               value="2"
+               flex="1" />
       </radiogroup>
     </vbox>
     <vbox>
       <!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
       <hbox>
         <button id="clearSiteDataButton"
             class="accessory-button"
             icon="clear"
--- a/browser/components/preferences/in-content/tests/browser.ini
+++ b/browser/components/preferences/in-content/tests/browser.ini
@@ -63,20 +63,21 @@ skip-if = !e10s
 skip-if = e10s
 [browser_permissions_urlFieldHidden.js]
 [browser_proxy_backup.js]
 [browser_privacypane.js]
 run-if = nightly_build
 # browser_privacypane.js only has Browser Error collection tests currently,
 # which is disabled outside Nightly. Remove this once non-Nightly tests are
 # added.
-[browser_privacypane_2.js]
+[browser_privacypane_1.js]
 [browser_privacypane_3.js]
 [browser_privacypane_4.js]
 [browser_privacypane_5.js]
+[browser_privacypane_8.js]
 [browser_sanitizeOnShutdown_prefLocked.js]
 [browser_searchShowSuggestionsFirst.js]
 [browser_searchsuggestions.js]
 [browser_security-1.js]
 [browser_security-2.js]
 [browser_spotlight.js]
 [browser_site_login_exceptions.js]
 [browser_site_autoplay_media_exceptions.js]
new file mode 100644
--- /dev/null
+++ b/browser/components/preferences/in-content/tests/browser_privacypane_1.js
@@ -0,0 +1,16 @@
+let rootDir = getRootDirectory(gTestPath);
+let jar = getJar(rootDir);
+if (jar) {
+  let tmpdir = extractJarToTmp(jar);
+  rootDir = "file://" + tmpdir.path + "/";
+}
+/* import-globals-from privacypane_tests_perwindow.js */
+Services.scriptloader.loadSubScript(rootDir + "privacypane_tests_perwindow.js", this);
+
+run_test_subset([
+  test_pane_visibility,
+  test_dependent_elements,
+  test_dependent_cookie_elements,
+  test_dependent_clearonclose_elements,
+  test_dependent_prefs,
+]);
deleted file mode 100644
--- a/browser/components/preferences/in-content/tests/browser_privacypane_2.js
+++ /dev/null
@@ -1,20 +0,0 @@
-let rootDir = getRootDirectory(gTestPath);
-let jar = getJar(rootDir);
-if (jar) {
-  let tmpdir = extractJarToTmp(jar);
-  rootDir = "file://" + tmpdir.path + "/";
-}
-/* import-globals-from privacypane_tests_perwindow.js */
-Services.scriptloader.loadSubScript(rootDir + "privacypane_tests_perwindow.js", this);
-
-SpecialPowers.pushPrefEnv({"set":
-  [["browser.contentblocking.cookies-site-data.ui.reject-trackers.enabled", false]]
-});
-
-run_test_subset([
-  test_pane_visibility,
-  test_dependent_elements,
-  test_dependent_cookie_elements,
-  test_dependent_clearonclose_elements,
-  test_dependent_prefs,
-]);
--- a/browser/components/preferences/in-content/tests/browser_privacypane_3.js
+++ b/browser/components/preferences/in-content/tests/browser_privacypane_3.js
@@ -8,11 +8,9 @@ if (jar) {
 Services.scriptloader.loadSubScript(rootDir + "privacypane_tests_perwindow.js", this);
 
 run_test_subset([
   test_custom_retention("rememberHistory", "remember"),
   test_custom_retention("rememberHistory", "custom"),
   test_custom_retention("rememberForms", "custom"),
   test_custom_retention("rememberForms", "custom"),
   test_historymode_retention("remember", "custom"),
-  test_custom_retention("alwaysClear", "remember"),
-  test_custom_retention("alwaysClear", "custom"),
 ]);
--- a/browser/components/preferences/in-content/tests/browser_privacypane_4.js
+++ b/browser/components/preferences/in-content/tests/browser_privacypane_4.js
@@ -1,20 +1,24 @@
+requestLongerTimeout(2);
+
 let rootDir = getRootDirectory(gTestPath);
 let jar = getJar(rootDir);
 if (jar) {
   let tmpdir = extractJarToTmp(jar);
   rootDir = "file://" + tmpdir.path + "/";
 }
 /* import-globals-from privacypane_tests_perwindow.js */
 Services.scriptloader.loadSubScript(rootDir + "privacypane_tests_perwindow.js", this);
-
-SpecialPowers.pushPrefEnv({"set":
-  [["browser.contentblocking.cookies-site-data.ui.reject-trackers.enabled", false]]
-});
+let runtime = Services.appInfo;
 
 run_test_subset([
-  test_pane_visibility,
-  test_dependent_elements,
-  test_dependent_cookie_elements,
-  test_dependent_clearonclose_elements,
-  test_dependent_prefs,
+  test_custom_retention("acceptCookies", "remember"),
+  test_custom_retention("acceptCookies", "custom"),
+  test_custom_retention("acceptThirdPartyMenu", "custom", "visited"),
+  test_custom_retention("acceptThirdPartyMenu", "custom", "always"),
+  test_custom_retention("keepCookiesUntil", "custom", 1),
+  test_custom_retention("keepCookiesUntil", "custom", 2),
+  test_custom_retention("keepCookiesUntil", "custom", 0),
+  test_custom_retention("alwaysClear", "custom"),
+  test_custom_retention("alwaysClear", "custom"),
+  test_historymode_retention("remember", "custom"),
 ]);
new file mode 100644
--- /dev/null
+++ b/browser/components/preferences/in-content/tests/browser_privacypane_8.js
@@ -0,0 +1,25 @@
+let rootDir = getRootDirectory(gTestPath);
+let jar = getJar(rootDir);
+if (jar) {
+  let tmpdir = extractJarToTmp(jar);
+  rootDir = "file://" + tmpdir.path + "/";
+}
+/* import-globals-from privacypane_tests_perwindow.js */
+Services.scriptloader.loadSubScript(rootDir + "privacypane_tests_perwindow.js", this);
+
+run_test_subset([
+  // history mode should be initialized to remember
+  test_historymode_retention("remember", undefined),
+
+  // history mode should remain remember; toggle acceptCookies checkbox
+  test_custom_retention("acceptCookies", "remember"),
+
+  // history mode should now be custom; set history mode to dontremember
+  test_historymode_retention("dontremember", "custom"),
+
+  // history mode should remain custom; set history mode to remember
+  test_historymode_retention("remember", "custom"),
+
+  // history mode should now be remember
+  test_historymode_retention("remember", "remember"),
+]);
--- a/browser/components/preferences/in-content/tests/privacypane_tests_perwindow.js
+++ b/browser/components/preferences/in-content/tests/privacypane_tests_perwindow.js
@@ -49,17 +49,19 @@ function test_dependent_elements(win) {
     win.document.getElementById("keepUntil"),
     win.document.getElementById("keepCookiesUntil"),
     win.document.getElementById("alwaysClear"),
   ];
   controls.forEach(function(control) {
     ok(control, "the dependent controls should exist");
   });
   let independents = [
-    win.document.getElementById("blockCookies")
+    win.document.getElementById("acceptCookies"),
+    win.document.getElementById("acceptThirdPartyLabel"),
+    win.document.getElementById("acceptThirdPartyMenu")
   ];
   independents.forEach(function(control) {
     ok(control, "the independent controls should exist");
   });
   let cookieexceptions = win.document.getElementById("cookieExceptions");
   ok(cookieexceptions, "the cookie exceptions button should exist");
   let keepuntil = win.document.getElementById("keepCookiesUntil");
   ok(keepuntil, "the keep cookies until menulist should exist");
@@ -111,63 +113,49 @@ function test_dependent_elements(win) {
   controlChanged(historymode);
   expect_disabled(false);
   check_independents(false);
 }
 
 function test_dependent_cookie_elements(win) {
   let keepUntil = win.document.getElementById("keepUntil");
   let keepCookiesUntil = win.document.getElementById("keepCookiesUntil");
-  let blockCookiesLabel = win.document.getElementById("blockCookiesLabel");
-  let blockCookiesMenu = win.document.getElementById("blockCookiesMenu");
+  let acceptThirdPartyLabel = win.document.getElementById("acceptThirdPartyLabel");
+  let acceptThirdPartyMenu = win.document.getElementById("acceptThirdPartyMenu");
 
-  let controls = [blockCookiesLabel, blockCookiesMenu, keepUntil, keepCookiesUntil];
+  let controls = [acceptThirdPartyLabel, acceptThirdPartyMenu, keepUntil, keepCookiesUntil];
   controls.forEach(function(control) {
     ok(control, "the dependent cookie controls should exist");
   });
-  let blockcookies = win.document.getElementById("blockCookies");
-  ok(blockcookies, "the block cookies checkbox should exist");
+  let acceptcookies = win.document.getElementById("acceptCookies");
+  ok(acceptcookies, "the accept cookies checkbox should exist");
 
   function expect_disabled(disabled, c = controls) {
     c.forEach(function(control) {
       is(control.disabled, disabled,
         control.getAttribute("id") + " should " + (disabled ? "" : "not ") + "be disabled");
     });
   }
 
-  blockcookies.value = "disallow";
-  controlChanged(blockcookies);
-  expect_disabled(false);
-
-  blockcookies.value = "allow";
-  controlChanged(blockcookies);
-  expect_disabled(true, [blockCookiesLabel, blockCookiesMenu]);
-  expect_disabled(false, [keepUntil, keepCookiesUntil]);
+  acceptcookies.value = "2";
+  controlChanged(acceptcookies);
+  expect_disabled(true);
 
-  blockCookiesMenu.value = "always";
-  controlChanged(blockCookiesMenu);
-  expect_disabled(true, [keepUntil, keepCookiesUntil]);
-  expect_disabled(false, [blockCookiesLabel, blockCookiesMenu]);
-
-  if (win.contentBlockingCookiesAndSiteDataRejectTrackersEnabled) {
-    blockCookiesMenu.value = "trackers";
-  } else {
-    blockCookiesMenu.value = "unvisited";
-  }
-  controlChanged(blockCookiesMenu);
+  acceptcookies.value = "1";
+  controlChanged(acceptcookies);
   expect_disabled(false);
 
   let historymode = win.document.getElementById("historyMode");
 
   // The History mode setting for "never remember history" should still
   // disable the "keep cookies until..." menu.
   historymode.value = "dontremember";
   controlChanged(historymode);
   expect_disabled(true, [keepUntil, keepCookiesUntil]);
-  expect_disabled(false, [blockCookiesLabel, blockCookiesMenu]);
+  expect_disabled(false, [acceptThirdPartyLabel, acceptThirdPartyMenu]);
 
   historymode.value = "remember";
   controlChanged(historymode);
   expect_disabled(false);
 }
 
 function test_dependent_clearonclose_elements(win) {
   let historymode = win.document.getElementById("historyMode");
--- a/browser/locales/en-US/browser/preferences/preferences.ftl
+++ b/browser/locales/en-US/browser/preferences/preferences.ftl
@@ -728,47 +728,41 @@ sitedata-total-size-calculating = Calculating site data and cache size…
 
 # Variables:
 #   $value (Number) - Value of the unit (for example: 4.6, 500)
 #   $unit (String) - Name of the unit (for example: "bytes", "KB")
 sitedata-total-size = Your stored cookies, site data and cache are currently using { $value } { $unit } of disk space.
 
 sitedata-learn-more = Learn more
 
+sitedata-accept-cookies-option =
+    .label = Accept cookies and site data from websites (recommended)
+    .accesskey = A
+
+sitedata-block-cookies-option =
+    .label = Block cookies and site data (may cause websites to break)
+    .accesskey = B
+
 sitedata-keep-until = Keep until
     .accesskey = u
 
 sitedata-keep-until-expire =
     .label = They expire
 sitedata-keep-until-closed =
     .label = { -brand-short-name } is closed
 
-sitedata-allow-cookies-option =
-    .label = Accept cookies and site data
-    .accesskey = A
-
-sitedata-disallow-cookies-option =
-    .label = Block cookies and site data
-    .accesskey = B
+sitedata-accept-third-party-desc = Accept third-party cookies and site data
+    .accesskey = y
 
-# This label means 'type of content that is blocked', and is followed by a drop-down list with content types below.
-# The list items are the strings named sitedata-block-*-option*.
-sitedata-block-desc = Type blocked
-    .accesskey = T
-
-sitedata-block-trackers-option-recommended =
-    .label = Third party trackers (recommended)
-sitedata-block-trackers-option =
-    .label = Third party trackers
-sitedata-block-unvisited-option =
-    .label = Cookies from unvisited websites
-sitedata-block-all-third-parties-option =
-    .label = All third-party cookies
-sitedata-block-always-option =
-    .label = All cookies (may cause websites to break)
+sitedata-accept-third-party-always-option =
+    .label = Always
+sitedata-accept-third-party-visited-option =
+    .label = From visited
+sitedata-accept-third-party-never-option =
+    .label = Never
 
 sitedata-clear =
     .label = Clear Data…
     .accesskey = l
 
 sitedata-settings =
     .label = Manage Data…
     .accesskey = M
--- a/browser/themes/shared/incontentprefs/preferences.inc.css
+++ b/browser/themes/shared/incontentprefs/preferences.inc.css
@@ -406,18 +406,17 @@ button > hbox > label {
 }
 
 #historyButtons {
   display: flex;
   flex-direction: column;
   justify-content: space-between;
 }
 
-#blockCookies,
-#keepRow {
+#acceptCookies {
   margin-top: 1.5em;
 }
 
 /* Collapse the non-active vboxes in decks to use only the height the
    active vbox needs */
 #historyPane:not([selectedIndex="1"]) > #historyDontRememberPane,
 #historyPane:not([selectedIndex="2"]) > #historyCustomPane,
 #weavePrefsDeck:not([selectedIndex="1"]) > #hasFxaAccount,