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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
use super::*;
/// The MutationRecord class.
/// [`MutationRecord`](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord)
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct MutationRecord {
inner: Any,
}
impl FromVal for MutationRecord {
fn from_val(v: &Any) -> Self {
MutationRecord {
inner: Any::from_val(v),
}
}
fn take_ownership(v: AnyHandle) -> Self {
Self::from_val(&Any::take_ownership(v))
}
fn as_handle(&self) -> AnyHandle {
self.inner.as_handle()
}
}
impl core::ops::Deref for MutationRecord {
type Target = Any;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl core::ops::DerefMut for MutationRecord {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl AsRef<Any> for MutationRecord {
fn as_ref(&self) -> &Any {
&self.inner
}
}
impl AsMut<Any> for MutationRecord {
fn as_mut(&mut self) -> &mut Any {
&mut self.inner
}
}
impl From<MutationRecord> for Any {
fn from(s: MutationRecord) -> Any {
let handle = s.inner.as_handle();
core::mem::forget(s);
Any::take_ownership(handle)
}
}
impl From<&MutationRecord> for Any {
fn from(s: &MutationRecord) -> Any {
s.inner.clone().into()
}
}
jsbind::utils::impl_dyn_cast!(MutationRecord);
impl MutationRecord {
/// Getter of the `type` attribute.
/// [`MutationRecord.type`](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord/type)
pub fn type_(&self) -> JsString {
self.inner.get("type").as_::<JsString>()
}
}
impl MutationRecord {
/// Getter of the `target` attribute.
/// [`MutationRecord.target`](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord/target)
pub fn target(&self) -> Node {
self.inner.get("target").as_::<Node>()
}
}
impl MutationRecord {
/// Getter of the `addedNodes` attribute.
/// [`MutationRecord.addedNodes`](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord/addedNodes)
pub fn added_nodes(&self) -> NodeList {
self.inner.get("addedNodes").as_::<NodeList>()
}
}
impl MutationRecord {
/// Getter of the `removedNodes` attribute.
/// [`MutationRecord.removedNodes`](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord/removedNodes)
pub fn removed_nodes(&self) -> NodeList {
self.inner.get("removedNodes").as_::<NodeList>()
}
}
impl MutationRecord {
/// Getter of the `previousSibling` attribute.
/// [`MutationRecord.previousSibling`](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord/previousSibling)
pub fn previous_sibling(&self) -> Node {
self.inner.get("previousSibling").as_::<Node>()
}
}
impl MutationRecord {
/// Getter of the `nextSibling` attribute.
/// [`MutationRecord.nextSibling`](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord/nextSibling)
pub fn next_sibling(&self) -> Node {
self.inner.get("nextSibling").as_::<Node>()
}
}
impl MutationRecord {
/// Getter of the `attributeName` attribute.
/// [`MutationRecord.attributeName`](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord/attributeName)
pub fn attribute_name(&self) -> JsString {
self.inner.get("attributeName").as_::<JsString>()
}
}
impl MutationRecord {
/// Getter of the `attributeNamespace` attribute.
/// [`MutationRecord.attributeNamespace`](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord/attributeNamespace)
pub fn attribute_namespace(&self) -> JsString {
self.inner.get("attributeNamespace").as_::<JsString>()
}
}
impl MutationRecord {
/// Getter of the `oldValue` attribute.
/// [`MutationRecord.oldValue`](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord/oldValue)
pub fn old_value(&self) -> JsString {
self.inner.get("oldValue").as_::<JsString>()
}
}