aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlinputelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmlinputelement.rs')
-rw-r--r--components/script/dom/htmlinputelement.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs
index 0a5624b77ea..f0af836c983 100644
--- a/components/script/dom/htmlinputelement.rs
+++ b/components/script/dom/htmlinputelement.rs
@@ -613,6 +613,18 @@ impl<'a> Activatable for JSRef<'a, HTMLInputElement> {
Temporary::from_rooted(ElementCast::from_ref(*self))
}
+ fn is_instance_activatable(&self) -> bool {
+ match self.input_type.get() {
+ // https://html.spec.whatwg.org/multipage/forms.html#submit-button-state-%28type=submit%29:activation-behaviour-2
+ // https://html.spec.whatwg.org/multipage/forms.html#reset-button-state-%28type=reset%29:activation-behaviour-2
+ // https://html.spec.whatwg.org/multipage/forms.html#checkbox-state-%28type=checkbox%29:activation-behaviour-2
+ // https://html.spec.whatwg.org/multipage/forms.html#radio-button-state-%28type=radio%29:activation-behaviour-2
+ InputType::InputSubmit | InputType::InputReset
+ | InputType::InputCheckbox | InputType::InputRadio => self.mutable(),
+ _ => false
+ }
+ }
+
// https://html.spec.whatwg.org/multipage/interaction.html#run-pre-click-activation-steps
#[allow(unsafe_blocks)]
fn pre_click_activation(&self) {