Skip to content

Commit 9a050fe

Browse files
committed
html: add missing applet, basefont and keygen tags
1 parent 45504a5 commit 9a050fe

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/html/elements.zig

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub const Interfaces = .{
1010
HTMLAnchorElement,
1111
HTMLAreaElement,
1212
HTMLAudioElement,
13+
HTMLAppletElement,
1314
HTMLBRElement,
1415
HTMLBaseElement,
1516
HTMLBodyElement,
@@ -113,6 +114,12 @@ pub const HTMLAnchorElement = struct {
113114
pub const mem_guarantied = true;
114115
};
115116

117+
pub const HTMLAppletElement = struct {
118+
pub const Self = parser.Applet;
119+
pub const prototype = *HTMLElement;
120+
pub const mem_guarantied = true;
121+
};
122+
116123
pub const HTMLAreaElement = struct {
117124
pub const Self = parser.Area;
118125
pub const prototype = *HTMLElement;
@@ -495,8 +502,9 @@ pub fn toInterface(comptime T: type, e: *parser.Element) !T {
495502
const elem: *align(@alignOf(*parser.Element)) parser.Element = @alignCast(e);
496503
const tag = try parser.elementHTMLGetTagType(@as(*parser.ElementHTML, @ptrCast(elem)));
497504
return switch (tag) {
498-
.abbr, .acronym, .address, .article, .aside, .b, .bdi, .bdo, .bgsound, .big, .center, .cite, .code, .dd, .details, .dfn, .dt, .em, .figcaption, .figure, .footer, .header, .hgroup, .i, .isindex, .kbd, .main, .mark, .marquee, .menu, .menuitem, .nav, .nobr, .noframes, .noscript, .rp, .rt, .ruby, .s, .samp, .section, .small, .spacer, .strike, .strong, .sub, .summary, .sup, .tt, .u, .wbr, ._var => .{ .HTMLElement = @as(*parser.ElementHTML, @ptrCast(elem)) },
505+
.abbr, .acronym, .address, .article, .aside, .b, .basefont, .bdi, .bdo, .bgsound, .big, .center, .cite, .code, .dd, .details, .dfn, .dt, .em, .figcaption, .figure, .footer, .header, .hgroup, .i, .isindex, .keygen, .kbd, .main, .mark, .marquee, .menu, .menuitem, .nav, .nobr, .noframes, .noscript, .rp, .rt, .ruby, .s, .samp, .section, .small, .spacer, .strike, .strong, .sub, .summary, .sup, .tt, .u, .wbr, ._var => .{ .HTMLElement = @as(*parser.ElementHTML, @ptrCast(elem)) },
499506
.a => .{ .HTMLAnchorElement = @as(*parser.Anchor, @ptrCast(elem)) },
507+
.applet => .{ .HTMLAppletElement = @as(*parser.Applet, @ptrCast(elem)) },
500508
.area => .{ .HTMLAreaElement = @as(*parser.Area, @ptrCast(elem)) },
501509
.audio => .{ .HTMLAudioElement = @as(*parser.Audio, @ptrCast(elem)) },
502510
.base => .{ .HTMLBaseElement = @as(*parser.Base, @ptrCast(elem)) },

src/netsurf.zig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ inline fn lwcStringFromData(data: []const u8) !*LWCString {
8484

8585
pub const Tag = enum(u8) {
8686
acronym = c.DOM_HTML_ELEMENT_TYPE_ACRONYM,
87+
applet = c.DOM_HTML_ELEMENT_TYPE_APPLET,
8788
bgsound = c.DOM_HTML_ELEMENT_TYPE_BGSOUND,
8889
big = c.DOM_HTML_ELEMENT_TYPE_BIG,
8990
marquee = c.DOM_HTML_ELEMENT_TYPE_MARQUEE,
@@ -100,10 +101,11 @@ pub const Tag = enum(u8) {
100101
area = c.DOM_HTML_ELEMENT_TYPE_AREA,
101102
audio = c.DOM_HTML_ELEMENT_TYPE_AUDIO,
102103
b = c.DOM_HTML_ELEMENT_TYPE_B,
104+
base = c.DOM_HTML_ELEMENT_TYPE_BASE,
105+
basefont = c.DOM_HTML_ELEMENT_TYPE_BASEFONT,
103106
bdi = c.DOM_HTML_ELEMENT_TYPE_BDI,
104107
bdo = c.DOM_HTML_ELEMENT_TYPE_BDO,
105108
br = c.DOM_HTML_ELEMENT_TYPE_BR,
106-
base = c.DOM_HTML_ELEMENT_TYPE_BASE,
107109
body = c.DOM_HTML_ELEMENT_TYPE_BODY,
108110
button = c.DOM_HTML_ELEMENT_TYPE_BUTTON,
109111
canvas = c.DOM_HTML_ELEMENT_TYPE_CANVAS,
@@ -147,6 +149,7 @@ pub const Tag = enum(u8) {
147149
img = c.DOM_HTML_ELEMENT_TYPE_IMG,
148150
input = c.DOM_HTML_ELEMENT_TYPE_INPUT,
149151
kbd = c.DOM_HTML_ELEMENT_TYPE_KBD,
152+
keygen = c.DOM_HTML_ELEMENT_TYPE_KEYGEN,
150153
li = c.DOM_HTML_ELEMENT_TYPE_LI,
151154
label = c.DOM_HTML_ELEMENT_TYPE_LABEL,
152155
legend = c.DOM_HTML_ELEMENT_TYPE_LEGEND,
@@ -1060,6 +1063,7 @@ pub const MediaElement = struct { base: *c.dom_html_element };
10601063

10611064
pub const Unknown = struct { base: *c.dom_html_element };
10621065
pub const Anchor = c.dom_html_anchor_element;
1066+
pub const Applet = c.dom_html_applet_element;
10631067
pub const Area = c.dom_html_area_element;
10641068
pub const Audio = struct { base: *c.dom_html_element };
10651069
pub const BR = c.dom_html_br_element;

0 commit comments

Comments
 (0)