main: global document must be the html doc

This commit is contained in:
Pierre Tachoire
2024-01-05 11:44:50 +01:00
parent c2ade9061b
commit b96a251c37

View File

@@ -206,7 +206,7 @@ pub const Page = struct {
log.debug("setup global env", .{}); log.debug("setup global env", .{});
try self.env.addObject(apis, self.window, "window"); try self.env.addObject(apis, self.window, "window");
try self.env.addObject(apis, self.window, "self"); try self.env.addObject(apis, self.window, "self");
try self.env.addObject(apis, doc, "document"); try self.env.addObject(apis, html_doc, "document");
// browse the DOM tree to retrieve scripts // browse the DOM tree to retrieve scripts
var sasync = std.ArrayList(*parser.Element).init(self.allocator); var sasync = std.ArrayList(*parser.Element).init(self.allocator);