зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1723396 - Ship Custom Elements disabledFeatures; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D121491
This commit is contained in:
Родитель
2c6fa34fb9
Коммит
f7e947ba90
|
@ -916,6 +916,7 @@ void CustomElementRegistry::Define(
|
|||
}
|
||||
}
|
||||
|
||||
if (StaticPrefs::dom_webcomponents_disabledFeatures_enabled()) {
|
||||
/**
|
||||
* 14.6. Let disabledFeatures be an empty sequence<DOMString>.
|
||||
* 14.7. Let disabledFeaturesIterable be Get(constructor,
|
||||
|
@ -925,7 +926,6 @@ void CustomElementRegistry::Define(
|
|||
* disabledFeaturesIterable to a sequence<DOMString>.
|
||||
* Rethrow any exceptions from the conversion.
|
||||
*/
|
||||
if (StaticPrefs::dom_webcomponents_formAssociatedCustomElement_enabled()) {
|
||||
if (!JSObjectToAtomArray(aCx, constructor, u"disabledFeatures"_ns,
|
||||
disabledFeatures, aRv)) {
|
||||
return;
|
||||
|
@ -940,7 +940,9 @@ void CustomElementRegistry::Define(
|
|||
// "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);
|
||||
|
|
|
@ -1139,9 +1139,7 @@ bool Element::CanAttachShadowDOM() const {
|
|||
*/
|
||||
// It will always have CustomElementData when the element is a valid custom
|
||||
// element or has is value.
|
||||
CustomElementData* ceData = GetCustomElementData();
|
||||
if (StaticPrefs::dom_webcomponents_formAssociatedCustomElement_enabled() &&
|
||||
ceData) {
|
||||
if (CustomElementData* ceData = GetCustomElementData()) {
|
||||
CustomElementDefinition* definition = ceData->GetCustomElementDefinition();
|
||||
// If the definition is null, the element possible hasn't yet upgraded.
|
||||
// Fallback to use LookupCustomElementDefinition to find its definition.
|
||||
|
|
|
@ -3704,6 +3704,12 @@
|
|||
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
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
prefs: [dom.webcomponents.formAssociatedCustomElement.enabled:true]
|
Загрузка…
Ссылка в новой задаче