dom: add document.compatMode with hardcoded value

This commit is contained in:
Pierre Tachoire
2023-11-21 09:33:31 +01:00
parent 4ae0c0c5af
commit f1ea914303

View File

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