script_bindings/home/runner/work/servo/servo/target/debug/build/script_bindings-d55f55d5af1efaee/out/Bindings/
HTMLTrackElementBinding.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::ElementBinding::Element_Binding;
6use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
7use crate::codegen::GenericBindings::HTMLElementBinding::HTMLElement_Binding;
8use crate::codegen::GenericBindings::NodeBinding::Node_Binding;
9use crate::import::base::*;
10
11pub use self::HTMLTrackElement_Binding::{HTMLTrackElementConstants, Wrap, HTMLTrackElementMethods, GetProtoObject, GetConstructorObject, DefineDOMInterface};
12pub mod HTMLTrackElement_Binding {
13use crate::codegen::GenericBindings::ElementBinding::Element_Binding;
14use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
15use crate::codegen::GenericBindings::HTMLElementBinding::HTMLElement_Binding;
16use crate::codegen::GenericBindings::NodeBinding::Node_Binding;
17use crate::import::module::*;
18
19unsafe extern "C" fn get_kind<D: DomTypes>
20(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
21    let mut result = false;
22    wrap_panic(&mut || result = (|| {
23        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
24        let this = &*(this as *const D::HTMLTrackElement);
25        <D as DomHelpers<D>>::push_new_element_queue();
26
27        let result: DOMString = this.Kind();
28        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
29
30
31        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
32        return true;
33    })());
34    result
35}
36
37unsafe extern "C" fn set_kind<D: DomTypes>
38(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
39    let mut result = false;
40    wrap_panic(&mut || result = (|| {
41        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
42        let this = &*(this as *const D::HTMLTrackElement);
43        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
44            Ok(ConversionResult::Success(value)) => value,
45            Ok(ConversionResult::Failure(error)) => {
46                throw_type_error(cx.raw_cx(), &error);
47        return false;
48
49            }
50            _ => {
51                return false;
52
53            },
54        }
55        ;
56        <D as DomHelpers<D>>::push_new_element_queue();
57
58        let result: () = this.SetKind(arg0);
59        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
60
61
62        true
63    })());
64    result
65}
66
67
68static kind_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
69
70pub(crate) fn init_kind_getterinfo<D: DomTypes>() {
71    kind_getterinfo.set(JSJitInfo {
72    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
73        getter: Some(get_kind::<D>)
74    },
75    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
76        protoID: PrototypeList::ID::HTMLTrackElement as u16,
77    },
78    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
79    _bitfield_align_1: [],
80    _bitfield_1: __BindgenBitfieldUnit::new(
81        new_jsjitinfo_bitfield_1!(
82            JSJitInfo_OpType::Getter as u8,
83            JSJitInfo_AliasSet::AliasEverything as u8,
84            JSValueType::JSVAL_TYPE_STRING as u8,
85            true,
86            false,
87            false,
88            false,
89            false,
90            false,
91            0,
92        ).to_ne_bytes()
93    ),
94});
95}
96static kind_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
97
98pub(crate) fn init_kind_setterinfo<D: DomTypes>() {
99    kind_setterinfo.set(JSJitInfo {
100    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
101        setter: Some(set_kind::<D>)
102    },
103    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
104        protoID: PrototypeList::ID::HTMLTrackElement as u16,
105    },
106    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
107    _bitfield_align_1: [],
108    _bitfield_1: __BindgenBitfieldUnit::new(
109        new_jsjitinfo_bitfield_1!(
110            JSJitInfo_OpType::Setter as u8,
111            JSJitInfo_AliasSet::AliasEverything as u8,
112            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
113            false,
114            false,
115            false,
116            false,
117            false,
118            false,
119            0,
120        ).to_ne_bytes()
121    ),
122});
123}
124unsafe extern "C" fn get_src<D: DomTypes>
125(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
126    let mut result = false;
127    wrap_panic(&mut || result = (|| {
128        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
129        let this = &*(this as *const D::HTMLTrackElement);
130        <D as DomHelpers<D>>::push_new_element_queue();
131
132        let result: USVString = this.Src();
133        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
134
135
136        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
137        return true;
138    })());
139    result
140}
141
142unsafe extern "C" fn set_src<D: DomTypes>
143(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
144    let mut result = false;
145    wrap_panic(&mut || result = (|| {
146        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
147        let this = &*(this as *const D::HTMLTrackElement);
148        let arg0: USVString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
149            Ok(ConversionResult::Success(value)) => value,
150            Ok(ConversionResult::Failure(error)) => {
151                throw_type_error(cx.raw_cx(), &error);
152        return false;
153
154            }
155            _ => {
156                return false;
157
158            },
159        }
160        ;
161        <D as DomHelpers<D>>::push_new_element_queue();
162
163        let result: () = this.SetSrc(arg0);
164        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
165
166
167        true
168    })());
169    result
170}
171
172
173static src_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
174
175pub(crate) fn init_src_getterinfo<D: DomTypes>() {
176    src_getterinfo.set(JSJitInfo {
177    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
178        getter: Some(get_src::<D>)
179    },
180    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
181        protoID: PrototypeList::ID::HTMLTrackElement as u16,
182    },
183    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
184    _bitfield_align_1: [],
185    _bitfield_1: __BindgenBitfieldUnit::new(
186        new_jsjitinfo_bitfield_1!(
187            JSJitInfo_OpType::Getter as u8,
188            JSJitInfo_AliasSet::AliasEverything as u8,
189            JSValueType::JSVAL_TYPE_STRING as u8,
190            true,
191            false,
192            false,
193            false,
194            false,
195            false,
196            0,
197        ).to_ne_bytes()
198    ),
199});
200}
201static src_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
202
203pub(crate) fn init_src_setterinfo<D: DomTypes>() {
204    src_setterinfo.set(JSJitInfo {
205    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
206        setter: Some(set_src::<D>)
207    },
208    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
209        protoID: PrototypeList::ID::HTMLTrackElement as u16,
210    },
211    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
212    _bitfield_align_1: [],
213    _bitfield_1: __BindgenBitfieldUnit::new(
214        new_jsjitinfo_bitfield_1!(
215            JSJitInfo_OpType::Setter as u8,
216            JSJitInfo_AliasSet::AliasEverything as u8,
217            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
218            false,
219            false,
220            false,
221            false,
222            false,
223            false,
224            0,
225        ).to_ne_bytes()
226    ),
227});
228}
229unsafe extern "C" fn get_srclang<D: DomTypes>
230(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
231    let mut result = false;
232    wrap_panic(&mut || result = (|| {
233        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
234        let this = &*(this as *const D::HTMLTrackElement);
235        <D as DomHelpers<D>>::push_new_element_queue();
236
237        let result: DOMString = this.Srclang();
238        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
239
240
241        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
242        return true;
243    })());
244    result
245}
246
247unsafe extern "C" fn set_srclang<D: DomTypes>
248(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
249    let mut result = false;
250    wrap_panic(&mut || result = (|| {
251        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
252        let this = &*(this as *const D::HTMLTrackElement);
253        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
254            Ok(ConversionResult::Success(value)) => value,
255            Ok(ConversionResult::Failure(error)) => {
256                throw_type_error(cx.raw_cx(), &error);
257        return false;
258
259            }
260            _ => {
261                return false;
262
263            },
264        }
265        ;
266        <D as DomHelpers<D>>::push_new_element_queue();
267
268        let result: () = this.SetSrclang(arg0);
269        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
270
271
272        true
273    })());
274    result
275}
276
277
278static srclang_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
279
280pub(crate) fn init_srclang_getterinfo<D: DomTypes>() {
281    srclang_getterinfo.set(JSJitInfo {
282    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
283        getter: Some(get_srclang::<D>)
284    },
285    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
286        protoID: PrototypeList::ID::HTMLTrackElement as u16,
287    },
288    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
289    _bitfield_align_1: [],
290    _bitfield_1: __BindgenBitfieldUnit::new(
291        new_jsjitinfo_bitfield_1!(
292            JSJitInfo_OpType::Getter as u8,
293            JSJitInfo_AliasSet::AliasEverything as u8,
294            JSValueType::JSVAL_TYPE_STRING as u8,
295            true,
296            false,
297            false,
298            false,
299            false,
300            false,
301            0,
302        ).to_ne_bytes()
303    ),
304});
305}
306static srclang_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
307
308pub(crate) fn init_srclang_setterinfo<D: DomTypes>() {
309    srclang_setterinfo.set(JSJitInfo {
310    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
311        setter: Some(set_srclang::<D>)
312    },
313    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
314        protoID: PrototypeList::ID::HTMLTrackElement as u16,
315    },
316    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
317    _bitfield_align_1: [],
318    _bitfield_1: __BindgenBitfieldUnit::new(
319        new_jsjitinfo_bitfield_1!(
320            JSJitInfo_OpType::Setter as u8,
321            JSJitInfo_AliasSet::AliasEverything as u8,
322            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
323            false,
324            false,
325            false,
326            false,
327            false,
328            false,
329            0,
330        ).to_ne_bytes()
331    ),
332});
333}
334unsafe extern "C" fn get_label<D: DomTypes>
335(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
336    let mut result = false;
337    wrap_panic(&mut || result = (|| {
338        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
339        let this = &*(this as *const D::HTMLTrackElement);
340        <D as DomHelpers<D>>::push_new_element_queue();
341
342        let result: DOMString = this.Label();
343        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
344
345
346        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
347        return true;
348    })());
349    result
350}
351
352unsafe extern "C" fn set_label<D: DomTypes>
353(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
354    let mut result = false;
355    wrap_panic(&mut || result = (|| {
356        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
357        let this = &*(this as *const D::HTMLTrackElement);
358        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
359            Ok(ConversionResult::Success(value)) => value,
360            Ok(ConversionResult::Failure(error)) => {
361                throw_type_error(cx.raw_cx(), &error);
362        return false;
363
364            }
365            _ => {
366                return false;
367
368            },
369        }
370        ;
371        <D as DomHelpers<D>>::push_new_element_queue();
372
373        let result: () = this.SetLabel(arg0);
374        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
375
376
377        true
378    })());
379    result
380}
381
382
383static label_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
384
385pub(crate) fn init_label_getterinfo<D: DomTypes>() {
386    label_getterinfo.set(JSJitInfo {
387    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
388        getter: Some(get_label::<D>)
389    },
390    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
391        protoID: PrototypeList::ID::HTMLTrackElement as u16,
392    },
393    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
394    _bitfield_align_1: [],
395    _bitfield_1: __BindgenBitfieldUnit::new(
396        new_jsjitinfo_bitfield_1!(
397            JSJitInfo_OpType::Getter as u8,
398            JSJitInfo_AliasSet::AliasEverything as u8,
399            JSValueType::JSVAL_TYPE_STRING as u8,
400            true,
401            false,
402            false,
403            false,
404            false,
405            false,
406            0,
407        ).to_ne_bytes()
408    ),
409});
410}
411static label_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
412
413pub(crate) fn init_label_setterinfo<D: DomTypes>() {
414    label_setterinfo.set(JSJitInfo {
415    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
416        setter: Some(set_label::<D>)
417    },
418    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
419        protoID: PrototypeList::ID::HTMLTrackElement as u16,
420    },
421    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
422    _bitfield_align_1: [],
423    _bitfield_1: __BindgenBitfieldUnit::new(
424        new_jsjitinfo_bitfield_1!(
425            JSJitInfo_OpType::Setter as u8,
426            JSJitInfo_AliasSet::AliasEverything as u8,
427            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
428            false,
429            false,
430            false,
431            false,
432            false,
433            false,
434            0,
435        ).to_ne_bytes()
436    ),
437});
438}
439unsafe extern "C" fn get_default<D: DomTypes>
440(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
441    let mut result = false;
442    wrap_panic(&mut || result = (|| {
443        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
444        let this = &*(this as *const D::HTMLTrackElement);
445        <D as DomHelpers<D>>::push_new_element_queue();
446
447        let result: bool = this.Default();
448        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
449
450
451        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
452        return true;
453    })());
454    result
455}
456
457unsafe extern "C" fn set_default<D: DomTypes>
458(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
459    let mut result = false;
460    wrap_panic(&mut || result = (|| {
461        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
462        let this = &*(this as *const D::HTMLTrackElement);
463        let arg0: bool = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
464            Ok(ConversionResult::Success(value)) => value,
465            Ok(ConversionResult::Failure(error)) => {
466                throw_type_error(cx.raw_cx(), &error);
467        return false;
468
469            }
470            _ => {
471                return false;
472
473            },
474        }
475        ;
476        <D as DomHelpers<D>>::push_new_element_queue();
477
478        let result: () = this.SetDefault(arg0);
479        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
480
481
482        true
483    })());
484    result
485}
486
487
488static default_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
489
490pub(crate) fn init_default_getterinfo<D: DomTypes>() {
491    default_getterinfo.set(JSJitInfo {
492    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
493        getter: Some(get_default::<D>)
494    },
495    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
496        protoID: PrototypeList::ID::HTMLTrackElement as u16,
497    },
498    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
499    _bitfield_align_1: [],
500    _bitfield_1: __BindgenBitfieldUnit::new(
501        new_jsjitinfo_bitfield_1!(
502            JSJitInfo_OpType::Getter as u8,
503            JSJitInfo_AliasSet::AliasEverything as u8,
504            JSValueType::JSVAL_TYPE_BOOLEAN as u8,
505            true,
506            false,
507            false,
508            false,
509            false,
510            false,
511            0,
512        ).to_ne_bytes()
513    ),
514});
515}
516static default_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
517
518pub(crate) fn init_default_setterinfo<D: DomTypes>() {
519    default_setterinfo.set(JSJitInfo {
520    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
521        setter: Some(set_default::<D>)
522    },
523    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
524        protoID: PrototypeList::ID::HTMLTrackElement as u16,
525    },
526    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
527    _bitfield_align_1: [],
528    _bitfield_1: __BindgenBitfieldUnit::new(
529        new_jsjitinfo_bitfield_1!(
530            JSJitInfo_OpType::Setter as u8,
531            JSJitInfo_AliasSet::AliasEverything as u8,
532            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
533            false,
534            false,
535            false,
536            false,
537            false,
538            false,
539            0,
540        ).to_ne_bytes()
541    ),
542});
543}
544unsafe extern "C" fn get_readyState<D: DomTypes>
545(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
546    let mut result = false;
547    wrap_panic(&mut || result = (|| {
548        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
549        let this = &*(this as *const D::HTMLTrackElement);
550        let result: u16 = this.ReadyState();
551
552        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
553        return true;
554    })());
555    result
556}
557
558
559static readyState_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
560
561pub(crate) fn init_readyState_getterinfo<D: DomTypes>() {
562    readyState_getterinfo.set(JSJitInfo {
563    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
564        getter: Some(get_readyState::<D>)
565    },
566    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
567        protoID: PrototypeList::ID::HTMLTrackElement as u16,
568    },
569    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
570    _bitfield_align_1: [],
571    _bitfield_1: __BindgenBitfieldUnit::new(
572        new_jsjitinfo_bitfield_1!(
573            JSJitInfo_OpType::Getter as u8,
574            JSJitInfo_AliasSet::AliasEverything as u8,
575            JSValueType::JSVAL_TYPE_INT32 as u8,
576            true,
577            false,
578            false,
579            false,
580            false,
581            false,
582            0,
583        ).to_ne_bytes()
584    ),
585});
586}
587unsafe extern "C" fn get_track<D: DomTypes>
588(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
589    let mut result = false;
590    wrap_panic(&mut || result = (|| {
591        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
592        let this = &*(this as *const D::HTMLTrackElement);
593        let result: DomRoot<D::TextTrack> = this.Track();
594
595        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
596        return true;
597    })());
598    result
599}
600
601
602static track_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
603
604pub(crate) fn init_track_getterinfo<D: DomTypes>() {
605    track_getterinfo.set(JSJitInfo {
606    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
607        getter: Some(get_track::<D>)
608    },
609    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
610        protoID: PrototypeList::ID::HTMLTrackElement as u16,
611    },
612    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
613    _bitfield_align_1: [],
614    _bitfield_1: __BindgenBitfieldUnit::new(
615        new_jsjitinfo_bitfield_1!(
616            JSJitInfo_OpType::Getter as u8,
617            JSJitInfo_AliasSet::AliasEverything as u8,
618            JSValueType::JSVAL_TYPE_OBJECT as u8,
619            true,
620            false,
621            false,
622            false,
623            false,
624            false,
625            0,
626        ).to_ne_bytes()
627    ),
628});
629}
630unsafe extern "C" fn _finalize<D: DomTypes>
631(_cx: *mut GCContext, obj: *mut JSObject){
632    wrap_panic(&mut || {
633
634        let this = native_from_object_static::<D::HTMLTrackElement>(obj).unwrap();
635        finalize_common(this);
636    })
637}
638
639unsafe extern "C" fn _trace<D: DomTypes>
640(trc: *mut JSTracer, obj: *mut JSObject){
641    wrap_panic(&mut || {
642
643        let this = native_from_object_static::<D::HTMLTrackElement>(obj).unwrap();
644        if this.is_null() { return; } // GC during obj creation
645        (*this).trace(trc);
646    })
647}
648
649pub mod HTMLTrackElementConstants {
650    pub const NONE: u16 = 0;
651    pub const LOADING: u16 = 1;
652    pub const LOADED: u16 = 2;
653    pub const ERROR: u16 = 3;
654} // mod HTMLTrackElementConstants
655
656static CLASS_OPS: ThreadUnsafeOnceLock<JSClassOps> = ThreadUnsafeOnceLock::new();
657
658pub(crate) fn init_class_ops<D: DomTypes>() {
659    CLASS_OPS.set(JSClassOps {
660        addProperty: None,
661        delProperty: None,
662        enumerate: None,
663        newEnumerate: None,
664        resolve: None,
665        mayResolve: None,
666        finalize: Some(_finalize::<D>),
667        call: None,
668        construct: None,
669        trace: Some(_trace::<D>),
670    });
671}
672
673pub static Class: ThreadUnsafeOnceLock<DOMJSClass> = ThreadUnsafeOnceLock::new();
674
675pub(crate) fn init_domjs_class<D: DomTypes>() {
676    init_class_ops::<D>();
677    Class.set(DOMJSClass {
678        base: JSClass {
679            name: c"HTMLTrackElement".as_ptr(),
680            flags: JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE |
681                   (((1) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT)
682                   /* JSCLASS_HAS_RESERVED_SLOTS(1) */,
683            cOps: unsafe { CLASS_OPS.get() },
684            spec: ptr::null(),
685            ext: ptr::null(),
686            oOps: ptr::null(),
687        },
688        dom_class:
689DOMClass {
690    interface_chain: [ PrototypeList::ID::EventTarget, PrototypeList::ID::Node, PrototypeList::ID::Element, PrototypeList::ID::HTMLElement, PrototypeList::ID::HTMLTrackElement, PrototypeList::ID::Last ],
691    depth: 4,
692    type_id: crate::codegen::InheritTypes::TopTypeId { eventtarget: (crate::codegen::InheritTypes::EventTargetTypeId::Node(crate::codegen::InheritTypes::NodeTypeId::Element(crate::codegen::InheritTypes::ElementTypeId::HTMLElement(crate::codegen::InheritTypes::HTMLElementTypeId::HTMLTrackElement)))) },
693    malloc_size_of: malloc_size_of_including_raw_self::<D::HTMLTrackElement> as unsafe fn(&mut _, _) -> _,
694    global: Globals::EMPTY,
695},
696    });
697}
698
699#[cfg_attr(crown, allow(crown::unrooted_must_root))] pub unsafe fn Wrap<D: DomTypes>
700(cx: SafeJSContext, scope: &D::GlobalScope, given_proto: Option<HandleObject>, object: Box<D::HTMLTrackElement>, _can_gc: CanGc) -> DomRoot<D::HTMLTrackElement>{
701
702    let raw = Root::new(MaybeUnreflectedDom::from_box(object));
703
704    let scope = scope.reflector().get_jsobject();
705    assert!(!scope.get().is_null());
706    assert!(((*get_object_class(scope.get())).flags & JSCLASS_IS_GLOBAL) != 0);
707    let _ac = JSAutoRealm::new(cx.raw_cx(), scope.get());
708
709    rooted!(&in(cx) let mut canonical_proto = ptr::null_mut::<JSObject>());
710    GetProtoObject::<D>(cx, scope, canonical_proto.handle_mut());
711    assert!(!canonical_proto.is_null());
712
713
714    rooted!(&in(cx) let mut proto = ptr::null_mut::<JSObject>());
715    if let Some(given) = given_proto {
716        proto.set(*given);
717        if get_context_realm(cx.raw_cx()) != get_object_realm(*given) {
718            assert!(JS_WrapObject(cx.raw_cx(), proto.handle_mut()));
719        }
720    } else {
721        proto.set(*canonical_proto);
722    }
723    rooted!(&in(cx) let obj = JS_NewObjectWithGivenProto(
724        cx.raw_cx(),
725        &Class.get().base,
726        proto.handle(),
727    ));
728    assert!(!obj.is_null());
729    JS_SetReservedSlot(
730        obj.get(),
731        DOM_OBJECT_SLOT,
732        &PrivateValue(raw.as_ptr() as *const libc::c_void),
733    );
734
735    let root = raw.reflect_with(obj.get());
736
737
738
739    DomRoot::from_ref(&*root)
740}
741
742pub trait HTMLTrackElementMethods<D: DomTypes> {
743    fn Kind(&self, ) -> DOMString;
744    fn SetKind(&self, r#value: DOMString);
745    fn Src(&self, ) -> USVString;
746    fn SetSrc(&self, r#value: USVString);
747    fn Srclang(&self, ) -> DOMString;
748    fn SetSrclang(&self, r#value: DOMString);
749    fn Label(&self, ) -> DOMString;
750    fn SetLabel(&self, r#value: DOMString);
751    fn Default(&self, ) -> bool;
752    fn SetDefault(&self, r#value: bool);
753    fn ReadyState(&self, ) -> u16;
754    fn Track(&self, ) -> DomRoot<D::TextTrack>;
755}
756static sAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
757
758pub(crate) fn init_sAttributes_specs<D: DomTypes>() {
759    sAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
760    JSPropertySpec {
761                    name: JSPropertySpec_Name { string_: c"kind".as_ptr() },
762                    attributes_: (JSPROP_ENUMERATE),
763                    kind_: (JSPropertySpec_Kind::NativeAccessor),
764                    u: JSPropertySpec_AccessorsOrValue {
765                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
766                            getter: JSPropertySpec_Accessor {
767                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { kind_getterinfo.get() } },
768                            },
769                            setter: JSPropertySpec_Accessor {
770                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { kind_setterinfo.get() } },
771                            }
772                        }
773                    }
774                }
775,
776    JSPropertySpec {
777                    name: JSPropertySpec_Name { string_: c"src".as_ptr() },
778                    attributes_: (JSPROP_ENUMERATE),
779                    kind_: (JSPropertySpec_Kind::NativeAccessor),
780                    u: JSPropertySpec_AccessorsOrValue {
781                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
782                            getter: JSPropertySpec_Accessor {
783                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { src_getterinfo.get() } },
784                            },
785                            setter: JSPropertySpec_Accessor {
786                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { src_setterinfo.get() } },
787                            }
788                        }
789                    }
790                }
791,
792    JSPropertySpec {
793                    name: JSPropertySpec_Name { string_: c"srclang".as_ptr() },
794                    attributes_: (JSPROP_ENUMERATE),
795                    kind_: (JSPropertySpec_Kind::NativeAccessor),
796                    u: JSPropertySpec_AccessorsOrValue {
797                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
798                            getter: JSPropertySpec_Accessor {
799                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { srclang_getterinfo.get() } },
800                            },
801                            setter: JSPropertySpec_Accessor {
802                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { srclang_setterinfo.get() } },
803                            }
804                        }
805                    }
806                }
807,
808    JSPropertySpec {
809                    name: JSPropertySpec_Name { string_: c"label".as_ptr() },
810                    attributes_: (JSPROP_ENUMERATE),
811                    kind_: (JSPropertySpec_Kind::NativeAccessor),
812                    u: JSPropertySpec_AccessorsOrValue {
813                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
814                            getter: JSPropertySpec_Accessor {
815                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { label_getterinfo.get() } },
816                            },
817                            setter: JSPropertySpec_Accessor {
818                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { label_setterinfo.get() } },
819                            }
820                        }
821                    }
822                }
823,
824    JSPropertySpec {
825                    name: JSPropertySpec_Name { string_: c"default".as_ptr() },
826                    attributes_: (JSPROP_ENUMERATE),
827                    kind_: (JSPropertySpec_Kind::NativeAccessor),
828                    u: JSPropertySpec_AccessorsOrValue {
829                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
830                            getter: JSPropertySpec_Accessor {
831                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { default_getterinfo.get() } },
832                            },
833                            setter: JSPropertySpec_Accessor {
834                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { default_setterinfo.get() } },
835                            }
836                        }
837                    }
838                }
839,
840    JSPropertySpec {
841                    name: JSPropertySpec_Name { string_: c"readyState".as_ptr() },
842                    attributes_: (JSPROP_ENUMERATE),
843                    kind_: (JSPropertySpec_Kind::NativeAccessor),
844                    u: JSPropertySpec_AccessorsOrValue {
845                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
846                            getter: JSPropertySpec_Accessor {
847                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { readyState_getterinfo.get() } },
848                            },
849                            setter: JSPropertySpec_Accessor {
850                                native: JSNativeWrapper { op: None, info: ptr::null() },
851                            }
852                        }
853                    }
854                }
855,
856    JSPropertySpec {
857                    name: JSPropertySpec_Name { string_: c"track".as_ptr() },
858                    attributes_: (JSPROP_ENUMERATE),
859                    kind_: (JSPropertySpec_Kind::NativeAccessor),
860                    u: JSPropertySpec_AccessorsOrValue {
861                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
862                            getter: JSPropertySpec_Accessor {
863                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { track_getterinfo.get() } },
864                            },
865                            setter: JSPropertySpec_Accessor {
866                                native: JSNativeWrapper { op: None, info: ptr::null() },
867                            }
868                        }
869                    }
870                }
871,
872    JSPropertySpec::ZERO]))[..]
873,
874&Box::leak(Box::new([
875    JSPropertySpec {
876                    name: JSPropertySpec_Name { symbol_: SymbolCode::toStringTag as usize + 1 },
877                    attributes_: (JSPROP_READONLY),
878                    kind_: (JSPropertySpec_Kind::Value),
879                    u: JSPropertySpec_AccessorsOrValue {
880                        value: JSPropertySpec_ValueWrapper {
881                            type_: JSPropertySpec_ValueWrapper_Type::String,
882                            __bindgen_anon_1: JSPropertySpec_ValueWrapper__bindgen_ty_1 {
883                                string: c"HTMLTrackElement".as_ptr(),
884                            }
885                        }
886                    }
887                }
888,
889    JSPropertySpec::ZERO]))[..]
890])));
891}static sAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
892
893pub(crate) fn init_sAttributes_prefs<D: DomTypes>() {
894    sAttributes.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sAttributes_specs.get() })[0]),
895    Guard::new(&[Condition::Satisfied], (unsafe { sAttributes_specs.get() })[1])])));
896}static sConstants_specs: ThreadUnsafeOnceLock<&[&[ConstantSpec]]> = ThreadUnsafeOnceLock::new();
897
898pub(crate) fn init_sConstants_specs<D: DomTypes>() {
899    sConstants_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
900    ConstantSpec { name: c"NONE", value: ConstantVal::Int(0) },
901    ConstantSpec { name: c"LOADING", value: ConstantVal::Int(1) },
902    ConstantSpec { name: c"LOADED", value: ConstantVal::Int(2) },
903    ConstantSpec { name: c"ERROR", value: ConstantVal::Int(3) }]))[..]
904])));
905}static sConstants: ThreadUnsafeOnceLock<&[Guard<&[ConstantSpec]>]> = ThreadUnsafeOnceLock::new();
906
907pub(crate) fn init_sConstants_prefs<D: DomTypes>() {
908    sConstants.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sConstants_specs.get() })[0])])));
909}
910pub fn GetProtoObject<D: DomTypes>
911(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
912    /* Get the interface prototype object for this class.  This will create the
913       object as needed. */get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::HTMLTrackElement), CreateInterfaceObjects::<D>, rval)
914}
915
916
917static PrototypeClass: JSClass = JSClass {
918    name: c"HTMLTrackElementPrototype".as_ptr(),
919    flags:
920        // JSCLASS_HAS_RESERVED_SLOTS()
921        (0 ) << JSCLASS_RESERVED_SLOTS_SHIFT,
922    cOps: ptr::null(),
923    spec: ptr::null(),
924    ext: ptr::null(),
925    oOps: ptr::null(),
926};
927
928unsafe extern "C" fn _constructor<D: DomTypes>
929(cx: *mut RawJSContext, argc: u32, vp: *mut JSVal) -> bool{
930    let mut result = false;
931    wrap_panic(&mut || result = {
932        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
933        let args = CallArgs::from_vp(vp, argc);
934        let global = D::GlobalScope::from_object(JS_CALLEE(cx.raw_cx(), vp).to_object());
935
936                        <D as DomHelpers<D>>::call_html_constructor::<D::HTMLTrackElement>(
937                            SafeJSContext::from_ptr(cx.raw_cx()),
938                            &args,
939                            &global,
940                            PrototypeList::ID::HTMLTrackElement,
941                            CreateInterfaceObjects::<D>,
942                            CanGc::note()
943                        )
944
945    });
946    result
947}
948
949
950static INTERFACE_OBJECT_CLASS: ThreadUnsafeOnceLock<NonCallbackInterfaceObjectClass> = ThreadUnsafeOnceLock::new();
951
952pub(crate) fn init_interface_object<D: DomTypes>() {
953    INTERFACE_OBJECT_CLASS.set(NonCallbackInterfaceObjectClass::new(
954        Box::leak(Box::new(InterfaceConstructorBehavior::call(_constructor::<D>))),
955        b"function HTMLTrackElement() {\n    [native code]\n}",
956        PrototypeList::ID::HTMLTrackElement,
957        4,
958    ));
959}
960
961pub fn GetConstructorObject<D: DomTypes>
962(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
963    /* Get the interface object for this class.  This will create the object as
964       needed. */get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::Constructor(PrototypeList::Constructor::HTMLTrackElement), CreateInterfaceObjects::<D>, rval)
965}
966
967pub fn DefineDOMInterface<D: DomTypes>
968(cx: SafeJSContext, global: HandleObject){
969    define_dom_interface(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::HTMLTrackElement),CreateInterfaceObjects::<D>, ConstructorEnabled::<D>)
970}
971
972pub fn ConstructorEnabled<D: DomTypes>
973(aCx: SafeJSContext, aObj: HandleObject) -> bool{
974    is_exposed_in(aObj, Globals::WINDOW)
975}
976
977unsafe fn CreateInterfaceObjects<D: DomTypes>
978(cx: SafeJSContext, global: HandleObject, cache: *mut ProtoOrIfaceArray){
979
980    rooted!(&in(cx) let mut prototype_proto = ptr::null_mut::<JSObject>());
981    HTMLElement_Binding::GetProtoObject::<D>(cx, global, prototype_proto.handle_mut());
982    assert!(!prototype_proto.is_null());
983
984    rooted!(&in(cx) let mut prototype = ptr::null_mut::<JSObject>());
985    create_interface_prototype_object::<D>(cx,
986                                      global,
987                                      prototype_proto.handle(),
988                                      &PrototypeClass,
989                                      &[],
990                                      sAttributes.get(),
991                                      sConstants.get(),
992                                      &[],
993                                      prototype.handle_mut());
994    assert!(!prototype.is_null());
995    assert!((*cache)[PrototypeList::ID::HTMLTrackElement as usize].is_null());
996    (*cache)[PrototypeList::ID::HTMLTrackElement as usize] = prototype.get();
997    <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::HTMLTrackElement as isize),
998                                  ptr::null_mut(),
999                                  prototype.get());
1000
1001    rooted!(&in(cx) let mut interface_proto = ptr::null_mut::<JSObject>());
1002
1003    HTMLElement_Binding::GetConstructorObject::<D>(cx, global, interface_proto.handle_mut());
1004
1005    assert!(!interface_proto.is_null());
1006
1007    rooted!(&in(cx) let mut interface = ptr::null_mut::<JSObject>());
1008    create_noncallback_interface_object::<D>(cx,
1009                                        global,
1010                                        interface_proto.handle(),
1011                                        INTERFACE_OBJECT_CLASS.get(),
1012                                        &[],
1013                                        &[],
1014                                        sConstants.get(),
1015                                        prototype.handle(),
1016                                        c"HTMLTrackElement",
1017                                        0,
1018                                        &[],
1019                                        interface.handle_mut());
1020    assert!(!interface.is_null());
1021
1022    assert!((*cache)[PrototypeList::Constructor::HTMLTrackElement as usize].is_null());
1023    (*cache)[PrototypeList::Constructor::HTMLTrackElement as usize] = interface.get();
1024    <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::Constructor::HTMLTrackElement as isize),
1025                                  ptr::null_mut(),
1026                                  interface.get());
1027
1028}
1029
1030
1031        pub(crate) fn init_statics<D: DomTypes>() {
1032            init_interface_object::<D>();
1033            init_domjs_class::<D>();
1034
1035            init_kind_getterinfo::<D>();
1036init_src_getterinfo::<D>();
1037init_srclang_getterinfo::<D>();
1038init_label_getterinfo::<D>();
1039init_default_getterinfo::<D>();
1040init_readyState_getterinfo::<D>();
1041init_track_getterinfo::<D>();
1042            init_kind_setterinfo::<D>();
1043init_src_setterinfo::<D>();
1044init_srclang_setterinfo::<D>();
1045init_label_setterinfo::<D>();
1046init_default_setterinfo::<D>();
1047
1048            init_sAttributes_specs::<D>();
1049init_sAttributes_prefs::<D>();
1050init_sConstants_specs::<D>();
1051init_sConstants_prefs::<D>();
1052        }
1053        } // mod HTMLTrackElement_Binding
1054
1055