Implement HTMLDocument.createElement

Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
This commit is contained in:
Francis Bouvier
2023-03-16 18:22:46 +01:00
parent 081daa1245
commit 50ac87ed6a
12 changed files with 1325 additions and 134 deletions

View File

@@ -1,13 +1,8 @@
const std = @import("std");
const jsruntime = @import("jsruntime");
const Case = jsruntime.test_utils.Case;
const checkCases = jsruntime.test_utils.checkCases;
const parser = @import("../parser.zig");
const DOM = @import("../dom.zig");
const Node = DOM.Node;
const Node = @import("node.zig").Node;
pub const Element = struct {
proto: Node,
@@ -29,26 +24,3 @@ pub const Element = struct {
return parser.elementLocalName(self.base);
}
};
// HTML elements
// -------------
pub const HTMLElement = struct {
proto: Element,
pub const prototype = *Element;
pub fn init(elem_base: *parser.Element) HTMLElement {
return .{ .proto = Element.init(elem_base) };
}
};
pub const HTMLBodyElement = struct {
proto: HTMLElement,
pub const prototype = *HTMLElement;
pub fn init(elem_base: *parser.Element) HTMLBodyElement {
return .{ .proto = HTMLElement.init(elem_base) };
}
};