mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-18 09:58:10 +00:00
backport some node_lexbor modifications
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
This commit is contained in:
@@ -12,7 +12,7 @@ pub const HTMLElement = struct {
|
||||
pub const mem_guarantied = true;
|
||||
};
|
||||
|
||||
pub const HTMLElementsTypes = .{
|
||||
pub const Types = .{
|
||||
HTMLUnknownElement,
|
||||
HTMLAnchorElement,
|
||||
HTMLAreaElement,
|
||||
@@ -74,9 +74,9 @@ pub const HTMLElementsTypes = .{
|
||||
HTMLUListElement,
|
||||
HTMLVideoElement,
|
||||
};
|
||||
const HTMLElementsGenerated = generate.Union.compile(HTMLElementsTypes);
|
||||
pub const HTMLElements = HTMLElementsGenerated._union;
|
||||
pub const HTMLElementsTags = HTMLElementsGenerated._enum;
|
||||
const Generated = generate.Union.compile(Types);
|
||||
pub const Union = Generated._union;
|
||||
pub const Tags = Generated._enum;
|
||||
|
||||
// Deprecated HTMLElements in Chrome (2023/03/15)
|
||||
// HTMLContentelement
|
||||
@@ -454,7 +454,7 @@ pub const HTMLVideoElement = struct {
|
||||
pub const mem_guarantied = true;
|
||||
};
|
||||
|
||||
pub fn ElementToHTMLElementInterface(elem: *parser.Element) HTMLElements {
|
||||
pub fn toInterface(comptime T: type, elem: *parser.Element) T {
|
||||
const tag = parser.elementHTMLGetTagType(@as(*parser.ElementHTML, @ptrCast(elem)));
|
||||
return switch (tag) {
|
||||
.a => .{ .HTMLAnchorElement = @as(*parser.Anchor, @ptrCast(elem)) },
|
||||
|
||||
Reference in New Issue
Block a user