1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:47:46 +00:00

LibWeb: Add the type field to DOM::Document

This patch adds the document type concept to documents and sets it in
various places.
This commit is contained in:
networkException 2022-07-03 21:44:00 +02:00 committed by Linus Groh
parent baac3ba60c
commit 6805baeedd
5 changed files with 19 additions and 5 deletions

View file

@ -25,7 +25,8 @@ NonnullRefPtr<DOM::Document> DOMParser::parse_from_string(String const& string,
// 2. Switch on type:
if (type == Bindings::DOMParserSupportedType::Text_Html) {
// -> "text/html"
// FIXME: 1. Set document's type to "html".
// 1. Set document's type to "html".
document->set_document_type(DOM::Document::Type::HTML);
// 2. Create an HTML parser parser, associated with document.
// 3. Place string into the input stream for parser. The encoding confidence is irrelevant.

View file

@ -24,8 +24,7 @@ DOM::Document& HTMLTemplateElement::appropriate_template_contents_owner_document
if (!document.associated_inert_template_document()) {
auto new_document = DOM::Document::create();
new_document->set_created_for_appropriate_template_contents(true);
// FIXME: If doc is an HTML document, mark new doc as an HTML document also.
new_document->set_document_type(document.document_type());
document.set_associated_inert_template_document(new_document);
}