Bug 1726606: Default browser.display.document_color_use to 1 on MacOS. r=emilio, a=jcristau FIREFOX_91_0_2_BUILD1 FIREFOX_91_0_2_RELEASE
authorMorgan Reschenberg <mreschenberg@mozilla.com>
Thu, 19 Aug 2021 17:44:44 +0000 (2021-08-19)
changeset 658036 1aa232202866276c3ee7a2748b2bb291bf4fe6fa
parent 658035 99d8637e9a2a210f0f829779920c870e0f245b5b
child 658037 fa16b7399db663147e0ffa757804bff7aea90b9d
push id2640
push userjcristau@mozilla.com
push dateMon, 23 Aug 2021 12:38:56 +0000 (2021-08-23)
treeherdermozilla-release@1aa232202866 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio, jcristau
bugs1726606
milestone91.0.2
Bug 1726606: Default browser.display.document_color_use to 1 on MacOS. r=emilio, a=jcristau Differential Revision: https://phabricator.services.mozilla.com/D123142
accessible/tests/browser/telemetry/browser_HCM_telemetry.js
modules/libpref/init/StaticPrefList.yaml
--- a/accessible/tests/browser/telemetry/browser_HCM_telemetry.js
+++ b/accessible/tests/browser/telemetry/browser_HCM_telemetry.js
@@ -90,35 +90,35 @@ async function setForegroundColor(color)
 
 async function setBackgroundColor(color) {
   Services.prefs.setStringPref("browser.display.background_color", color);
 }
 
 add_task(async function testInit() {
   const dialogWin = await openColorsDialog();
   const menulistHCM = dialogWin.document.getElementById("useDocumentColors");
-  if (AppConstants.platform == "win" || AppConstants.platform == "macosx") {
+  if (AppConstants.platform == "win") {
     is(
       menulistHCM.value,
       "0",
-      "HCM menulist should be set to only with HCM theme on startup for windows and mac"
+      "HCM menulist should be set to only with HCM theme on startup for windows"
     );
 
     // Verify correct default value
     TelemetryTestUtils.assertKeyedScalar(
       TelemetryTestUtils.getProcessScalars("parent", true, true),
       "a11y.theme",
       "default",
       false
     );
   } else {
     is(
       menulistHCM.value,
       "1",
-      "HCM menulist should be set to never on startup for other platforms"
+      "HCM menulist should be set to never on startup for non-windows platforms"
     );
 
     // Verify correct default value
     TelemetryTestUtils.assertKeyedScalar(
       TelemetryTestUtils.getProcessScalars("parent", true, true),
       "a11y.theme",
       "always",
       false
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -974,24 +974,29 @@
   value: 32
   mirror: always
 
 - name: browser.display.background_color
   type: String
   value: "#FFFFFF"
   mirror: never
 
-# 0 = always, except in high contrast mode
-# 1 = always
-# 2 = never
-#
-# Default to 0 on windows and mac, 1 elsewhere.
+# This preference is a bit confusing because we use the opposite
+# string value in the colors dialog to indicate to users how FF HCM
+# will behave.
+# With resect to document colors, these values mean:
+# 0 = "default" = always, except in high contrast mode
+# 1 = "always"
+# 2 = "never"
+#
+# On windows, we set this to 0, which means FF HCM will mirror OS HCM.
+# Everywhere else, we set this to 1, disabling FF HCM.
 - name: browser.display.document_color_use
   type: RelaxedAtomicUint32
-#if defined(XP_WIN) || defined(XP_MACOSX)
+#if defined(XP_WIN)
   value: 0
 #else
   value: 1
 #endif
   mirror: always
   rust: true
 
 # 0 = always native