mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
Merge pull request #78 from Browsercore/domcdoc-encoding
dom: implement document.characterSet
This commit is contained in:
@@ -54,10 +54,8 @@ pub const Document = struct {
|
|||||||
return "CSS1Compat";
|
return "CSS1Compat";
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO implement characterSet
|
|
||||||
pub fn get_characterSet(self: *parser.Document) []const u8 {
|
pub fn get_characterSet(self: *parser.Document) []const u8 {
|
||||||
_ = self;
|
return parser.documentGetInputEncoding(self);
|
||||||
return "UTF-8";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// alias of get_characterSet
|
// alias of get_characterSet
|
||||||
|
|||||||
@@ -800,6 +800,12 @@ pub inline fn documentGetDocumentURI(doc: *Document) []const u8 {
|
|||||||
return stringToData(s.?);
|
return stringToData(s.?);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub inline fn documentGetInputEncoding(doc: *Document) []const u8 {
|
||||||
|
var s: ?*String = undefined;
|
||||||
|
_ = documentVtable(doc).dom_document_get_input_encoding.?(doc, &s);
|
||||||
|
return stringToData(s.?);
|
||||||
|
}
|
||||||
|
|
||||||
pub inline fn documentCreateElement(doc: *Document, tag_name: []const u8) *Element {
|
pub inline fn documentCreateElement(doc: *Document, tag_name: []const u8) *Element {
|
||||||
var elem: ?*Element = undefined;
|
var elem: ?*Element = undefined;
|
||||||
_ = documentVtable(doc).dom_document_create_element.?(doc, stringFromData(tag_name), &elem);
|
_ = documentVtable(doc).dom_document_create_element.?(doc, stringFromData(tag_name), &elem);
|
||||||
|
|||||||
Reference in New Issue
Block a user