Userland+Ladybird: Always specify url to be about:srcdoc in load_html()

After moving to navigables, we started reusing the code that populates
session history entries with the srcdoc attribute value from iframes
in `Page::load_html()` for loading HTML.

This change addresses a crash in `determine_the_origin` which occurred
because this method expected the URL to be `about:srcdoc` if we also
provided HTML content (previously, it was the URL passed along with the
HTML content into `load_html()`).
This commit is contained in:
Aliaksandr Kalenik 2023-09-17 17:12:17 +02:00 committed by Andreas Kling
commit 3c675e3f25
Notes: sideshowbarker 2024-07-16 17:12:03 +09:00
18 changed files with 31 additions and 32 deletions

View file

@ -47,9 +47,9 @@ void Page::load(const AK::URL& url)
(void)top_level_traversable()->navigate(url, *top_level_traversable()->active_document());
}
void Page::load_html(StringView html, const AK::URL& url)
void Page::load_html(StringView html)
{
(void)top_level_traversable()->navigate(url, *top_level_traversable()->active_document(), String::from_utf8(html).release_value_but_fixme_should_propagate_errors());
(void)top_level_traversable()->navigate("about:srcdoc"sv, *top_level_traversable()->active_document(), String::from_utf8(html).release_value_but_fixme_should_propagate_errors());
}
bool Page::has_ongoing_navigation() const