|
@@ -4373,11 +4373,11 @@ JS::NonnullGCPtr<HTMLParser> HTMLParser::create_for_scripting(DOM::Document& doc
|
|
return document.heap().allocate_without_realm<HTMLParser>(document);
|
|
return document.heap().allocate_without_realm<HTMLParser>(document);
|
|
}
|
|
}
|
|
|
|
|
|
-JS::NonnullGCPtr<HTMLParser> HTMLParser::create_with_uncertain_encoding(DOM::Document& document, ByteBuffer const& input)
|
|
|
|
|
|
+JS::NonnullGCPtr<HTMLParser> HTMLParser::create_with_uncertain_encoding(DOM::Document& document, ByteBuffer const& input, Optional<MimeSniff::MimeType> maybe_mime_type)
|
|
{
|
|
{
|
|
if (document.has_encoding())
|
|
if (document.has_encoding())
|
|
return document.heap().allocate_without_realm<HTMLParser>(document, input, document.encoding().value().to_byte_string());
|
|
return document.heap().allocate_without_realm<HTMLParser>(document, input, document.encoding().value().to_byte_string());
|
|
- auto encoding = run_encoding_sniffing_algorithm(document, input);
|
|
|
|
|
|
+ auto encoding = run_encoding_sniffing_algorithm(document, input, maybe_mime_type);
|
|
dbgln_if(HTML_PARSER_DEBUG, "The encoding sniffing algorithm returned encoding '{}'", encoding);
|
|
dbgln_if(HTML_PARSER_DEBUG, "The encoding sniffing algorithm returned encoding '{}'", encoding);
|
|
return document.heap().allocate_without_realm<HTMLParser>(document, input, encoding);
|
|
return document.heap().allocate_without_realm<HTMLParser>(document, input, encoding);
|
|
}
|
|
}
|