dom/document: fix get_body

This commit is contained in:
Pierre Tachoire
2023-10-17 14:30:11 +02:00
parent 77ab43fbd4
commit 2a4d2be7db

View File

@@ -20,9 +20,8 @@ pub const Document = struct {
// JS funcs // JS funcs
// -------- // --------
pub fn get_body(self: *parser.Document) ?*HTMLBodyElement { pub fn get_body(self: *parser.Document) ?*parser.Body {
const b = parser.documentBody(self) orelse null; return parser.documentBody(self);
return @as(*HTMLBodyElement, @ptrCast(b));
} }
pub fn _getElementById(self: *parser.Document, id: []const u8) ?NodeUnion { pub fn _getElementById(self: *parser.Document, id: []const u8) ?NodeUnion {