dom: add document.createElement and document.getElementById

This commit is contained in:
Pierre Tachoire
2023-10-11 14:48:31 +02:00
parent f3601f1245
commit 6370b2d7a7
3 changed files with 29 additions and 10 deletions

View File

@@ -3,12 +3,18 @@ const std = @import("std");
const parser = @import("../netsurf.zig");
const Node = @import("node.zig").Node;
const Union = @import("node.zig").Union;
pub const Element = struct {
pub const Self = parser.Element;
pub const prototype = *Node;
pub const mem_guarantied = true;
pub fn toInterface(e: *parser.Element) Union {
const n = @as(*parser.Node, @ptrCast(e));
return Node.toInterface(n);
}
// JS funcs
// --------