mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +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
|
@ -344,7 +344,7 @@ WebIDL::ExceptionOr<GC::Ref<Document>> Document::create_and_initialize(Type type
|
|||
|
||||
// 3. If referrer is a URL record, then set document's referrer to the serialization of referrer.
|
||||
if (referrer.has<URL::URL>()) {
|
||||
document->m_referrer = MUST(String::from_byte_string(referrer.get<URL::URL>().serialize()));
|
||||
document->m_referrer = referrer.get<URL::URL>().serialize();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4468,8 +4468,8 @@ void Document::update_for_history_step_application(GC::Ref<HTML::SessionHistoryE
|
|||
// initialized to the serialization of entry's URL.
|
||||
if (old_url.fragment() != entry->url().fragment()) {
|
||||
HTML::HashChangeEventInit hashchange_event_init;
|
||||
hashchange_event_init.old_url = MUST(String::from_byte_string(old_url.serialize()));
|
||||
hashchange_event_init.new_url = MUST(String::from_byte_string(entry->url().serialize()));
|
||||
hashchange_event_init.old_url = old_url.serialize();
|
||||
hashchange_event_init.new_url = entry->url().serialize();
|
||||
auto hashchange_event = HTML::HashChangeEvent::create(realm(), "hashchange"_fly_string, hashchange_event_init);
|
||||
HTML::queue_global_task(HTML::Task::Source::DOMManipulation, relevant_global_object, GC::create_function(heap(), [hashchange_event, &relevant_global_object]() {
|
||||
relevant_global_object.dispatch_event(hashchange_event);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue