Bug 1888507 - Do not dispatch input, change for detached checkbox, radio. r=dom-core,sefeng

Differential Revision: https://phabricator.services.mozilla.com/D217408
This commit is contained in:
Vincent Hilla
2024-10-22 13:21:16 +00:00
parent dc190169fd
commit 257d5eb9f2
2 changed files with 3 additions and 15 deletions

View File

@@ -4106,7 +4106,9 @@ void HTMLInputElement::ActivationBehavior(EventChainPostVisitor& aVisitor) {
return;
}
if (mCheckedIsToggled) {
// https://html.spec.whatwg.org/#checkbox-state-(type=checkbox):input-activation-behavior
// If element is connected, fire input and change event
if (mCheckedIsToggled && IsInComposedDoc()) {
SetUserInteracted(true);
// Fire input event and then change event.