add more generic HTML types

This commit is contained in:
Pierre Tachoire
2025-12-30 12:36:17 +01:00
parent 6d33d23935
commit e09d15b12a
2 changed files with 18 additions and 3 deletions

View File

@@ -1367,7 +1367,7 @@ pub fn createElementNS(self: *Page, namespace: Element.Namespace, name: []const
Element.Html.Quote,
namespace,
attribute_iterator,
.{ ._proto = undefined, ._tag_name = String.init(undefined, "q", .{}) catch unreachable, ._tag = .unknown },
.{ ._proto = undefined, ._tag_name = String.init(undefined, "q", .{}) catch unreachable, ._tag = .quote },
),
's' => return self.createHtmlElementT(
Element.Html.Generic,
@@ -1523,7 +1523,7 @@ pub fn createElementNS(self: *Page, namespace: Element.Namespace, name: []const
Element.Html.TableCol,
namespace,
attribute_iterator,
.{ ._proto = undefined, ._tag_name = String.init(undefined, "col", .{}) catch unreachable, ._tag = .unknown },
.{ ._proto = undefined, ._tag_name = String.init(undefined, "col", .{}) catch unreachable, ._tag = .col },
),
asUint("dir") => return self.createHtmlElementT(
Element.Html.Directory,
@@ -1926,7 +1926,7 @@ pub fn createElementNS(self: *Page, namespace: Element.Namespace, name: []const
Element.Html.TableCol,
namespace,
attribute_iterator,
.{ ._proto = undefined, ._tag_name = String.init(undefined, "colgroup", .{}) catch unreachable, ._tag = .unknown },
.{ ._proto = undefined, ._tag_name = String.init(undefined, "colgroup", .{}) catch unreachable, ._tag = .colgroup },
),
asUint("fieldset") => return self.createHtmlElementT(
Element.Html.FieldSet,
@@ -1952,6 +1952,12 @@ pub fn createElementNS(self: *Page, namespace: Element.Namespace, name: []const
attribute_iterator,
.{ ._proto = undefined },
),
asUint("noscript") => return self.createHtmlElementT(
Element.Html.Generic,
namespace,
attribute_iterator,
.{ ._proto = undefined, ._tag_name = String.init(undefined, "noscript", .{}) catch unreachable, ._tag = .noscript },
),
else => {},
},
10 => switch (@as(u80, @bitCast(name[0..10].*))) {

View File

@@ -1219,6 +1219,8 @@ pub const Tag = enum {
caption,
circle,
code,
col,
colgroup,
custom,
data,
datalist,
@@ -1265,20 +1267,26 @@ pub const Tag = enum {
meta,
meter,
nav,
noscript,
object,
ol,
optgroup,
option,
output,
p,
path,
param,
polygon,
polyline,
progress,
quote,
rect,
s,
script,
section,
select,
slot,
source,
span,
strong,
style,
@@ -1298,6 +1306,7 @@ pub const Tag = enum {
thead,
title,
tr,
track,
ul,
video,
unknown,