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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
use super::*;
/// The MathMLElement class.
/// [`MathMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement)
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct MathMLElement {
inner: Element,
}
impl FromVal for MathMLElement {
fn from_val(v: &Any) -> Self {
MathMLElement {
inner: Element::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 MathMLElement {
type Target = Element;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl core::ops::DerefMut for MathMLElement {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl AsRef<Any> for MathMLElement {
fn as_ref(&self) -> &Any {
&self.inner
}
}
impl AsMut<Any> for MathMLElement {
fn as_mut(&mut self) -> &mut Any {
&mut self.inner
}
}
impl From<MathMLElement> for Any {
fn from(s: MathMLElement) -> Any {
let handle = s.inner.as_handle();
core::mem::forget(s);
Any::take_ownership(handle)
}
}
impl From<&MathMLElement> for Any {
fn from(s: &MathMLElement) -> Any {
s.inner.clone().into()
}
}
jsbind::utils::impl_dyn_cast!(MathMLElement);
impl MathMLElement {
/// Getter of the `style` attribute.
/// [`MathMLElement.style`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/style)
pub fn style(&self) -> CSSStyleProperties {
self.inner.get("style").as_::<CSSStyleProperties>()
}
}
impl MathMLElement {
/// Getter of the `onbeforexrselect` attribute.
/// [`MathMLElement.onbeforexrselect`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onbeforexrselect)
pub fn onbeforexrselect(&self) -> Any {
self.inner.get("onbeforexrselect").as_::<Any>()
}
/// Setter of the `onbeforexrselect` attribute.
/// [`MathMLElement.onbeforexrselect`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onbeforexrselect)
pub fn set_onbeforexrselect(&mut self, value: &Any) {
self.inner.set("onbeforexrselect", value);
}
}
impl MathMLElement {
/// Getter of the `dataset` attribute.
/// [`MathMLElement.dataset`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/dataset)
pub fn dataset(&self) -> DOMStringMap {
self.inner.get("dataset").as_::<DOMStringMap>()
}
}
impl MathMLElement {
/// Getter of the `nonce` attribute.
/// [`MathMLElement.nonce`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/nonce)
pub fn nonce(&self) -> JsString {
self.inner.get("nonce").as_::<JsString>()
}
/// Setter of the `nonce` attribute.
/// [`MathMLElement.nonce`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/nonce)
pub fn set_nonce(&mut self, value: &JsString) {
self.inner.set("nonce", value);
}
}
impl MathMLElement {
/// Getter of the `autofocus` attribute.
/// [`MathMLElement.autofocus`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/autofocus)
pub fn autofocus(&self) -> bool {
self.inner.get("autofocus").as_::<bool>()
}
/// Setter of the `autofocus` attribute.
/// [`MathMLElement.autofocus`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/autofocus)
pub fn set_autofocus(&mut self, value: bool) {
self.inner.set("autofocus", value);
}
}
impl MathMLElement {
/// Getter of the `tabIndex` attribute.
/// [`MathMLElement.tabIndex`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/tabIndex)
pub fn tab_index(&self) -> i32 {
self.inner.get("tabIndex").as_::<i32>()
}
/// Setter of the `tabIndex` attribute.
/// [`MathMLElement.tabIndex`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/tabIndex)
pub fn set_tab_index(&mut self, value: i32) {
self.inner.set("tabIndex", value);
}
}
impl MathMLElement {
/// The focus method.
/// [`MathMLElement.focus`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/focus)
pub fn focus(&self) -> Undefined {
self.inner.call("focus", &[]).as_::<Undefined>()
}
}
impl MathMLElement {
/// The focus method.
/// [`MathMLElement.focus`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/focus)
pub fn focus_with_options(&self, options: &FocusOptions) -> Undefined {
self.inner
.call("focus", &[options.into()])
.as_::<Undefined>()
}
}
impl MathMLElement {
/// The blur method.
/// [`MathMLElement.blur`](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/blur)
pub fn blur(&self) -> Undefined {
self.inner.call("blur", &[]).as_::<Undefined>()
}
}