dom: document.contentType with hardcoded value

This commit is contained in:
Pierre Tachoire
2023-11-21 09:47:19 +01:00
parent f1ea914303
commit 0fadb4ff98

View File

@@ -34,6 +34,12 @@ pub const Document = struct {
return Element.toInterface(e); return Element.toInterface(e);
} }
// TODO implement contentType
pub fn get_contentType(self: *parser.Document) []const u8 {
_ = self;
return "text/html";
}
// TODO implement compactMode // TODO implement compactMode
pub fn get_compatMode(self: *parser.Document) []const u8 { pub fn get_compatMode(self: *parser.Document) []const u8 {
_ = self; _ = self;
@@ -157,6 +163,11 @@ pub fn testExecFn(
}; };
try checkCases(js_env, &getCompatMode); try checkCases(js_env, &getCompatMode);
var getContentType = [_]Case{
.{ .src = "document.contentType", .ex = "text/html" },
};
try checkCases(js_env, &getContentType);
const tags = comptime parser.Tag.all(); const tags = comptime parser.Tag.all();
comptime var createElements: [(tags.len) * 2]Case = undefined; comptime var createElements: [(tags.len) * 2]Case = undefined;
inline for (tags, 0..) |tag, i| { inline for (tags, 0..) |tag, i| {