HTMLDocument: add currentScript getter

This commit is contained in:
Pierre Tachoire
2024-01-04 14:51:50 +01:00
parent 8f18fda54f
commit d07717cd10

View File

@@ -130,6 +130,10 @@ pub const HTMLDocument = struct {
return try collection.HTMLCollectionByLinks(try rootNode(self), false);
}
pub fn get_currentScript(_: *parser.DocumentHTML) !?*parser.Element {
return null;
}
pub fn deinit(_: *parser.DocumentHTML, _: std.mem.Allocator) void {}
};
@@ -160,6 +164,7 @@ pub fn testExecFn(
.{ .src = "document.scripts.length", .ex = "0" },
.{ .src = "document.forms.length", .ex = "0" },
.{ .src = "document.links.length", .ex = "1" },
.{ .src = "document.currentScript", .ex = "null" },
};
try checkCases(js_env, &getters);