diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index 1cf586d4eb4ae..6f62bb70f59a6 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -4025,12 +4025,25 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) { - if ((aVisitor.mItemFlags & NS_OUTER_ACTIVATE_EVENT) && - (mType == FormControlType::InputReset || - mType == FormControlType::InputSubmit || - mType == FormControlType::InputImage) && - mForm) { - aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true; + + + + if (aVisitor.mItemFlags & NS_OUTER_ACTIVATE_EVENT) { + switch (mType) { + case FormControlType::InputReset: + case FormControlType::InputSubmit: + case FormControlType::InputImage: + if (mForm) { + aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true; + } + break; + case FormControlType::InputCheckbox: + case FormControlType::InputRadio: + aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true; + break; + default: + break; + } } } } diff --git a/testing/web-platform/meta/dom/events/Event-dispatch-single-activation-behavior.html.ini b/testing/web-platform/meta/dom/events/Event-dispatch-single-activation-behavior.html.ini index be6e34a1ce009..4b51e41acb341 100644 --- a/testing/web-platform/meta/dom/events/Event-dispatch-single-activation-behavior.html.ini +++ b/testing/web-platform/meta/dom/events/Event-dispatch-single-activation-behavior.html.ini @@ -14,18 +14,6 @@ [When clicking child of parent
, only child should be activated.] expected: FAIL - [When clicking child of parent , only child should be activated.] - expected: FAIL - - [When clicking child of parent , only child should be activated.] - expected: FAIL - - [When clicking child of parent , only child should be activated.] - expected: FAIL - - [When clicking child of parent , only child should be activated.] - expected: FAIL - [When clicking child of parent
, only child should be activated.] expected: FAIL diff --git a/testing/web-platform/mozilla/tests/html/semantics/forms/the-input-element/input-activation-behavior.html b/testing/web-platform/mozilla/tests/html/semantics/forms/the-input-element/input-activation-behavior.html new file mode 100644 index 0000000000000..d0ff8fd6669df --- /dev/null +++ b/testing/web-platform/mozilla/tests/html/semantics/forms/the-input-element/input-activation-behavior.html @@ -0,0 +1,103 @@ + + +Activation behavior of input + + + + + + + + +
+ +
+ + +
+ +