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
parent 683c08744a
commit 48fb343230
5 changed files with 8 additions and 8 deletions

View File

@@ -53,7 +53,7 @@ JS::NonnullGCPtr<DOM::Document> DOMParser::parse_from_string(StringView string,
// 2. Create an HTML parser parser, associated with document.
// 3. Place string into the input stream for parser. The encoding confidence is irrelevant.
// FIXME: We don't have the concept of encoding confidence yet.
auto parser = HTMLParser::create(*document, string, "UTF-8");
auto parser = HTMLParser::create(*document, string, "UTF-8"sv);
// 4. Start parser and let it run until it has consumed all the characters just inserted into the input stream.
// FIXME: This is to match the default URL. Instead, pass in this's relevant global object's associated Document's URL.