LibWeb/HTML: Early-out of input activation behavior for immutable inputs

The spec text change corresponds to e6e914d086

But while I'm here I might as well just implement it. :^)
This commit is contained in:
Sam Atkins 2025-03-14 17:04:07 +00:00 committed by Tim Ledbetter
parent 6b8adb522c
commit f1c88000da
Notes: github-actions[bot] 2025-03-14 20:34:36 +00:00

View file

@ -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.