@@ -119,19 +119,19 @@ pub const Document = struct {
119119
120120 pub fn _getElementById (self : * parser.Document , id : []const u8 ) ! ? ElementUnion {
121121 const e = try parser .documentGetElementById (self , id ) orelse return null ;
122- return try Element .toInterface (e );
122+ return try Element .toInterface (ElementUnion , e );
123123 }
124124
125125 pub fn _createElement (self : * parser.Document , tag_name : []const u8 ) ! ElementUnion {
126126 // The element’s namespace is the HTML namespace when document is an HTML document
127127 // https://dom.spec.whatwg.org/#ref-for-dom-document-createelement%E2%91%A0
128128 const e = try parser .documentCreateElementNS (self , "http://www.w3.org/1999/xhtml" , tag_name );
129- return Element .toInterface (e );
129+ return Element .toInterface (ElementUnion , e );
130130 }
131131
132132 pub fn _createElementNS (self : * parser.Document , ns : []const u8 , tag_name : []const u8 ) ! ElementUnion {
133133 const e = try parser .documentCreateElementNS (self , ns , tag_name );
134- return try Element .toInterface (e );
134+ return try Element .toInterface (ElementUnion , e );
135135 }
136136
137137 // We can't simply use libdom dom_document_get_elements_by_tag_name here.
@@ -210,12 +210,12 @@ pub const Document = struct {
210210
211211 pub fn get_firstElementChild (self : * parser.Document ) ! ? ElementUnion {
212212 const elt = try parser .documentGetDocumentElement (self ) orelse return null ;
213- return try Element .toInterface (elt );
213+ return try Element .toInterface (ElementUnion , elt );
214214 }
215215
216216 pub fn get_lastElementChild (self : * parser.Document ) ! ? ElementUnion {
217217 const elt = try parser .documentGetDocumentElement (self ) orelse return null ;
218- return try Element .toInterface (elt );
218+ return try Element .toInterface (ElementUnion , elt );
219219 }
220220
221221 pub fn get_childElementCount (self : * parser.Document ) ! u32 {
@@ -230,7 +230,7 @@ pub const Document = struct {
230230
231231 if (n == null ) return null ;
232232
233- return try Element .toInterface (parser .nodeToElement (n .? ));
233+ return try Element .toInterface (ElementUnion , parser .nodeToElement (n .? ));
234234 }
235235
236236 pub fn _querySelectorAll (self : * parser.Document , selector : []const u8 , page : * Page ) ! NodeList {
@@ -273,7 +273,7 @@ pub const Document = struct {
273273
274274 pub fn get_activeElement (self : * parser.Document , page : * Page ) ! ? ElementUnion {
275275 const ae = (try getActiveElement (self , page )) orelse return null ;
276- return try Element .toInterface (ae );
276+ return try Element .toInterface (ElementUnion , ae );
277277 }
278278
279279 // TODO: some elements can't be focused, like if they're disabled
0 commit comments