mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Use standardized encoding names, add encoding attribute to document
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 02:29:02 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/ed2689c00a0 Pull-request: https://github.com/SerenityOS/serenity/pull/4070 Reviewed-by: https://github.com/awesomekling
@@ -199,6 +199,14 @@ public:
|
||||
const String& content_type() const { return m_content_type; }
|
||||
void set_content_type(const String& content_type) { m_content_type = content_type; }
|
||||
|
||||
const String& encoding() const { return m_encoding; }
|
||||
void set_encoding(const String& encoding) { m_encoding = encoding; }
|
||||
|
||||
// NOTE: These are intended for the JS bindings
|
||||
const String& character_set() const { return encoding(); }
|
||||
const String& charset() const { return encoding(); }
|
||||
const String& input_encoding() const { return encoding(); }
|
||||
|
||||
const NonnullRefPtr<DOMImplementation> implementation() { return m_implementation; }
|
||||
|
||||
private:
|
||||
@@ -262,6 +270,7 @@ private:
|
||||
|
||||
String m_ready_state { "loading" };
|
||||
String m_content_type { "application/xml" };
|
||||
String m_encoding { "UTF-8" };
|
||||
|
||||
NonnullRefPtr<DOMImplementation> m_implementation;
|
||||
};
|
||||
|
||||
@@ -2,6 +2,9 @@ interface Document : Node {
|
||||
|
||||
readonly attribute DOMImplementation implementation;
|
||||
|
||||
readonly attribute DOMString characterSet;
|
||||
readonly attribute DOMString charset;
|
||||
readonly attribute DOMString inputEncoding;
|
||||
readonly attribute DOMString contentType;
|
||||
|
||||
Element? getElementById(DOMString id);
|
||||
|
||||
Reference in New Issue
Block a user