1#![allow(non_camel_case_types,non_upper_case_globals,unsafe_op_in_unsafe_fn,unused_imports,unused_variables,unused_assignments,unused_mut,clippy::approx_constant,clippy::enum_variant_names,clippy::let_unit_value,clippy::needless_return,clippy::too_many_arguments,clippy::unnecessary_cast,clippy::upper_case_acronyms)]
4
5use crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull;
6use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
7use crate::codegen::GenericBindings::WorkerGlobalScopeBinding::WorkerGlobalScope_Binding;
8use crate::import::base::*;
9
10
11#[repr(usize)]
12#[derive(Copy, Clone, Debug, JSTraceable, MallocSizeOf, PartialEq)]
13pub enum NotificationPermission {
14 Default,
15 Denied,
16 Granted
17}
18pub mod NotificationPermissionValues {
19
20 use crate::utils::find_enum_value;
21 use js::conversions::ConversionResult;
22 use js::conversions::FromJSValConvertible;
23 use js::conversions::ToJSValConvertible;
24 use js::context::RawJSContext;
25 use js::rust::HandleValue;
26 use js::rust::MutableHandleValue;
27 use js::jsval::JSVal;
28
29 pub(crate) const pairs: &[(&str, super::NotificationPermission)] = &[
30 ("default", super::NotificationPermission::Default),
31 ("denied", super::NotificationPermission::Denied),
32 ("granted", super::NotificationPermission::Granted),
33 ];
34
35 impl super::NotificationPermission {
36 pub fn as_str(&self) -> &'static str {
37 pairs[*self as usize].0
38 }
39 }
40
41 impl Default for super::NotificationPermission {
42 fn default() -> super::NotificationPermission {
43 pairs[0].1
44 }
45 }
46
47 impl std::str::FromStr for super::NotificationPermission {
48 type Err = ();
49
50 fn from_str(s: &str) -> Result<Self, Self::Err> {
51 pairs
52 .iter()
53 .find(|&&(key, _)| s == key)
54 .map(|&(_, ev)| ev)
55 .ok_or(())
56 }
57 }
58
59 impl ToJSValConvertible for super::NotificationPermission {
60 unsafe fn to_jsval(&self, cx: *mut RawJSContext, rval: MutableHandleValue) {
61 pairs[*self as usize].0.to_jsval(cx, rval);
62 }
63 }
64
65 impl FromJSValConvertible for super::NotificationPermission {
66 type Config = ();
67 unsafe fn from_jsval(cx: *mut RawJSContext, value: HandleValue, _option: ())
68 -> Result<ConversionResult<super::NotificationPermission>, ()> {
69 match find_enum_value(cx, value, pairs) {
70 Err(_) => Err(()),
71 Ok((None, search)) => {
72 Ok(ConversionResult::Failure(
73 format!("'{}' is not a valid enum value for enumeration 'NotificationPermission'.", search).into()
74 ))
75 }
76 Ok((Some(&value), _)) => Ok(ConversionResult::Success(value)),
77 }
78 }
79 }
80 } #[repr(usize)]
84#[derive(Copy, Clone, Debug, JSTraceable, MallocSizeOf, PartialEq)]
85pub enum NotificationDirection {
86 Auto,
87 Ltr,
88 Rtl
89}
90pub mod NotificationDirectionValues {
91
92 use crate::utils::find_enum_value;
93 use js::conversions::ConversionResult;
94 use js::conversions::FromJSValConvertible;
95 use js::conversions::ToJSValConvertible;
96 use js::context::RawJSContext;
97 use js::rust::HandleValue;
98 use js::rust::MutableHandleValue;
99 use js::jsval::JSVal;
100
101 pub(crate) const pairs: &[(&str, super::NotificationDirection)] = &[
102 ("auto", super::NotificationDirection::Auto),
103 ("ltr", super::NotificationDirection::Ltr),
104 ("rtl", super::NotificationDirection::Rtl),
105 ];
106
107 impl super::NotificationDirection {
108 pub fn as_str(&self) -> &'static str {
109 pairs[*self as usize].0
110 }
111 }
112
113 impl Default for super::NotificationDirection {
114 fn default() -> super::NotificationDirection {
115 pairs[0].1
116 }
117 }
118
119 impl std::str::FromStr for super::NotificationDirection {
120 type Err = ();
121
122 fn from_str(s: &str) -> Result<Self, Self::Err> {
123 pairs
124 .iter()
125 .find(|&&(key, _)| s == key)
126 .map(|&(_, ev)| ev)
127 .ok_or(())
128 }
129 }
130
131 impl ToJSValConvertible for super::NotificationDirection {
132 unsafe fn to_jsval(&self, cx: *mut RawJSContext, rval: MutableHandleValue) {
133 pairs[*self as usize].0.to_jsval(cx, rval);
134 }
135 }
136
137 impl FromJSValConvertible for super::NotificationDirection {
138 type Config = ();
139 unsafe fn from_jsval(cx: *mut RawJSContext, value: HandleValue, _option: ())
140 -> Result<ConversionResult<super::NotificationDirection>, ()> {
141 match find_enum_value(cx, value, pairs) {
142 Err(_) => Err(()),
143 Ok((None, search)) => {
144 Ok(ConversionResult::Failure(
145 format!("'{}' is not a valid enum value for enumeration 'NotificationDirection'.", search).into()
146 ))
147 }
148 Ok((Some(&value), _)) => Ok(ConversionResult::Success(value)),
149 }
150 }
151 }
152 } pub type EpochTimeStamp = u64;
155
156pub use self::GenericUnionTypes::UnsignedLongOrUnsignedLongSequence as VibratePattern;
157
158#[derive(JSTraceable)]
159#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
160pub struct NotificationOptions {
161 pub actions: Vec<crate::codegen::GenericBindings::NotificationBinding::NotificationAction>,
162 pub badge: Option<USVString>,
163 pub body: DOMString,
164 pub data: RootedTraceableBox<Heap<JSVal>>,
165 pub dir: NotificationDirection,
166 pub icon: Option<USVString>,
167 pub image: Option<USVString>,
168 pub lang: DOMString,
169 pub renotify: bool,
170 pub requireInteraction: bool,
171 pub silent: Option<bool>,
172 pub tag: DOMString,
173 pub timestamp: Option<u64>,
174 pub vibrate: Option<GenericUnionTypes::UnsignedLongOrUnsignedLongSequence>,
175}
176impl Default for NotificationOptions {
177 fn default() -> Self {
178 Self {
179 actions: Default::default(),
180 badge: Default::default(),
181 body: Default::default(),
182 data: Default::default(),
183 dir: Default::default(),
184 icon: Default::default(),
185 image: Default::default(),
186 lang: Default::default(),
187 renotify: Default::default(),
188 requireInteraction: Default::default(),
189 silent: Default::default(),
190 tag: Default::default(),
191 timestamp: Default::default(),
192 vibrate: Default::default(), }
193 }
194}
195
196impl NotificationOptions {
197 pub fn empty() -> RootedTraceableBox<Self> {
198 let mut dictionary = RootedTraceableBox::new(Self::default());
199 dictionary.actions = Vec::new();
200 dictionary.badge = None;
201 dictionary.body = DOMString::from("");
202 dictionary.data = RootedTraceableBox::from_box(Heap::boxed(NullValue()));
203 dictionary.dir = NotificationDirection::Auto;
204 dictionary.icon = None;
205 dictionary.image = None;
206 dictionary.lang = DOMString::from("");
207 dictionary.renotify = false;
208 dictionary.requireInteraction = false;
209 dictionary.silent = None;
210 dictionary.tag = DOMString::from("");
211 dictionary.timestamp = None;
212 dictionary.vibrate = None;
213 dictionary
214 }
215 pub fn new(cx: SafeJSContext, val: HandleValue, can_gc: CanGc)
216 -> Result<ConversionResult<RootedTraceableBox<NotificationOptions>>, ()> {
217 unsafe {
218 let object = if val.get().is_null_or_undefined() {
219 ptr::null_mut()
220 } else if val.get().is_object() {
221 val.get().to_object()
222 } else {
223 return Ok(ConversionResult::Failure("Value is not an object.".into()));
224 };
225 rooted!(&in(cx) let object = object);
226 let dictionary = RootedTraceableBox::new(NotificationOptions {
227 actions: {
228 rooted!(&in(cx) let mut rval = UndefinedValue());
229 if get_dictionary_property(cx.raw_cx(), object.handle(), "actions", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
230 match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), ()) {
231 Ok(ConversionResult::Success(value)) => value,
232 Ok(ConversionResult::Failure(error)) => {
233 throw_type_error(cx.raw_cx(), &error);
234 return Err(());
235
236 }
237 _ => {
238 return Err(());
239
240 },
241 }
242
243 } else {
244 Vec::new()
245 }
246 },
247 badge: {
248 rooted!(&in(cx) let mut rval = UndefinedValue());
249 if get_dictionary_property(cx.raw_cx(), object.handle(), "badge", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
250 Some(match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), ()) {
251 Ok(ConversionResult::Success(value)) => value,
252 Ok(ConversionResult::Failure(error)) => {
253 throw_type_error(cx.raw_cx(), &error);
254 return Err(());
255
256 }
257 _ => {
258 return Err(());
259
260 },
261 }
262 )
263 } else {
264 None
265 }
266 },
267 body: {
268 rooted!(&in(cx) let mut rval = UndefinedValue());
269 if get_dictionary_property(cx.raw_cx(), object.handle(), "body", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
270 match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), StringificationBehavior::Default) {
271 Ok(ConversionResult::Success(value)) => value,
272 Ok(ConversionResult::Failure(error)) => {
273 throw_type_error(cx.raw_cx(), &error);
274 return Err(());
275
276 }
277 _ => {
278 return Err(());
279
280 },
281 }
282
283 } else {
284 DOMString::from("")
285 }
286 },
287 data: {
288 rooted!(&in(cx) let mut rval = UndefinedValue());
289 if get_dictionary_property(cx.raw_cx(), object.handle(), "data", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
290 RootedTraceableBox::from_box(Heap::boxed(rval.handle().get()))
291 } else {
292 RootedTraceableBox::from_box(Heap::boxed(NullValue()))
293 }
294 },
295 dir: {
296 rooted!(&in(cx) let mut rval = UndefinedValue());
297 if get_dictionary_property(cx.raw_cx(), object.handle(), "dir", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
298 match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), ()) {
299 Ok(ConversionResult::Success(value)) => value,
300 Ok(ConversionResult::Failure(error)) => {
301 throw_type_error(cx.raw_cx(), &error); return Err(());
302
303 }
304 _ => {
305 return Err(());
306
307 },
308 }
309
310 } else {
311 NotificationDirection::Auto
312 }
313 },
314 icon: {
315 rooted!(&in(cx) let mut rval = UndefinedValue());
316 if get_dictionary_property(cx.raw_cx(), object.handle(), "icon", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
317 Some(match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), ()) {
318 Ok(ConversionResult::Success(value)) => value,
319 Ok(ConversionResult::Failure(error)) => {
320 throw_type_error(cx.raw_cx(), &error);
321 return Err(());
322
323 }
324 _ => {
325 return Err(());
326
327 },
328 }
329 )
330 } else {
331 None
332 }
333 },
334 image: {
335 rooted!(&in(cx) let mut rval = UndefinedValue());
336 if get_dictionary_property(cx.raw_cx(), object.handle(), "image", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
337 Some(match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), ()) {
338 Ok(ConversionResult::Success(value)) => value,
339 Ok(ConversionResult::Failure(error)) => {
340 throw_type_error(cx.raw_cx(), &error);
341 return Err(());
342
343 }
344 _ => {
345 return Err(());
346
347 },
348 }
349 )
350 } else {
351 None
352 }
353 },
354 lang: {
355 rooted!(&in(cx) let mut rval = UndefinedValue());
356 if get_dictionary_property(cx.raw_cx(), object.handle(), "lang", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
357 match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), StringificationBehavior::Default) {
358 Ok(ConversionResult::Success(value)) => value,
359 Ok(ConversionResult::Failure(error)) => {
360 throw_type_error(cx.raw_cx(), &error);
361 return Err(());
362
363 }
364 _ => {
365 return Err(());
366
367 },
368 }
369
370 } else {
371 DOMString::from("")
372 }
373 },
374 renotify: {
375 rooted!(&in(cx) let mut rval = UndefinedValue());
376 if get_dictionary_property(cx.raw_cx(), object.handle(), "renotify", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
377 match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), ()) {
378 Ok(ConversionResult::Success(value)) => value,
379 Ok(ConversionResult::Failure(error)) => {
380 throw_type_error(cx.raw_cx(), &error);
381 return Err(());
382
383 }
384 _ => {
385 return Err(());
386
387 },
388 }
389
390 } else {
391 false
392 }
393 },
394 requireInteraction: {
395 rooted!(&in(cx) let mut rval = UndefinedValue());
396 if get_dictionary_property(cx.raw_cx(), object.handle(), "requireInteraction", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
397 match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), ()) {
398 Ok(ConversionResult::Success(value)) => value,
399 Ok(ConversionResult::Failure(error)) => {
400 throw_type_error(cx.raw_cx(), &error);
401 return Err(());
402
403 }
404 _ => {
405 return Err(());
406
407 },
408 }
409
410 } else {
411 false
412 }
413 },
414 silent: {
415 rooted!(&in(cx) let mut rval = UndefinedValue());
416 if get_dictionary_property(cx.raw_cx(), object.handle(), "silent", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
417 match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), ()) {
418 Ok(ConversionResult::Success(value)) => value,
419 Ok(ConversionResult::Failure(error)) => {
420 throw_type_error(cx.raw_cx(), &error);
421 return Err(());
422
423 }
424 _ => {
425 return Err(());
426
427 },
428 }
429
430 } else {
431 None
432 }
433 },
434 tag: {
435 rooted!(&in(cx) let mut rval = UndefinedValue());
436 if get_dictionary_property(cx.raw_cx(), object.handle(), "tag", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
437 match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), StringificationBehavior::Default) {
438 Ok(ConversionResult::Success(value)) => value,
439 Ok(ConversionResult::Failure(error)) => {
440 throw_type_error(cx.raw_cx(), &error);
441 return Err(());
442
443 }
444 _ => {
445 return Err(());
446
447 },
448 }
449
450 } else {
451 DOMString::from("")
452 }
453 },
454 timestamp: {
455 rooted!(&in(cx) let mut rval = UndefinedValue());
456 if get_dictionary_property(cx.raw_cx(), object.handle(), "timestamp", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
457 Some(match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), ConversionBehavior::Default) {
458 Ok(ConversionResult::Success(value)) => value,
459 Ok(ConversionResult::Failure(error)) => {
460 throw_type_error(cx.raw_cx(), &error);
461 return Err(());
462
463 }
464 _ => {
465 return Err(());
466
467 },
468 }
469 )
470 } else {
471 None
472 }
473 },
474 vibrate: {
475 rooted!(&in(cx) let mut rval = UndefinedValue());
476 if get_dictionary_property(cx.raw_cx(), object.handle(), "vibrate", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
477 Some(match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), ()) {
478 Ok(ConversionResult::Success(value)) => value,
479 Ok(ConversionResult::Failure(error)) => {
480 throw_type_error(cx.raw_cx(), &error);
481 return Err(());
482
483 }
484 _ => {
485 return Err(());
486
487 },
488 }
489 )
490 } else {
491 None
492 }
493 },
494 });
495 Ok(ConversionResult::Success(dictionary))
496 }
497 }
498}
499
500impl FromJSValConvertible for RootedTraceableBox<NotificationOptions> {
501 type Config = ();
502 unsafe fn from_jsval(cx: *mut RawJSContext, value: HandleValue, _option: ())
503 -> Result<ConversionResult<RootedTraceableBox<NotificationOptions>>, ()> {
504 NotificationOptions::new(SafeJSContext::from_ptr(cx), value, CanGc::note())
505 }
506}
507
508impl NotificationOptions {
509 #[allow(clippy::wrong_self_convention)]
510 pub unsafe fn to_jsobject(&self, cx: *mut RawJSContext, mut obj: MutableHandleObject) {
511 let actions = &self.actions;
512 rooted!(in(cx) let mut actions_js = UndefinedValue());
513 actions.to_jsval(cx, actions_js.handle_mut());
514 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "actions", actions_js.handle()).unwrap();
515 if let Some(ref badge) = self.badge {
516 rooted!(in(cx) let mut badge_js = UndefinedValue());
517 badge.to_jsval(cx, badge_js.handle_mut());
518 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "badge", badge_js.handle()).unwrap();
519 }
520 let body = &self.body;
521 rooted!(in(cx) let mut body_js = UndefinedValue());
522 body.to_jsval(cx, body_js.handle_mut());
523 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "body", body_js.handle()).unwrap();
524 let data = &self.data;
525 rooted!(in(cx) let mut data_js = UndefinedValue());
526 data.to_jsval(cx, data_js.handle_mut());
527 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "data", data_js.handle()).unwrap();
528 let dir = &self.dir;
529 rooted!(in(cx) let mut dir_js = UndefinedValue());
530 dir.to_jsval(cx, dir_js.handle_mut());
531 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "dir", dir_js.handle()).unwrap();
532 if let Some(ref icon) = self.icon {
533 rooted!(in(cx) let mut icon_js = UndefinedValue());
534 icon.to_jsval(cx, icon_js.handle_mut());
535 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "icon", icon_js.handle()).unwrap();
536 }
537 if let Some(ref image) = self.image {
538 rooted!(in(cx) let mut image_js = UndefinedValue());
539 image.to_jsval(cx, image_js.handle_mut());
540 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "image", image_js.handle()).unwrap();
541 }
542 let lang = &self.lang;
543 rooted!(in(cx) let mut lang_js = UndefinedValue());
544 lang.to_jsval(cx, lang_js.handle_mut());
545 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "lang", lang_js.handle()).unwrap();
546 let renotify = &self.renotify;
547 rooted!(in(cx) let mut renotify_js = UndefinedValue());
548 renotify.to_jsval(cx, renotify_js.handle_mut());
549 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "renotify", renotify_js.handle()).unwrap();
550 let requireInteraction = &self.requireInteraction;
551 rooted!(in(cx) let mut requireInteraction_js = UndefinedValue());
552 requireInteraction.to_jsval(cx, requireInteraction_js.handle_mut());
553 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "requireInteraction", requireInteraction_js.handle()).unwrap();
554 let silent = &self.silent;
555 rooted!(in(cx) let mut silent_js = UndefinedValue());
556 silent.to_jsval(cx, silent_js.handle_mut());
557 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "silent", silent_js.handle()).unwrap();
558 let tag = &self.tag;
559 rooted!(in(cx) let mut tag_js = UndefinedValue());
560 tag.to_jsval(cx, tag_js.handle_mut());
561 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "tag", tag_js.handle()).unwrap();
562 if let Some(ref timestamp) = self.timestamp {
563 rooted!(in(cx) let mut timestamp_js = UndefinedValue());
564 timestamp.to_jsval(cx, timestamp_js.handle_mut());
565 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "timestamp", timestamp_js.handle()).unwrap();
566 }
567 if let Some(ref vibrate) = self.vibrate {
568 rooted!(in(cx) let mut vibrate_js = UndefinedValue());
569 vibrate.to_jsval(cx, vibrate_js.handle_mut());
570 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "vibrate", vibrate_js.handle()).unwrap();
571 }
572 }
573}
574
575impl ToJSValConvertible for NotificationOptions {
576 unsafe fn to_jsval(&self, cx: *mut RawJSContext, mut rval: MutableHandleValue) {
577 rooted!(in(cx) let mut obj = JS_NewObject(cx, ptr::null()));
578 self.to_jsobject(cx, obj.handle_mut());
579 rval.set(ObjectOrNullValue(obj.get()))
580 }
581}
582
583
584#[derive(JSTraceable)]
585pub struct GetNotificationOptions {
586 pub tag: DOMString,
587}
588impl Default for GetNotificationOptions {
589 fn default() -> Self {
590 Self::empty()
591 }
592}
593
594impl GetNotificationOptions {
595 pub fn empty() -> Self {
596 Self {
597 tag: DOMString::from(""),
598 }
599 }
600 pub fn new(cx: SafeJSContext, val: HandleValue, can_gc: CanGc)
601 -> Result<ConversionResult<GetNotificationOptions>, ()> {
602 unsafe {
603 let object = if val.get().is_null_or_undefined() {
604 ptr::null_mut()
605 } else if val.get().is_object() {
606 val.get().to_object()
607 } else {
608 return Ok(ConversionResult::Failure("Value is not an object.".into()));
609 };
610 rooted!(&in(cx) let object = object);
611 let dictionary = GetNotificationOptions {
612 tag: {
613 rooted!(&in(cx) let mut rval = UndefinedValue());
614 if get_dictionary_property(cx.raw_cx(), object.handle(), "tag", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
615 match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), StringificationBehavior::Default) {
616 Ok(ConversionResult::Success(value)) => value,
617 Ok(ConversionResult::Failure(error)) => {
618 throw_type_error(cx.raw_cx(), &error);
619 return Err(());
620
621 }
622 _ => {
623 return Err(());
624
625 },
626 }
627
628 } else {
629 DOMString::from("")
630 }
631 },
632 };
633 Ok(ConversionResult::Success(dictionary))
634 }
635 }
636}
637
638impl FromJSValConvertible for GetNotificationOptions {
639 type Config = ();
640 unsafe fn from_jsval(cx: *mut RawJSContext, value: HandleValue, _option: ())
641 -> Result<ConversionResult<GetNotificationOptions>, ()> {
642 GetNotificationOptions::new(SafeJSContext::from_ptr(cx), value, CanGc::note())
643 }
644}
645
646impl GetNotificationOptions {
647 #[allow(clippy::wrong_self_convention)]
648 pub unsafe fn to_jsobject(&self, cx: *mut RawJSContext, mut obj: MutableHandleObject) {
649 let tag = &self.tag;
650 rooted!(in(cx) let mut tag_js = UndefinedValue());
651 tag.to_jsval(cx, tag_js.handle_mut());
652 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "tag", tag_js.handle()).unwrap();
653 }
654}
655
656impl ToJSValConvertible for GetNotificationOptions {
657 unsafe fn to_jsval(&self, cx: *mut RawJSContext, mut rval: MutableHandleValue) {
658 rooted!(in(cx) let mut obj = JS_NewObject(cx, ptr::null()));
659 self.to_jsobject(cx, obj.handle_mut());
660 rval.set(ObjectOrNullValue(obj.get()))
661 }
662}
663
664
665#[derive(JSTraceable)]
666pub struct NotificationAction {
667 pub action: DOMString,
668 pub icon: Option<USVString>,
669 pub title: DOMString,
670}
671
672impl NotificationAction {
673
674 pub fn new(cx: SafeJSContext, val: HandleValue, can_gc: CanGc)
675 -> Result<ConversionResult<NotificationAction>, ()> {
676 unsafe {
677 let object = if val.get().is_null_or_undefined() {
678 ptr::null_mut()
679 } else if val.get().is_object() {
680 val.get().to_object()
681 } else {
682 return Ok(ConversionResult::Failure("Value is not an object.".into()));
683 };
684 rooted!(&in(cx) let object = object);
685 let dictionary = NotificationAction {
686 action: {
687 rooted!(&in(cx) let mut rval = UndefinedValue());
688 if get_dictionary_property(cx.raw_cx(), object.handle(), "action", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
689 match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), StringificationBehavior::Default) {
690 Ok(ConversionResult::Success(value)) => value,
691 Ok(ConversionResult::Failure(error)) => {
692 throw_type_error(cx.raw_cx(), &error);
693 return Err(());
694
695 }
696 _ => {
697 return Err(());
698
699 },
700 }
701
702 } else {
703 throw_type_error(cx.raw_cx(), "Missing required member \"action\".");
704 return Err(());
705 }
706 },
707 icon: {
708 rooted!(&in(cx) let mut rval = UndefinedValue());
709 if get_dictionary_property(cx.raw_cx(), object.handle(), "icon", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
710 Some(match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), ()) {
711 Ok(ConversionResult::Success(value)) => value,
712 Ok(ConversionResult::Failure(error)) => {
713 throw_type_error(cx.raw_cx(), &error);
714 return Err(());
715
716 }
717 _ => {
718 return Err(());
719
720 },
721 }
722 )
723 } else {
724 None
725 }
726 },
727 title: {
728 rooted!(&in(cx) let mut rval = UndefinedValue());
729 if get_dictionary_property(cx.raw_cx(), object.handle(), "title", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
730 match FromJSValConvertible::from_jsval(cx.raw_cx(), rval.handle(), StringificationBehavior::Default) {
731 Ok(ConversionResult::Success(value)) => value,
732 Ok(ConversionResult::Failure(error)) => {
733 throw_type_error(cx.raw_cx(), &error);
734 return Err(());
735
736 }
737 _ => {
738 return Err(());
739
740 },
741 }
742
743 } else {
744 throw_type_error(cx.raw_cx(), "Missing required member \"title\".");
745 return Err(());
746 }
747 },
748 };
749 Ok(ConversionResult::Success(dictionary))
750 }
751 }
752}
753
754impl FromJSValConvertible for NotificationAction {
755 type Config = ();
756 unsafe fn from_jsval(cx: *mut RawJSContext, value: HandleValue, _option: ())
757 -> Result<ConversionResult<NotificationAction>, ()> {
758 NotificationAction::new(SafeJSContext::from_ptr(cx), value, CanGc::note())
759 }
760}
761
762impl NotificationAction {
763 #[allow(clippy::wrong_self_convention)]
764 pub unsafe fn to_jsobject(&self, cx: *mut RawJSContext, mut obj: MutableHandleObject) {
765 let action = &self.action;
766 rooted!(in(cx) let mut action_js = UndefinedValue());
767 action.to_jsval(cx, action_js.handle_mut());
768 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "action", action_js.handle()).unwrap();
769 if let Some(ref icon) = self.icon {
770 rooted!(in(cx) let mut icon_js = UndefinedValue());
771 icon.to_jsval(cx, icon_js.handle_mut());
772 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "icon", icon_js.handle()).unwrap();
773 }
774 let title = &self.title;
775 rooted!(in(cx) let mut title_js = UndefinedValue());
776 title.to_jsval(cx, title_js.handle_mut());
777 set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "title", title_js.handle()).unwrap();
778 }
779}
780
781impl ToJSValConvertible for NotificationAction {
782 unsafe fn to_jsval(&self, cx: *mut RawJSContext, mut rval: MutableHandleValue) {
783 rooted!(in(cx) let mut obj = JS_NewObject(cx, ptr::null()));
784 self.to_jsobject(cx, obj.handle_mut());
785 rval.set(ObjectOrNullValue(obj.get()))
786 }
787}
788
789
790#[derive(JSTraceable, MallocSizeOf, PartialEq)]
791#[cfg_attr(crown, allow(crown::unrooted_must_root))]
792#[cfg_attr(crown, crown::unrooted_must_root_lint::allow_unrooted_interior)]
793pub struct NotificationPermissionCallback<D: DomTypes> {
794 pub parent: CallbackFunction<D>,
795}
796
797impl<D: DomTypes> NotificationPermissionCallback<D> {
798
799 pub unsafe fn new(aCx: SafeJSContext, aCallback: *mut JSObject) -> Rc<NotificationPermissionCallback<D>> {
800 let mut ret = Rc::new(NotificationPermissionCallback {
801 parent: CallbackFunction::new()
802 });
803 match Rc::get_mut(&mut ret) {
805 Some(ref mut callback) => callback.parent.init(aCx, aCallback),
806 None => unreachable!(),
807 };
808 ret
809 }
810
811 pub fn Call_<T: ThisReflector>(&self, thisObj: &T, permission: NotificationPermission, aExceptionHandling: ExceptionHandling, can_gc: CanGc) -> Fallible<()> {
812 let s = CallSetup::<D>::new(self, aExceptionHandling);
813 rooted!(in(*s.get_context()) let mut thisValue: JSVal);
814 let wrap_result = wrap_call_this_value(s.get_context(), thisObj, thisValue.handle_mut());
815 if !wrap_result {
816 return Err(JSFailed);
817 }
818 unsafe { self.Call(s.get_context(), thisValue.handle(), permission, can_gc) }
819 }
820
821 pub fn Call__<>(&self, permission: NotificationPermission, aExceptionHandling: ExceptionHandling, can_gc: CanGc) -> Fallible<()> {
822 let s = CallSetup::<D>::new(self, aExceptionHandling);
823
824 unsafe { self.Call(s.get_context(), HandleValue::undefined(), permission, can_gc) }
825 }
826
827 unsafe fn Call<>(&self, cx: SafeJSContext, aThisObj: HandleValue, permission: NotificationPermission, can_gc: CanGc) -> Fallible<()> {
828 rooted!(&in(cx) let mut rval = UndefinedValue());
829 rooted_vec!(let mut argv);
830 argv.extend((0..1).map(|_| Heap::default()));
831
832 let argc = 1;
833
834 rooted!(&in(cx) let mut argv_root = UndefinedValue());
835 (permission).to_jsval(cx.raw_cx(), argv_root.handle_mut());
836 {
837 let arg = &mut argv[0];
838 *arg = Heap::default();
839 arg.set(argv_root.get());
840 }
841
842 rooted!(&in(cx) let callable = ObjectValue(self.callback()));
843 rooted!(&in(cx) let rootedThis = aThisObj.get());
844 let ok = Call(
845 cx.raw_cx(), rootedThis.handle(), callable.handle(),
846 &HandleValueArray {
847 length_: argc as ::libc::size_t,
848 elements_: argv.as_ptr() as *const JSVal
849 }, rval.handle_mut());
850 maybe_resume_unwind();
851 if !ok {
852 return Err(JSFailed);
853 }
854
855 Ok(())
856
857 }
858}
859
860impl<D: DomTypes> CallbackContainer<D> for NotificationPermissionCallback<D> {
861 unsafe fn new(cx: SafeJSContext, callback: *mut JSObject) -> Rc<NotificationPermissionCallback<D>> {
862 NotificationPermissionCallback::new(cx, callback)
863 }
864
865 fn callback_holder(&self) -> &CallbackObject<D> {
866 self.parent.callback_holder()
867 }
868}
869
870impl<D: DomTypes> ToJSValConvertible for NotificationPermissionCallback<D> {
871 unsafe fn to_jsval(&self, cx: *mut RawJSContext, rval: MutableHandleValue) {
872 self.callback().to_jsval(cx, rval);
873 }
874}
875
876
877pub use self::Notification_Binding::{Wrap, NotificationMethods, GetProtoObject, DefineDOMInterface};
878pub mod Notification_Binding {
879use crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull;
880use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
881use crate::codegen::GenericBindings::NotificationBinding::NotificationAction;
882use crate::codegen::GenericBindings::NotificationBinding::NotificationDirection;
883use crate::codegen::GenericBindings::NotificationBinding::NotificationDirectionValues;
884use crate::codegen::GenericBindings::NotificationBinding::NotificationOptions;
885use crate::codegen::GenericBindings::NotificationBinding::NotificationPermission;
886use crate::codegen::GenericBindings::NotificationBinding::NotificationPermissionCallback;
887use crate::codegen::GenericBindings::NotificationBinding::NotificationPermissionValues;
888use crate::codegen::GenericBindings::WorkerGlobalScopeBinding::WorkerGlobalScope_Binding;
889use crate::import::module::*;
890
891unsafe extern "C" fn get_permission<D: DomTypes>
892(cx: *mut RawJSContext, argc: libc::c_uint, vp: *mut JSVal) -> bool{
893 let mut result = false;
894 wrap_panic(&mut || result = (|| {
895 let args = CallArgs::from_vp(vp, argc);
896 let global = D::GlobalScope::from_object(args.callee());
897 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
898 let args = CallArgs::from_vp(vp, argc);
899 let result: Result<NotificationPermission, Error> = <D::Notification>::GetPermission(&global);
900 let result = match result {
901 Ok(result) => result,
902 Err(e) => {
903 <D as DomHelpers<D>>::throw_dom_exception(SafeJSContext::from_ptr(cx.raw_cx()), global.upcast::<D::GlobalScope>(), e, CanGc::note());
904 return false;
905 },
906 };
907
908 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
909 return true;
910 })());
911 result
912}
913
914unsafe extern "C" fn requestPermission<D: DomTypes>
915(cx: *mut RawJSContext, argc: libc::c_uint, vp: *mut JSVal) -> bool{
916 let mut result = false;
917 wrap_panic(&mut || result = (|| {
918 let args = CallArgs::from_vp(vp, argc);
919 let global = D::GlobalScope::from_object(args.callee());
920 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
921 let args = CallArgs::from_vp(vp, argc);
922 let arg0: Option<Rc<NotificationPermissionCallback<D>>> = if args.get(0).is_undefined() {
923 None
924 } else {
925 Some(if HandleValue::from_raw(args.get(0)).get().is_object() {
926 if IsCallable(HandleValue::from_raw(args.get(0)).get().to_object()) {
927 NotificationPermissionCallback::<D>::new(SafeJSContext::from_ptr(cx.raw_cx()), HandleValue::from_raw(args.get(0)).get().to_object())
928 } else {
929 throw_type_error(cx.raw_cx(), "Value is not callable.");
930 return false;
931
932 }
933 } else {
934 throw_type_error(cx.raw_cx(), "Value is not an object.");
935 return false;
936
937 })
938 };
939 let result: Rc<D::Promise> = <D::Notification>::RequestPermission(&global, arg0, CanGc::note());
940
941 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
942 return true;
943 })());
944 result
945}
946
947
948 static requestPermission_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
949
950 pub(crate) fn init_requestPermission_methodinfo<D: DomTypes>() {
951 requestPermission_methodinfo.set(JSJitInfo {
952 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
953 staticMethod: Some(requestPermission::<D>)
954 },
955 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
956 protoID: PrototypeList::ID::Last as u16,
957 },
958 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 0 },
959 _bitfield_align_1: [],
960 _bitfield_1: __BindgenBitfieldUnit::new(
961 new_jsjitinfo_bitfield_1!(
962 JSJitInfo_OpType::StaticMethod as u8,
963 JSJitInfo_AliasSet::AliasEverything as u8,
964 JSValueType::JSVAL_TYPE_OBJECT as u8,
965 false,
966 false,
967 false,
968 false,
969 false,
970 false,
971 0,
972 ).to_ne_bytes()
973 ),
974 });
975 }
976
977unsafe extern "C" fn get_maxActions<D: DomTypes>
978(cx: *mut RawJSContext, argc: libc::c_uint, vp: *mut JSVal) -> bool{
979 let mut result = false;
980 wrap_panic(&mut || result = (|| {
981 let args = CallArgs::from_vp(vp, argc);
982 let global = D::GlobalScope::from_object(args.callee());
983 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
984 let args = CallArgs::from_vp(vp, argc);
985 let result: u32 = <D::Notification>::MaxActions(&global);
986
987 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
988 return true;
989 })());
990 result
991}
992
993unsafe extern "C" fn get_onclick<D: DomTypes>
994(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
995 let mut result = false;
996 wrap_panic(&mut || result = (|| {
997 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
998 let this = &*(this as *const D::Notification);
999 let result: Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>> = this.GetOnclick();
1000
1001 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1002 return true;
1003 })());
1004 result
1005}
1006
1007unsafe extern "C" fn set_onclick<D: DomTypes>
1008(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
1009 let mut result = false;
1010 wrap_panic(&mut || result = {
1011 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1012 let this = &*(this as *const D::Notification);
1013 let arg0: Option<Rc<EventHandlerNonNull<D>>> = if HandleValue::from_raw(args.get(0)).get().is_object() {
1014 Some(EventHandlerNonNull::<D>::new(SafeJSContext::from_ptr(cx.raw_cx()), HandleValue::from_raw(args.get(0)).get().to_object()))
1015 } else {
1016 None
1017 };
1018 let result: () = this.SetOnclick(arg0);
1019
1020 true
1021 });
1022 result
1023}
1024
1025
1026static onclick_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1027
1028pub(crate) fn init_onclick_getterinfo<D: DomTypes>() {
1029 onclick_getterinfo.set(JSJitInfo {
1030 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1031 getter: Some(get_onclick::<D>)
1032 },
1033 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1034 protoID: PrototypeList::ID::Notification as u16,
1035 },
1036 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1037 _bitfield_align_1: [],
1038 _bitfield_1: __BindgenBitfieldUnit::new(
1039 new_jsjitinfo_bitfield_1!(
1040 JSJitInfo_OpType::Getter as u8,
1041 JSJitInfo_AliasSet::AliasEverything as u8,
1042 JSValueType::JSVAL_TYPE_UNKNOWN as u8,
1043 true,
1044 false,
1045 false,
1046 false,
1047 false,
1048 false,
1049 0,
1050 ).to_ne_bytes()
1051 ),
1052});
1053}
1054static onclick_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1055
1056pub(crate) fn init_onclick_setterinfo<D: DomTypes>() {
1057 onclick_setterinfo.set(JSJitInfo {
1058 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1059 setter: Some(set_onclick::<D>)
1060 },
1061 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1062 protoID: PrototypeList::ID::Notification as u16,
1063 },
1064 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1065 _bitfield_align_1: [],
1066 _bitfield_1: __BindgenBitfieldUnit::new(
1067 new_jsjitinfo_bitfield_1!(
1068 JSJitInfo_OpType::Setter as u8,
1069 JSJitInfo_AliasSet::AliasEverything as u8,
1070 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1071 false,
1072 false,
1073 false,
1074 false,
1075 false,
1076 false,
1077 0,
1078 ).to_ne_bytes()
1079 ),
1080});
1081}
1082unsafe extern "C" fn get_onshow<D: DomTypes>
1083(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1084 let mut result = false;
1085 wrap_panic(&mut || result = (|| {
1086 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1087 let this = &*(this as *const D::Notification);
1088 let result: Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>> = this.GetOnshow();
1089
1090 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1091 return true;
1092 })());
1093 result
1094}
1095
1096unsafe extern "C" fn set_onshow<D: DomTypes>
1097(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
1098 let mut result = false;
1099 wrap_panic(&mut || result = {
1100 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1101 let this = &*(this as *const D::Notification);
1102 let arg0: Option<Rc<EventHandlerNonNull<D>>> = if HandleValue::from_raw(args.get(0)).get().is_object() {
1103 Some(EventHandlerNonNull::<D>::new(SafeJSContext::from_ptr(cx.raw_cx()), HandleValue::from_raw(args.get(0)).get().to_object()))
1104 } else {
1105 None
1106 };
1107 let result: () = this.SetOnshow(arg0);
1108
1109 true
1110 });
1111 result
1112}
1113
1114
1115static onshow_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1116
1117pub(crate) fn init_onshow_getterinfo<D: DomTypes>() {
1118 onshow_getterinfo.set(JSJitInfo {
1119 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1120 getter: Some(get_onshow::<D>)
1121 },
1122 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1123 protoID: PrototypeList::ID::Notification as u16,
1124 },
1125 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1126 _bitfield_align_1: [],
1127 _bitfield_1: __BindgenBitfieldUnit::new(
1128 new_jsjitinfo_bitfield_1!(
1129 JSJitInfo_OpType::Getter as u8,
1130 JSJitInfo_AliasSet::AliasEverything as u8,
1131 JSValueType::JSVAL_TYPE_UNKNOWN as u8,
1132 true,
1133 false,
1134 false,
1135 false,
1136 false,
1137 false,
1138 0,
1139 ).to_ne_bytes()
1140 ),
1141});
1142}
1143static onshow_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1144
1145pub(crate) fn init_onshow_setterinfo<D: DomTypes>() {
1146 onshow_setterinfo.set(JSJitInfo {
1147 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1148 setter: Some(set_onshow::<D>)
1149 },
1150 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1151 protoID: PrototypeList::ID::Notification as u16,
1152 },
1153 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1154 _bitfield_align_1: [],
1155 _bitfield_1: __BindgenBitfieldUnit::new(
1156 new_jsjitinfo_bitfield_1!(
1157 JSJitInfo_OpType::Setter as u8,
1158 JSJitInfo_AliasSet::AliasEverything as u8,
1159 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1160 false,
1161 false,
1162 false,
1163 false,
1164 false,
1165 false,
1166 0,
1167 ).to_ne_bytes()
1168 ),
1169});
1170}
1171unsafe extern "C" fn get_onerror<D: DomTypes>
1172(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1173 let mut result = false;
1174 wrap_panic(&mut || result = (|| {
1175 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1176 let this = &*(this as *const D::Notification);
1177 let result: Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>> = this.GetOnerror();
1178
1179 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1180 return true;
1181 })());
1182 result
1183}
1184
1185unsafe extern "C" fn set_onerror<D: DomTypes>
1186(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
1187 let mut result = false;
1188 wrap_panic(&mut || result = {
1189 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1190 let this = &*(this as *const D::Notification);
1191 let arg0: Option<Rc<EventHandlerNonNull<D>>> = if HandleValue::from_raw(args.get(0)).get().is_object() {
1192 Some(EventHandlerNonNull::<D>::new(SafeJSContext::from_ptr(cx.raw_cx()), HandleValue::from_raw(args.get(0)).get().to_object()))
1193 } else {
1194 None
1195 };
1196 let result: () = this.SetOnerror(arg0);
1197
1198 true
1199 });
1200 result
1201}
1202
1203
1204static onerror_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1205
1206pub(crate) fn init_onerror_getterinfo<D: DomTypes>() {
1207 onerror_getterinfo.set(JSJitInfo {
1208 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1209 getter: Some(get_onerror::<D>)
1210 },
1211 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1212 protoID: PrototypeList::ID::Notification as u16,
1213 },
1214 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1215 _bitfield_align_1: [],
1216 _bitfield_1: __BindgenBitfieldUnit::new(
1217 new_jsjitinfo_bitfield_1!(
1218 JSJitInfo_OpType::Getter as u8,
1219 JSJitInfo_AliasSet::AliasEverything as u8,
1220 JSValueType::JSVAL_TYPE_UNKNOWN as u8,
1221 true,
1222 false,
1223 false,
1224 false,
1225 false,
1226 false,
1227 0,
1228 ).to_ne_bytes()
1229 ),
1230});
1231}
1232static onerror_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1233
1234pub(crate) fn init_onerror_setterinfo<D: DomTypes>() {
1235 onerror_setterinfo.set(JSJitInfo {
1236 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1237 setter: Some(set_onerror::<D>)
1238 },
1239 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1240 protoID: PrototypeList::ID::Notification as u16,
1241 },
1242 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1243 _bitfield_align_1: [],
1244 _bitfield_1: __BindgenBitfieldUnit::new(
1245 new_jsjitinfo_bitfield_1!(
1246 JSJitInfo_OpType::Setter as u8,
1247 JSJitInfo_AliasSet::AliasEverything as u8,
1248 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1249 false,
1250 false,
1251 false,
1252 false,
1253 false,
1254 false,
1255 0,
1256 ).to_ne_bytes()
1257 ),
1258});
1259}
1260unsafe extern "C" fn get_onclose<D: DomTypes>
1261(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1262 let mut result = false;
1263 wrap_panic(&mut || result = (|| {
1264 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1265 let this = &*(this as *const D::Notification);
1266 let result: Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>> = this.GetOnclose();
1267
1268 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1269 return true;
1270 })());
1271 result
1272}
1273
1274unsafe extern "C" fn set_onclose<D: DomTypes>
1275(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
1276 let mut result = false;
1277 wrap_panic(&mut || result = {
1278 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1279 let this = &*(this as *const D::Notification);
1280 let arg0: Option<Rc<EventHandlerNonNull<D>>> = if HandleValue::from_raw(args.get(0)).get().is_object() {
1281 Some(EventHandlerNonNull::<D>::new(SafeJSContext::from_ptr(cx.raw_cx()), HandleValue::from_raw(args.get(0)).get().to_object()))
1282 } else {
1283 None
1284 };
1285 let result: () = this.SetOnclose(arg0);
1286
1287 true
1288 });
1289 result
1290}
1291
1292
1293static onclose_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1294
1295pub(crate) fn init_onclose_getterinfo<D: DomTypes>() {
1296 onclose_getterinfo.set(JSJitInfo {
1297 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1298 getter: Some(get_onclose::<D>)
1299 },
1300 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1301 protoID: PrototypeList::ID::Notification as u16,
1302 },
1303 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1304 _bitfield_align_1: [],
1305 _bitfield_1: __BindgenBitfieldUnit::new(
1306 new_jsjitinfo_bitfield_1!(
1307 JSJitInfo_OpType::Getter as u8,
1308 JSJitInfo_AliasSet::AliasEverything as u8,
1309 JSValueType::JSVAL_TYPE_UNKNOWN as u8,
1310 true,
1311 false,
1312 false,
1313 false,
1314 false,
1315 false,
1316 0,
1317 ).to_ne_bytes()
1318 ),
1319});
1320}
1321static onclose_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1322
1323pub(crate) fn init_onclose_setterinfo<D: DomTypes>() {
1324 onclose_setterinfo.set(JSJitInfo {
1325 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1326 setter: Some(set_onclose::<D>)
1327 },
1328 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1329 protoID: PrototypeList::ID::Notification as u16,
1330 },
1331 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1332 _bitfield_align_1: [],
1333 _bitfield_1: __BindgenBitfieldUnit::new(
1334 new_jsjitinfo_bitfield_1!(
1335 JSJitInfo_OpType::Setter as u8,
1336 JSJitInfo_AliasSet::AliasEverything as u8,
1337 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1338 false,
1339 false,
1340 false,
1341 false,
1342 false,
1343 false,
1344 0,
1345 ).to_ne_bytes()
1346 ),
1347});
1348}
1349unsafe extern "C" fn get_title<D: DomTypes>
1350(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1351 let mut result = false;
1352 wrap_panic(&mut || result = (|| {
1353 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1354 let this = &*(this as *const D::Notification);
1355 let result: DOMString = this.Title();
1356
1357 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1358 return true;
1359 })());
1360 result
1361}
1362
1363
1364static title_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1365
1366pub(crate) fn init_title_getterinfo<D: DomTypes>() {
1367 title_getterinfo.set(JSJitInfo {
1368 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1369 getter: Some(get_title::<D>)
1370 },
1371 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1372 protoID: PrototypeList::ID::Notification as u16,
1373 },
1374 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1375 _bitfield_align_1: [],
1376 _bitfield_1: __BindgenBitfieldUnit::new(
1377 new_jsjitinfo_bitfield_1!(
1378 JSJitInfo_OpType::Getter as u8,
1379 JSJitInfo_AliasSet::AliasDOMSets as u8,
1380 JSValueType::JSVAL_TYPE_STRING as u8,
1381 true,
1382 true,
1383 false,
1384 false,
1385 false,
1386 false,
1387 0,
1388 ).to_ne_bytes()
1389 ),
1390});
1391}
1392unsafe extern "C" fn get_dir<D: DomTypes>
1393(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1394 let mut result = false;
1395 wrap_panic(&mut || result = (|| {
1396 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1397 let this = &*(this as *const D::Notification);
1398 let result: NotificationDirection = this.Dir();
1399
1400 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1401 return true;
1402 })());
1403 result
1404}
1405
1406
1407static dir_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1408
1409pub(crate) fn init_dir_getterinfo<D: DomTypes>() {
1410 dir_getterinfo.set(JSJitInfo {
1411 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1412 getter: Some(get_dir::<D>)
1413 },
1414 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1415 protoID: PrototypeList::ID::Notification as u16,
1416 },
1417 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1418 _bitfield_align_1: [],
1419 _bitfield_1: __BindgenBitfieldUnit::new(
1420 new_jsjitinfo_bitfield_1!(
1421 JSJitInfo_OpType::Getter as u8,
1422 JSJitInfo_AliasSet::AliasDOMSets as u8,
1423 JSValueType::JSVAL_TYPE_STRING as u8,
1424 true,
1425 true,
1426 false,
1427 false,
1428 false,
1429 false,
1430 0,
1431 ).to_ne_bytes()
1432 ),
1433});
1434}
1435unsafe extern "C" fn get_lang<D: DomTypes>
1436(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1437 let mut result = false;
1438 wrap_panic(&mut || result = (|| {
1439 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1440 let this = &*(this as *const D::Notification);
1441 let result: DOMString = this.Lang();
1442
1443 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1444 return true;
1445 })());
1446 result
1447}
1448
1449
1450static lang_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1451
1452pub(crate) fn init_lang_getterinfo<D: DomTypes>() {
1453 lang_getterinfo.set(JSJitInfo {
1454 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1455 getter: Some(get_lang::<D>)
1456 },
1457 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1458 protoID: PrototypeList::ID::Notification as u16,
1459 },
1460 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1461 _bitfield_align_1: [],
1462 _bitfield_1: __BindgenBitfieldUnit::new(
1463 new_jsjitinfo_bitfield_1!(
1464 JSJitInfo_OpType::Getter as u8,
1465 JSJitInfo_AliasSet::AliasDOMSets as u8,
1466 JSValueType::JSVAL_TYPE_STRING as u8,
1467 true,
1468 true,
1469 false,
1470 false,
1471 false,
1472 false,
1473 0,
1474 ).to_ne_bytes()
1475 ),
1476});
1477}
1478unsafe extern "C" fn get_body<D: DomTypes>
1479(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1480 let mut result = false;
1481 wrap_panic(&mut || result = (|| {
1482 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1483 let this = &*(this as *const D::Notification);
1484 let result: DOMString = this.Body();
1485
1486 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1487 return true;
1488 })());
1489 result
1490}
1491
1492
1493static body_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1494
1495pub(crate) fn init_body_getterinfo<D: DomTypes>() {
1496 body_getterinfo.set(JSJitInfo {
1497 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1498 getter: Some(get_body::<D>)
1499 },
1500 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1501 protoID: PrototypeList::ID::Notification as u16,
1502 },
1503 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1504 _bitfield_align_1: [],
1505 _bitfield_1: __BindgenBitfieldUnit::new(
1506 new_jsjitinfo_bitfield_1!(
1507 JSJitInfo_OpType::Getter as u8,
1508 JSJitInfo_AliasSet::AliasDOMSets as u8,
1509 JSValueType::JSVAL_TYPE_STRING as u8,
1510 true,
1511 true,
1512 false,
1513 false,
1514 false,
1515 false,
1516 0,
1517 ).to_ne_bytes()
1518 ),
1519});
1520}
1521unsafe extern "C" fn get_tag<D: DomTypes>
1522(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1523 let mut result = false;
1524 wrap_panic(&mut || result = (|| {
1525 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1526 let this = &*(this as *const D::Notification);
1527 let result: DOMString = this.Tag();
1528
1529 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1530 return true;
1531 })());
1532 result
1533}
1534
1535
1536static tag_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1537
1538pub(crate) fn init_tag_getterinfo<D: DomTypes>() {
1539 tag_getterinfo.set(JSJitInfo {
1540 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1541 getter: Some(get_tag::<D>)
1542 },
1543 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1544 protoID: PrototypeList::ID::Notification as u16,
1545 },
1546 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1547 _bitfield_align_1: [],
1548 _bitfield_1: __BindgenBitfieldUnit::new(
1549 new_jsjitinfo_bitfield_1!(
1550 JSJitInfo_OpType::Getter as u8,
1551 JSJitInfo_AliasSet::AliasNone as u8,
1552 JSValueType::JSVAL_TYPE_STRING as u8,
1553 true,
1554 true,
1555 false,
1556 false,
1557 false,
1558 false,
1559 0,
1560 ).to_ne_bytes()
1561 ),
1562});
1563}
1564unsafe extern "C" fn get_image<D: DomTypes>
1565(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1566 let mut result = false;
1567 wrap_panic(&mut || result = (|| {
1568 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1569 let this = &*(this as *const D::Notification);
1570 let result: USVString = this.Image();
1571
1572 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1573 return true;
1574 })());
1575 result
1576}
1577
1578
1579static image_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1580
1581pub(crate) fn init_image_getterinfo<D: DomTypes>() {
1582 image_getterinfo.set(JSJitInfo {
1583 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1584 getter: Some(get_image::<D>)
1585 },
1586 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1587 protoID: PrototypeList::ID::Notification as u16,
1588 },
1589 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1590 _bitfield_align_1: [],
1591 _bitfield_1: __BindgenBitfieldUnit::new(
1592 new_jsjitinfo_bitfield_1!(
1593 JSJitInfo_OpType::Getter as u8,
1594 JSJitInfo_AliasSet::AliasDOMSets as u8,
1595 JSValueType::JSVAL_TYPE_STRING as u8,
1596 true,
1597 true,
1598 false,
1599 false,
1600 false,
1601 false,
1602 0,
1603 ).to_ne_bytes()
1604 ),
1605});
1606}
1607unsafe extern "C" fn get_icon<D: DomTypes>
1608(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1609 let mut result = false;
1610 wrap_panic(&mut || result = (|| {
1611 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1612 let this = &*(this as *const D::Notification);
1613 let result: USVString = this.Icon();
1614
1615 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1616 return true;
1617 })());
1618 result
1619}
1620
1621
1622static icon_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1623
1624pub(crate) fn init_icon_getterinfo<D: DomTypes>() {
1625 icon_getterinfo.set(JSJitInfo {
1626 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1627 getter: Some(get_icon::<D>)
1628 },
1629 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1630 protoID: PrototypeList::ID::Notification as u16,
1631 },
1632 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1633 _bitfield_align_1: [],
1634 _bitfield_1: __BindgenBitfieldUnit::new(
1635 new_jsjitinfo_bitfield_1!(
1636 JSJitInfo_OpType::Getter as u8,
1637 JSJitInfo_AliasSet::AliasDOMSets as u8,
1638 JSValueType::JSVAL_TYPE_STRING as u8,
1639 true,
1640 true,
1641 false,
1642 false,
1643 false,
1644 false,
1645 0,
1646 ).to_ne_bytes()
1647 ),
1648});
1649}
1650unsafe extern "C" fn get_badge<D: DomTypes>
1651(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1652 let mut result = false;
1653 wrap_panic(&mut || result = (|| {
1654 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1655 let this = &*(this as *const D::Notification);
1656 let result: USVString = this.Badge();
1657
1658 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1659 return true;
1660 })());
1661 result
1662}
1663
1664
1665static badge_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1666
1667pub(crate) fn init_badge_getterinfo<D: DomTypes>() {
1668 badge_getterinfo.set(JSJitInfo {
1669 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1670 getter: Some(get_badge::<D>)
1671 },
1672 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1673 protoID: PrototypeList::ID::Notification as u16,
1674 },
1675 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1676 _bitfield_align_1: [],
1677 _bitfield_1: __BindgenBitfieldUnit::new(
1678 new_jsjitinfo_bitfield_1!(
1679 JSJitInfo_OpType::Getter as u8,
1680 JSJitInfo_AliasSet::AliasDOMSets as u8,
1681 JSValueType::JSVAL_TYPE_STRING as u8,
1682 true,
1683 true,
1684 false,
1685 false,
1686 false,
1687 false,
1688 0,
1689 ).to_ne_bytes()
1690 ),
1691});
1692}
1693unsafe extern "C" fn get_renotify<D: DomTypes>
1694(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1695 let mut result = false;
1696 wrap_panic(&mut || result = (|| {
1697 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1698 let this = &*(this as *const D::Notification);
1699 let result: bool = this.Renotify();
1700
1701 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1702 return true;
1703 })());
1704 result
1705}
1706
1707
1708static renotify_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1709
1710pub(crate) fn init_renotify_getterinfo<D: DomTypes>() {
1711 renotify_getterinfo.set(JSJitInfo {
1712 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1713 getter: Some(get_renotify::<D>)
1714 },
1715 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1716 protoID: PrototypeList::ID::Notification as u16,
1717 },
1718 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1719 _bitfield_align_1: [],
1720 _bitfield_1: __BindgenBitfieldUnit::new(
1721 new_jsjitinfo_bitfield_1!(
1722 JSJitInfo_OpType::Getter as u8,
1723 JSJitInfo_AliasSet::AliasEverything as u8,
1724 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
1725 true,
1726 false,
1727 false,
1728 false,
1729 false,
1730 false,
1731 0,
1732 ).to_ne_bytes()
1733 ),
1734});
1735}
1736unsafe extern "C" fn get_requireInteraction<D: DomTypes>
1737(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1738 let mut result = false;
1739 wrap_panic(&mut || result = (|| {
1740 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1741 let this = &*(this as *const D::Notification);
1742 let result: bool = this.RequireInteraction();
1743
1744 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1745 return true;
1746 })());
1747 result
1748}
1749
1750
1751static requireInteraction_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1752
1753pub(crate) fn init_requireInteraction_getterinfo<D: DomTypes>() {
1754 requireInteraction_getterinfo.set(JSJitInfo {
1755 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1756 getter: Some(get_requireInteraction::<D>)
1757 },
1758 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1759 protoID: PrototypeList::ID::Notification as u16,
1760 },
1761 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1762 _bitfield_align_1: [],
1763 _bitfield_1: __BindgenBitfieldUnit::new(
1764 new_jsjitinfo_bitfield_1!(
1765 JSJitInfo_OpType::Getter as u8,
1766 JSJitInfo_AliasSet::AliasNone as u8,
1767 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
1768 true,
1769 true,
1770 false,
1771 false,
1772 false,
1773 false,
1774 0,
1775 ).to_ne_bytes()
1776 ),
1777});
1778}
1779unsafe extern "C" fn get_silent<D: DomTypes>
1780(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1781 let mut result = false;
1782 wrap_panic(&mut || result = (|| {
1783 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1784 let this = &*(this as *const D::Notification);
1785 let result: Option<bool> = this.GetSilent();
1786
1787 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1788 return true;
1789 })());
1790 result
1791}
1792
1793
1794static silent_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1795
1796pub(crate) fn init_silent_getterinfo<D: DomTypes>() {
1797 silent_getterinfo.set(JSJitInfo {
1798 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1799 getter: Some(get_silent::<D>)
1800 },
1801 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1802 protoID: PrototypeList::ID::Notification as u16,
1803 },
1804 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1805 _bitfield_align_1: [],
1806 _bitfield_1: __BindgenBitfieldUnit::new(
1807 new_jsjitinfo_bitfield_1!(
1808 JSJitInfo_OpType::Getter as u8,
1809 JSJitInfo_AliasSet::AliasNone as u8,
1810 JSValueType::JSVAL_TYPE_UNKNOWN as u8,
1811 true,
1812 true,
1813 false,
1814 false,
1815 false,
1816 false,
1817 0,
1818 ).to_ne_bytes()
1819 ),
1820});
1821}
1822unsafe extern "C" fn get_vibrate<D: DomTypes>
1823(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1824 let mut result = false;
1825 wrap_panic(&mut || result = (|| {
1826 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1827 let this = &*(this as *const D::Notification);
1828 rooted!(&in(cx) let mut retval: JSVal);
1829 let result: () = this.Vibrate(SafeJSContext::from_ptr(cx.raw_cx()), CanGc::note(), retval.handle_mut());
1830
1831 (retval).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1832 return true;
1833 })());
1834 result
1835}
1836
1837
1838static vibrate_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1839
1840pub(crate) fn init_vibrate_getterinfo<D: DomTypes>() {
1841 vibrate_getterinfo.set(JSJitInfo {
1842 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1843 getter: Some(get_vibrate::<D>)
1844 },
1845 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1846 protoID: PrototypeList::ID::Notification as u16,
1847 },
1848 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1849 _bitfield_align_1: [],
1850 _bitfield_1: __BindgenBitfieldUnit::new(
1851 new_jsjitinfo_bitfield_1!(
1852 JSJitInfo_OpType::Getter as u8,
1853 JSJitInfo_AliasSet::AliasEverything as u8,
1854 JSValueType::JSVAL_TYPE_UNKNOWN as u8,
1855 true,
1856 false,
1857 false,
1858 false,
1859 false,
1860 false,
1861 0,
1862 ).to_ne_bytes()
1863 ),
1864});
1865}
1866unsafe extern "C" fn get_timestamp<D: DomTypes>
1867(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1868 let mut result = false;
1869 wrap_panic(&mut || result = (|| {
1870 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1871 let this = &*(this as *const D::Notification);
1872 let result: u64 = this.Timestamp();
1873
1874 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1875 return true;
1876 })());
1877 result
1878}
1879
1880
1881static timestamp_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1882
1883pub(crate) fn init_timestamp_getterinfo<D: DomTypes>() {
1884 timestamp_getterinfo.set(JSJitInfo {
1885 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1886 getter: Some(get_timestamp::<D>)
1887 },
1888 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1889 protoID: PrototypeList::ID::Notification as u16,
1890 },
1891 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1892 _bitfield_align_1: [],
1893 _bitfield_1: __BindgenBitfieldUnit::new(
1894 new_jsjitinfo_bitfield_1!(
1895 JSJitInfo_OpType::Getter as u8,
1896 JSJitInfo_AliasSet::AliasEverything as u8,
1897 JSValueType::JSVAL_TYPE_DOUBLE as u8,
1898 true,
1899 false,
1900 false,
1901 false,
1902 false,
1903 false,
1904 0,
1905 ).to_ne_bytes()
1906 ),
1907});
1908}
1909unsafe extern "C" fn get_data<D: DomTypes>
1910(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1911 let mut result = false;
1912 wrap_panic(&mut || result = (|| {
1913 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1914 let this = &*(this as *const D::Notification);
1915 rooted!(&in(cx) let mut retval: JSVal);
1916 let result: () = this.Data(SafeJSContext::from_ptr(cx.raw_cx()), retval.handle_mut());
1917
1918 (retval).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1919 return true;
1920 })());
1921 result
1922}
1923
1924
1925static data_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1926
1927pub(crate) fn init_data_getterinfo<D: DomTypes>() {
1928 data_getterinfo.set(JSJitInfo {
1929 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1930 getter: Some(get_data::<D>)
1931 },
1932 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1933 protoID: PrototypeList::ID::Notification as u16,
1934 },
1935 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1936 _bitfield_align_1: [],
1937 _bitfield_1: __BindgenBitfieldUnit::new(
1938 new_jsjitinfo_bitfield_1!(
1939 JSJitInfo_OpType::Getter as u8,
1940 JSJitInfo_AliasSet::AliasNone as u8,
1941 JSValueType::JSVAL_TYPE_UNKNOWN as u8,
1942 true,
1943 true,
1944 false,
1945 false,
1946 false,
1947 false,
1948 0,
1949 ).to_ne_bytes()
1950 ),
1951});
1952}
1953unsafe extern "C" fn get_actions<D: DomTypes>
1954(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1955 let mut result = false;
1956 wrap_panic(&mut || result = (|| {
1957 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1958 let this = &*(this as *const D::Notification);
1959 rooted!(&in(cx) let mut retval: JSVal);
1960 let result: () = this.Actions(SafeJSContext::from_ptr(cx.raw_cx()), CanGc::note(), retval.handle_mut());
1961
1962 (retval).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1963 return true;
1964 })());
1965 result
1966}
1967
1968
1969static actions_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1970
1971pub(crate) fn init_actions_getterinfo<D: DomTypes>() {
1972 actions_getterinfo.set(JSJitInfo {
1973 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1974 getter: Some(get_actions::<D>)
1975 },
1976 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1977 protoID: PrototypeList::ID::Notification as u16,
1978 },
1979 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
1980 _bitfield_align_1: [],
1981 _bitfield_1: __BindgenBitfieldUnit::new(
1982 new_jsjitinfo_bitfield_1!(
1983 JSJitInfo_OpType::Getter as u8,
1984 JSJitInfo_AliasSet::AliasEverything as u8,
1985 JSValueType::JSVAL_TYPE_UNKNOWN as u8,
1986 true,
1987 false,
1988 false,
1989 false,
1990 false,
1991 false,
1992 0,
1993 ).to_ne_bytes()
1994 ),
1995});
1996}
1997unsafe extern "C" fn close<D: DomTypes>
1998(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
1999 let mut result = false;
2000 wrap_panic(&mut || result = (|| {
2001 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
2002 let this = &*(this as *const D::Notification);
2003 let args = &*args;
2004 let argc = args.argc_;
2005 let result: () = this.Close();
2006
2007 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
2008 return true;
2009 })());
2010 result
2011}
2012
2013
2014static close_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
2015
2016pub(crate) fn init_close_methodinfo<D: DomTypes>() {
2017 close_methodinfo.set(JSJitInfo {
2018 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
2019 method: Some(close::<D>)
2020 },
2021 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
2022 protoID: PrototypeList::ID::Notification as u16,
2023 },
2024 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
2025 _bitfield_align_1: [],
2026 _bitfield_1: __BindgenBitfieldUnit::new(
2027 new_jsjitinfo_bitfield_1!(
2028 JSJitInfo_OpType::Method as u8,
2029 JSJitInfo_AliasSet::AliasEverything as u8,
2030 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
2031 true,
2032 false,
2033 false,
2034 false,
2035 false,
2036 false,
2037 0,
2038 ).to_ne_bytes()
2039 ),
2040});
2041}
2042unsafe extern "C" fn _finalize<D: DomTypes>
2043(_cx: *mut GCContext, obj: *mut JSObject){
2044 wrap_panic(&mut || {
2045
2046 let this = native_from_object_static::<D::Notification>(obj).unwrap();
2047 finalize_common(this);
2048 })
2049}
2050
2051unsafe extern "C" fn _trace<D: DomTypes>
2052(trc: *mut JSTracer, obj: *mut JSObject){
2053 wrap_panic(&mut || {
2054
2055 let this = native_from_object_static::<D::Notification>(obj).unwrap();
2056 if this.is_null() { return; } (*this).trace(trc);
2058 })
2059}
2060
2061
2062static CLASS_OPS: ThreadUnsafeOnceLock<JSClassOps> = ThreadUnsafeOnceLock::new();
2063
2064pub(crate) fn init_class_ops<D: DomTypes>() {
2065 CLASS_OPS.set(JSClassOps {
2066 addProperty: None,
2067 delProperty: None,
2068 enumerate: None,
2069 newEnumerate: None,
2070 resolve: None,
2071 mayResolve: None,
2072 finalize: Some(_finalize::<D>),
2073 call: None,
2074 construct: None,
2075 trace: Some(_trace::<D>),
2076 });
2077}
2078
2079pub static Class: ThreadUnsafeOnceLock<DOMJSClass> = ThreadUnsafeOnceLock::new();
2080
2081pub(crate) fn init_domjs_class<D: DomTypes>() {
2082 init_class_ops::<D>();
2083 Class.set(DOMJSClass {
2084 base: JSClass {
2085 name: c"Notification".as_ptr(),
2086 flags: JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE |
2087 (((1) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT)
2088 ,
2089 cOps: unsafe { CLASS_OPS.get() },
2090 spec: ptr::null(),
2091 ext: ptr::null(),
2092 oOps: ptr::null(),
2093 },
2094 dom_class:
2095DOMClass {
2096 interface_chain: [ PrototypeList::ID::EventTarget, PrototypeList::ID::Notification, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last ],
2097 depth: 1,
2098 type_id: crate::codegen::InheritTypes::TopTypeId { eventtarget: (crate::codegen::InheritTypes::EventTargetTypeId::Notification) },
2099 malloc_size_of: malloc_size_of_including_raw_self::<D::Notification> as unsafe fn(&mut _, _) -> _,
2100 global: Globals::EMPTY,
2101},
2102 });
2103}
2104
2105#[cfg_attr(crown, allow(crown::unrooted_must_root))] pub unsafe fn Wrap<D: DomTypes>
2106(cx: SafeJSContext, scope: &D::GlobalScope, given_proto: Option<HandleObject>, object: Box<D::Notification>, _can_gc: CanGc) -> DomRoot<D::Notification>{
2107
2108 let raw = Root::new(MaybeUnreflectedDom::from_box(object));
2109
2110 let scope = scope.reflector().get_jsobject();
2111 assert!(!scope.get().is_null());
2112 assert!(((*get_object_class(scope.get())).flags & JSCLASS_IS_GLOBAL) != 0);
2113 let _ac = JSAutoRealm::new(cx.raw_cx(), scope.get());
2114
2115 rooted!(&in(cx) let mut canonical_proto = ptr::null_mut::<JSObject>());
2116 GetProtoObject::<D>(cx, scope, canonical_proto.handle_mut());
2117 assert!(!canonical_proto.is_null());
2118
2119
2120 rooted!(&in(cx) let mut proto = ptr::null_mut::<JSObject>());
2121 if let Some(given) = given_proto {
2122 proto.set(*given);
2123 if get_context_realm(cx.raw_cx()) != get_object_realm(*given) {
2124 assert!(JS_WrapObject(cx.raw_cx(), proto.handle_mut()));
2125 }
2126 } else {
2127 proto.set(*canonical_proto);
2128 }
2129 rooted!(&in(cx) let obj = JS_NewObjectWithGivenProto(
2130 cx.raw_cx(),
2131 &Class.get().base,
2132 proto.handle(),
2133 ));
2134 assert!(!obj.is_null());
2135 JS_SetReservedSlot(
2136 obj.get(),
2137 DOM_OBJECT_SLOT,
2138 &PrivateValue(raw.as_ptr() as *const libc::c_void),
2139 );
2140
2141 let root = raw.reflect_with(obj.get());
2142
2143
2144
2145 DomRoot::from_ref(&*root)
2146}
2147
2148pub trait NotificationMethods<D: DomTypes> {
2149 fn GetPermission(r#global: &D::GlobalScope) -> Fallible<NotificationPermission>;
2150 fn RequestPermission(r#global: &D::GlobalScope, r#deprecatedCallback: Option<Rc<NotificationPermissionCallback<D>>>, r#_can_gc: CanGc) -> Rc<D::Promise>;
2151 fn MaxActions(r#global: &D::GlobalScope) -> u32;
2152 fn GetOnclick(&self, ) -> Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>>;
2153 fn SetOnclick(&self, r#value: Option<Rc<EventHandlerNonNull<D>>>);
2154 fn GetOnshow(&self, ) -> Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>>;
2155 fn SetOnshow(&self, r#value: Option<Rc<EventHandlerNonNull<D>>>);
2156 fn GetOnerror(&self, ) -> Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>>;
2157 fn SetOnerror(&self, r#value: Option<Rc<EventHandlerNonNull<D>>>);
2158 fn GetOnclose(&self, ) -> Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>>;
2159 fn SetOnclose(&self, r#value: Option<Rc<EventHandlerNonNull<D>>>);
2160 fn Title(&self, ) -> DOMString;
2161 fn Dir(&self, ) -> NotificationDirection;
2162 fn Lang(&self, ) -> DOMString;
2163 fn Body(&self, ) -> DOMString;
2164 fn Tag(&self, ) -> DOMString;
2165 fn Image(&self, ) -> USVString;
2166 fn Icon(&self, ) -> USVString;
2167 fn Badge(&self, ) -> USVString;
2168 fn Renotify(&self, ) -> bool;
2169 fn RequireInteraction(&self, ) -> bool;
2170 fn GetSilent(&self, ) -> Option<bool>;
2171 fn Vibrate(&self, r#cx: SafeJSContext, r#_can_gc: CanGc, r#retval: MutableHandleValue);
2172 fn Timestamp(&self, ) -> u64;
2173 fn Data(&self, r#cx: SafeJSContext, r#retval: MutableHandleValue);
2174 fn Actions(&self, r#cx: SafeJSContext, r#_can_gc: CanGc, r#retval: MutableHandleValue);
2175 fn Close(&self, );
2176 fn Constructor(r#global: &D::GlobalScope, r#proto: Option<HandleObject>, r#can_gc: CanGc, r#title: DOMString, r#options: RootedTraceableBox<crate::codegen::GenericBindings::NotificationBinding::NotificationOptions>) -> Fallible<DomRoot<D::Notification>>;
2177}
2178static sStaticMethods_specs: ThreadUnsafeOnceLock<&[&[JSFunctionSpec]]> = ThreadUnsafeOnceLock::new();
2179
2180pub(crate) fn init_sStaticMethods_specs<D: DomTypes>() {
2181 sStaticMethods_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
2182 JSFunctionSpec {
2183 name: JSPropertySpec_Name { string_: c"requestPermission".as_ptr() },
2184 call: JSNativeWrapper { op: Some(generic_static_promise_method), info: unsafe { requestPermission_methodinfo.get() } },
2185 nargs: 0,
2186 flags: (JSPROP_ENUMERATE) as u16,
2187 selfHostedName: ptr::null()
2188 },
2189 JSFunctionSpec {
2190 name: JSPropertySpec_Name { string_: ptr::null() },
2191 call: JSNativeWrapper { op: None, info: ptr::null() },
2192 nargs: 0,
2193 flags: 0,
2194 selfHostedName: ptr::null()
2195 }]))[..]
2196])));
2197}static sStaticMethods: ThreadUnsafeOnceLock<&[Guard<&[JSFunctionSpec]>]> = ThreadUnsafeOnceLock::new();
2198
2199pub(crate) fn init_sStaticMethods_prefs<D: DomTypes>() {
2200 sStaticMethods.set(Box::leak(Box::new([ Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sStaticMethods_specs.get() })[0])])));
2201}static sStaticAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
2202
2203pub(crate) fn init_sStaticAttributes_specs<D: DomTypes>() {
2204 sStaticAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
2205 JSPropertySpec {
2206 name: JSPropertySpec_Name { string_: c"permission".as_ptr() },
2207 attributes_: (JSPROP_ENUMERATE),
2208 kind_: (JSPropertySpec_Kind::NativeAccessor),
2209 u: JSPropertySpec_AccessorsOrValue {
2210 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2211 getter: JSPropertySpec_Accessor {
2212 native: JSNativeWrapper { op: Some(get_permission::<D>), info: ptr::null() },
2213 },
2214 setter: JSPropertySpec_Accessor {
2215 native: JSNativeWrapper { op: None, info: ptr::null() },
2216 }
2217 }
2218 }
2219 }
2220,
2221 JSPropertySpec {
2222 name: JSPropertySpec_Name { string_: c"maxActions".as_ptr() },
2223 attributes_: (JSPROP_ENUMERATE),
2224 kind_: (JSPropertySpec_Kind::NativeAccessor),
2225 u: JSPropertySpec_AccessorsOrValue {
2226 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2227 getter: JSPropertySpec_Accessor {
2228 native: JSNativeWrapper { op: Some(get_maxActions::<D>), info: ptr::null() },
2229 },
2230 setter: JSPropertySpec_Accessor {
2231 native: JSNativeWrapper { op: None, info: ptr::null() },
2232 }
2233 }
2234 }
2235 }
2236,
2237 JSPropertySpec::ZERO]))[..]
2238])));
2239}static sStaticAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
2240
2241pub(crate) fn init_sStaticAttributes_prefs<D: DomTypes>() {
2242 sStaticAttributes.set(Box::leak(Box::new([ Guard::new(&[Condition::Exposed(Globals::WINDOW),Condition::Exposed(Globals::SERVICE_WORKER_GLOBAL_SCOPE),Condition::Exposed(Globals::DEDICATED_WORKER_GLOBAL_SCOPE)], (unsafe { sStaticAttributes_specs.get() })[0])])));
2243}static sMethods_specs: ThreadUnsafeOnceLock<&[&[JSFunctionSpec]]> = ThreadUnsafeOnceLock::new();
2244
2245pub(crate) fn init_sMethods_specs<D: DomTypes>() {
2246 sMethods_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
2247 JSFunctionSpec {
2248 name: JSPropertySpec_Name { string_: c"close".as_ptr() },
2249 call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { close_methodinfo.get() } as *const _ as *const JSJitInfo },
2250 nargs: 0,
2251 flags: (JSPROP_ENUMERATE) as u16,
2252 selfHostedName: ptr::null()
2253 },
2254 JSFunctionSpec {
2255 name: JSPropertySpec_Name { string_: ptr::null() },
2256 call: JSNativeWrapper { op: None, info: ptr::null() },
2257 nargs: 0,
2258 flags: 0,
2259 selfHostedName: ptr::null()
2260 }]))[..]
2261])));
2262}static sMethods: ThreadUnsafeOnceLock<&[Guard<&[JSFunctionSpec]>]> = ThreadUnsafeOnceLock::new();
2263
2264pub(crate) fn init_sMethods_prefs<D: DomTypes>() {
2265 sMethods.set(Box::leak(Box::new([ Guard::new(&[Condition::Exposed(Globals::WINDOW),Condition::Exposed(Globals::SERVICE_WORKER_GLOBAL_SCOPE),Condition::Exposed(Globals::DEDICATED_WORKER_GLOBAL_SCOPE)], (unsafe { sMethods_specs.get() })[0])])));
2266}static sAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
2267
2268pub(crate) fn init_sAttributes_specs<D: DomTypes>() {
2269 sAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
2270 JSPropertySpec {
2271 name: JSPropertySpec_Name { string_: c"onclick".as_ptr() },
2272 attributes_: (JSPROP_ENUMERATE),
2273 kind_: (JSPropertySpec_Kind::NativeAccessor),
2274 u: JSPropertySpec_AccessorsOrValue {
2275 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2276 getter: JSPropertySpec_Accessor {
2277 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { onclick_getterinfo.get() } },
2278 },
2279 setter: JSPropertySpec_Accessor {
2280 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { onclick_setterinfo.get() } },
2281 }
2282 }
2283 }
2284 }
2285,
2286 JSPropertySpec {
2287 name: JSPropertySpec_Name { string_: c"onshow".as_ptr() },
2288 attributes_: (JSPROP_ENUMERATE),
2289 kind_: (JSPropertySpec_Kind::NativeAccessor),
2290 u: JSPropertySpec_AccessorsOrValue {
2291 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2292 getter: JSPropertySpec_Accessor {
2293 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { onshow_getterinfo.get() } },
2294 },
2295 setter: JSPropertySpec_Accessor {
2296 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { onshow_setterinfo.get() } },
2297 }
2298 }
2299 }
2300 }
2301,
2302 JSPropertySpec {
2303 name: JSPropertySpec_Name { string_: c"onerror".as_ptr() },
2304 attributes_: (JSPROP_ENUMERATE),
2305 kind_: (JSPropertySpec_Kind::NativeAccessor),
2306 u: JSPropertySpec_AccessorsOrValue {
2307 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2308 getter: JSPropertySpec_Accessor {
2309 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { onerror_getterinfo.get() } },
2310 },
2311 setter: JSPropertySpec_Accessor {
2312 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { onerror_setterinfo.get() } },
2313 }
2314 }
2315 }
2316 }
2317,
2318 JSPropertySpec {
2319 name: JSPropertySpec_Name { string_: c"onclose".as_ptr() },
2320 attributes_: (JSPROP_ENUMERATE),
2321 kind_: (JSPropertySpec_Kind::NativeAccessor),
2322 u: JSPropertySpec_AccessorsOrValue {
2323 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2324 getter: JSPropertySpec_Accessor {
2325 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { onclose_getterinfo.get() } },
2326 },
2327 setter: JSPropertySpec_Accessor {
2328 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { onclose_setterinfo.get() } },
2329 }
2330 }
2331 }
2332 }
2333,
2334 JSPropertySpec {
2335 name: JSPropertySpec_Name { string_: c"title".as_ptr() },
2336 attributes_: (JSPROP_ENUMERATE),
2337 kind_: (JSPropertySpec_Kind::NativeAccessor),
2338 u: JSPropertySpec_AccessorsOrValue {
2339 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2340 getter: JSPropertySpec_Accessor {
2341 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { title_getterinfo.get() } },
2342 },
2343 setter: JSPropertySpec_Accessor {
2344 native: JSNativeWrapper { op: None, info: ptr::null() },
2345 }
2346 }
2347 }
2348 }
2349,
2350 JSPropertySpec {
2351 name: JSPropertySpec_Name { string_: c"dir".as_ptr() },
2352 attributes_: (JSPROP_ENUMERATE),
2353 kind_: (JSPropertySpec_Kind::NativeAccessor),
2354 u: JSPropertySpec_AccessorsOrValue {
2355 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2356 getter: JSPropertySpec_Accessor {
2357 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { dir_getterinfo.get() } },
2358 },
2359 setter: JSPropertySpec_Accessor {
2360 native: JSNativeWrapper { op: None, info: ptr::null() },
2361 }
2362 }
2363 }
2364 }
2365,
2366 JSPropertySpec {
2367 name: JSPropertySpec_Name { string_: c"lang".as_ptr() },
2368 attributes_: (JSPROP_ENUMERATE),
2369 kind_: (JSPropertySpec_Kind::NativeAccessor),
2370 u: JSPropertySpec_AccessorsOrValue {
2371 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2372 getter: JSPropertySpec_Accessor {
2373 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { lang_getterinfo.get() } },
2374 },
2375 setter: JSPropertySpec_Accessor {
2376 native: JSNativeWrapper { op: None, info: ptr::null() },
2377 }
2378 }
2379 }
2380 }
2381,
2382 JSPropertySpec {
2383 name: JSPropertySpec_Name { string_: c"body".as_ptr() },
2384 attributes_: (JSPROP_ENUMERATE),
2385 kind_: (JSPropertySpec_Kind::NativeAccessor),
2386 u: JSPropertySpec_AccessorsOrValue {
2387 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2388 getter: JSPropertySpec_Accessor {
2389 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { body_getterinfo.get() } },
2390 },
2391 setter: JSPropertySpec_Accessor {
2392 native: JSNativeWrapper { op: None, info: ptr::null() },
2393 }
2394 }
2395 }
2396 }
2397,
2398 JSPropertySpec {
2399 name: JSPropertySpec_Name { string_: c"tag".as_ptr() },
2400 attributes_: (JSPROP_ENUMERATE),
2401 kind_: (JSPropertySpec_Kind::NativeAccessor),
2402 u: JSPropertySpec_AccessorsOrValue {
2403 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2404 getter: JSPropertySpec_Accessor {
2405 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { tag_getterinfo.get() } },
2406 },
2407 setter: JSPropertySpec_Accessor {
2408 native: JSNativeWrapper { op: None, info: ptr::null() },
2409 }
2410 }
2411 }
2412 }
2413,
2414 JSPropertySpec {
2415 name: JSPropertySpec_Name { string_: c"image".as_ptr() },
2416 attributes_: (JSPROP_ENUMERATE),
2417 kind_: (JSPropertySpec_Kind::NativeAccessor),
2418 u: JSPropertySpec_AccessorsOrValue {
2419 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2420 getter: JSPropertySpec_Accessor {
2421 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { image_getterinfo.get() } },
2422 },
2423 setter: JSPropertySpec_Accessor {
2424 native: JSNativeWrapper { op: None, info: ptr::null() },
2425 }
2426 }
2427 }
2428 }
2429,
2430 JSPropertySpec {
2431 name: JSPropertySpec_Name { string_: c"icon".as_ptr() },
2432 attributes_: (JSPROP_ENUMERATE),
2433 kind_: (JSPropertySpec_Kind::NativeAccessor),
2434 u: JSPropertySpec_AccessorsOrValue {
2435 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2436 getter: JSPropertySpec_Accessor {
2437 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { icon_getterinfo.get() } },
2438 },
2439 setter: JSPropertySpec_Accessor {
2440 native: JSNativeWrapper { op: None, info: ptr::null() },
2441 }
2442 }
2443 }
2444 }
2445,
2446 JSPropertySpec {
2447 name: JSPropertySpec_Name { string_: c"badge".as_ptr() },
2448 attributes_: (JSPROP_ENUMERATE),
2449 kind_: (JSPropertySpec_Kind::NativeAccessor),
2450 u: JSPropertySpec_AccessorsOrValue {
2451 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2452 getter: JSPropertySpec_Accessor {
2453 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { badge_getterinfo.get() } },
2454 },
2455 setter: JSPropertySpec_Accessor {
2456 native: JSNativeWrapper { op: None, info: ptr::null() },
2457 }
2458 }
2459 }
2460 }
2461,
2462 JSPropertySpec {
2463 name: JSPropertySpec_Name { string_: c"renotify".as_ptr() },
2464 attributes_: (JSPROP_ENUMERATE),
2465 kind_: (JSPropertySpec_Kind::NativeAccessor),
2466 u: JSPropertySpec_AccessorsOrValue {
2467 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2468 getter: JSPropertySpec_Accessor {
2469 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { renotify_getterinfo.get() } },
2470 },
2471 setter: JSPropertySpec_Accessor {
2472 native: JSNativeWrapper { op: None, info: ptr::null() },
2473 }
2474 }
2475 }
2476 }
2477,
2478 JSPropertySpec {
2479 name: JSPropertySpec_Name { string_: c"requireInteraction".as_ptr() },
2480 attributes_: (JSPROP_ENUMERATE),
2481 kind_: (JSPropertySpec_Kind::NativeAccessor),
2482 u: JSPropertySpec_AccessorsOrValue {
2483 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2484 getter: JSPropertySpec_Accessor {
2485 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { requireInteraction_getterinfo.get() } },
2486 },
2487 setter: JSPropertySpec_Accessor {
2488 native: JSNativeWrapper { op: None, info: ptr::null() },
2489 }
2490 }
2491 }
2492 }
2493,
2494 JSPropertySpec {
2495 name: JSPropertySpec_Name { string_: c"silent".as_ptr() },
2496 attributes_: (JSPROP_ENUMERATE),
2497 kind_: (JSPropertySpec_Kind::NativeAccessor),
2498 u: JSPropertySpec_AccessorsOrValue {
2499 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2500 getter: JSPropertySpec_Accessor {
2501 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { silent_getterinfo.get() } },
2502 },
2503 setter: JSPropertySpec_Accessor {
2504 native: JSNativeWrapper { op: None, info: ptr::null() },
2505 }
2506 }
2507 }
2508 }
2509,
2510 JSPropertySpec {
2511 name: JSPropertySpec_Name { string_: c"vibrate".as_ptr() },
2512 attributes_: (JSPROP_ENUMERATE),
2513 kind_: (JSPropertySpec_Kind::NativeAccessor),
2514 u: JSPropertySpec_AccessorsOrValue {
2515 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2516 getter: JSPropertySpec_Accessor {
2517 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { vibrate_getterinfo.get() } },
2518 },
2519 setter: JSPropertySpec_Accessor {
2520 native: JSNativeWrapper { op: None, info: ptr::null() },
2521 }
2522 }
2523 }
2524 }
2525,
2526 JSPropertySpec {
2527 name: JSPropertySpec_Name { string_: c"timestamp".as_ptr() },
2528 attributes_: (JSPROP_ENUMERATE),
2529 kind_: (JSPropertySpec_Kind::NativeAccessor),
2530 u: JSPropertySpec_AccessorsOrValue {
2531 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2532 getter: JSPropertySpec_Accessor {
2533 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { timestamp_getterinfo.get() } },
2534 },
2535 setter: JSPropertySpec_Accessor {
2536 native: JSNativeWrapper { op: None, info: ptr::null() },
2537 }
2538 }
2539 }
2540 }
2541,
2542 JSPropertySpec {
2543 name: JSPropertySpec_Name { string_: c"data".as_ptr() },
2544 attributes_: (JSPROP_ENUMERATE),
2545 kind_: (JSPropertySpec_Kind::NativeAccessor),
2546 u: JSPropertySpec_AccessorsOrValue {
2547 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2548 getter: JSPropertySpec_Accessor {
2549 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { data_getterinfo.get() } },
2550 },
2551 setter: JSPropertySpec_Accessor {
2552 native: JSNativeWrapper { op: None, info: ptr::null() },
2553 }
2554 }
2555 }
2556 }
2557,
2558 JSPropertySpec {
2559 name: JSPropertySpec_Name { string_: c"actions".as_ptr() },
2560 attributes_: (JSPROP_ENUMERATE),
2561 kind_: (JSPropertySpec_Kind::NativeAccessor),
2562 u: JSPropertySpec_AccessorsOrValue {
2563 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2564 getter: JSPropertySpec_Accessor {
2565 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { actions_getterinfo.get() } },
2566 },
2567 setter: JSPropertySpec_Accessor {
2568 native: JSNativeWrapper { op: None, info: ptr::null() },
2569 }
2570 }
2571 }
2572 }
2573,
2574 JSPropertySpec::ZERO]))[..]
2575,
2576&Box::leak(Box::new([
2577 JSPropertySpec {
2578 name: JSPropertySpec_Name { symbol_: SymbolCode::toStringTag as usize + 1 },
2579 attributes_: (JSPROP_READONLY),
2580 kind_: (JSPropertySpec_Kind::Value),
2581 u: JSPropertySpec_AccessorsOrValue {
2582 value: JSPropertySpec_ValueWrapper {
2583 type_: JSPropertySpec_ValueWrapper_Type::String,
2584 __bindgen_anon_1: JSPropertySpec_ValueWrapper__bindgen_ty_1 {
2585 string: c"Notification".as_ptr(),
2586 }
2587 }
2588 }
2589 }
2590,
2591 JSPropertySpec::ZERO]))[..]
2592])));
2593}static sAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
2594
2595pub(crate) fn init_sAttributes_prefs<D: DomTypes>() {
2596 sAttributes.set(Box::leak(Box::new([ Guard::new(&[Condition::Exposed(Globals::WINDOW),Condition::Exposed(Globals::SERVICE_WORKER_GLOBAL_SCOPE),Condition::Exposed(Globals::DEDICATED_WORKER_GLOBAL_SCOPE)], (unsafe { sAttributes_specs.get() })[0]),
2597 Guard::new(&[Condition::Satisfied], (unsafe { sAttributes_specs.get() })[1])])));
2598}
2599pub fn GetProtoObject<D: DomTypes>
2600(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
2601 get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::Notification), CreateInterfaceObjects::<D>, rval)
2603}
2604
2605
2606static PrototypeClass: JSClass = JSClass {
2607 name: c"NotificationPrototype".as_ptr(),
2608 flags:
2609 (0 ) << JSCLASS_RESERVED_SLOTS_SHIFT,
2611 cOps: ptr::null(),
2612 spec: ptr::null(),
2613 ext: ptr::null(),
2614 oOps: ptr::null(),
2615};
2616
2617unsafe extern "C" fn _constructor<D: DomTypes>
2618(cx: *mut RawJSContext, argc: u32, vp: *mut JSVal) -> bool{
2619 let mut result = false;
2620 wrap_panic(&mut || result = {
2621 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
2622 let args = CallArgs::from_vp(vp, argc);
2623 let global = D::GlobalScope::from_object(JS_CALLEE(cx.raw_cx(), vp).to_object());
2624
2625 call_default_constructor::<D>(
2626 SafeJSContext::from_ptr(cx.raw_cx()),
2627 &args,
2628 &global,
2629 PrototypeList::ID::Notification,
2630 "Notification",
2631 CreateInterfaceObjects::<D>,
2632 |cx: SafeJSContext, args: &CallArgs, global: &D::GlobalScope, desired_proto: HandleObject| {
2633
2634 if argc < 1 {
2635 throw_type_error(cx.raw_cx(), "Not enough arguments to \"Notification.constructor\".");
2636 return false;
2637 }
2638 let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
2639 Ok(ConversionResult::Success(value)) => value,
2640 Ok(ConversionResult::Failure(error)) => {
2641 throw_type_error(cx.raw_cx(), &error);
2642 return false;
2643
2644 }
2645 _ => {
2646 return false;
2647
2648 },
2649 }
2650 ;
2651 let arg1: RootedTraceableBox<crate::codegen::GenericBindings::NotificationBinding::NotificationOptions> = if args.get(1).is_undefined() {
2652 crate::codegen::GenericBindings::NotificationBinding::NotificationOptions::empty()
2653 } else {
2654 match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(1)), ()) {
2655 Ok(ConversionResult::Success(value)) => value,
2656 Ok(ConversionResult::Failure(error)) => {
2657 throw_type_error(cx.raw_cx(), &error);
2658 return false;
2659
2660 }
2661 _ => {
2662 return false;
2663
2664 },
2665 }
2666
2667 };
2668 let result: Result<DomRoot<D::Notification>, Error> = <D::Notification>::Constructor(global, Some(desired_proto), CanGc::note(), arg0, arg1);
2669 let result = match result {
2670 Ok(result) => result,
2671 Err(e) => {
2672 <D as DomHelpers<D>>::throw_dom_exception(SafeJSContext::from_ptr(cx.raw_cx()), global.upcast::<D::GlobalScope>(), e, CanGc::note());
2673 return false;
2674 },
2675 };
2676
2677 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
2678 return true;
2679 }
2680 )
2681
2682 });
2683 result
2684}
2685
2686
2687static INTERFACE_OBJECT_CLASS: ThreadUnsafeOnceLock<NonCallbackInterfaceObjectClass> = ThreadUnsafeOnceLock::new();
2688
2689pub(crate) fn init_interface_object<D: DomTypes>() {
2690 INTERFACE_OBJECT_CLASS.set(NonCallbackInterfaceObjectClass::new(
2691 Box::leak(Box::new(InterfaceConstructorBehavior::call(_constructor::<D>))),
2692 b"function Notification() {\n [native code]\n}",
2693 PrototypeList::ID::Notification,
2694 1,
2695 ));
2696}
2697
2698pub fn DefineDOMInterface<D: DomTypes>
2699(cx: SafeJSContext, global: HandleObject){
2700 define_dom_interface(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::Notification),CreateInterfaceObjects::<D>, ConstructorEnabled::<D>)
2701}
2702
2703pub fn ConstructorEnabled<D: DomTypes>
2704(aCx: SafeJSContext, aObj: HandleObject) -> bool{
2705 is_exposed_in(aObj, Globals::DEDICATED_WORKER_GLOBAL_SCOPE | Globals::SERVICE_WORKER_GLOBAL_SCOPE | Globals::WINDOW) &&
2706 pref!(dom_notification_enabled)
2707}
2708
2709unsafe fn CreateInterfaceObjects<D: DomTypes>
2710(cx: SafeJSContext, global: HandleObject, cache: *mut ProtoOrIfaceArray){
2711
2712 rooted!(&in(cx) let mut prototype_proto = ptr::null_mut::<JSObject>());
2713 EventTarget_Binding::GetProtoObject::<D>(cx, global, prototype_proto.handle_mut());
2714 assert!(!prototype_proto.is_null());
2715
2716 rooted!(&in(cx) let mut prototype = ptr::null_mut::<JSObject>());
2717 create_interface_prototype_object::<D>(cx,
2718 global,
2719 prototype_proto.handle(),
2720 &PrototypeClass,
2721 sMethods.get(),
2722 sAttributes.get(),
2723 &[],
2724 &[],
2725 prototype.handle_mut());
2726 assert!(!prototype.is_null());
2727 assert!((*cache)[PrototypeList::ID::Notification as usize].is_null());
2728 (*cache)[PrototypeList::ID::Notification as usize] = prototype.get();
2729 <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::Notification as isize),
2730 ptr::null_mut(),
2731 prototype.get());
2732
2733 rooted!(&in(cx) let mut interface_proto = ptr::null_mut::<JSObject>());
2734
2735 EventTarget_Binding::GetConstructorObject::<D>(cx, global, interface_proto.handle_mut());
2736
2737 assert!(!interface_proto.is_null());
2738
2739 rooted!(&in(cx) let mut interface = ptr::null_mut::<JSObject>());
2740 create_noncallback_interface_object::<D>(cx,
2741 global,
2742 interface_proto.handle(),
2743 INTERFACE_OBJECT_CLASS.get(),
2744 sStaticMethods.get(),
2745 sStaticAttributes.get(),
2746 &[],
2747 prototype.handle(),
2748 c"Notification",
2749 1,
2750 &[],
2751 interface.handle_mut());
2752 assert!(!interface.is_null());
2753}
2754
2755
2756 pub(crate) fn init_statics<D: DomTypes>() {
2757 init_interface_object::<D>();
2758 init_domjs_class::<D>();
2759 crate::codegen::GenericBindings::NotificationBinding::Notification_Binding::init_requestPermission_methodinfo::<D>();
2760crate::codegen::GenericBindings::NotificationBinding::Notification_Binding::init_close_methodinfo::<D>();
2761 init_onclick_getterinfo::<D>();
2762init_onshow_getterinfo::<D>();
2763init_onerror_getterinfo::<D>();
2764init_onclose_getterinfo::<D>();
2765init_title_getterinfo::<D>();
2766init_dir_getterinfo::<D>();
2767init_lang_getterinfo::<D>();
2768init_body_getterinfo::<D>();
2769init_tag_getterinfo::<D>();
2770init_image_getterinfo::<D>();
2771init_icon_getterinfo::<D>();
2772init_badge_getterinfo::<D>();
2773init_renotify_getterinfo::<D>();
2774init_requireInteraction_getterinfo::<D>();
2775init_silent_getterinfo::<D>();
2776init_vibrate_getterinfo::<D>();
2777init_timestamp_getterinfo::<D>();
2778init_data_getterinfo::<D>();
2779init_actions_getterinfo::<D>();
2780 init_onclick_setterinfo::<D>();
2781init_onshow_setterinfo::<D>();
2782init_onerror_setterinfo::<D>();
2783init_onclose_setterinfo::<D>();
2784
2785 init_sStaticMethods_specs::<D>();
2786init_sStaticMethods_prefs::<D>();
2787init_sStaticAttributes_specs::<D>();
2788init_sStaticAttributes_prefs::<D>();
2789init_sMethods_specs::<D>();
2790init_sMethods_prefs::<D>();
2791init_sAttributes_specs::<D>();
2792init_sAttributes_prefs::<D>();
2793 }
2794 }