Skip to content

Commit 6e6660e

Browse files
committed
enum as subtype
1 parent 81400be commit 6e6660e

File tree

14 files changed

+81
-83
lines changed

14 files changed

+81
-83
lines changed

src/browser/dom/attribute.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const DOMException = @import("exceptions.zig").DOMException;
2727
pub const Attr = struct {
2828
pub const Self = parser.Attribute;
2929
pub const prototype = *Node;
30-
pub const subtype = "node";
30+
pub const subtype = .node;
3131

3232
pub fn get_namespaceURI(self: *parser.Attribute) !?[]const u8 {
3333
return try parser.nodeGetNamespace(parser.attributeToNode(self));

src/browser/dom/cdata_section.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ const Text = @import("text.zig").Text;
2626
pub const CDATASection = struct {
2727
pub const Self = parser.CDATASection;
2828
pub const prototype = *Text;
29-
pub const subtype = "node";
29+
pub const subtype = .node;
3030
};

src/browser/dom/character_data.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub const Interfaces = .{
3838
pub const CharacterData = struct {
3939
pub const Self = parser.CharacterData;
4040
pub const prototype = *Node;
41-
pub const subtype = "node";
41+
pub const subtype = .node;
4242

4343
// JS funcs
4444
// --------

src/browser/dom/comment.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const SessionState = @import("../env.zig").SessionState;
2727
pub const Comment = struct {
2828
pub const Self = parser.Comment;
2929
pub const prototype = *CharacterData;
30-
pub const subtype = "node";
30+
pub const subtype = .node;
3131

3232
pub fn constructor(data: ?[]const u8, state: *const SessionState) !*parser.Comment {
3333
return parser.documentCreateComment(

src/browser/dom/document.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const DOMImplementation = @import("implementation.zig").DOMImplementation;
3939
pub const Document = struct {
4040
pub const Self = parser.Document;
4141
pub const prototype = *Node;
42-
pub const subtype = "node";
42+
pub const subtype = .node;
4343

4444
pub fn constructor(state: *const SessionState) !*parser.DocumentHTML {
4545
const doc = try parser.documentCreateDocument(

src/browser/dom/document_fragment.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const Node = @import("node.zig").Node;
2727
pub const DocumentFragment = struct {
2828
pub const Self = parser.DocumentFragment;
2929
pub const prototype = *Node;
30-
pub const subtype = "node";
30+
pub const subtype = .node;
3131

3232
pub fn constructor(state: *const SessionState) !*parser.DocumentFragment {
3333
return parser.documentCreateDocumentFragment(

src/browser/dom/document_type.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const Node = @import("node.zig").Node;
2626
pub const DocumentType = struct {
2727
pub const Self = parser.DocumentType;
2828
pub const prototype = *Node;
29-
pub const subtype = "node";
29+
pub const subtype = .node;
3030

3131
pub fn get_name(self: *parser.DocumentType) ![]const u8 {
3232
return try parser.documentTypeGetName(self);

src/browser/dom/element.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const DOMException = @import("exceptions.zig").DOMException;
3737
pub const Element = struct {
3838
pub const Self = parser.Element;
3939
pub const prototype = *Node;
40-
pub const subtype = "node";
40+
pub const subtype = .node;
4141

4242
pub const DOMRect = struct {
4343
x: f64,

src/browser/dom/node.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub const Union = generate.Union(Interfaces);
6060
pub const Node = struct {
6161
pub const Self = parser.Node;
6262
pub const prototype = *EventTarget;
63-
pub const subtype = "node";
63+
pub const subtype = .node;
6464

6565
pub fn toInterface(node: *parser.Node) !Union {
6666
return switch (try parser.nodeType(node)) {

src/browser/dom/processing_instruction.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub const ProcessingInstruction = struct {
2828
// TODO for libdom processing instruction inherit from node.
2929
// But the spec says it must inherit from CDATA.
3030
pub const prototype = *Node;
31-
pub const subtype = "node";
31+
pub const subtype = .node;
3232

3333
pub fn get_target(self: *parser.ProcessingInstruction) ![]const u8 {
3434
// libdom stores the ProcessingInstruction target in the node's name.

0 commit comments

Comments
 (0)