mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 15:28:55 +00:00
LibWeb: Make factory methods of DOM::Event fallible
Because of interdependencies between DOM::Event and UIEvents::MouseEvent to template function fire_an_event() in WebDriverConnection.cpp, the commit: 'LibWeb: Make factory methods of UIEvents::MouseEvent fallible' have been squashed into this commit.
This commit is contained in:
parent
0d9076c9f5
commit
c120c46acc
Notes:
sideshowbarker
2024-07-17 08:13:43 +09:00
Author: https://github.com/kennethmyhra
Commit: c120c46acc
Pull-request: https://github.com/SerenityOS/serenity/pull/17491
Reviewed-by: https://github.com/linusg ✅
20 changed files with 85 additions and 85 deletions
|
@ -134,12 +134,12 @@ void HTMLInputElement::update_the_file_selection(JS::NonnullGCPtr<FileAPI::FileL
|
|||
this->set_files(files.ptr());
|
||||
|
||||
// 2. Fire an event named input at the input element, with the bubbles and composed attributes initialized to true.
|
||||
auto input_event = DOM::Event::create(this->realm(), EventNames::input, { .bubbles = true, .composed = true });
|
||||
this->dispatch_event(*input_event);
|
||||
auto input_event = DOM::Event::create(this->realm(), EventNames::input, { .bubbles = true, .composed = true }).release_value_but_fixme_should_propagate_errors();
|
||||
this->dispatch_event(input_event);
|
||||
|
||||
// 3. Fire an event named change at the input element, with the bubbles attribute initialized to true.
|
||||
auto change_event = DOM::Event::create(this->realm(), EventNames::change, { .bubbles = true });
|
||||
this->dispatch_event(*change_event);
|
||||
auto change_event = DOM::Event::create(this->realm(), EventNames::change, { .bubbles = true }).release_value_but_fixme_should_propagate_errors();
|
||||
this->dispatch_event(change_event);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -225,13 +225,13 @@ void HTMLInputElement::run_input_activation_behavior()
|
|||
return;
|
||||
|
||||
// 2. Fire an event named input at the element with the bubbles and composed attributes initialized to true.
|
||||
auto input_event = DOM::Event::create(realm(), HTML::EventNames::input);
|
||||
auto input_event = DOM::Event::create(realm(), HTML::EventNames::input).release_value_but_fixme_should_propagate_errors();
|
||||
input_event->set_bubbles(true);
|
||||
input_event->set_composed(true);
|
||||
dispatch_event(*input_event);
|
||||
dispatch_event(input_event);
|
||||
|
||||
// 3. Fire an event named change at the element with the bubbles attribute initialized to true.
|
||||
auto change_event = DOM::Event::create(realm(), HTML::EventNames::change);
|
||||
auto change_event = DOM::Event::create(realm(), HTML::EventNames::change).release_value_but_fixme_should_propagate_errors();
|
||||
change_event->set_bubbles(true);
|
||||
dispatch_event(*change_event);
|
||||
} else if (type_state() == TypeAttributeState::SubmitButton) {
|
||||
|
@ -249,7 +249,7 @@ void HTMLInputElement::run_input_activation_behavior()
|
|||
} else if (type_state() == TypeAttributeState::FileUpload) {
|
||||
show_the_picker_if_applicable(*this);
|
||||
} else {
|
||||
dispatch_event(*DOM::Event::create(realm(), EventNames::change));
|
||||
dispatch_event(DOM::Event::create(realm(), EventNames::change).release_value_but_fixme_should_propagate_errors());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -262,15 +262,15 @@ void HTMLInputElement::did_edit_text_node(Badge<BrowsingContext>)
|
|||
// NOTE: This is a bit ad-hoc, but basically implements part of "4.10.5.5 Common event behaviors"
|
||||
// https://html.spec.whatwg.org/multipage/input.html#common-input-element-events
|
||||
queue_an_element_task(HTML::Task::Source::UserInteraction, [this] {
|
||||
auto input_event = DOM::Event::create(realm(), HTML::EventNames::input);
|
||||
auto input_event = DOM::Event::create(realm(), HTML::EventNames::input).release_value_but_fixme_should_propagate_errors();
|
||||
input_event->set_bubbles(true);
|
||||
input_event->set_composed(true);
|
||||
dispatch_event(*input_event);
|
||||
|
||||
// FIXME: This should only fire when the input is "committed", whatever that means.
|
||||
auto change_event = DOM::Event::create(realm(), HTML::EventNames::change);
|
||||
auto change_event = DOM::Event::create(realm(), HTML::EventNames::change).release_value_but_fixme_should_propagate_errors();
|
||||
change_event->set_bubbles(true);
|
||||
dispatch_event(*change_event);
|
||||
dispatch_event(change_event);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue