1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::*;
extern "C" {
    fn customelement_attach_shadow(element: Element) -> Element;
    fn customelement_define(tag: CString);
    fn customelement_define_with_attributes(tag: CString, attributes: CString);
}

pub fn attach_shadow(element: Element) -> Element {
    unsafe { customelement_attach_shadow(element) }
}

pub fn define(tag: &str) {
    unsafe {
        customelement_define(to_cstring(tag));
    }
}

pub fn define_with_attributes(tag: &str, attributes: &str) {
    unsafe {
        customelement_define_with_attributes(to_cstring(tag), to_cstring(attributes));
    }
}