Iterfaces generation refacto

Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
This commit is contained in:
Francis Bouvier
2023-10-09 17:31:42 +02:00
parent 8c3712c697
commit b8aa291e1e
4 changed files with 46 additions and 59 deletions

View File

@@ -3,16 +3,8 @@ const generate = @import("../generate.zig");
const Element = @import("../dom/element.zig").Element;
// Abstract class
// --------------
pub const HTMLElement = struct {
pub const Self = parser.ElementHTML;
pub const prototype = *Element;
pub const mem_guarantied = true;
};
pub const Types = .{
// HTMLElement interfaces
pub const Interfaces = .{
HTMLUnknownElement,
HTMLAnchorElement,
HTMLAreaElement,
@@ -74,10 +66,19 @@ pub const Types = .{
HTMLUListElement,
HTMLVideoElement,
};
const Generated = generate.Union.compile(Types);
const Generated = generate.Union.compile(Interfaces);
pub const Union = Generated._union;
pub const Tags = Generated._enum;
// Abstract class
// --------------
pub const HTMLElement = struct {
pub const Self = parser.ElementHTML;
pub const prototype = *Element;
pub const mem_guarantied = true;
};
// Deprecated HTMLElements in Chrome (2023/03/15)
// HTMLContentelement
// HTMLShadowElement