Skip to content

Commit

Permalink
LibWeb: Mark a few calls to set_attribute as infallible
Browse files Browse the repository at this point in the history
These cannot possibly throw an exception because the attribute names are
already known to be valid.
  • Loading branch information
trflynn89 authored and gmta committed Jan 15, 2025
1 parent b43bb24 commit e95096d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Libraries/LibWeb/HTML/HTMLLIElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class HTMLLIElement final : public HTMLElement {
WebIDL::Long value();
void set_value(WebIDL::Long value)
{
set_attribute(AttributeNames::value, String::number(value)).release_value_but_fixme_should_propagate_errors();
MUST(set_attribute(AttributeNames::value, String::number(value)));
}

private:
Expand Down
2 changes: 1 addition & 1 deletion Libraries/LibWeb/HTML/HTMLOListElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class HTMLOListElement final : public HTMLElement {
WebIDL::Long start();
void set_start(WebIDL::Long start)
{
set_attribute(AttributeNames::start, String::number(start)).release_value_but_fixme_should_propagate_errors();
MUST(set_attribute(AttributeNames::start, String::number(start)));
}

private:
Expand Down
2 changes: 1 addition & 1 deletion Libraries/LibWeb/HTML/HTMLSummaryElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void HTMLSummaryElement::activation_behavior(DOM::Event const&)
if (parent->has_attribute(HTML::AttributeNames::open))
parent->remove_attribute(HTML::AttributeNames::open);
else
parent->set_attribute(HTML::AttributeNames::open, String {}).release_value_but_fixme_should_propagate_errors();
MUST(parent->set_attribute(HTML::AttributeNames::open, String {}));
}

// https://html.spec.whatwg.org/multipage/interactive-elements.html#summary-for-its-parent-details
Expand Down

0 comments on commit e95096d

Please sign in to comment.