From c120c46acc4bc12fa8f3f9ed5f9f953626d3cf9e Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Tue, 14 Feb 2023 22:43:17 +0100 Subject: 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. --- Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Userland/Libraries/LibWeb/HTML/Parser') diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index 9e1c172513..b8148c3fee 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -253,9 +253,9 @@ void HTMLParser::the_end() document->load_timing_info().dom_content_loaded_event_start_time = HighResolutionTime::unsafe_shared_current_time(); // 2. Fire an event named DOMContentLoaded at the Document object, with its bubbles attribute initialized to true. - auto content_loaded_event = DOM::Event::create(document->realm(), HTML::EventNames::DOMContentLoaded); + auto content_loaded_event = DOM::Event::create(document->realm(), HTML::EventNames::DOMContentLoaded).release_value_but_fixme_should_propagate_errors(); content_loaded_event->set_bubbles(true); - document->dispatch_event(*content_loaded_event); + document->dispatch_event(content_loaded_event); // 3. Set the Document's load timing info's DOM content loaded event end time to the current high resolution time given the Document's relevant global object. document->load_timing_info().dom_content_loaded_event_end_time = HighResolutionTime::unsafe_shared_current_time(); @@ -294,7 +294,7 @@ void HTMLParser::the_end() // 5. Fire an event named load at window, with legacy target override flag set. // FIXME: The legacy target override flag is currently set by a virtual override of dispatch_event() // We should reorganize this so that the flag appears explicitly here instead. - window->dispatch_event(*DOM::Event::create(document->realm(), HTML::EventNames::load)); + window->dispatch_event(DOM::Event::create(document->realm(), HTML::EventNames::load).release_value_but_fixme_should_propagate_errors()); // FIXME: 6. Invoke WebDriver BiDi load complete with the Document's browsing context, and a new WebDriver BiDi navigation status whose id is the Document object's navigation id, status is "complete", and url is the Document object's URL. -- cgit v1.2.3