mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibURL+LibWeb: Make URL::serialize return a String
Simplifying a bunch of uneeded error handling around the place.
This commit is contained in:
parent
d7ac0601ab
commit
0fa54c2327
Notes:
github-actions[bot]
2024-12-04 16:48:13 +00:00
Author: https://github.com/shannonbooth
Commit: 0fa54c2327
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2727
Reviewed-by: https://github.com/AtkinsSJ ✅
52 changed files with 88 additions and 103 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue