From bc85a9bacea388392c08ab10f7f12316ea621fed Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sat, 21 Jun 2025 14:44:03 +1200 Subject: [PATCH] LibWeb/HTML: Don't return any errors for update_the_img_data There should not be any exceptions to propagate, so let's update the return type accordingly. --- Libraries/LibWeb/HTML/HTMLImageElement.cpp | 7 +++---- Libraries/LibWeb/HTML/HTMLImageElement.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Libraries/LibWeb/HTML/HTMLImageElement.cpp index 06490549e48..f0d11890ac8 100644 --- a/Libraries/LibWeb/HTML/HTMLImageElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLImageElement.cpp @@ -133,7 +133,7 @@ void HTMLImageElement::form_associated_element_attribute_changed(FlyString const } if (name.is_one_of(HTML::AttributeNames::src, HTML::AttributeNames::srcset)) { - update_the_image_data(true).release_value_but_fixme_should_propagate_errors(); + update_the_image_data(true); } if (name == HTML::AttributeNames::alt) { @@ -480,7 +480,7 @@ static BatchingDispatcher& batching_dispatcher() } // https://html.spec.whatwg.org/multipage/images.html#update-the-image-data -ErrorOr HTMLImageElement::update_the_image_data(bool restart_animations, bool maybe_omit_events) +void HTMLImageElement::update_the_image_data(bool restart_animations, bool maybe_omit_events) { // 1. If the element's node document is not fully active, then: if (!document().is_fully_active()) { @@ -572,7 +572,7 @@ ErrorOr HTMLImageElement::update_the_image_data(bool restart_animations, b }); // 8. Abort the update the image data algorithm. - return {}; + return; } } after_step_7: @@ -730,7 +730,6 @@ after_step_7: image_request->fetch_image(realm(), request); })); - return {}; } void HTMLImageElement::add_callbacks_to_image_request(GC::Ref image_request, bool maybe_omit_events, URL::URL const& url_string, String const& previous_url) diff --git a/Libraries/LibWeb/HTML/HTMLImageElement.h b/Libraries/LibWeb/HTML/HTMLImageElement.h index 06239ee17a6..d4e547efa66 100644 --- a/Libraries/LibWeb/HTML/HTMLImageElement.h +++ b/Libraries/LibWeb/HTML/HTMLImageElement.h @@ -76,7 +76,7 @@ public: void react_to_changes_in_the_environment(); // https://html.spec.whatwg.org/multipage/images.html#update-the-image-data - ErrorOr update_the_image_data(bool restart_the_animations = false, bool maybe_omit_events = false); + void update_the_image_data(bool restart_the_animations = false, bool maybe_omit_events = false); // https://html.spec.whatwg.org/multipage/images.html#use-srcset-or-picture [[nodiscard]] bool uses_srcset_or_picture() const;