Bug 1827019 - Reset mFieldset after unlink; r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D176356
This commit is contained in:
Edgar Chen
2023-04-27 21:48:43 +00:00
parent 5a6b6c8db8
commit bce9491bb2
2 changed files with 3 additions and 1 deletions

View File

@@ -1938,7 +1938,8 @@ void nsGenericHTMLFormElement::AfterSetAttr(
}
void nsGenericHTMLFormElement::ForgetFieldSet(nsIContent* aFieldset) {
if (IsFormAssociatedElement() && GetFieldSetInternal() == aFieldset) {
MOZ_DIAGNOSTIC_ASSERT(IsFormAssociatedElement());
if (GetFieldSetInternal() == aFieldset) {
SetFieldSetInternal(nullptr);
}
}