Bug 1745058 - Get rid of dom.webcomponents.disabledFeatures.enabled pref; r=smaug
authorEdgar Chen <echen@mozilla.com>
Thu, 19 May 2022 07:43:01 +0000
changeset 618212 3e7cbc8b1b366f04141ebee987fc2141b2e873ea
parent 618211 fed95db5980319412ad84c1f3089f48a60b83663
child 618213 fec5550d39906b2a58d1a31bfcf5b3068b757a68
push id39719
push usersmolnar@mozilla.com
push dateThu, 19 May 2022 16:03:14 +0000
treeherdermozilla-central@cc776278c4ea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1745058
milestone102.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 1745058 - Get rid of dom.webcomponents.disabledFeatures.enabled pref; r=smaug Depends on D146741 Differential Revision: https://phabricator.services.mozilla.com/D146742
dom/base/CustomElementRegistry.cpp
modules/libpref/init/StaticPrefList.yaml
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -970,41 +970,39 @@ void CustomElementRegistry::Define(
      */
     if (callbacksHolder->mAttributeChangedCallback.WasPassed()) {
       if (!JSObjectToAtomArray(aCx, constructor, u"observedAttributes"_ns,
                                observedAttributes, aRv)) {
         return;
       }
     }
 
-    if (StaticPrefs::dom_webcomponents_disabledFeatures_enabled()) {
-      /**
-       * 14.6. Let disabledFeatures be an empty sequence<DOMString>.
-       * 14.7. Let disabledFeaturesIterable be Get(constructor,
-       *       "disabledFeatures"). Rethrow any exceptions.
-       * 14.8. If disabledFeaturesIterable is not undefined, then set
-       *       disabledFeatures to the result of converting
-       *       disabledFeaturesIterable to a sequence<DOMString>.
-       *       Rethrow any exceptions from the conversion.
-       */
-      if (!JSObjectToAtomArray(aCx, constructor, u"disabledFeatures"_ns,
-                               disabledFeatures, aRv)) {
-        return;
-      }
+    /**
+     * 14.6. Let disabledFeatures be an empty sequence<DOMString>.
+     * 14.7. Let disabledFeaturesIterable be Get(constructor,
+     *       "disabledFeatures"). Rethrow any exceptions.
+     * 14.8. If disabledFeaturesIterable is not undefined, then set
+     *       disabledFeatures to the result of converting
+     *       disabledFeaturesIterable to a sequence<DOMString>.
+     *       Rethrow any exceptions from the conversion.
+     */
+    if (!JSObjectToAtomArray(aCx, constructor, u"disabledFeatures"_ns,
+                             disabledFeatures, aRv)) {
+      return;
+    }
 
-      // 14.9. Set disableInternals to true if disabledFeaturesSequence contains
-      //       "internals".
-      disableInternals = disabledFeatures.Contains(
-          static_cast<nsStaticAtom*>(nsGkAtoms::internals));
+    // 14.9. Set disableInternals to true if disabledFeaturesSequence contains
+    //       "internals".
+    disableInternals = disabledFeatures.Contains(
+        static_cast<nsStaticAtom*>(nsGkAtoms::internals));
 
-      // 14.10. Set disableShadow to true if disabledFeaturesSequence contains
-      //        "shadow".
-      disableShadow = disabledFeatures.Contains(
-          static_cast<nsStaticAtom*>(nsGkAtoms::shadow));
-    }
+    // 14.10. Set disableShadow to true if disabledFeaturesSequence contains
+    //        "shadow".
+    disableShadow = disabledFeatures.Contains(
+        static_cast<nsStaticAtom*>(nsGkAtoms::shadow));
 
     if (StaticPrefs::dom_webcomponents_formAssociatedCustomElement_enabled()) {
       // 14.11. Let formAssociatedValue be Get(constructor, "formAssociated").
       //        Rethrow any exceptions.
       JS::Rooted<JS::Value> formAssociatedValue(aCx);
       if (!JS_GetProperty(aCx, constructor, "formAssociated",
                           &formAssociatedValue)) {
         aRv.NoteJSContextException(aCx);
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -4103,22 +4103,16 @@
 
 # NOTE: This preference is used in unit tests. If it is removed or its default
 # value changes, please update test_sharedMap_static_prefs.js accordingly.
 - name: dom.webcomponents.shadowdom.report_usage
   type: bool
   value: false
   mirror: always
 
-# Is support for custom element disabledFeatures enabled?
-- name: dom.webcomponents.disabledFeatures.enabled
-  type: bool
-  value: true
-  mirror: always
-
 # Is support for form-associated custom element enabled?
 - name: dom.webcomponents.formAssociatedCustomElement.enabled
   type: bool
   value: true
   mirror: always
 
 # Is support for the Web GPU API enabled?
 - name: dom.webgpu.enabled