1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 09:35:07 +00:00

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
This commit is contained in:
Luke 2020-11-13 08:34:40 +00:00 committed by Andreas Kling
parent dcb21b0c3a
commit 1993ccb456

View file

@ -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;
};