LibURL+LibWeb: Make URL::serialize return a String

Simplifying a bunch of uneeded error handling around the place.
This commit is contained in:
Shannon Booth 2024-12-03 22:31:33 +13:00 committed by Sam Atkins
commit 0fa54c2327
Notes: github-actions[bot] 2024-12-04 16:48:13 +00:00
52 changed files with 88 additions and 103 deletions

View file

@ -424,7 +424,7 @@ String HTMLHyperlinkElementUtils::href() const
return href_content_attribute.release_value();
// 5. Return url, serialized.
return MUST(String::from_byte_string(url->serialize()));
return url->serialize();
}
// https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-href
@ -438,7 +438,7 @@ WebIDL::ExceptionOr<void> HTMLHyperlinkElementUtils::set_href(String href)
void HTMLHyperlinkElementUtils::update_href()
{
// To update href, set the element's href content attribute's value to the element's url, serialized.
MUST(set_hyperlink_element_utils_href(MUST(String::from_byte_string(m_url->serialize()))));
MUST(set_hyperlink_element_utils_href(m_url->serialize()));
}
bool HTMLHyperlinkElementUtils::cannot_navigate() const
@ -492,7 +492,7 @@ void HTMLHyperlinkElementUtils::follow_the_hyperlink(Optional<String> hyperlink_
if (!url.is_valid())
return;
auto url_string = MUST(url.to_string());
auto url_string = url.to_string();
// 10. If hyperlinkSuffix is non-null, then append it to urlString.
if (hyperlink_suffix.has_value()) {