mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 15:49:11 +00:00
LibWeb: Use standardized encoding names, add encoding attribute to document
This commit is contained in:
parent
f3d2053bff
commit
ed2689c00a
Notes:
sideshowbarker
2024-07-19 02:29:02 +09:00
Author: https://github.com/Lubrsi
Commit: ed2689c00a
Pull-request: https://github.com/SerenityOS/serenity/pull/4070
Reviewed-by: https://github.com/awesomekling
5 changed files with 20 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue