1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use delegate::delegate;

use crate::Node;

pub struct DocumentType {
    inner: web_sys::DocumentType,
}

impl DocumentType {
    delegate! {
        target self.inner {
            pub fn name(&self) -> String;

            pub fn public_id(&self) -> String;

            pub fn system_id(&self) -> String;
        }
    }
}

impl From<web_sys::DocumentType> for DocumentType {
    fn from(inner: web_sys::DocumentType) -> Self {
        DocumentType { inner }
    }
}

impl AsRef<web_sys::DocumentType> for DocumentType {
    fn as_ref(&self) -> &web_sys::DocumentType {
        &self.inner
    }
}

impl AsRef<web_sys::Node> for DocumentType {
    fn as_ref(&self) -> &web_sys::Node {
        self.inner.as_ref()
    }
}

impl Node for DocumentType {}