Skip to content

Commit fd170df

Browse files
committed
node subtypes
1 parent 581a79f commit fd170df

File tree

14 files changed

+86
-1
lines changed

14 files changed

+86
-1
lines changed

src/browser/dom/attribute.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +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";
3031

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

src/browser/dom/cdata_section.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +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";
2930
};

src/browser/dom/character_data.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +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";
4142

4243
// JS funcs
4344
// --------

src/browser/dom/comment.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +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";
3031

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

src/browser/dom/document.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +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";
4243

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

src/browser/dom/document_fragment.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +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";
3031

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

src/browser/dom/document_type.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +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";
2930

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

src/browser/dom/element.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +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";
4041

4142
pub const DOMRect = struct {
4243
x: f64,

src/browser/dom/node.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +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";
6364

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

src/browser/dom/processing_instruction.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +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";
3132

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

0 commit comments

Comments
 (0)