Bug 1648223 - Enable the Experimental Preferences by default. r=mstriemer,preferences-reviewers,ntim
authorJared Wein <jwein@mozilla.com>
Fri, 26 Jun 2020 18:23:24 +0000
changeset 537653 647dc310f17872822babcaf48e1bb4d298bfcecf
parent 537652 1dd4d8a6ab36c62fcb63b89122c3ed213b39dfaf
child 537654 3285aa54f529bfe23362f213013acc7272df53f5
push id120137
push userjwein@mozilla.com
push dateFri, 26 Jun 2020 18:47:05 +0000
treeherderautoland@647dc310f178 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstriemer, preferences-reviewers, ntim
bugs1648223
milestone79.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 1648223 - Enable the Experimental Preferences by default. r=mstriemer,preferences-reviewers,ntim Differential Revision: https://phabricator.services.mozilla.com/D81111
browser/app/profile/firefox.js
browser/components/preferences/preferences.js
toolkit/components/featuregates/docs/index.rst
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -749,17 +749,21 @@ pref("plugins.favorfallback.rules", "nos
 #ifdef XP_WIN
   pref("browser.preferences.instantApply", false);
 #else
   pref("browser.preferences.instantApply", true);
 #endif
 
 // Toggling Search bar on and off in about:preferences
 pref("browser.preferences.search", true);
+#if defined(NIGHTLY_BUILD)
+pref("browser.preferences.experimental", true);
+#else
 pref("browser.preferences.experimental", false);
+#endif
 pref("browser.preferences.defaultPerformanceSettings.enabled", true);
 
 pref("browser.download.show_plugins_in_list", true);
 pref("browser.download.hide_plugins_without_extensions", true);
 
 // Backspace and Shift+Backspace behavior
 // 0 goes Back/Forward
 // 1 act like PgUp/PgDown
--- a/browser/components/preferences/preferences.js
+++ b/browser/components/preferences/preferences.js
@@ -79,24 +79,27 @@ function init_all() {
   Preferences.forceEnableInstantApply();
 
   gSubDialog.init();
   register_module("paneGeneral", gMainPane);
   register_module("paneHome", gHomePane);
   register_module("paneSearch", gSearchPane);
   register_module("panePrivacy", gPrivacyPane);
   register_module("paneContainers", gContainersPane);
+  if (Services.prefs.getBoolPref("browser.preferences.experimental")) {
+    document.getElementById("category-experimental").hidden = false;
+    register_module("paneExperimental", gExperimentalPane);
+  }
+  // The Sync category needs to be the last of the "real" categories
+  // registered and inititalized since many tests wait for the
+  // "sync-pane-loaded" observer notification before starting the test.
   if (Services.prefs.getBoolPref("identity.fxaccounts.enabled")) {
     document.getElementById("category-sync").hidden = false;
     register_module("paneSync", gSyncPane);
   }
-  if (Services.prefs.getBoolPref("browser.preferences.experimental")) {
-    document.getElementById("category-experimental").hidden = false;
-    register_module("paneExperimental", gExperimentalPane);
-  }
   register_module("paneSearchResults", gSearchResultsPane);
   gSearchResultsPane.init();
   gMainPane.preInit();
 
   let categories = document.getElementById("categories");
   categories.addEventListener("select", event => gotoPref(event.target.value));
 
   document.documentElement.addEventListener("keydown", function(event) {
--- a/toolkit/components/featuregates/docs/index.rst
+++ b/toolkit/components/featuregates/docs/index.rst
@@ -10,31 +10,35 @@ pitfalls of other systems, such as using
 to be compatible with tools that want to know and affect the state of
 features in Firefox over time and in the wild.
 
 Feature Definitions
 ===================
 
 All features must have a definition, specified in
 ``toolkit/components/featuregates/Features.toml``. These definitions include
-data such as title and description (to be shown to users), and bug numbers (to
-track the development of the feature over time). Here is an example feature
-definition with an id of ``demo-feature``:
+data such as references to title and description strings (to be shown to users),
+and bug numbers (to track the development of the feature over time). Here is an
+example feature definition with an id of ``demo-feature``:
 
 .. code-block:: toml
 
    [demo-feature]
-   title = "Demo Feature"
-   description = "A no-op feature to demo the feature gate system."
+   title = "experimental-features-demo-feature"
+   description = "experimental-features-demo-feature-description"
    restart-required = false
    bug-numbers = [1479127]
    type = boolean
    is-public = {default = false, nightly = true}
    default-value = {default = false, nightly = true}
 
+The references defined in the `title` and `description` values point to strings
+stored in ``toolkit/locales/en-US/toolkit/featuregates/features.ftl``. The `title`
+string should specify the user-facing string as the `label` attribute.
+
 .. _targeted value:
 
 Targeted values
 ---------------
 
 Several fields can take a value that indicates it varies by channel and OS.
 These are known as *targeted values*. The simplest computed value is to
 simply provide the value:
@@ -78,27 +82,50 @@ more-specific case matches. The conditio
 * ``mac``
 * ``linux``
 * ``android``
 
 Fields
 ------
 
 title
-    Required. A human readable name for the feature, meant to be shown to
-    users. Should fit onto a single line.
+    Required. The string ID of the human readable name for the feature, meant to be shown to
+    users. Should fit onto a single line. The actual string should be defined in
+    ``toolkit/locales/en-US/toolkit/featuregates/features.ftl`` with the user-facing value
+    defined as the `label` attribute of the string.
 
 description
-    Required. A human readable description for the feature, meant to be shown to
-    users. Should be at most a paragraph.
+    Required. The string ID of the human readable description for the feature, meant to be shown to
+    users. Should be at most a paragraph. The actual string should be defined in
+    ``toolkit/locales/en-US/toolkit/featuregates/features.ftl``.
 
 description-links
     Optional. A dictionary of key-value pairs that are referenced in the description. The key
     name must appear in the description localization text as
-    <a data-l10n-name="key-name">.
+    <a data-l10n-name="key-name">. For example in Features.toml:
+
+.. code-block:: toml
+
+   [demo-feature]
+   title = "experimental-features-demo-feature"
+   description = "experimental-features-demo-feature-description"
+   description-links = {exampleCom = "https://example.com", exampleOrg = "https://example.org"}
+   restart-required = false
+   bug-numbers = [1479127]
+   type = boolean
+   is-public = {default = false, nightly = true}
+   default-value = {default = false, nightly = true}
+
+and in features.ftl:
+
+.. code-block:: fluent
+
+   experimental-features-demo-feature =
+       .label = Example Demo Feature
+   experimental-features-demo-feature-description = Example demo feature that can point to <a data-l10n-name="exampleCom">.com</a> links and <a data-l10n-name="exampleOrg">.org</a> links.
 
 bug-numbers
     Required. A list of bug numbers related to this feature. This should
     likely be the metabug for the the feature, but any related bugs can be
     included. At least one bug is required.
 
 restart-required
     Required. If this feature requires a the browser to be restarted for changes