script_bindings/home/runner/work/servo/servo/target/debug/build/script_bindings-d55f55d5af1efaee/out/Bindings/
TextTrackBinding.rs

1/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */
2
3#![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::import::base::*;
8
9
10#[repr(usize)]
11#[derive(Copy, Clone, Debug, JSTraceable, MallocSizeOf, PartialEq)]
12pub enum TextTrackMode {
13    Disabled,
14    Hidden,
15    Showing
16}
17pub mod TextTrackModeValues {
18
19    use crate::utils::find_enum_value;
20    use js::conversions::ConversionResult;
21    use js::conversions::FromJSValConvertible;
22    use js::conversions::ToJSValConvertible;
23    use js::context::RawJSContext;
24    use js::rust::HandleValue;
25    use js::rust::MutableHandleValue;
26    use js::jsval::JSVal;
27
28    pub(crate) const pairs: &[(&str, super::TextTrackMode)] = &[
29        ("disabled", super::TextTrackMode::Disabled),
30        ("hidden", super::TextTrackMode::Hidden),
31        ("showing", super::TextTrackMode::Showing),
32    ];
33
34    impl super::TextTrackMode {
35        pub fn as_str(&self) -> &'static str {
36            pairs[*self as usize].0
37        }
38    }
39
40    impl Default for super::TextTrackMode {
41        fn default() -> super::TextTrackMode {
42            pairs[0].1
43        }
44    }
45
46    impl std::str::FromStr for super::TextTrackMode {
47        type Err = ();
48
49        fn from_str(s: &str) -> Result<Self, Self::Err> {
50            pairs
51                .iter()
52                .find(|&&(key, _)| s == key)
53                .map(|&(_, ev)| ev)
54                .ok_or(())
55        }
56    }
57
58    impl ToJSValConvertible for super::TextTrackMode {
59        unsafe fn to_jsval(&self, cx: *mut RawJSContext, rval: MutableHandleValue) {
60            pairs[*self as usize].0.to_jsval(cx, rval);
61        }
62    }
63
64    impl FromJSValConvertible for super::TextTrackMode {
65        type Config = ();
66        unsafe fn from_jsval(cx: *mut RawJSContext, value: HandleValue, _option: ())
67                             -> Result<ConversionResult<super::TextTrackMode>, ()> {
68            match find_enum_value(cx, value, pairs) {
69                Err(_) => Err(()),
70                Ok((None, search)) => {
71                    Ok(ConversionResult::Failure(
72                        format!("'{}' is not a valid enum value for enumeration 'TextTrackMode'.", search).into()
73                    ))
74                }
75                Ok((Some(&value), _)) => Ok(ConversionResult::Success(value)),
76            }
77        }
78    }
79        } // mod TextTrackModeValues
80
81
82#[repr(usize)]
83#[derive(Copy, Clone, Debug, JSTraceable, MallocSizeOf, PartialEq)]
84pub enum TextTrackKind {
85    Subtitles,
86    Captions,
87    Descriptions,
88    Chapters,
89    Metadata
90}
91pub mod TextTrackKindValues {
92
93    use crate::utils::find_enum_value;
94    use js::conversions::ConversionResult;
95    use js::conversions::FromJSValConvertible;
96    use js::conversions::ToJSValConvertible;
97    use js::context::RawJSContext;
98    use js::rust::HandleValue;
99    use js::rust::MutableHandleValue;
100    use js::jsval::JSVal;
101
102    pub(crate) const pairs: &[(&str, super::TextTrackKind)] = &[
103        ("subtitles", super::TextTrackKind::Subtitles),
104        ("captions", super::TextTrackKind::Captions),
105        ("descriptions", super::TextTrackKind::Descriptions),
106        ("chapters", super::TextTrackKind::Chapters),
107        ("metadata", super::TextTrackKind::Metadata),
108    ];
109
110    impl super::TextTrackKind {
111        pub fn as_str(&self) -> &'static str {
112            pairs[*self as usize].0
113        }
114    }
115
116    impl Default for super::TextTrackKind {
117        fn default() -> super::TextTrackKind {
118            pairs[0].1
119        }
120    }
121
122    impl std::str::FromStr for super::TextTrackKind {
123        type Err = ();
124
125        fn from_str(s: &str) -> Result<Self, Self::Err> {
126            pairs
127                .iter()
128                .find(|&&(key, _)| s == key)
129                .map(|&(_, ev)| ev)
130                .ok_or(())
131        }
132    }
133
134    impl ToJSValConvertible for super::TextTrackKind {
135        unsafe fn to_jsval(&self, cx: *mut RawJSContext, rval: MutableHandleValue) {
136            pairs[*self as usize].0.to_jsval(cx, rval);
137        }
138    }
139
140    impl FromJSValConvertible for super::TextTrackKind {
141        type Config = ();
142        unsafe fn from_jsval(cx: *mut RawJSContext, value: HandleValue, _option: ())
143                             -> Result<ConversionResult<super::TextTrackKind>, ()> {
144            match find_enum_value(cx, value, pairs) {
145                Err(_) => Err(()),
146                Ok((None, search)) => {
147                    Ok(ConversionResult::Failure(
148                        format!("'{}' is not a valid enum value for enumeration 'TextTrackKind'.", search).into()
149                    ))
150                }
151                Ok((Some(&value), _)) => Ok(ConversionResult::Success(value)),
152            }
153        }
154    }
155        } // mod TextTrackKindValues
156
157pub use self::TextTrack_Binding::{Wrap, TextTrackMethods, GetProtoObject, DefineDOMInterface};
158pub mod TextTrack_Binding {
159use crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull;
160use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
161use crate::codegen::GenericBindings::TextTrackBinding::TextTrackKind;
162use crate::codegen::GenericBindings::TextTrackBinding::TextTrackKindValues;
163use crate::codegen::GenericBindings::TextTrackBinding::TextTrackMode;
164use crate::codegen::GenericBindings::TextTrackBinding::TextTrackModeValues;
165use crate::import::module::*;
166
167unsafe extern "C" fn get_kind<D: DomTypes>
168(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
169    let mut result = false;
170    wrap_panic(&mut || result = (|| {
171        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
172        let this = &*(this as *const D::TextTrack);
173        let result: TextTrackKind = this.Kind();
174
175        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
176        return true;
177    })());
178    result
179}
180
181
182static kind_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
183
184pub(crate) fn init_kind_getterinfo<D: DomTypes>() {
185    kind_getterinfo.set(JSJitInfo {
186    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
187        getter: Some(get_kind::<D>)
188    },
189    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
190        protoID: PrototypeList::ID::TextTrack as u16,
191    },
192    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
193    _bitfield_align_1: [],
194    _bitfield_1: __BindgenBitfieldUnit::new(
195        new_jsjitinfo_bitfield_1!(
196            JSJitInfo_OpType::Getter as u8,
197            JSJitInfo_AliasSet::AliasEverything as u8,
198            JSValueType::JSVAL_TYPE_STRING as u8,
199            true,
200            false,
201            false,
202            false,
203            false,
204            false,
205            0,
206        ).to_ne_bytes()
207    ),
208});
209}
210unsafe extern "C" fn get_label<D: DomTypes>
211(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
212    let mut result = false;
213    wrap_panic(&mut || result = (|| {
214        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
215        let this = &*(this as *const D::TextTrack);
216        let result: DOMString = this.Label();
217
218        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
219        return true;
220    })());
221    result
222}
223
224
225static label_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
226
227pub(crate) fn init_label_getterinfo<D: DomTypes>() {
228    label_getterinfo.set(JSJitInfo {
229    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
230        getter: Some(get_label::<D>)
231    },
232    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
233        protoID: PrototypeList::ID::TextTrack as u16,
234    },
235    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
236    _bitfield_align_1: [],
237    _bitfield_1: __BindgenBitfieldUnit::new(
238        new_jsjitinfo_bitfield_1!(
239            JSJitInfo_OpType::Getter as u8,
240            JSJitInfo_AliasSet::AliasEverything as u8,
241            JSValueType::JSVAL_TYPE_STRING as u8,
242            true,
243            false,
244            false,
245            false,
246            false,
247            false,
248            0,
249        ).to_ne_bytes()
250    ),
251});
252}
253unsafe extern "C" fn get_language<D: DomTypes>
254(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
255    let mut result = false;
256    wrap_panic(&mut || result = (|| {
257        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
258        let this = &*(this as *const D::TextTrack);
259        let result: DOMString = this.Language();
260
261        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
262        return true;
263    })());
264    result
265}
266
267
268static language_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
269
270pub(crate) fn init_language_getterinfo<D: DomTypes>() {
271    language_getterinfo.set(JSJitInfo {
272    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
273        getter: Some(get_language::<D>)
274    },
275    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
276        protoID: PrototypeList::ID::TextTrack as u16,
277    },
278    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
279    _bitfield_align_1: [],
280    _bitfield_1: __BindgenBitfieldUnit::new(
281        new_jsjitinfo_bitfield_1!(
282            JSJitInfo_OpType::Getter as u8,
283            JSJitInfo_AliasSet::AliasEverything as u8,
284            JSValueType::JSVAL_TYPE_STRING as u8,
285            true,
286            false,
287            false,
288            false,
289            false,
290            false,
291            0,
292        ).to_ne_bytes()
293    ),
294});
295}
296unsafe extern "C" fn get_id<D: DomTypes>
297(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
298    let mut result = false;
299    wrap_panic(&mut || result = (|| {
300        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
301        let this = &*(this as *const D::TextTrack);
302        let result: DOMString = this.Id();
303
304        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
305        return true;
306    })());
307    result
308}
309
310
311static id_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
312
313pub(crate) fn init_id_getterinfo<D: DomTypes>() {
314    id_getterinfo.set(JSJitInfo {
315    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
316        getter: Some(get_id::<D>)
317    },
318    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
319        protoID: PrototypeList::ID::TextTrack as u16,
320    },
321    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
322    _bitfield_align_1: [],
323    _bitfield_1: __BindgenBitfieldUnit::new(
324        new_jsjitinfo_bitfield_1!(
325            JSJitInfo_OpType::Getter as u8,
326            JSJitInfo_AliasSet::AliasEverything as u8,
327            JSValueType::JSVAL_TYPE_STRING as u8,
328            true,
329            false,
330            false,
331            false,
332            false,
333            false,
334            0,
335        ).to_ne_bytes()
336    ),
337});
338}
339unsafe extern "C" fn get_mode<D: DomTypes>
340(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
341    let mut result = false;
342    wrap_panic(&mut || result = (|| {
343        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
344        let this = &*(this as *const D::TextTrack);
345        let result: TextTrackMode = this.Mode();
346
347        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
348        return true;
349    })());
350    result
351}
352
353unsafe extern "C" fn set_mode<D: DomTypes>
354(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
355    let mut result = false;
356    wrap_panic(&mut || result = (|| {
357        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
358        let this = &*(this as *const D::TextTrack);
359        let arg0: TextTrackMode = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
360            Ok(ConversionResult::Success(value)) => value,
361            Ok(ConversionResult::Failure(error)) => {
362                return true;
363            }
364            _ => {
365                return false;
366
367            },
368        }
369        ;
370        let result: () = this.SetMode(arg0);
371
372        true
373    })());
374    result
375}
376
377
378static mode_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
379
380pub(crate) fn init_mode_getterinfo<D: DomTypes>() {
381    mode_getterinfo.set(JSJitInfo {
382    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
383        getter: Some(get_mode::<D>)
384    },
385    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
386        protoID: PrototypeList::ID::TextTrack as u16,
387    },
388    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
389    _bitfield_align_1: [],
390    _bitfield_1: __BindgenBitfieldUnit::new(
391        new_jsjitinfo_bitfield_1!(
392            JSJitInfo_OpType::Getter as u8,
393            JSJitInfo_AliasSet::AliasEverything as u8,
394            JSValueType::JSVAL_TYPE_STRING as u8,
395            true,
396            false,
397            false,
398            false,
399            false,
400            false,
401            0,
402        ).to_ne_bytes()
403    ),
404});
405}
406static mode_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
407
408pub(crate) fn init_mode_setterinfo<D: DomTypes>() {
409    mode_setterinfo.set(JSJitInfo {
410    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
411        setter: Some(set_mode::<D>)
412    },
413    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
414        protoID: PrototypeList::ID::TextTrack as u16,
415    },
416    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
417    _bitfield_align_1: [],
418    _bitfield_1: __BindgenBitfieldUnit::new(
419        new_jsjitinfo_bitfield_1!(
420            JSJitInfo_OpType::Setter as u8,
421            JSJitInfo_AliasSet::AliasEverything as u8,
422            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
423            false,
424            false,
425            false,
426            false,
427            false,
428            false,
429            0,
430        ).to_ne_bytes()
431    ),
432});
433}
434unsafe extern "C" fn get_cues<D: DomTypes>
435(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
436    let mut result = false;
437    wrap_panic(&mut || result = (|| {
438        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
439        let this = &*(this as *const D::TextTrack);
440        let result: Option<DomRoot<D::TextTrackCueList>> = this.GetCues();
441
442        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
443        return true;
444    })());
445    result
446}
447
448
449static cues_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
450
451pub(crate) fn init_cues_getterinfo<D: DomTypes>() {
452    cues_getterinfo.set(JSJitInfo {
453    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
454        getter: Some(get_cues::<D>)
455    },
456    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
457        protoID: PrototypeList::ID::TextTrack as u16,
458    },
459    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
460    _bitfield_align_1: [],
461    _bitfield_1: __BindgenBitfieldUnit::new(
462        new_jsjitinfo_bitfield_1!(
463            JSJitInfo_OpType::Getter as u8,
464            JSJitInfo_AliasSet::AliasEverything as u8,
465            JSValueType::JSVAL_TYPE_UNKNOWN as u8,
466            true,
467            false,
468            false,
469            false,
470            false,
471            false,
472            0,
473        ).to_ne_bytes()
474    ),
475});
476}
477unsafe extern "C" fn get_activeCues<D: DomTypes>
478(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
479    let mut result = false;
480    wrap_panic(&mut || result = (|| {
481        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
482        let this = &*(this as *const D::TextTrack);
483        let result: Option<DomRoot<D::TextTrackCueList>> = this.GetActiveCues();
484
485        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
486        return true;
487    })());
488    result
489}
490
491
492static activeCues_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
493
494pub(crate) fn init_activeCues_getterinfo<D: DomTypes>() {
495    activeCues_getterinfo.set(JSJitInfo {
496    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
497        getter: Some(get_activeCues::<D>)
498    },
499    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
500        protoID: PrototypeList::ID::TextTrack as u16,
501    },
502    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
503    _bitfield_align_1: [],
504    _bitfield_1: __BindgenBitfieldUnit::new(
505        new_jsjitinfo_bitfield_1!(
506            JSJitInfo_OpType::Getter as u8,
507            JSJitInfo_AliasSet::AliasEverything as u8,
508            JSValueType::JSVAL_TYPE_UNKNOWN as u8,
509            true,
510            false,
511            false,
512            false,
513            false,
514            false,
515            0,
516        ).to_ne_bytes()
517    ),
518});
519}
520unsafe extern "C" fn addCue<D: DomTypes>
521(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
522    let mut result = false;
523    wrap_panic(&mut || result = (|| {
524        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
525        let this = &*(this as *const D::TextTrack);
526        let args = &*args;
527        let argc = args.argc_;
528
529        if argc < 1 {
530            throw_type_error(cx.raw_cx(), "Not enough arguments to \"TextTrack.addCue\".");
531            return false;
532        }
533        let arg0: DomRoot<D::TextTrackCue> = if HandleValue::from_raw(args.get(0)).get().is_object() {
534            match root_from_handlevalue(HandleValue::from_raw(args.get(0)), SafeJSContext::from_ptr(cx.raw_cx())) {
535                Ok(val) => val,
536                Err(()) => {
537                    throw_type_error(cx.raw_cx(), "value does not implement interface TextTrackCue.");
538                    return false;
539
540                }
541            }
542
543        } else {
544            throw_type_error(cx.raw_cx(), "Value is not an object.");
545            return false;
546
547        };
548        let result: Result<(), Error> = this.AddCue(&arg0);
549        let result = match result {
550            Ok(result) => result,
551            Err(e) => {
552                <D as DomHelpers<D>>::throw_dom_exception(SafeJSContext::from_ptr(cx.raw_cx()), &this.global_(InRealm::already(&AlreadyInRealm::assert_for_cx(SafeJSContext::from_ptr(cx.raw_cx())))), e, CanGc::note());
553                return false;
554            },
555        };
556
557        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
558        return true;
559    })());
560    result
561}
562
563
564static addCue_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
565
566pub(crate) fn init_addCue_methodinfo<D: DomTypes>() {
567    addCue_methodinfo.set(JSJitInfo {
568    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
569        method: Some(addCue::<D>)
570    },
571    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
572        protoID: PrototypeList::ID::TextTrack as u16,
573    },
574    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
575    _bitfield_align_1: [],
576    _bitfield_1: __BindgenBitfieldUnit::new(
577        new_jsjitinfo_bitfield_1!(
578            JSJitInfo_OpType::Method as u8,
579            JSJitInfo_AliasSet::AliasEverything as u8,
580            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
581            false,
582            false,
583            false,
584            false,
585            false,
586            false,
587            0,
588        ).to_ne_bytes()
589    ),
590});
591}
592unsafe extern "C" fn removeCue<D: DomTypes>
593(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
594    let mut result = false;
595    wrap_panic(&mut || result = (|| {
596        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
597        let this = &*(this as *const D::TextTrack);
598        let args = &*args;
599        let argc = args.argc_;
600
601        if argc < 1 {
602            throw_type_error(cx.raw_cx(), "Not enough arguments to \"TextTrack.removeCue\".");
603            return false;
604        }
605        let arg0: DomRoot<D::TextTrackCue> = if HandleValue::from_raw(args.get(0)).get().is_object() {
606            match root_from_handlevalue(HandleValue::from_raw(args.get(0)), SafeJSContext::from_ptr(cx.raw_cx())) {
607                Ok(val) => val,
608                Err(()) => {
609                    throw_type_error(cx.raw_cx(), "value does not implement interface TextTrackCue.");
610                    return false;
611
612                }
613            }
614
615        } else {
616            throw_type_error(cx.raw_cx(), "Value is not an object.");
617            return false;
618
619        };
620        let result: Result<(), Error> = this.RemoveCue(&arg0);
621        let result = match result {
622            Ok(result) => result,
623            Err(e) => {
624                <D as DomHelpers<D>>::throw_dom_exception(SafeJSContext::from_ptr(cx.raw_cx()), &this.global_(InRealm::already(&AlreadyInRealm::assert_for_cx(SafeJSContext::from_ptr(cx.raw_cx())))), e, CanGc::note());
625                return false;
626            },
627        };
628
629        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
630        return true;
631    })());
632    result
633}
634
635
636static removeCue_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
637
638pub(crate) fn init_removeCue_methodinfo<D: DomTypes>() {
639    removeCue_methodinfo.set(JSJitInfo {
640    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
641        method: Some(removeCue::<D>)
642    },
643    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
644        protoID: PrototypeList::ID::TextTrack as u16,
645    },
646    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
647    _bitfield_align_1: [],
648    _bitfield_1: __BindgenBitfieldUnit::new(
649        new_jsjitinfo_bitfield_1!(
650            JSJitInfo_OpType::Method as u8,
651            JSJitInfo_AliasSet::AliasEverything as u8,
652            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
653            false,
654            false,
655            false,
656            false,
657            false,
658            false,
659            0,
660        ).to_ne_bytes()
661    ),
662});
663}
664unsafe extern "C" fn get_oncuechange<D: DomTypes>
665(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
666    let mut result = false;
667    wrap_panic(&mut || result = (|| {
668        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
669        let this = &*(this as *const D::TextTrack);
670        let result: Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>> = this.GetOncuechange();
671
672        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
673        return true;
674    })());
675    result
676}
677
678unsafe extern "C" fn set_oncuechange<D: DomTypes>
679(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
680    let mut result = false;
681    wrap_panic(&mut || result = {
682        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
683        let this = &*(this as *const D::TextTrack);
684        let arg0: Option<Rc<EventHandlerNonNull<D>>> = if HandleValue::from_raw(args.get(0)).get().is_object() {
685            Some(EventHandlerNonNull::<D>::new(SafeJSContext::from_ptr(cx.raw_cx()), HandleValue::from_raw(args.get(0)).get().to_object()))
686        } else {
687            None
688        };
689        let result: () = this.SetOncuechange(arg0);
690
691        true
692    });
693    result
694}
695
696
697static oncuechange_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
698
699pub(crate) fn init_oncuechange_getterinfo<D: DomTypes>() {
700    oncuechange_getterinfo.set(JSJitInfo {
701    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
702        getter: Some(get_oncuechange::<D>)
703    },
704    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
705        protoID: PrototypeList::ID::TextTrack as u16,
706    },
707    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
708    _bitfield_align_1: [],
709    _bitfield_1: __BindgenBitfieldUnit::new(
710        new_jsjitinfo_bitfield_1!(
711            JSJitInfo_OpType::Getter as u8,
712            JSJitInfo_AliasSet::AliasEverything as u8,
713            JSValueType::JSVAL_TYPE_UNKNOWN as u8,
714            true,
715            false,
716            false,
717            false,
718            false,
719            false,
720            0,
721        ).to_ne_bytes()
722    ),
723});
724}
725static oncuechange_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
726
727pub(crate) fn init_oncuechange_setterinfo<D: DomTypes>() {
728    oncuechange_setterinfo.set(JSJitInfo {
729    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
730        setter: Some(set_oncuechange::<D>)
731    },
732    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
733        protoID: PrototypeList::ID::TextTrack as u16,
734    },
735    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
736    _bitfield_align_1: [],
737    _bitfield_1: __BindgenBitfieldUnit::new(
738        new_jsjitinfo_bitfield_1!(
739            JSJitInfo_OpType::Setter as u8,
740            JSJitInfo_AliasSet::AliasEverything as u8,
741            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
742            false,
743            false,
744            false,
745            false,
746            false,
747            false,
748            0,
749        ).to_ne_bytes()
750    ),
751});
752}
753unsafe extern "C" fn _finalize<D: DomTypes>
754(_cx: *mut GCContext, obj: *mut JSObject){
755    wrap_panic(&mut || {
756
757        let this = native_from_object_static::<D::TextTrack>(obj).unwrap();
758        finalize_common(this);
759    })
760}
761
762unsafe extern "C" fn _trace<D: DomTypes>
763(trc: *mut JSTracer, obj: *mut JSObject){
764    wrap_panic(&mut || {
765
766        let this = native_from_object_static::<D::TextTrack>(obj).unwrap();
767        if this.is_null() { return; } // GC during obj creation
768        (*this).trace(trc);
769    })
770}
771
772
773static CLASS_OPS: ThreadUnsafeOnceLock<JSClassOps> = ThreadUnsafeOnceLock::new();
774
775pub(crate) fn init_class_ops<D: DomTypes>() {
776    CLASS_OPS.set(JSClassOps {
777        addProperty: None,
778        delProperty: None,
779        enumerate: None,
780        newEnumerate: None,
781        resolve: None,
782        mayResolve: None,
783        finalize: Some(_finalize::<D>),
784        call: None,
785        construct: None,
786        trace: Some(_trace::<D>),
787    });
788}
789
790pub static Class: ThreadUnsafeOnceLock<DOMJSClass> = ThreadUnsafeOnceLock::new();
791
792pub(crate) fn init_domjs_class<D: DomTypes>() {
793    init_class_ops::<D>();
794    Class.set(DOMJSClass {
795        base: JSClass {
796            name: c"TextTrack".as_ptr(),
797            flags: JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE |
798                   (((1) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT)
799                   /* JSCLASS_HAS_RESERVED_SLOTS(1) */,
800            cOps: unsafe { CLASS_OPS.get() },
801            spec: ptr::null(),
802            ext: ptr::null(),
803            oOps: ptr::null(),
804        },
805        dom_class:
806DOMClass {
807    interface_chain: [ PrototypeList::ID::EventTarget, PrototypeList::ID::TextTrack, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last ],
808    depth: 1,
809    type_id: crate::codegen::InheritTypes::TopTypeId { eventtarget: (crate::codegen::InheritTypes::EventTargetTypeId::TextTrack) },
810    malloc_size_of: malloc_size_of_including_raw_self::<D::TextTrack> as unsafe fn(&mut _, _) -> _,
811    global: Globals::EMPTY,
812},
813    });
814}
815
816#[cfg_attr(crown, allow(crown::unrooted_must_root))] pub unsafe fn Wrap<D: DomTypes>
817(cx: SafeJSContext, scope: &D::GlobalScope, given_proto: Option<HandleObject>, object: Box<D::TextTrack>, _can_gc: CanGc) -> DomRoot<D::TextTrack>{
818
819    let raw = Root::new(MaybeUnreflectedDom::from_box(object));
820
821    let scope = scope.reflector().get_jsobject();
822    assert!(!scope.get().is_null());
823    assert!(((*get_object_class(scope.get())).flags & JSCLASS_IS_GLOBAL) != 0);
824    let _ac = JSAutoRealm::new(cx.raw_cx(), scope.get());
825
826    rooted!(&in(cx) let mut canonical_proto = ptr::null_mut::<JSObject>());
827    GetProtoObject::<D>(cx, scope, canonical_proto.handle_mut());
828    assert!(!canonical_proto.is_null());
829
830
831    rooted!(&in(cx) let mut proto = ptr::null_mut::<JSObject>());
832    if let Some(given) = given_proto {
833        proto.set(*given);
834        if get_context_realm(cx.raw_cx()) != get_object_realm(*given) {
835            assert!(JS_WrapObject(cx.raw_cx(), proto.handle_mut()));
836        }
837    } else {
838        proto.set(*canonical_proto);
839    }
840    rooted!(&in(cx) let obj = JS_NewObjectWithGivenProto(
841        cx.raw_cx(),
842        &Class.get().base,
843        proto.handle(),
844    ));
845    assert!(!obj.is_null());
846    JS_SetReservedSlot(
847        obj.get(),
848        DOM_OBJECT_SLOT,
849        &PrivateValue(raw.as_ptr() as *const libc::c_void),
850    );
851
852    let root = raw.reflect_with(obj.get());
853
854
855
856    DomRoot::from_ref(&*root)
857}
858
859pub trait TextTrackMethods<D: DomTypes> {
860    fn Kind(&self, ) -> TextTrackKind;
861    fn Label(&self, ) -> DOMString;
862    fn Language(&self, ) -> DOMString;
863    fn Id(&self, ) -> DOMString;
864    fn Mode(&self, ) -> TextTrackMode;
865    fn SetMode(&self, r#value: TextTrackMode);
866    fn GetCues(&self, ) -> Option<DomRoot<D::TextTrackCueList>>;
867    fn GetActiveCues(&self, ) -> Option<DomRoot<D::TextTrackCueList>>;
868    fn AddCue(&self, r#cue: &D::TextTrackCue) -> Fallible<()>;
869    fn RemoveCue(&self, r#cue: &D::TextTrackCue) -> Fallible<()>;
870    fn GetOncuechange(&self, ) -> Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>>;
871    fn SetOncuechange(&self, r#value: Option<Rc<EventHandlerNonNull<D>>>);
872}
873static sMethods_specs: ThreadUnsafeOnceLock<&[&[JSFunctionSpec]]> = ThreadUnsafeOnceLock::new();
874
875pub(crate) fn init_sMethods_specs<D: DomTypes>() {
876    sMethods_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
877    JSFunctionSpec {
878        name: JSPropertySpec_Name { string_: c"addCue".as_ptr() },
879        call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { addCue_methodinfo.get() } as *const _ as *const JSJitInfo },
880        nargs: 1,
881        flags: (JSPROP_ENUMERATE) as u16,
882        selfHostedName: ptr::null()
883    },
884    JSFunctionSpec {
885        name: JSPropertySpec_Name { string_: c"removeCue".as_ptr() },
886        call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { removeCue_methodinfo.get() } as *const _ as *const JSJitInfo },
887        nargs: 1,
888        flags: (JSPROP_ENUMERATE) as u16,
889        selfHostedName: ptr::null()
890    },
891    JSFunctionSpec {
892        name: JSPropertySpec_Name { string_: ptr::null() },
893        call: JSNativeWrapper { op: None, info: ptr::null() },
894        nargs: 0,
895        flags: 0,
896        selfHostedName: ptr::null()
897    }]))[..]
898])));
899}static sMethods: ThreadUnsafeOnceLock<&[Guard<&[JSFunctionSpec]>]> = ThreadUnsafeOnceLock::new();
900
901pub(crate) fn init_sMethods_prefs<D: DomTypes>() {
902    sMethods.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sMethods_specs.get() })[0])])));
903}static sAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
904
905pub(crate) fn init_sAttributes_specs<D: DomTypes>() {
906    sAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
907    JSPropertySpec {
908                    name: JSPropertySpec_Name { string_: c"kind".as_ptr() },
909                    attributes_: (JSPROP_ENUMERATE),
910                    kind_: (JSPropertySpec_Kind::NativeAccessor),
911                    u: JSPropertySpec_AccessorsOrValue {
912                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
913                            getter: JSPropertySpec_Accessor {
914                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { kind_getterinfo.get() } },
915                            },
916                            setter: JSPropertySpec_Accessor {
917                                native: JSNativeWrapper { op: None, info: ptr::null() },
918                            }
919                        }
920                    }
921                }
922,
923    JSPropertySpec {
924                    name: JSPropertySpec_Name { string_: c"label".as_ptr() },
925                    attributes_: (JSPROP_ENUMERATE),
926                    kind_: (JSPropertySpec_Kind::NativeAccessor),
927                    u: JSPropertySpec_AccessorsOrValue {
928                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
929                            getter: JSPropertySpec_Accessor {
930                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { label_getterinfo.get() } },
931                            },
932                            setter: JSPropertySpec_Accessor {
933                                native: JSNativeWrapper { op: None, info: ptr::null() },
934                            }
935                        }
936                    }
937                }
938,
939    JSPropertySpec {
940                    name: JSPropertySpec_Name { string_: c"language".as_ptr() },
941                    attributes_: (JSPROP_ENUMERATE),
942                    kind_: (JSPropertySpec_Kind::NativeAccessor),
943                    u: JSPropertySpec_AccessorsOrValue {
944                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
945                            getter: JSPropertySpec_Accessor {
946                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { language_getterinfo.get() } },
947                            },
948                            setter: JSPropertySpec_Accessor {
949                                native: JSNativeWrapper { op: None, info: ptr::null() },
950                            }
951                        }
952                    }
953                }
954,
955    JSPropertySpec {
956                    name: JSPropertySpec_Name { string_: c"id".as_ptr() },
957                    attributes_: (JSPROP_ENUMERATE),
958                    kind_: (JSPropertySpec_Kind::NativeAccessor),
959                    u: JSPropertySpec_AccessorsOrValue {
960                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
961                            getter: JSPropertySpec_Accessor {
962                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { id_getterinfo.get() } },
963                            },
964                            setter: JSPropertySpec_Accessor {
965                                native: JSNativeWrapper { op: None, info: ptr::null() },
966                            }
967                        }
968                    }
969                }
970,
971    JSPropertySpec {
972                    name: JSPropertySpec_Name { string_: c"mode".as_ptr() },
973                    attributes_: (JSPROP_ENUMERATE),
974                    kind_: (JSPropertySpec_Kind::NativeAccessor),
975                    u: JSPropertySpec_AccessorsOrValue {
976                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
977                            getter: JSPropertySpec_Accessor {
978                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { mode_getterinfo.get() } },
979                            },
980                            setter: JSPropertySpec_Accessor {
981                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { mode_setterinfo.get() } },
982                            }
983                        }
984                    }
985                }
986,
987    JSPropertySpec {
988                    name: JSPropertySpec_Name { string_: c"cues".as_ptr() },
989                    attributes_: (JSPROP_ENUMERATE),
990                    kind_: (JSPropertySpec_Kind::NativeAccessor),
991                    u: JSPropertySpec_AccessorsOrValue {
992                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
993                            getter: JSPropertySpec_Accessor {
994                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { cues_getterinfo.get() } },
995                            },
996                            setter: JSPropertySpec_Accessor {
997                                native: JSNativeWrapper { op: None, info: ptr::null() },
998                            }
999                        }
1000                    }
1001                }
1002,
1003    JSPropertySpec {
1004                    name: JSPropertySpec_Name { string_: c"activeCues".as_ptr() },
1005                    attributes_: (JSPROP_ENUMERATE),
1006                    kind_: (JSPropertySpec_Kind::NativeAccessor),
1007                    u: JSPropertySpec_AccessorsOrValue {
1008                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1009                            getter: JSPropertySpec_Accessor {
1010                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { activeCues_getterinfo.get() } },
1011                            },
1012                            setter: JSPropertySpec_Accessor {
1013                                native: JSNativeWrapper { op: None, info: ptr::null() },
1014                            }
1015                        }
1016                    }
1017                }
1018,
1019    JSPropertySpec {
1020                    name: JSPropertySpec_Name { string_: c"oncuechange".as_ptr() },
1021                    attributes_: (JSPROP_ENUMERATE),
1022                    kind_: (JSPropertySpec_Kind::NativeAccessor),
1023                    u: JSPropertySpec_AccessorsOrValue {
1024                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1025                            getter: JSPropertySpec_Accessor {
1026                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { oncuechange_getterinfo.get() } },
1027                            },
1028                            setter: JSPropertySpec_Accessor {
1029                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { oncuechange_setterinfo.get() } },
1030                            }
1031                        }
1032                    }
1033                }
1034,
1035    JSPropertySpec::ZERO]))[..]
1036,
1037&Box::leak(Box::new([
1038    JSPropertySpec {
1039                    name: JSPropertySpec_Name { symbol_: SymbolCode::toStringTag as usize + 1 },
1040                    attributes_: (JSPROP_READONLY),
1041                    kind_: (JSPropertySpec_Kind::Value),
1042                    u: JSPropertySpec_AccessorsOrValue {
1043                        value: JSPropertySpec_ValueWrapper {
1044                            type_: JSPropertySpec_ValueWrapper_Type::String,
1045                            __bindgen_anon_1: JSPropertySpec_ValueWrapper__bindgen_ty_1 {
1046                                string: c"TextTrack".as_ptr(),
1047                            }
1048                        }
1049                    }
1050                }
1051,
1052    JSPropertySpec::ZERO]))[..]
1053])));
1054}static sAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
1055
1056pub(crate) fn init_sAttributes_prefs<D: DomTypes>() {
1057    sAttributes.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sAttributes_specs.get() })[0]),
1058    Guard::new(&[Condition::Satisfied], (unsafe { sAttributes_specs.get() })[1])])));
1059}
1060pub fn GetProtoObject<D: DomTypes>
1061(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
1062    /* Get the interface prototype object for this class.  This will create the
1063       object as needed. */get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::TextTrack), CreateInterfaceObjects::<D>, rval)
1064}
1065
1066
1067static PrototypeClass: JSClass = JSClass {
1068    name: c"TextTrackPrototype".as_ptr(),
1069    flags:
1070        // JSCLASS_HAS_RESERVED_SLOTS()
1071        (0 ) << JSCLASS_RESERVED_SLOTS_SHIFT,
1072    cOps: ptr::null(),
1073    spec: ptr::null(),
1074    ext: ptr::null(),
1075    oOps: ptr::null(),
1076};
1077
1078
1079static INTERFACE_OBJECT_CLASS: ThreadUnsafeOnceLock<NonCallbackInterfaceObjectClass> = ThreadUnsafeOnceLock::new();
1080
1081pub(crate) fn init_interface_object<D: DomTypes>() {
1082    INTERFACE_OBJECT_CLASS.set(NonCallbackInterfaceObjectClass::new(
1083        Box::leak(Box::new(InterfaceConstructorBehavior::throw())),
1084        b"function TextTrack() {\n    [native code]\n}",
1085        PrototypeList::ID::TextTrack,
1086        1,
1087    ));
1088}
1089
1090pub fn DefineDOMInterface<D: DomTypes>
1091(cx: SafeJSContext, global: HandleObject){
1092    define_dom_interface(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::TextTrack),CreateInterfaceObjects::<D>, ConstructorEnabled::<D>)
1093}
1094
1095pub fn ConstructorEnabled<D: DomTypes>
1096(aCx: SafeJSContext, aObj: HandleObject) -> bool{
1097    is_exposed_in(aObj, Globals::WINDOW)
1098}
1099
1100unsafe fn CreateInterfaceObjects<D: DomTypes>
1101(cx: SafeJSContext, global: HandleObject, cache: *mut ProtoOrIfaceArray){
1102
1103    rooted!(&in(cx) let mut prototype_proto = ptr::null_mut::<JSObject>());
1104    EventTarget_Binding::GetProtoObject::<D>(cx, global, prototype_proto.handle_mut());
1105    assert!(!prototype_proto.is_null());
1106
1107    rooted!(&in(cx) let mut prototype = ptr::null_mut::<JSObject>());
1108    create_interface_prototype_object::<D>(cx,
1109                                      global,
1110                                      prototype_proto.handle(),
1111                                      &PrototypeClass,
1112                                      sMethods.get(),
1113                                      sAttributes.get(),
1114                                      &[],
1115                                      &[],
1116                                      prototype.handle_mut());
1117    assert!(!prototype.is_null());
1118    assert!((*cache)[PrototypeList::ID::TextTrack as usize].is_null());
1119    (*cache)[PrototypeList::ID::TextTrack as usize] = prototype.get();
1120    <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::TextTrack as isize),
1121                                  ptr::null_mut(),
1122                                  prototype.get());
1123
1124    rooted!(&in(cx) let mut interface_proto = ptr::null_mut::<JSObject>());
1125
1126    EventTarget_Binding::GetConstructorObject::<D>(cx, global, interface_proto.handle_mut());
1127
1128    assert!(!interface_proto.is_null());
1129
1130    rooted!(&in(cx) let mut interface = ptr::null_mut::<JSObject>());
1131    create_noncallback_interface_object::<D>(cx,
1132                                        global,
1133                                        interface_proto.handle(),
1134                                        INTERFACE_OBJECT_CLASS.get(),
1135                                        &[],
1136                                        &[],
1137                                        &[],
1138                                        prototype.handle(),
1139                                        c"TextTrack",
1140                                        0,
1141                                        &[],
1142                                        interface.handle_mut());
1143    assert!(!interface.is_null());
1144}
1145
1146
1147        pub(crate) fn init_statics<D: DomTypes>() {
1148            init_interface_object::<D>();
1149            init_domjs_class::<D>();
1150            crate::codegen::GenericBindings::TextTrackBinding::TextTrack_Binding::init_addCue_methodinfo::<D>();
1151crate::codegen::GenericBindings::TextTrackBinding::TextTrack_Binding::init_removeCue_methodinfo::<D>();
1152            init_kind_getterinfo::<D>();
1153init_label_getterinfo::<D>();
1154init_language_getterinfo::<D>();
1155init_id_getterinfo::<D>();
1156init_mode_getterinfo::<D>();
1157init_cues_getterinfo::<D>();
1158init_activeCues_getterinfo::<D>();
1159init_oncuechange_getterinfo::<D>();
1160            init_mode_setterinfo::<D>();
1161init_oncuechange_setterinfo::<D>();
1162
1163            init_sMethods_specs::<D>();
1164init_sMethods_prefs::<D>();
1165init_sAttributes_specs::<D>();
1166init_sAttributes_prefs::<D>();
1167        }
1168        } // mod TextTrack_Binding
1169
1170