summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke <luke.wilde@live.co.uk>2020-11-13 08:34:40 +0000
committerAndreas Kling <kling@serenityos.org>2020-11-13 09:51:07 +0100
commit1993ccb4565c3fd8a0103046b19dfbeddfcb1589 (patch)
tree1b2bd8ac5d9631c89c75d564ce0b5f0ecea5b956
parentdcb21b0c3a3de1b0031f9ef3578823c6e0bd634f (diff)
downloadserenity-1993ccb4565c3fd8a0103046b19dfbeddfcb1589.zip
LibWeb: Add default values of URL and content type in document
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
-rw-r--r--Libraries/LibWeb/DOM/Document.h4
1 files 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<Document> create(const URL& url = {}) { return adopt(*new Document(url)); }
+ static NonnullRefPtr<Document> 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<Document> m_associated_inert_template_document;
String m_ready_state { "loading" };
- String m_content_type;
+ String m_content_type { "application/xml" };
NonnullRefPtr<DOMImplementation> m_implementation;
};