mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 13:57:32 +00:00
Bug 1749663 - Get rid of dom.webcomponents.formAssociatedCustomElement.enabled pref; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D146743
This commit is contained in:
parent
d3f8ad3074
commit
ee0a09597a
@ -999,24 +999,22 @@ void CustomElementRegistry::Define(
|
||||
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);
|
||||
return;
|
||||
}
|
||||
// 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);
|
||||
return;
|
||||
}
|
||||
|
||||
// 14.12. Set formAssociated to the result of converting
|
||||
// formAssociatedValue to a boolean. Rethrow any exceptions from
|
||||
// the conversion.
|
||||
if (!ValueToPrimitive<bool, eDefault>(
|
||||
aCx, formAssociatedValue, "formAssociated", &formAssociated)) {
|
||||
aRv.NoteJSContextException(aCx);
|
||||
return;
|
||||
}
|
||||
// 14.12. Set formAssociated to the result of converting
|
||||
// formAssociatedValue to a boolean. Rethrow any exceptions from
|
||||
// the conversion.
|
||||
if (!ValueToPrimitive<bool, eDefault>(aCx, formAssociatedValue,
|
||||
"formAssociated", &formAssociated)) {
|
||||
aRv.NoteJSContextException(aCx);
|
||||
return;
|
||||
}
|
||||
} // Unset mIsCustomDefinitionRunning
|
||||
|
||||
|
@ -268,11 +268,7 @@ void HTMLElement::UpdateFormOwner(bool aBindToTree, Element* aFormIdElement) {
|
||||
|
||||
bool HTMLElement::IsFormAssociatedElement() const {
|
||||
CustomElementData* data = GetCustomElementData();
|
||||
bool isFormAssociatedCustomElement = data && data->IsFormAssociated();
|
||||
MOZ_ASSERT_IF(
|
||||
isFormAssociatedCustomElement,
|
||||
StaticPrefs::dom_webcomponents_formAssociatedCustomElement_enabled());
|
||||
return isFormAssociatedCustomElement;
|
||||
return data && data->IsFormAssociated();
|
||||
}
|
||||
|
||||
void HTMLElement::FieldSetDisabledChanged(bool aNotify) {
|
||||
|
@ -5,12 +5,6 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(async function init() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["dom.webcomponents.formAssociatedCustomElement.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function report_validity() {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{
|
||||
|
@ -13,29 +13,29 @@ interface ElementInternals {
|
||||
readonly attribute ShadowRoot? shadowRoot;
|
||||
|
||||
// Form-associated custom elements
|
||||
[Pref="dom.webcomponents.formAssociatedCustomElement.enabled", Throws]
|
||||
[Throws]
|
||||
void setFormValue((File or USVString or FormData)? value,
|
||||
optional (File or USVString or FormData)? state);
|
||||
|
||||
[Pref="dom.webcomponents.formAssociatedCustomElement.enabled", Throws]
|
||||
[Throws]
|
||||
readonly attribute HTMLFormElement? form;
|
||||
|
||||
[Pref="dom.webcomponents.formAssociatedCustomElement.enabled", Throws]
|
||||
[Throws]
|
||||
void setValidity(optional ValidityStateFlags flags = {},
|
||||
optional DOMString message,
|
||||
optional HTMLElement anchor);
|
||||
[Pref="dom.webcomponents.formAssociatedCustomElement.enabled", Throws]
|
||||
[Throws]
|
||||
readonly attribute boolean willValidate;
|
||||
[Pref="dom.webcomponents.formAssociatedCustomElement.enabled", Throws]
|
||||
[Throws]
|
||||
readonly attribute ValidityState validity;
|
||||
[Pref="dom.webcomponents.formAssociatedCustomElement.enabled", Throws]
|
||||
[Throws]
|
||||
readonly attribute DOMString validationMessage;
|
||||
[Pref="dom.webcomponents.formAssociatedCustomElement.enabled", Throws]
|
||||
[Throws]
|
||||
boolean checkValidity();
|
||||
[Pref="dom.webcomponents.formAssociatedCustomElement.enabled", Throws]
|
||||
[Throws]
|
||||
boolean reportValidity();
|
||||
|
||||
[Pref="dom.webcomponents.formAssociatedCustomElement.enabled", Throws]
|
||||
[Throws]
|
||||
readonly attribute NodeList labels;
|
||||
};
|
||||
|
||||
|
@ -4108,12 +4108,6 @@
|
||||
value: false
|
||||
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
|
||||
type: RelaxedAtomicBool
|
||||
|
@ -1,2 +1 @@
|
||||
prefs: [dom.webcomponents.formAssociatedCustomElement.enabled:true]
|
||||
leak-threshold: [default:51200]
|
||||
|
Loading…
x
Reference in New Issue
Block a user