mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibWeb: Fire a change event on input elements in the focus update steps
This ensures the change event is received before the blur event.
This commit is contained in:
committed by
Andreas Kling
parent
301d58e2d9
commit
08ee48606d
Notes:
sideshowbarker
2024-07-16 22:22:13 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/08ee48606d Pull-request: https://github.com/SerenityOS/serenity/pull/22150 Reviewed-by: https://github.com/awesomekling ✅
@@ -1340,4 +1340,47 @@ void HTMLInputElement::activation_behavior(DOM::Event const&)
|
||||
run_input_activation_behavior().release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
bool HTMLInputElement::has_input_activation_behavior() const
|
||||
{
|
||||
switch (type_state()) {
|
||||
case TypeAttributeState::Checkbox:
|
||||
case TypeAttributeState::Color:
|
||||
case TypeAttributeState::FileUpload:
|
||||
case TypeAttributeState::ImageButton:
|
||||
case TypeAttributeState::RadioButton:
|
||||
case TypeAttributeState::ResetButton:
|
||||
case TypeAttributeState::SubmitButton:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/input.html#the-input-element:event-change-2
|
||||
bool HTMLInputElement::change_event_applies() const
|
||||
{
|
||||
switch (type_state()) {
|
||||
case TypeAttributeState::Checkbox:
|
||||
case TypeAttributeState::Color:
|
||||
case TypeAttributeState::Date:
|
||||
case TypeAttributeState::Email:
|
||||
case TypeAttributeState::FileUpload:
|
||||
case TypeAttributeState::LocalDateAndTime:
|
||||
case TypeAttributeState::Month:
|
||||
case TypeAttributeState::Number:
|
||||
case TypeAttributeState::Password:
|
||||
case TypeAttributeState::RadioButton:
|
||||
case TypeAttributeState::Range:
|
||||
case TypeAttributeState::Search:
|
||||
case TypeAttributeState::Telephone:
|
||||
case TypeAttributeState::Text:
|
||||
case TypeAttributeState::Time:
|
||||
case TypeAttributeState::URL:
|
||||
case TypeAttributeState::Week:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user