LibWeb: Change HTMLParser's factory to accept the encoding as StringView

No need to force an allocation. This makes a future patch a bit simpler,
where we will have the encoding as a String. With this patch, we won't
have to convert it to a ByteString.
This commit is contained in:
Timothy Flynn 2024-04-03 21:56:58 -04:00 committed by Andreas Kling
commit 48fb343230
Notes: sideshowbarker 2024-07-17 05:18:58 +09:00
5 changed files with 8 additions and 8 deletions

View file

@ -1127,7 +1127,7 @@ WebIDL::ExceptionOr<void> Navigable::populate_session_history_entry_document(
// FIXME: Add error message to generated error page
auto error_html = load_error_page(entry->url()).release_value_but_fixme_should_propagate_errors();
entry->document_state()->set_document(create_document_for_inline_content(this, navigation_id, [error_html](auto& document) {
auto parser = HTML::HTMLParser::create(document, error_html, "utf-8");
auto parser = HTML::HTMLParser::create(document, error_html, "utf-8"sv);
document.set_url(URL::URL("about:error"));
parser->run();
}));