LibWeb: Set correct content and document types in DOMParser

It appears this was removed by accident in an earlier commit, regressing
the included WPT test.
This commit is contained in:
Veeti Paananen 2025-07-09 08:29:06 +03:00 committed by Shannon Booth
parent bfa978c501
commit c834c594ac
Notes: github-actions[bot] 2025-07-09 08:11:21 +00:00
3 changed files with 103 additions and 0 deletions

View file

@ -49,6 +49,8 @@ GC::Ref<DOM::Document> DOMParser::parse_from_string(StringView string, Bindings:
if (type == Bindings::DOMParserSupportedType::Text_Html) {
// -> "text/html"
document = HTML::HTMLDocument::create(realm(), associated_document.url());
document->set_content_type(Bindings::idl_enum_to_string(type));
document->set_document_type(DOM::Document::Type::HTML);
// 1. Parse HTML from a string given document and compliantString. FIXME: Use compliantString.
document->parse_html_from_a_string(string);