From f1c88000da226ef008c25bad659313a3e252189d Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 14 Mar 2025 17:04:07 +0000 Subject: [PATCH] LibWeb/HTML: Early-out of input activation behavior for immutable inputs The spec text change corresponds to https://github.com/whatwg/html/commit/e6e914d086526b45b59866df0b3ee09c650d803e But while I'm here I might as well just implement it. :^) --- Libraries/LibWeb/HTML/HTMLInputElement.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Libraries/LibWeb/HTML/HTMLInputElement.cpp index ae124229180..ca46d705a4f 100644 --- a/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -2806,9 +2806,11 @@ void HTMLInputElement::activation_behavior(DOM::Event const& event) { // The activation behavior for input elements are these steps: - // FIXME: 1. If this element is not mutable and is not in the Checkbox state and is not in the Radio state, then return. + // 1. If element is not mutable, and element's type attribute is neither in the Checkbox nor in the Radio state, then return. + if (!is_mutable() && !first_is_one_of(m_type, TypeAttributeState::Checkbox, TypeAttributeState::RadioButton)) + return; - // 2. Run this element's input activation behavior, if any, and do nothing otherwise. + // 2. Run element's input activation behavior, if any, and do nothing otherwise. run_input_activation_behavior(event).release_value_but_fixme_should_propagate_errors(); // 3. If element has a form owner and element's type attribute is not in the Button state, then return.