1 /*
2  * Copyright (C) 2018 Alexander Borisov
3  *
4  * Author: Alexander Borisov <borisov@lexbor.com>
5  */
6 
7 #include "lexbor/html/interfaces/audio_element.h"
8 #include "lexbor/html/interfaces/document.h"
9 
10 
11 lxb_html_audio_element_t *
lxb_html_audio_element_interface_create(lxb_html_document_t * document)12 lxb_html_audio_element_interface_create(lxb_html_document_t *document)
13 {
14     lxb_html_audio_element_t *element;
15 
16     element = lexbor_mraw_calloc(document->dom_document.mraw,
17                                  sizeof(lxb_html_audio_element_t));
18     if (element == NULL) {
19         return NULL;
20     }
21 
22     lxb_dom_node_t *node = lxb_dom_interface_node(element);
23 
24     node->owner_document = lxb_html_document_original_ref(document);
25     node->type = LXB_DOM_NODE_TYPE_ELEMENT;
26 
27     return element;
28 }
29 
30 lxb_html_audio_element_t *
lxb_html_audio_element_interface_destroy(lxb_html_audio_element_t * audio_element)31 lxb_html_audio_element_interface_destroy(lxb_html_audio_element_t *audio_element)
32 {
33     (void) lxb_dom_node_interface_destroy(lxb_dom_interface_node(audio_element));
34     return NULL;
35 }
36