dom: create elementToNode helper

This commit is contained in:
Pierre Tachoire
2023-11-17 15:11:00 +01:00
parent 3ca6a4a74e
commit 18bfaf8b55
2 changed files with 7 additions and 7 deletions

View File

@@ -45,9 +45,9 @@ pub const Document = struct {
// That's why we reimplemented getElementsByTagName by using an
// HTMLCollection in zig here.
pub fn _getElementsByTagName(self: *parser.Document, tag_name: []const u8) HTMLCollection {
const root = parser.documentGetDocumentNode(self);
const root = parser.documentGetDocumentElement(self);
return HTMLCollection{
.root = root,
.root = parser.elementToNode(root),
.match = tag_name,
};
}