1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 13:54:57 +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:
Kenneth Myhra 2023-02-14 22:43:17 +01:00 committed by Linus Groh
parent 0d9076c9f5
commit c120c46acc
20 changed files with 85 additions and 85 deletions

View file

@ -71,7 +71,7 @@ void HTMLScriptElement::execute_script()
// 3. If el's result is null, then fire an event named error at el, and return.
if (m_result.has<ResultState::Null>()) {
dbgln("HTMLScriptElement: Refusing to run script because the element's result is null.");
dispatch_event(*DOM::Event::create(realm(), HTML::EventNames::error));
dispatch_event(DOM::Event::create(realm(), HTML::EventNames::error).release_value_but_fixme_should_propagate_errors());
return;
}
@ -122,7 +122,7 @@ void HTMLScriptElement::execute_script()
// 8. If el's from an external file is true, then fire an event named load at el.
if (m_from_an_external_file)
dispatch_event(*DOM::Event::create(realm(), HTML::EventNames::load));
dispatch_event(DOM::Event::create(realm(), HTML::EventNames::load).release_value_but_fixme_should_propagate_errors());
}
// https://html.spec.whatwg.org/multipage/scripting.html#prepare-a-script
@ -292,7 +292,7 @@ void HTMLScriptElement::prepare_script()
if (m_script_type == ScriptType::ImportMap) {
// then queue an element task on the DOM manipulation task source given el to fire an event named error at el, and return.
queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {
dispatch_event(*DOM::Event::create(realm(), HTML::EventNames::error));
dispatch_event(DOM::Event::create(realm(), HTML::EventNames::error).release_value_but_fixme_should_propagate_errors());
});
return;
}
@ -304,7 +304,7 @@ void HTMLScriptElement::prepare_script()
if (src.is_empty()) {
dbgln("HTMLScriptElement: Refusing to run script because the src attribute is empty.");
queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {
dispatch_event(*DOM::Event::create(realm(), HTML::EventNames::error));
dispatch_event(DOM::Event::create(realm(), HTML::EventNames::error).release_value_but_fixme_should_propagate_errors());
});
return;
}
@ -319,7 +319,7 @@ void HTMLScriptElement::prepare_script()
if (!url.is_valid()) {
dbgln("HTMLScriptElement: Refusing to run script because the src URL '{}' is invalid.", url);
queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {
dispatch_event(*DOM::Event::create(realm(), HTML::EventNames::error));
dispatch_event(DOM::Event::create(realm(), HTML::EventNames::error).release_value_but_fixme_should_propagate_errors());
});
return;
}