HTMLDocument: implements anchors

This commit is contained in:
Pierre Tachoire
2024-01-04 15:16:48 +01:00
parent 552bf4224c
commit 91d1f539d4
2 changed files with 35 additions and 0 deletions

View File

@@ -134,6 +134,10 @@ pub const HTMLDocument = struct {
return try collection.HTMLCollectionByLinks(try rootNode(self), false);
}
pub fn get_anchors(self: *parser.DocumentHTML) !collection.HTMLCollection {
return try collection.HTMLCollectionByAnchors(try rootNode(self), false);
}
pub fn get_currentScript(_: *parser.DocumentHTML) !?*parser.Element {
return null;
}
@@ -177,6 +181,7 @@ pub fn testExecFn(
.{ .src = "document.forms.length", .ex = "0" },
.{ .src = "document.links.length", .ex = "1" },
.{ .src = "document.applets.length", .ex = "0" },
.{ .src = "document.anchors.length", .ex = "0" },
.{ .src = "document.currentScript", .ex = "null" },
};
try checkCases(js_env, &getters);