From 1993ccb4565c3fd8a0103046b19dfbeddfcb1589 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 13 Nov 2020 08:34:40 +0000 Subject: [PATCH] LibWeb: Add default values of URL and content type in document MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As per this line in the specification: Unless stated otherwise, a document’s encoding is the utf-8 encoding, content type is "application/xml", URL is "about:blank", origin is an opaque origin, type is "xml", and its mode is "no-quirks". https://dom.spec.whatwg.org/#document --- Libraries/LibWeb/DOM/Document.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/LibWeb/DOM/Document.h b/Libraries/LibWeb/DOM/Document.h index 2f40dd4e20..50e34e3b94 100644 --- a/Libraries/LibWeb/DOM/Document.h +++ b/Libraries/LibWeb/DOM/Document.h @@ -58,7 +58,7 @@ class Document public: using WrapperType = Bindings::DocumentWrapper; - static NonnullRefPtr create(const URL& url = {}) { return adopt(*new Document(url)); } + static NonnullRefPtr create(const URL& url = "about:blank") { return adopt(*new Document(url)); } virtual ~Document() override; void set_url(const URL& url) { m_url = url; } @@ -261,7 +261,7 @@ private: RefPtr m_associated_inert_template_document; String m_ready_state { "loading" }; - String m_content_type; + String m_content_type { "application/xml" }; NonnullRefPtr m_implementation; };