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::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::codegen::GenericBindings::TextTrackBinding::TextTrackKind;
10use crate::codegen::GenericBindings::TextTrackBinding::TextTrackKindValues;
11use crate::import::base::*;
12
13
14#[repr(usize)]
15#[derive(Copy, Clone, Debug, JSTraceable, MallocSizeOf, PartialEq)]
16pub enum CanPlayTypeResult {
17 _empty,
18 Maybe,
19 Probably
20}
21pub mod CanPlayTypeResultValues {
22
23 use crate::utils::find_enum_value;
24 use js::conversions::ConversionResult;
25 use js::conversions::FromJSValConvertible;
26 use js::conversions::ToJSValConvertible;
27 use js::context::RawJSContext;
28 use js::rust::HandleValue;
29 use js::rust::MutableHandleValue;
30 use js::jsval::JSVal;
31
32 pub(crate) const pairs: &[(&str, super::CanPlayTypeResult)] = &[
33 ("", super::CanPlayTypeResult::_empty),
34 ("maybe", super::CanPlayTypeResult::Maybe),
35 ("probably", super::CanPlayTypeResult::Probably),
36 ];
37
38 impl super::CanPlayTypeResult {
39 pub fn as_str(&self) -> &'static str {
40 pairs[*self as usize].0
41 }
42 }
43
44 impl Default for super::CanPlayTypeResult {
45 fn default() -> super::CanPlayTypeResult {
46 pairs[0].1
47 }
48 }
49
50 impl std::str::FromStr for super::CanPlayTypeResult {
51 type Err = ();
52
53 fn from_str(s: &str) -> Result<Self, Self::Err> {
54 pairs
55 .iter()
56 .find(|&&(key, _)| s == key)
57 .map(|&(_, ev)| ev)
58 .ok_or(())
59 }
60 }
61
62 impl ToJSValConvertible for super::CanPlayTypeResult {
63 unsafe fn to_jsval(&self, cx: *mut RawJSContext, rval: MutableHandleValue) {
64 pairs[*self as usize].0.to_jsval(cx, rval);
65 }
66 }
67
68 impl FromJSValConvertible for super::CanPlayTypeResult {
69 type Config = ();
70 unsafe fn from_jsval(cx: *mut RawJSContext, value: HandleValue, _option: ())
71 -> Result<ConversionResult<super::CanPlayTypeResult>, ()> {
72 match find_enum_value(cx, value, pairs) {
73 Err(_) => Err(()),
74 Ok((None, search)) => {
75 Ok(ConversionResult::Failure(
76 format!("'{}' is not a valid enum value for enumeration 'CanPlayTypeResult'.", search).into()
77 ))
78 }
79 Ok((Some(&value), _)) => Ok(ConversionResult::Success(value)),
80 }
81 }
82 }
83 } pub use self::GenericUnionTypes::MediaStreamOrBlob as MediaProvider;
86
87pub use self::HTMLMediaElement_Binding::{HTMLMediaElementConstants, HTMLMediaElementMethods, GetProtoObject, GetConstructorObject, DefineDOMInterface};
88pub mod HTMLMediaElement_Binding {
89use crate::codegen::GenericBindings::ElementBinding::Element_Binding;
90use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
91use crate::codegen::GenericBindings::HTMLElementBinding::HTMLElement_Binding;
92use crate::codegen::GenericBindings::HTMLMediaElementBinding::CanPlayTypeResult;
93use crate::codegen::GenericBindings::HTMLMediaElementBinding::CanPlayTypeResultValues;
94use crate::codegen::GenericBindings::NodeBinding::Node_Binding;
95use crate::codegen::GenericBindings::TextTrackBinding::TextTrackKind;
96use crate::codegen::GenericBindings::TextTrackBinding::TextTrackKindValues;
97use crate::import::module::*;
98
99unsafe extern "C" fn get_error<D: DomTypes>
100(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
101 let mut result = false;
102 wrap_panic(&mut || result = (|| {
103 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
104 let this = &*(this as *const D::HTMLMediaElement);
105 let result: Option<DomRoot<D::MediaError>> = this.GetError();
106
107 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
108 return true;
109 })());
110 result
111}
112
113
114static error_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
115
116pub(crate) fn init_error_getterinfo<D: DomTypes>() {
117 error_getterinfo.set(JSJitInfo {
118 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
119 getter: Some(get_error::<D>)
120 },
121 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
122 protoID: PrototypeList::ID::HTMLMediaElement as u16,
123 },
124 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
125 _bitfield_align_1: [],
126 _bitfield_1: __BindgenBitfieldUnit::new(
127 new_jsjitinfo_bitfield_1!(
128 JSJitInfo_OpType::Getter as u8,
129 JSJitInfo_AliasSet::AliasEverything as u8,
130 JSValueType::JSVAL_TYPE_UNKNOWN as u8,
131 true,
132 false,
133 false,
134 false,
135 false,
136 false,
137 0,
138 ).to_ne_bytes()
139 ),
140});
141}
142unsafe extern "C" fn get_src<D: DomTypes>
143(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> 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::HTMLMediaElement);
148 <D as DomHelpers<D>>::push_new_element_queue();
149
150 let result: USVString = this.Src();
151 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
152
153
154 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
155 return true;
156 })());
157 result
158}
159
160unsafe extern "C" fn set_src<D: DomTypes>
161(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
162 let mut result = false;
163 wrap_panic(&mut || result = (|| {
164 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
165 let this = &*(this as *const D::HTMLMediaElement);
166 let arg0: USVString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
167 Ok(ConversionResult::Success(value)) => value,
168 Ok(ConversionResult::Failure(error)) => {
169 throw_type_error(cx.raw_cx(), &error);
170 return false;
171
172 }
173 _ => {
174 return false;
175
176 },
177 }
178 ;
179 <D as DomHelpers<D>>::push_new_element_queue();
180
181 let result: () = this.SetSrc(arg0);
182 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
183
184
185 true
186 })());
187 result
188}
189
190
191static src_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
192
193pub(crate) fn init_src_getterinfo<D: DomTypes>() {
194 src_getterinfo.set(JSJitInfo {
195 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
196 getter: Some(get_src::<D>)
197 },
198 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
199 protoID: PrototypeList::ID::HTMLMediaElement as u16,
200 },
201 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
202 _bitfield_align_1: [],
203 _bitfield_1: __BindgenBitfieldUnit::new(
204 new_jsjitinfo_bitfield_1!(
205 JSJitInfo_OpType::Getter as u8,
206 JSJitInfo_AliasSet::AliasEverything as u8,
207 JSValueType::JSVAL_TYPE_STRING as u8,
208 true,
209 false,
210 false,
211 false,
212 false,
213 false,
214 0,
215 ).to_ne_bytes()
216 ),
217});
218}
219static src_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
220
221pub(crate) fn init_src_setterinfo<D: DomTypes>() {
222 src_setterinfo.set(JSJitInfo {
223 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
224 setter: Some(set_src::<D>)
225 },
226 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
227 protoID: PrototypeList::ID::HTMLMediaElement as u16,
228 },
229 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
230 _bitfield_align_1: [],
231 _bitfield_1: __BindgenBitfieldUnit::new(
232 new_jsjitinfo_bitfield_1!(
233 JSJitInfo_OpType::Setter as u8,
234 JSJitInfo_AliasSet::AliasEverything as u8,
235 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
236 false,
237 false,
238 false,
239 false,
240 false,
241 false,
242 0,
243 ).to_ne_bytes()
244 ),
245});
246}
247unsafe extern "C" fn get_srcObject<D: DomTypes>
248(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> 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::HTMLMediaElement);
253 let result: Option<GenericUnionTypes::MediaStreamOrBlob::<D>> = this.GetSrcObject();
254
255 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
256 return true;
257 })());
258 result
259}
260
261unsafe extern "C" fn set_srcObject<D: DomTypes>
262(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
263 let mut result = false;
264 wrap_panic(&mut || result = (|| {
265 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
266 let this = &*(this as *const D::HTMLMediaElement);
267 let arg0: Option<GenericUnionTypes::MediaStreamOrBlob::<D> > = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
268 Ok(ConversionResult::Success(value)) => value,
269 Ok(ConversionResult::Failure(error)) => {
270 throw_type_error(cx.raw_cx(), &error);
271 return false;
272
273 }
274 _ => {
275 return false;
276
277 },
278 }
279 ;
280 let result: () = this.SetSrcObject(arg0, CanGc::note());
281
282 true
283 })());
284 result
285}
286
287
288static srcObject_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
289
290pub(crate) fn init_srcObject_getterinfo<D: DomTypes>() {
291 srcObject_getterinfo.set(JSJitInfo {
292 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
293 getter: Some(get_srcObject::<D>)
294 },
295 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
296 protoID: PrototypeList::ID::HTMLMediaElement as u16,
297 },
298 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
299 _bitfield_align_1: [],
300 _bitfield_1: __BindgenBitfieldUnit::new(
301 new_jsjitinfo_bitfield_1!(
302 JSJitInfo_OpType::Getter as u8,
303 JSJitInfo_AliasSet::AliasEverything as u8,
304 JSValueType::JSVAL_TYPE_UNKNOWN as u8,
305 true,
306 false,
307 false,
308 false,
309 false,
310 false,
311 0,
312 ).to_ne_bytes()
313 ),
314});
315}
316static srcObject_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
317
318pub(crate) fn init_srcObject_setterinfo<D: DomTypes>() {
319 srcObject_setterinfo.set(JSJitInfo {
320 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
321 setter: Some(set_srcObject::<D>)
322 },
323 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
324 protoID: PrototypeList::ID::HTMLMediaElement as u16,
325 },
326 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
327 _bitfield_align_1: [],
328 _bitfield_1: __BindgenBitfieldUnit::new(
329 new_jsjitinfo_bitfield_1!(
330 JSJitInfo_OpType::Setter as u8,
331 JSJitInfo_AliasSet::AliasEverything as u8,
332 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
333 false,
334 false,
335 false,
336 false,
337 false,
338 false,
339 0,
340 ).to_ne_bytes()
341 ),
342});
343}
344unsafe extern "C" fn get_currentSrc<D: DomTypes>
345(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
346 let mut result = false;
347 wrap_panic(&mut || result = (|| {
348 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
349 let this = &*(this as *const D::HTMLMediaElement);
350 let result: USVString = this.CurrentSrc();
351
352 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
353 return true;
354 })());
355 result
356}
357
358
359static currentSrc_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
360
361pub(crate) fn init_currentSrc_getterinfo<D: DomTypes>() {
362 currentSrc_getterinfo.set(JSJitInfo {
363 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
364 getter: Some(get_currentSrc::<D>)
365 },
366 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
367 protoID: PrototypeList::ID::HTMLMediaElement as u16,
368 },
369 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
370 _bitfield_align_1: [],
371 _bitfield_1: __BindgenBitfieldUnit::new(
372 new_jsjitinfo_bitfield_1!(
373 JSJitInfo_OpType::Getter as u8,
374 JSJitInfo_AliasSet::AliasEverything as u8,
375 JSValueType::JSVAL_TYPE_STRING as u8,
376 true,
377 false,
378 false,
379 false,
380 false,
381 false,
382 0,
383 ).to_ne_bytes()
384 ),
385});
386}
387unsafe extern "C" fn get_crossOrigin<D: DomTypes>
388(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
389 let mut result = false;
390 wrap_panic(&mut || result = (|| {
391 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
392 let this = &*(this as *const D::HTMLMediaElement);
393 <D as DomHelpers<D>>::push_new_element_queue();
394
395 let result: Option<DOMString> = this.GetCrossOrigin();
396 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
397
398
399 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
400 return true;
401 })());
402 result
403}
404
405unsafe extern "C" fn set_crossOrigin<D: DomTypes>
406(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
407 let mut result = false;
408 wrap_panic(&mut || result = (|| {
409 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
410 let this = &*(this as *const D::HTMLMediaElement);
411 let arg0: Option<DOMString> = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
412 Ok(ConversionResult::Success(value)) => value,
413 Ok(ConversionResult::Failure(error)) => {
414 throw_type_error(cx.raw_cx(), &error);
415 return false;
416
417 }
418 _ => {
419 return false;
420
421 },
422 }
423 ;
424 <D as DomHelpers<D>>::push_new_element_queue();
425
426 let result: () = this.SetCrossOrigin(arg0, CanGc::note());
427 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
428
429
430 true
431 })());
432 result
433}
434
435
436static crossOrigin_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
437
438pub(crate) fn init_crossOrigin_getterinfo<D: DomTypes>() {
439 crossOrigin_getterinfo.set(JSJitInfo {
440 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
441 getter: Some(get_crossOrigin::<D>)
442 },
443 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
444 protoID: PrototypeList::ID::HTMLMediaElement as u16,
445 },
446 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
447 _bitfield_align_1: [],
448 _bitfield_1: __BindgenBitfieldUnit::new(
449 new_jsjitinfo_bitfield_1!(
450 JSJitInfo_OpType::Getter as u8,
451 JSJitInfo_AliasSet::AliasEverything as u8,
452 JSValueType::JSVAL_TYPE_UNKNOWN as u8,
453 true,
454 false,
455 false,
456 false,
457 false,
458 false,
459 0,
460 ).to_ne_bytes()
461 ),
462});
463}
464static crossOrigin_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
465
466pub(crate) fn init_crossOrigin_setterinfo<D: DomTypes>() {
467 crossOrigin_setterinfo.set(JSJitInfo {
468 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
469 setter: Some(set_crossOrigin::<D>)
470 },
471 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
472 protoID: PrototypeList::ID::HTMLMediaElement as u16,
473 },
474 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
475 _bitfield_align_1: [],
476 _bitfield_1: __BindgenBitfieldUnit::new(
477 new_jsjitinfo_bitfield_1!(
478 JSJitInfo_OpType::Setter as u8,
479 JSJitInfo_AliasSet::AliasEverything as u8,
480 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
481 false,
482 false,
483 false,
484 false,
485 false,
486 false,
487 0,
488 ).to_ne_bytes()
489 ),
490});
491}
492unsafe extern "C" fn get_networkState<D: DomTypes>
493(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
494 let mut result = false;
495 wrap_panic(&mut || result = (|| {
496 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
497 let this = &*(this as *const D::HTMLMediaElement);
498 let result: u16 = this.NetworkState();
499
500 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
501 return true;
502 })());
503 result
504}
505
506
507static networkState_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
508
509pub(crate) fn init_networkState_getterinfo<D: DomTypes>() {
510 networkState_getterinfo.set(JSJitInfo {
511 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
512 getter: Some(get_networkState::<D>)
513 },
514 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
515 protoID: PrototypeList::ID::HTMLMediaElement as u16,
516 },
517 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
518 _bitfield_align_1: [],
519 _bitfield_1: __BindgenBitfieldUnit::new(
520 new_jsjitinfo_bitfield_1!(
521 JSJitInfo_OpType::Getter as u8,
522 JSJitInfo_AliasSet::AliasEverything as u8,
523 JSValueType::JSVAL_TYPE_INT32 as u8,
524 true,
525 false,
526 false,
527 false,
528 false,
529 false,
530 0,
531 ).to_ne_bytes()
532 ),
533});
534}
535unsafe extern "C" fn get_preload<D: DomTypes>
536(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
537 let mut result = false;
538 wrap_panic(&mut || result = (|| {
539 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
540 let this = &*(this as *const D::HTMLMediaElement);
541 <D as DomHelpers<D>>::push_new_element_queue();
542
543 let result: DOMString = this.Preload();
544 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
545
546
547 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
548 return true;
549 })());
550 result
551}
552
553unsafe extern "C" fn set_preload<D: DomTypes>
554(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
555 let mut result = false;
556 wrap_panic(&mut || result = (|| {
557 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
558 let this = &*(this as *const D::HTMLMediaElement);
559 let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
560 Ok(ConversionResult::Success(value)) => value,
561 Ok(ConversionResult::Failure(error)) => {
562 throw_type_error(cx.raw_cx(), &error);
563 return false;
564
565 }
566 _ => {
567 return false;
568
569 },
570 }
571 ;
572 <D as DomHelpers<D>>::push_new_element_queue();
573
574 let result: () = this.SetPreload(arg0);
575 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
576
577
578 true
579 })());
580 result
581}
582
583
584static preload_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
585
586pub(crate) fn init_preload_getterinfo<D: DomTypes>() {
587 preload_getterinfo.set(JSJitInfo {
588 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
589 getter: Some(get_preload::<D>)
590 },
591 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
592 protoID: PrototypeList::ID::HTMLMediaElement as u16,
593 },
594 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
595 _bitfield_align_1: [],
596 _bitfield_1: __BindgenBitfieldUnit::new(
597 new_jsjitinfo_bitfield_1!(
598 JSJitInfo_OpType::Getter as u8,
599 JSJitInfo_AliasSet::AliasEverything as u8,
600 JSValueType::JSVAL_TYPE_STRING as u8,
601 true,
602 false,
603 false,
604 false,
605 false,
606 false,
607 0,
608 ).to_ne_bytes()
609 ),
610});
611}
612static preload_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
613
614pub(crate) fn init_preload_setterinfo<D: DomTypes>() {
615 preload_setterinfo.set(JSJitInfo {
616 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
617 setter: Some(set_preload::<D>)
618 },
619 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
620 protoID: PrototypeList::ID::HTMLMediaElement as u16,
621 },
622 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
623 _bitfield_align_1: [],
624 _bitfield_1: __BindgenBitfieldUnit::new(
625 new_jsjitinfo_bitfield_1!(
626 JSJitInfo_OpType::Setter as u8,
627 JSJitInfo_AliasSet::AliasEverything as u8,
628 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
629 false,
630 false,
631 false,
632 false,
633 false,
634 false,
635 0,
636 ).to_ne_bytes()
637 ),
638});
639}
640unsafe extern "C" fn get_buffered<D: DomTypes>
641(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
642 let mut result = false;
643 wrap_panic(&mut || result = (|| {
644 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
645 let this = &*(this as *const D::HTMLMediaElement);
646 let result: DomRoot<D::TimeRanges> = this.Buffered(CanGc::note());
647
648 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
649 return true;
650 })());
651 result
652}
653
654
655static buffered_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
656
657pub(crate) fn init_buffered_getterinfo<D: DomTypes>() {
658 buffered_getterinfo.set(JSJitInfo {
659 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
660 getter: Some(get_buffered::<D>)
661 },
662 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
663 protoID: PrototypeList::ID::HTMLMediaElement as u16,
664 },
665 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
666 _bitfield_align_1: [],
667 _bitfield_1: __BindgenBitfieldUnit::new(
668 new_jsjitinfo_bitfield_1!(
669 JSJitInfo_OpType::Getter as u8,
670 JSJitInfo_AliasSet::AliasEverything as u8,
671 JSValueType::JSVAL_TYPE_OBJECT as u8,
672 true,
673 false,
674 false,
675 false,
676 false,
677 false,
678 0,
679 ).to_ne_bytes()
680 ),
681});
682}
683unsafe extern "C" fn load<D: DomTypes>
684(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
685 let mut result = false;
686 wrap_panic(&mut || result = (|| {
687 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
688 let this = &*(this as *const D::HTMLMediaElement);
689 let args = &*args;
690 let argc = args.argc_;
691 let result: () = this.Load(CanGc::note());
692
693 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
694 return true;
695 })());
696 result
697}
698
699
700static load_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
701
702pub(crate) fn init_load_methodinfo<D: DomTypes>() {
703 load_methodinfo.set(JSJitInfo {
704 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
705 method: Some(load::<D>)
706 },
707 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
708 protoID: PrototypeList::ID::HTMLMediaElement as u16,
709 },
710 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
711 _bitfield_align_1: [],
712 _bitfield_1: __BindgenBitfieldUnit::new(
713 new_jsjitinfo_bitfield_1!(
714 JSJitInfo_OpType::Method as u8,
715 JSJitInfo_AliasSet::AliasEverything as u8,
716 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
717 true,
718 false,
719 false,
720 false,
721 false,
722 false,
723 0,
724 ).to_ne_bytes()
725 ),
726});
727}
728unsafe extern "C" fn canPlayType<D: DomTypes>
729(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
730 let mut result = false;
731 wrap_panic(&mut || result = (|| {
732 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
733 let this = &*(this as *const D::HTMLMediaElement);
734 let args = &*args;
735 let argc = args.argc_;
736
737 if argc < 1 {
738 throw_type_error(cx.raw_cx(), "Not enough arguments to \"HTMLMediaElement.canPlayType\".");
739 return false;
740 }
741 let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
742 Ok(ConversionResult::Success(value)) => value,
743 Ok(ConversionResult::Failure(error)) => {
744 throw_type_error(cx.raw_cx(), &error);
745 return false;
746
747 }
748 _ => {
749 return false;
750
751 },
752 }
753 ;
754 let result: CanPlayTypeResult = this.CanPlayType(arg0);
755
756 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
757 return true;
758 })());
759 result
760}
761
762
763static canPlayType_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
764
765pub(crate) fn init_canPlayType_methodinfo<D: DomTypes>() {
766 canPlayType_methodinfo.set(JSJitInfo {
767 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
768 method: Some(canPlayType::<D>)
769 },
770 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
771 protoID: PrototypeList::ID::HTMLMediaElement as u16,
772 },
773 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
774 _bitfield_align_1: [],
775 _bitfield_1: __BindgenBitfieldUnit::new(
776 new_jsjitinfo_bitfield_1!(
777 JSJitInfo_OpType::Method as u8,
778 JSJitInfo_AliasSet::AliasEverything as u8,
779 JSValueType::JSVAL_TYPE_STRING as u8,
780 false,
781 false,
782 false,
783 false,
784 false,
785 false,
786 0,
787 ).to_ne_bytes()
788 ),
789});
790}
791unsafe extern "C" fn get_readyState<D: DomTypes>
792(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
793 let mut result = false;
794 wrap_panic(&mut || result = (|| {
795 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
796 let this = &*(this as *const D::HTMLMediaElement);
797 let result: u16 = this.ReadyState();
798
799 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
800 return true;
801 })());
802 result
803}
804
805
806static readyState_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
807
808pub(crate) fn init_readyState_getterinfo<D: DomTypes>() {
809 readyState_getterinfo.set(JSJitInfo {
810 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
811 getter: Some(get_readyState::<D>)
812 },
813 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
814 protoID: PrototypeList::ID::HTMLMediaElement as u16,
815 },
816 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
817 _bitfield_align_1: [],
818 _bitfield_1: __BindgenBitfieldUnit::new(
819 new_jsjitinfo_bitfield_1!(
820 JSJitInfo_OpType::Getter as u8,
821 JSJitInfo_AliasSet::AliasEverything as u8,
822 JSValueType::JSVAL_TYPE_INT32 as u8,
823 true,
824 false,
825 false,
826 false,
827 false,
828 false,
829 0,
830 ).to_ne_bytes()
831 ),
832});
833}
834unsafe extern "C" fn get_seeking<D: DomTypes>
835(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
836 let mut result = false;
837 wrap_panic(&mut || result = (|| {
838 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
839 let this = &*(this as *const D::HTMLMediaElement);
840 let result: bool = this.Seeking();
841
842 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
843 return true;
844 })());
845 result
846}
847
848
849static seeking_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
850
851pub(crate) fn init_seeking_getterinfo<D: DomTypes>() {
852 seeking_getterinfo.set(JSJitInfo {
853 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
854 getter: Some(get_seeking::<D>)
855 },
856 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
857 protoID: PrototypeList::ID::HTMLMediaElement as u16,
858 },
859 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
860 _bitfield_align_1: [],
861 _bitfield_1: __BindgenBitfieldUnit::new(
862 new_jsjitinfo_bitfield_1!(
863 JSJitInfo_OpType::Getter as u8,
864 JSJitInfo_AliasSet::AliasEverything as u8,
865 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
866 true,
867 false,
868 false,
869 false,
870 false,
871 false,
872 0,
873 ).to_ne_bytes()
874 ),
875});
876}
877unsafe extern "C" fn get_currentTime<D: DomTypes>
878(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
879 let mut result = false;
880 wrap_panic(&mut || result = (|| {
881 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
882 let this = &*(this as *const D::HTMLMediaElement);
883 let result: Finite<f64> = this.CurrentTime();
884
885 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
886 return true;
887 })());
888 result
889}
890
891unsafe extern "C" fn set_currentTime<D: DomTypes>
892(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
893 let mut result = false;
894 wrap_panic(&mut || result = (|| {
895 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
896 let this = &*(this as *const D::HTMLMediaElement);
897 let arg0: Finite<f64> = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
898 Ok(ConversionResult::Success(value)) => value,
899 Ok(ConversionResult::Failure(error)) => {
900 throw_type_error(cx.raw_cx(), &error);
901 return false;
902
903 }
904 _ => {
905 return false;
906
907 },
908 }
909 ;
910 let result: () = this.SetCurrentTime(arg0);
911
912 true
913 })());
914 result
915}
916
917
918static currentTime_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
919
920pub(crate) fn init_currentTime_getterinfo<D: DomTypes>() {
921 currentTime_getterinfo.set(JSJitInfo {
922 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
923 getter: Some(get_currentTime::<D>)
924 },
925 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
926 protoID: PrototypeList::ID::HTMLMediaElement as u16,
927 },
928 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
929 _bitfield_align_1: [],
930 _bitfield_1: __BindgenBitfieldUnit::new(
931 new_jsjitinfo_bitfield_1!(
932 JSJitInfo_OpType::Getter as u8,
933 JSJitInfo_AliasSet::AliasEverything as u8,
934 JSValueType::JSVAL_TYPE_DOUBLE as u8,
935 true,
936 false,
937 false,
938 false,
939 false,
940 false,
941 0,
942 ).to_ne_bytes()
943 ),
944});
945}
946static currentTime_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
947
948pub(crate) fn init_currentTime_setterinfo<D: DomTypes>() {
949 currentTime_setterinfo.set(JSJitInfo {
950 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
951 setter: Some(set_currentTime::<D>)
952 },
953 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
954 protoID: PrototypeList::ID::HTMLMediaElement as u16,
955 },
956 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
957 _bitfield_align_1: [],
958 _bitfield_1: __BindgenBitfieldUnit::new(
959 new_jsjitinfo_bitfield_1!(
960 JSJitInfo_OpType::Setter as u8,
961 JSJitInfo_AliasSet::AliasEverything as u8,
962 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
963 false,
964 false,
965 false,
966 false,
967 false,
968 false,
969 0,
970 ).to_ne_bytes()
971 ),
972});
973}
974unsafe extern "C" fn fastSeek<D: DomTypes>
975(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
976 let mut result = false;
977 wrap_panic(&mut || result = (|| {
978 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
979 let this = &*(this as *const D::HTMLMediaElement);
980 let args = &*args;
981 let argc = args.argc_;
982
983 if argc < 1 {
984 throw_type_error(cx.raw_cx(), "Not enough arguments to \"HTMLMediaElement.fastSeek\".");
985 return false;
986 }
987 let arg0: Finite<f64> = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
988 Ok(ConversionResult::Success(value)) => value,
989 Ok(ConversionResult::Failure(error)) => {
990 throw_type_error(cx.raw_cx(), &error);
991 return false;
992
993 }
994 _ => {
995 return false;
996
997 },
998 }
999 ;
1000 let result: () = this.FastSeek(arg0);
1001
1002 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1003 return true;
1004 })());
1005 result
1006}
1007
1008
1009static fastSeek_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1010
1011pub(crate) fn init_fastSeek_methodinfo<D: DomTypes>() {
1012 fastSeek_methodinfo.set(JSJitInfo {
1013 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1014 method: Some(fastSeek::<D>)
1015 },
1016 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1017 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1018 },
1019 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1020 _bitfield_align_1: [],
1021 _bitfield_1: __BindgenBitfieldUnit::new(
1022 new_jsjitinfo_bitfield_1!(
1023 JSJitInfo_OpType::Method as u8,
1024 JSJitInfo_AliasSet::AliasEverything as u8,
1025 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1026 false,
1027 false,
1028 false,
1029 false,
1030 false,
1031 false,
1032 0,
1033 ).to_ne_bytes()
1034 ),
1035});
1036}
1037unsafe extern "C" fn get_duration<D: DomTypes>
1038(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1039 let mut result = false;
1040 wrap_panic(&mut || result = (|| {
1041 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1042 let this = &*(this as *const D::HTMLMediaElement);
1043 let result: f64 = this.Duration();
1044
1045 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1046 return true;
1047 })());
1048 result
1049}
1050
1051
1052static duration_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1053
1054pub(crate) fn init_duration_getterinfo<D: DomTypes>() {
1055 duration_getterinfo.set(JSJitInfo {
1056 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1057 getter: Some(get_duration::<D>)
1058 },
1059 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1060 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1061 },
1062 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1063 _bitfield_align_1: [],
1064 _bitfield_1: __BindgenBitfieldUnit::new(
1065 new_jsjitinfo_bitfield_1!(
1066 JSJitInfo_OpType::Getter as u8,
1067 JSJitInfo_AliasSet::AliasEverything as u8,
1068 JSValueType::JSVAL_TYPE_DOUBLE as u8,
1069 true,
1070 false,
1071 false,
1072 false,
1073 false,
1074 false,
1075 0,
1076 ).to_ne_bytes()
1077 ),
1078});
1079}
1080unsafe extern "C" fn get_paused<D: DomTypes>
1081(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1082 let mut result = false;
1083 wrap_panic(&mut || result = (|| {
1084 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1085 let this = &*(this as *const D::HTMLMediaElement);
1086 let result: bool = this.Paused();
1087
1088 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1089 return true;
1090 })());
1091 result
1092}
1093
1094
1095static paused_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1096
1097pub(crate) fn init_paused_getterinfo<D: DomTypes>() {
1098 paused_getterinfo.set(JSJitInfo {
1099 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1100 getter: Some(get_paused::<D>)
1101 },
1102 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1103 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1104 },
1105 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1106 _bitfield_align_1: [],
1107 _bitfield_1: __BindgenBitfieldUnit::new(
1108 new_jsjitinfo_bitfield_1!(
1109 JSJitInfo_OpType::Getter as u8,
1110 JSJitInfo_AliasSet::AliasEverything as u8,
1111 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
1112 true,
1113 false,
1114 false,
1115 false,
1116 false,
1117 false,
1118 0,
1119 ).to_ne_bytes()
1120 ),
1121});
1122}
1123unsafe extern "C" fn get_defaultPlaybackRate<D: DomTypes>
1124(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1125 let mut result = false;
1126 wrap_panic(&mut || result = (|| {
1127 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1128 let this = &*(this as *const D::HTMLMediaElement);
1129 let result: Result<Finite<f64>, Error> = this.GetDefaultPlaybackRate();
1130 let result = match result {
1131 Ok(result) => result,
1132 Err(e) => {
1133 <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());
1134 return false;
1135 },
1136 };
1137
1138 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1139 return true;
1140 })());
1141 result
1142}
1143
1144unsafe extern "C" fn set_defaultPlaybackRate<D: DomTypes>
1145(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
1146 let mut result = false;
1147 wrap_panic(&mut || result = (|| {
1148 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1149 let this = &*(this as *const D::HTMLMediaElement);
1150 let arg0: Finite<f64> = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
1151 Ok(ConversionResult::Success(value)) => value,
1152 Ok(ConversionResult::Failure(error)) => {
1153 throw_type_error(cx.raw_cx(), &error);
1154 return false;
1155
1156 }
1157 _ => {
1158 return false;
1159
1160 },
1161 }
1162 ;
1163 let result: Result<(), Error> = this.SetDefaultPlaybackRate(arg0);
1164 let result = match result {
1165 Ok(result) => result,
1166 Err(e) => {
1167 <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());
1168 return false;
1169 },
1170 };
1171
1172 true
1173 })());
1174 result
1175}
1176
1177
1178static defaultPlaybackRate_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1179
1180pub(crate) fn init_defaultPlaybackRate_getterinfo<D: DomTypes>() {
1181 defaultPlaybackRate_getterinfo.set(JSJitInfo {
1182 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1183 getter: Some(get_defaultPlaybackRate::<D>)
1184 },
1185 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1186 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1187 },
1188 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1189 _bitfield_align_1: [],
1190 _bitfield_1: __BindgenBitfieldUnit::new(
1191 new_jsjitinfo_bitfield_1!(
1192 JSJitInfo_OpType::Getter as u8,
1193 JSJitInfo_AliasSet::AliasEverything as u8,
1194 JSValueType::JSVAL_TYPE_DOUBLE as u8,
1195 false,
1196 false,
1197 false,
1198 false,
1199 false,
1200 false,
1201 0,
1202 ).to_ne_bytes()
1203 ),
1204});
1205}
1206static defaultPlaybackRate_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1207
1208pub(crate) fn init_defaultPlaybackRate_setterinfo<D: DomTypes>() {
1209 defaultPlaybackRate_setterinfo.set(JSJitInfo {
1210 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1211 setter: Some(set_defaultPlaybackRate::<D>)
1212 },
1213 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1214 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1215 },
1216 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1217 _bitfield_align_1: [],
1218 _bitfield_1: __BindgenBitfieldUnit::new(
1219 new_jsjitinfo_bitfield_1!(
1220 JSJitInfo_OpType::Setter as u8,
1221 JSJitInfo_AliasSet::AliasEverything as u8,
1222 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1223 false,
1224 false,
1225 false,
1226 false,
1227 false,
1228 false,
1229 0,
1230 ).to_ne_bytes()
1231 ),
1232});
1233}
1234unsafe extern "C" fn get_playbackRate<D: DomTypes>
1235(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1236 let mut result = false;
1237 wrap_panic(&mut || result = (|| {
1238 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1239 let this = &*(this as *const D::HTMLMediaElement);
1240 let result: Result<Finite<f64>, Error> = this.GetPlaybackRate();
1241 let result = match result {
1242 Ok(result) => result,
1243 Err(e) => {
1244 <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());
1245 return false;
1246 },
1247 };
1248
1249 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1250 return true;
1251 })());
1252 result
1253}
1254
1255unsafe extern "C" fn set_playbackRate<D: DomTypes>
1256(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
1257 let mut result = false;
1258 wrap_panic(&mut || result = (|| {
1259 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1260 let this = &*(this as *const D::HTMLMediaElement);
1261 let arg0: Finite<f64> = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
1262 Ok(ConversionResult::Success(value)) => value,
1263 Ok(ConversionResult::Failure(error)) => {
1264 throw_type_error(cx.raw_cx(), &error);
1265 return false;
1266
1267 }
1268 _ => {
1269 return false;
1270
1271 },
1272 }
1273 ;
1274 let result: Result<(), Error> = this.SetPlaybackRate(arg0);
1275 let result = match result {
1276 Ok(result) => result,
1277 Err(e) => {
1278 <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());
1279 return false;
1280 },
1281 };
1282
1283 true
1284 })());
1285 result
1286}
1287
1288
1289static playbackRate_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1290
1291pub(crate) fn init_playbackRate_getterinfo<D: DomTypes>() {
1292 playbackRate_getterinfo.set(JSJitInfo {
1293 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1294 getter: Some(get_playbackRate::<D>)
1295 },
1296 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1297 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1298 },
1299 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1300 _bitfield_align_1: [],
1301 _bitfield_1: __BindgenBitfieldUnit::new(
1302 new_jsjitinfo_bitfield_1!(
1303 JSJitInfo_OpType::Getter as u8,
1304 JSJitInfo_AliasSet::AliasEverything as u8,
1305 JSValueType::JSVAL_TYPE_DOUBLE as u8,
1306 false,
1307 false,
1308 false,
1309 false,
1310 false,
1311 false,
1312 0,
1313 ).to_ne_bytes()
1314 ),
1315});
1316}
1317static playbackRate_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1318
1319pub(crate) fn init_playbackRate_setterinfo<D: DomTypes>() {
1320 playbackRate_setterinfo.set(JSJitInfo {
1321 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1322 setter: Some(set_playbackRate::<D>)
1323 },
1324 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1325 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1326 },
1327 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1328 _bitfield_align_1: [],
1329 _bitfield_1: __BindgenBitfieldUnit::new(
1330 new_jsjitinfo_bitfield_1!(
1331 JSJitInfo_OpType::Setter as u8,
1332 JSJitInfo_AliasSet::AliasEverything as u8,
1333 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1334 false,
1335 false,
1336 false,
1337 false,
1338 false,
1339 false,
1340 0,
1341 ).to_ne_bytes()
1342 ),
1343});
1344}
1345unsafe extern "C" fn get_played<D: DomTypes>
1346(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1347 let mut result = false;
1348 wrap_panic(&mut || result = (|| {
1349 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1350 let this = &*(this as *const D::HTMLMediaElement);
1351 let result: DomRoot<D::TimeRanges> = this.Played(CanGc::note());
1352
1353 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1354 return true;
1355 })());
1356 result
1357}
1358
1359
1360static played_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1361
1362pub(crate) fn init_played_getterinfo<D: DomTypes>() {
1363 played_getterinfo.set(JSJitInfo {
1364 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1365 getter: Some(get_played::<D>)
1366 },
1367 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1368 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1369 },
1370 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1371 _bitfield_align_1: [],
1372 _bitfield_1: __BindgenBitfieldUnit::new(
1373 new_jsjitinfo_bitfield_1!(
1374 JSJitInfo_OpType::Getter as u8,
1375 JSJitInfo_AliasSet::AliasEverything as u8,
1376 JSValueType::JSVAL_TYPE_OBJECT as u8,
1377 true,
1378 false,
1379 false,
1380 false,
1381 false,
1382 false,
1383 0,
1384 ).to_ne_bytes()
1385 ),
1386});
1387}
1388unsafe extern "C" fn get_seekable<D: DomTypes>
1389(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1390 let mut result = false;
1391 wrap_panic(&mut || result = (|| {
1392 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1393 let this = &*(this as *const D::HTMLMediaElement);
1394 let result: DomRoot<D::TimeRanges> = this.Seekable(CanGc::note());
1395
1396 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1397 return true;
1398 })());
1399 result
1400}
1401
1402
1403static seekable_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1404
1405pub(crate) fn init_seekable_getterinfo<D: DomTypes>() {
1406 seekable_getterinfo.set(JSJitInfo {
1407 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1408 getter: Some(get_seekable::<D>)
1409 },
1410 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1411 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1412 },
1413 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1414 _bitfield_align_1: [],
1415 _bitfield_1: __BindgenBitfieldUnit::new(
1416 new_jsjitinfo_bitfield_1!(
1417 JSJitInfo_OpType::Getter as u8,
1418 JSJitInfo_AliasSet::AliasEverything as u8,
1419 JSValueType::JSVAL_TYPE_OBJECT as u8,
1420 true,
1421 false,
1422 false,
1423 false,
1424 false,
1425 false,
1426 0,
1427 ).to_ne_bytes()
1428 ),
1429});
1430}
1431unsafe extern "C" fn get_ended<D: DomTypes>
1432(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1433 let mut result = false;
1434 wrap_panic(&mut || result = (|| {
1435 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1436 let this = &*(this as *const D::HTMLMediaElement);
1437 let result: bool = this.Ended();
1438
1439 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1440 return true;
1441 })());
1442 result
1443}
1444
1445
1446static ended_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1447
1448pub(crate) fn init_ended_getterinfo<D: DomTypes>() {
1449 ended_getterinfo.set(JSJitInfo {
1450 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1451 getter: Some(get_ended::<D>)
1452 },
1453 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1454 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1455 },
1456 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1457 _bitfield_align_1: [],
1458 _bitfield_1: __BindgenBitfieldUnit::new(
1459 new_jsjitinfo_bitfield_1!(
1460 JSJitInfo_OpType::Getter as u8,
1461 JSJitInfo_AliasSet::AliasEverything as u8,
1462 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
1463 true,
1464 false,
1465 false,
1466 false,
1467 false,
1468 false,
1469 0,
1470 ).to_ne_bytes()
1471 ),
1472});
1473}
1474unsafe extern "C" fn get_autoplay<D: DomTypes>
1475(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1476 let mut result = false;
1477 wrap_panic(&mut || result = (|| {
1478 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1479 let this = &*(this as *const D::HTMLMediaElement);
1480 <D as DomHelpers<D>>::push_new_element_queue();
1481
1482 let result: bool = this.Autoplay();
1483 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
1484
1485
1486 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1487 return true;
1488 })());
1489 result
1490}
1491
1492unsafe extern "C" fn set_autoplay<D: DomTypes>
1493(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
1494 let mut result = false;
1495 wrap_panic(&mut || result = (|| {
1496 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1497 let this = &*(this as *const D::HTMLMediaElement);
1498 let arg0: bool = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
1499 Ok(ConversionResult::Success(value)) => value,
1500 Ok(ConversionResult::Failure(error)) => {
1501 throw_type_error(cx.raw_cx(), &error);
1502 return false;
1503
1504 }
1505 _ => {
1506 return false;
1507
1508 },
1509 }
1510 ;
1511 <D as DomHelpers<D>>::push_new_element_queue();
1512
1513 let result: () = this.SetAutoplay(arg0);
1514 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
1515
1516
1517 true
1518 })());
1519 result
1520}
1521
1522
1523static autoplay_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1524
1525pub(crate) fn init_autoplay_getterinfo<D: DomTypes>() {
1526 autoplay_getterinfo.set(JSJitInfo {
1527 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1528 getter: Some(get_autoplay::<D>)
1529 },
1530 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1531 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1532 },
1533 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1534 _bitfield_align_1: [],
1535 _bitfield_1: __BindgenBitfieldUnit::new(
1536 new_jsjitinfo_bitfield_1!(
1537 JSJitInfo_OpType::Getter as u8,
1538 JSJitInfo_AliasSet::AliasEverything as u8,
1539 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
1540 true,
1541 false,
1542 false,
1543 false,
1544 false,
1545 false,
1546 0,
1547 ).to_ne_bytes()
1548 ),
1549});
1550}
1551static autoplay_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1552
1553pub(crate) fn init_autoplay_setterinfo<D: DomTypes>() {
1554 autoplay_setterinfo.set(JSJitInfo {
1555 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1556 setter: Some(set_autoplay::<D>)
1557 },
1558 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1559 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1560 },
1561 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1562 _bitfield_align_1: [],
1563 _bitfield_1: __BindgenBitfieldUnit::new(
1564 new_jsjitinfo_bitfield_1!(
1565 JSJitInfo_OpType::Setter as u8,
1566 JSJitInfo_AliasSet::AliasEverything as u8,
1567 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1568 false,
1569 false,
1570 false,
1571 false,
1572 false,
1573 false,
1574 0,
1575 ).to_ne_bytes()
1576 ),
1577});
1578}
1579unsafe extern "C" fn get_loop<D: DomTypes>
1580(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1581 let mut result = false;
1582 wrap_panic(&mut || result = (|| {
1583 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1584 let this = &*(this as *const D::HTMLMediaElement);
1585 <D as DomHelpers<D>>::push_new_element_queue();
1586
1587 let result: bool = this.Loop();
1588 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
1589
1590
1591 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1592 return true;
1593 })());
1594 result
1595}
1596
1597unsafe extern "C" fn set_loop<D: DomTypes>
1598(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
1599 let mut result = false;
1600 wrap_panic(&mut || result = (|| {
1601 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1602 let this = &*(this as *const D::HTMLMediaElement);
1603 let arg0: bool = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
1604 Ok(ConversionResult::Success(value)) => value,
1605 Ok(ConversionResult::Failure(error)) => {
1606 throw_type_error(cx.raw_cx(), &error);
1607 return false;
1608
1609 }
1610 _ => {
1611 return false;
1612
1613 },
1614 }
1615 ;
1616 <D as DomHelpers<D>>::push_new_element_queue();
1617
1618 let result: () = this.SetLoop(arg0);
1619 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
1620
1621
1622 true
1623 })());
1624 result
1625}
1626
1627
1628static loop_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1629
1630pub(crate) fn init_loop_getterinfo<D: DomTypes>() {
1631 loop_getterinfo.set(JSJitInfo {
1632 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1633 getter: Some(get_loop::<D>)
1634 },
1635 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1636 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1637 },
1638 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1639 _bitfield_align_1: [],
1640 _bitfield_1: __BindgenBitfieldUnit::new(
1641 new_jsjitinfo_bitfield_1!(
1642 JSJitInfo_OpType::Getter as u8,
1643 JSJitInfo_AliasSet::AliasEverything as u8,
1644 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
1645 true,
1646 false,
1647 false,
1648 false,
1649 false,
1650 false,
1651 0,
1652 ).to_ne_bytes()
1653 ),
1654});
1655}
1656static loop_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1657
1658pub(crate) fn init_loop_setterinfo<D: DomTypes>() {
1659 loop_setterinfo.set(JSJitInfo {
1660 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1661 setter: Some(set_loop::<D>)
1662 },
1663 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1664 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1665 },
1666 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1667 _bitfield_align_1: [],
1668 _bitfield_1: __BindgenBitfieldUnit::new(
1669 new_jsjitinfo_bitfield_1!(
1670 JSJitInfo_OpType::Setter as u8,
1671 JSJitInfo_AliasSet::AliasEverything as u8,
1672 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1673 false,
1674 false,
1675 false,
1676 false,
1677 false,
1678 false,
1679 0,
1680 ).to_ne_bytes()
1681 ),
1682});
1683}
1684unsafe extern "C" fn play<D: DomTypes>
1685(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
1686 let mut result = false;
1687 wrap_panic(&mut || result = (|| {
1688 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1689 let this = &*(this as *const D::HTMLMediaElement);
1690 let args = &*args;
1691 let argc = args.argc_;
1692 let result: Rc<D::Promise> = this.Play(InRealm::already(&AlreadyInRealm::assert_for_cx(SafeJSContext::from_ptr(cx.raw_cx()))), CanGc::note());
1693
1694 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1695 return true;
1696 })());
1697 result
1698}
1699
1700unsafe extern "C" fn play_promise_wrapper<D: DomTypes>
1701(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
1702 let mut result = false;
1703 wrap_panic(&mut || result = (|| {
1704 let ok = play::<D>(cx, _obj, this, args);
1705 if ok {
1706 return true;
1707 }
1708 return exception_to_promise(cx, (*args).rval(), CanGc::note());
1709
1710 })());
1711 result
1712}
1713
1714
1715static play_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1716
1717pub(crate) fn init_play_methodinfo<D: DomTypes>() {
1718 play_methodinfo.set(JSJitInfo {
1719 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1720 method: Some(play_promise_wrapper::<D>)
1721 },
1722 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1723 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1724 },
1725 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1726 _bitfield_align_1: [],
1727 _bitfield_1: __BindgenBitfieldUnit::new(
1728 new_jsjitinfo_bitfield_1!(
1729 JSJitInfo_OpType::Method as u8,
1730 JSJitInfo_AliasSet::AliasEverything as u8,
1731 JSValueType::JSVAL_TYPE_OBJECT as u8,
1732 true,
1733 false,
1734 false,
1735 false,
1736 false,
1737 false,
1738 0,
1739 ).to_ne_bytes()
1740 ),
1741});
1742}
1743unsafe extern "C" fn pause<D: DomTypes>
1744(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
1745 let mut result = false;
1746 wrap_panic(&mut || result = (|| {
1747 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1748 let this = &*(this as *const D::HTMLMediaElement);
1749 let args = &*args;
1750 let argc = args.argc_;
1751 let result: () = this.Pause(CanGc::note());
1752
1753 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1754 return true;
1755 })());
1756 result
1757}
1758
1759
1760static pause_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1761
1762pub(crate) fn init_pause_methodinfo<D: DomTypes>() {
1763 pause_methodinfo.set(JSJitInfo {
1764 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1765 method: Some(pause::<D>)
1766 },
1767 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1768 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1769 },
1770 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1771 _bitfield_align_1: [],
1772 _bitfield_1: __BindgenBitfieldUnit::new(
1773 new_jsjitinfo_bitfield_1!(
1774 JSJitInfo_OpType::Method as u8,
1775 JSJitInfo_AliasSet::AliasEverything as u8,
1776 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1777 true,
1778 false,
1779 false,
1780 false,
1781 false,
1782 false,
1783 0,
1784 ).to_ne_bytes()
1785 ),
1786});
1787}
1788unsafe extern "C" fn get_controls<D: DomTypes>
1789(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1790 let mut result = false;
1791 wrap_panic(&mut || result = (|| {
1792 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1793 let this = &*(this as *const D::HTMLMediaElement);
1794 <D as DomHelpers<D>>::push_new_element_queue();
1795
1796 let result: bool = this.Controls();
1797 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
1798
1799
1800 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1801 return true;
1802 })());
1803 result
1804}
1805
1806unsafe extern "C" fn set_controls<D: DomTypes>
1807(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
1808 let mut result = false;
1809 wrap_panic(&mut || result = (|| {
1810 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1811 let this = &*(this as *const D::HTMLMediaElement);
1812 let arg0: bool = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
1813 Ok(ConversionResult::Success(value)) => value,
1814 Ok(ConversionResult::Failure(error)) => {
1815 throw_type_error(cx.raw_cx(), &error);
1816 return false;
1817
1818 }
1819 _ => {
1820 return false;
1821
1822 },
1823 }
1824 ;
1825 <D as DomHelpers<D>>::push_new_element_queue();
1826
1827 let result: () = this.SetControls(arg0);
1828 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
1829
1830
1831 true
1832 })());
1833 result
1834}
1835
1836
1837static controls_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1838
1839pub(crate) fn init_controls_getterinfo<D: DomTypes>() {
1840 controls_getterinfo.set(JSJitInfo {
1841 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1842 getter: Some(get_controls::<D>)
1843 },
1844 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1845 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1846 },
1847 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1848 _bitfield_align_1: [],
1849 _bitfield_1: __BindgenBitfieldUnit::new(
1850 new_jsjitinfo_bitfield_1!(
1851 JSJitInfo_OpType::Getter as u8,
1852 JSJitInfo_AliasSet::AliasEverything as u8,
1853 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
1854 true,
1855 false,
1856 false,
1857 false,
1858 false,
1859 false,
1860 0,
1861 ).to_ne_bytes()
1862 ),
1863});
1864}
1865static controls_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1866
1867pub(crate) fn init_controls_setterinfo<D: DomTypes>() {
1868 controls_setterinfo.set(JSJitInfo {
1869 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1870 setter: Some(set_controls::<D>)
1871 },
1872 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1873 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1874 },
1875 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1876 _bitfield_align_1: [],
1877 _bitfield_1: __BindgenBitfieldUnit::new(
1878 new_jsjitinfo_bitfield_1!(
1879 JSJitInfo_OpType::Setter as u8,
1880 JSJitInfo_AliasSet::AliasEverything as u8,
1881 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1882 false,
1883 false,
1884 false,
1885 false,
1886 false,
1887 false,
1888 0,
1889 ).to_ne_bytes()
1890 ),
1891});
1892}
1893unsafe extern "C" fn get_volume<D: DomTypes>
1894(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1895 let mut result = false;
1896 wrap_panic(&mut || result = (|| {
1897 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1898 let this = &*(this as *const D::HTMLMediaElement);
1899 let result: Result<Finite<f64>, Error> = this.GetVolume();
1900 let result = match result {
1901 Ok(result) => result,
1902 Err(e) => {
1903 <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());
1904 return false;
1905 },
1906 };
1907
1908 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1909 return true;
1910 })());
1911 result
1912}
1913
1914unsafe extern "C" fn set_volume<D: DomTypes>
1915(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
1916 let mut result = false;
1917 wrap_panic(&mut || result = (|| {
1918 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1919 let this = &*(this as *const D::HTMLMediaElement);
1920 let arg0: Finite<f64> = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
1921 Ok(ConversionResult::Success(value)) => value,
1922 Ok(ConversionResult::Failure(error)) => {
1923 throw_type_error(cx.raw_cx(), &error);
1924 return false;
1925
1926 }
1927 _ => {
1928 return false;
1929
1930 },
1931 }
1932 ;
1933 let result: Result<(), Error> = this.SetVolume(arg0);
1934 let result = match result {
1935 Ok(result) => result,
1936 Err(e) => {
1937 <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());
1938 return false;
1939 },
1940 };
1941
1942 true
1943 })());
1944 result
1945}
1946
1947
1948static volume_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1949
1950pub(crate) fn init_volume_getterinfo<D: DomTypes>() {
1951 volume_getterinfo.set(JSJitInfo {
1952 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1953 getter: Some(get_volume::<D>)
1954 },
1955 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1956 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1957 },
1958 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1959 _bitfield_align_1: [],
1960 _bitfield_1: __BindgenBitfieldUnit::new(
1961 new_jsjitinfo_bitfield_1!(
1962 JSJitInfo_OpType::Getter as u8,
1963 JSJitInfo_AliasSet::AliasEverything as u8,
1964 JSValueType::JSVAL_TYPE_DOUBLE as u8,
1965 false,
1966 false,
1967 false,
1968 false,
1969 false,
1970 false,
1971 0,
1972 ).to_ne_bytes()
1973 ),
1974});
1975}
1976static volume_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1977
1978pub(crate) fn init_volume_setterinfo<D: DomTypes>() {
1979 volume_setterinfo.set(JSJitInfo {
1980 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1981 setter: Some(set_volume::<D>)
1982 },
1983 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1984 protoID: PrototypeList::ID::HTMLMediaElement as u16,
1985 },
1986 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1987 _bitfield_align_1: [],
1988 _bitfield_1: __BindgenBitfieldUnit::new(
1989 new_jsjitinfo_bitfield_1!(
1990 JSJitInfo_OpType::Setter as u8,
1991 JSJitInfo_AliasSet::AliasEverything as u8,
1992 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1993 false,
1994 false,
1995 false,
1996 false,
1997 false,
1998 false,
1999 0,
2000 ).to_ne_bytes()
2001 ),
2002});
2003}
2004unsafe extern "C" fn get_muted<D: DomTypes>
2005(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
2006 let mut result = false;
2007 wrap_panic(&mut || result = (|| {
2008 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
2009 let this = &*(this as *const D::HTMLMediaElement);
2010 let result: bool = this.Muted();
2011
2012 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
2013 return true;
2014 })());
2015 result
2016}
2017
2018unsafe extern "C" fn set_muted<D: DomTypes>
2019(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
2020 let mut result = false;
2021 wrap_panic(&mut || result = (|| {
2022 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
2023 let this = &*(this as *const D::HTMLMediaElement);
2024 let arg0: bool = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
2025 Ok(ConversionResult::Success(value)) => value,
2026 Ok(ConversionResult::Failure(error)) => {
2027 throw_type_error(cx.raw_cx(), &error);
2028 return false;
2029
2030 }
2031 _ => {
2032 return false;
2033
2034 },
2035 }
2036 ;
2037 let result: () = this.SetMuted(arg0);
2038
2039 true
2040 })());
2041 result
2042}
2043
2044
2045static muted_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
2046
2047pub(crate) fn init_muted_getterinfo<D: DomTypes>() {
2048 muted_getterinfo.set(JSJitInfo {
2049 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
2050 getter: Some(get_muted::<D>)
2051 },
2052 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
2053 protoID: PrototypeList::ID::HTMLMediaElement as u16,
2054 },
2055 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
2056 _bitfield_align_1: [],
2057 _bitfield_1: __BindgenBitfieldUnit::new(
2058 new_jsjitinfo_bitfield_1!(
2059 JSJitInfo_OpType::Getter as u8,
2060 JSJitInfo_AliasSet::AliasEverything as u8,
2061 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
2062 true,
2063 false,
2064 false,
2065 false,
2066 false,
2067 false,
2068 0,
2069 ).to_ne_bytes()
2070 ),
2071});
2072}
2073static muted_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
2074
2075pub(crate) fn init_muted_setterinfo<D: DomTypes>() {
2076 muted_setterinfo.set(JSJitInfo {
2077 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
2078 setter: Some(set_muted::<D>)
2079 },
2080 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
2081 protoID: PrototypeList::ID::HTMLMediaElement as u16,
2082 },
2083 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
2084 _bitfield_align_1: [],
2085 _bitfield_1: __BindgenBitfieldUnit::new(
2086 new_jsjitinfo_bitfield_1!(
2087 JSJitInfo_OpType::Setter as u8,
2088 JSJitInfo_AliasSet::AliasEverything as u8,
2089 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
2090 false,
2091 false,
2092 false,
2093 false,
2094 false,
2095 false,
2096 0,
2097 ).to_ne_bytes()
2098 ),
2099});
2100}
2101unsafe extern "C" fn get_defaultMuted<D: DomTypes>
2102(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
2103 let mut result = false;
2104 wrap_panic(&mut || result = (|| {
2105 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
2106 let this = &*(this as *const D::HTMLMediaElement);
2107 <D as DomHelpers<D>>::push_new_element_queue();
2108
2109 let result: bool = this.DefaultMuted();
2110 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
2111
2112
2113 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
2114 return true;
2115 })());
2116 result
2117}
2118
2119unsafe extern "C" fn set_defaultMuted<D: DomTypes>
2120(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
2121 let mut result = false;
2122 wrap_panic(&mut || result = (|| {
2123 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
2124 let this = &*(this as *const D::HTMLMediaElement);
2125 let arg0: bool = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
2126 Ok(ConversionResult::Success(value)) => value,
2127 Ok(ConversionResult::Failure(error)) => {
2128 throw_type_error(cx.raw_cx(), &error);
2129 return false;
2130
2131 }
2132 _ => {
2133 return false;
2134
2135 },
2136 }
2137 ;
2138 <D as DomHelpers<D>>::push_new_element_queue();
2139
2140 let result: () = this.SetDefaultMuted(arg0);
2141 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
2142
2143
2144 true
2145 })());
2146 result
2147}
2148
2149
2150static defaultMuted_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
2151
2152pub(crate) fn init_defaultMuted_getterinfo<D: DomTypes>() {
2153 defaultMuted_getterinfo.set(JSJitInfo {
2154 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
2155 getter: Some(get_defaultMuted::<D>)
2156 },
2157 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
2158 protoID: PrototypeList::ID::HTMLMediaElement as u16,
2159 },
2160 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
2161 _bitfield_align_1: [],
2162 _bitfield_1: __BindgenBitfieldUnit::new(
2163 new_jsjitinfo_bitfield_1!(
2164 JSJitInfo_OpType::Getter as u8,
2165 JSJitInfo_AliasSet::AliasEverything as u8,
2166 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
2167 true,
2168 false,
2169 false,
2170 false,
2171 false,
2172 false,
2173 0,
2174 ).to_ne_bytes()
2175 ),
2176});
2177}
2178static defaultMuted_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
2179
2180pub(crate) fn init_defaultMuted_setterinfo<D: DomTypes>() {
2181 defaultMuted_setterinfo.set(JSJitInfo {
2182 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
2183 setter: Some(set_defaultMuted::<D>)
2184 },
2185 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
2186 protoID: PrototypeList::ID::HTMLMediaElement as u16,
2187 },
2188 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
2189 _bitfield_align_1: [],
2190 _bitfield_1: __BindgenBitfieldUnit::new(
2191 new_jsjitinfo_bitfield_1!(
2192 JSJitInfo_OpType::Setter as u8,
2193 JSJitInfo_AliasSet::AliasEverything as u8,
2194 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
2195 false,
2196 false,
2197 false,
2198 false,
2199 false,
2200 false,
2201 0,
2202 ).to_ne_bytes()
2203 ),
2204});
2205}
2206unsafe extern "C" fn get_audioTracks<D: DomTypes>
2207(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
2208 let mut result = false;
2209 wrap_panic(&mut || result = (|| {
2210 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
2211 let this = &*(this as *const D::HTMLMediaElement);
2212 let result: DomRoot<D::AudioTrackList> = this.AudioTracks(CanGc::note());
2213
2214 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
2215 return true;
2216 })());
2217 result
2218}
2219
2220
2221static audioTracks_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
2222
2223pub(crate) fn init_audioTracks_getterinfo<D: DomTypes>() {
2224 audioTracks_getterinfo.set(JSJitInfo {
2225 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
2226 getter: Some(get_audioTracks::<D>)
2227 },
2228 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
2229 protoID: PrototypeList::ID::HTMLMediaElement as u16,
2230 },
2231 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
2232 _bitfield_align_1: [],
2233 _bitfield_1: __BindgenBitfieldUnit::new(
2234 new_jsjitinfo_bitfield_1!(
2235 JSJitInfo_OpType::Getter as u8,
2236 JSJitInfo_AliasSet::AliasEverything as u8,
2237 JSValueType::JSVAL_TYPE_OBJECT as u8,
2238 true,
2239 false,
2240 false,
2241 false,
2242 false,
2243 false,
2244 0,
2245 ).to_ne_bytes()
2246 ),
2247});
2248}
2249unsafe extern "C" fn get_videoTracks<D: DomTypes>
2250(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
2251 let mut result = false;
2252 wrap_panic(&mut || result = (|| {
2253 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
2254 let this = &*(this as *const D::HTMLMediaElement);
2255 let result: DomRoot<D::VideoTrackList> = this.VideoTracks(CanGc::note());
2256
2257 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
2258 return true;
2259 })());
2260 result
2261}
2262
2263
2264static videoTracks_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
2265
2266pub(crate) fn init_videoTracks_getterinfo<D: DomTypes>() {
2267 videoTracks_getterinfo.set(JSJitInfo {
2268 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
2269 getter: Some(get_videoTracks::<D>)
2270 },
2271 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
2272 protoID: PrototypeList::ID::HTMLMediaElement as u16,
2273 },
2274 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
2275 _bitfield_align_1: [],
2276 _bitfield_1: __BindgenBitfieldUnit::new(
2277 new_jsjitinfo_bitfield_1!(
2278 JSJitInfo_OpType::Getter as u8,
2279 JSJitInfo_AliasSet::AliasEverything as u8,
2280 JSValueType::JSVAL_TYPE_OBJECT as u8,
2281 true,
2282 false,
2283 false,
2284 false,
2285 false,
2286 false,
2287 0,
2288 ).to_ne_bytes()
2289 ),
2290});
2291}
2292unsafe extern "C" fn get_textTracks<D: DomTypes>
2293(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
2294 let mut result = false;
2295 wrap_panic(&mut || result = (|| {
2296 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
2297 let this = &*(this as *const D::HTMLMediaElement);
2298 let result: DomRoot<D::TextTrackList> = this.TextTracks(CanGc::note());
2299
2300 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
2301 return true;
2302 })());
2303 result
2304}
2305
2306
2307static textTracks_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
2308
2309pub(crate) fn init_textTracks_getterinfo<D: DomTypes>() {
2310 textTracks_getterinfo.set(JSJitInfo {
2311 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
2312 getter: Some(get_textTracks::<D>)
2313 },
2314 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
2315 protoID: PrototypeList::ID::HTMLMediaElement as u16,
2316 },
2317 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
2318 _bitfield_align_1: [],
2319 _bitfield_1: __BindgenBitfieldUnit::new(
2320 new_jsjitinfo_bitfield_1!(
2321 JSJitInfo_OpType::Getter as u8,
2322 JSJitInfo_AliasSet::AliasEverything as u8,
2323 JSValueType::JSVAL_TYPE_OBJECT as u8,
2324 true,
2325 false,
2326 false,
2327 false,
2328 false,
2329 false,
2330 0,
2331 ).to_ne_bytes()
2332 ),
2333});
2334}
2335unsafe extern "C" fn addTextTrack<D: DomTypes>
2336(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
2337 let mut result = false;
2338 wrap_panic(&mut || result = (|| {
2339 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
2340 let this = &*(this as *const D::HTMLMediaElement);
2341 let args = &*args;
2342 let argc = args.argc_;
2343
2344 if argc < 1 {
2345 throw_type_error(cx.raw_cx(), "Not enough arguments to \"HTMLMediaElement.addTextTrack\".");
2346 return false;
2347 }
2348 let arg0: TextTrackKind = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
2349 Ok(ConversionResult::Success(value)) => value,
2350 Ok(ConversionResult::Failure(error)) => {
2351 throw_type_error(cx.raw_cx(), &error); return false;
2352
2353 }
2354 _ => {
2355 return false;
2356
2357 },
2358 }
2359 ;
2360 let arg1: DOMString = if args.get(1).is_undefined() {
2361 DOMString::from("")
2362 } else {
2363 match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(1)), StringificationBehavior::Default) {
2364 Ok(ConversionResult::Success(value)) => value,
2365 Ok(ConversionResult::Failure(error)) => {
2366 throw_type_error(cx.raw_cx(), &error);
2367 return false;
2368
2369 }
2370 _ => {
2371 return false;
2372
2373 },
2374 }
2375
2376 };
2377 let arg2: DOMString = if args.get(2).is_undefined() {
2378 DOMString::from("")
2379 } else {
2380 match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(2)), StringificationBehavior::Default) {
2381 Ok(ConversionResult::Success(value)) => value,
2382 Ok(ConversionResult::Failure(error)) => {
2383 throw_type_error(cx.raw_cx(), &error);
2384 return false;
2385
2386 }
2387 _ => {
2388 return false;
2389
2390 },
2391 }
2392
2393 };
2394 let result: DomRoot<D::TextTrack> = this.AddTextTrack(arg0, arg1, arg2, CanGc::note());
2395
2396 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
2397 return true;
2398 })());
2399 result
2400}
2401
2402
2403static addTextTrack_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
2404
2405pub(crate) fn init_addTextTrack_methodinfo<D: DomTypes>() {
2406 addTextTrack_methodinfo.set(JSJitInfo {
2407 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
2408 method: Some(addTextTrack::<D>)
2409 },
2410 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
2411 protoID: PrototypeList::ID::HTMLMediaElement as u16,
2412 },
2413 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
2414 _bitfield_align_1: [],
2415 _bitfield_1: __BindgenBitfieldUnit::new(
2416 new_jsjitinfo_bitfield_1!(
2417 JSJitInfo_OpType::Method as u8,
2418 JSJitInfo_AliasSet::AliasEverything as u8,
2419 JSValueType::JSVAL_TYPE_OBJECT as u8,
2420 false,
2421 false,
2422 false,
2423 false,
2424 false,
2425 false,
2426 0,
2427 ).to_ne_bytes()
2428 ),
2429});
2430}
2431pub mod HTMLMediaElementConstants {
2432 pub const NETWORK_EMPTY: u16 = 0;
2433 pub const NETWORK_IDLE: u16 = 1;
2434 pub const NETWORK_LOADING: u16 = 2;
2435 pub const NETWORK_NO_SOURCE: u16 = 3;
2436 pub const HAVE_NOTHING: u16 = 0;
2437 pub const HAVE_METADATA: u16 = 1;
2438 pub const HAVE_CURRENT_DATA: u16 = 2;
2439 pub const HAVE_FUTURE_DATA: u16 = 3;
2440 pub const HAVE_ENOUGH_DATA: u16 = 4;
2441} pub trait HTMLMediaElementMethods<D: DomTypes> {
2443 fn GetError(&self, ) -> Option<DomRoot<D::MediaError>>;
2444 fn Src(&self, ) -> USVString;
2445 fn SetSrc(&self, r#value: USVString);
2446 fn GetSrcObject(&self, ) -> Option<GenericUnionTypes::MediaStreamOrBlob::<D>>;
2447 fn SetSrcObject(&self, r#value: Option<GenericUnionTypes::MediaStreamOrBlob::<D> >, r#_can_gc: CanGc);
2448 fn CurrentSrc(&self, ) -> USVString;
2449 fn GetCrossOrigin(&self, ) -> Option<DOMString>;
2450 fn SetCrossOrigin(&self, r#value: Option<DOMString>, r#_can_gc: CanGc);
2451 fn NetworkState(&self, ) -> u16;
2452 fn Preload(&self, ) -> DOMString;
2453 fn SetPreload(&self, r#value: DOMString);
2454 fn Buffered(&self, r#_can_gc: CanGc) -> DomRoot<D::TimeRanges>;
2455 fn Load(&self, r#_can_gc: CanGc);
2456 fn CanPlayType(&self, r#type_: DOMString) -> CanPlayTypeResult;
2457 fn ReadyState(&self, ) -> u16;
2458 fn Seeking(&self, ) -> bool;
2459 fn CurrentTime(&self, ) -> Finite<f64>;
2460 fn SetCurrentTime(&self, r#value: Finite<f64>);
2461 fn FastSeek(&self, r#time: Finite<f64>);
2462 fn Duration(&self, ) -> f64;
2463 fn Paused(&self, ) -> bool;
2464 fn GetDefaultPlaybackRate(&self, ) -> Fallible<Finite<f64>>;
2465 fn SetDefaultPlaybackRate(&self, r#value: Finite<f64>) -> ErrorResult;
2466 fn GetPlaybackRate(&self, ) -> Fallible<Finite<f64>>;
2467 fn SetPlaybackRate(&self, r#value: Finite<f64>) -> ErrorResult;
2468 fn Played(&self, r#_can_gc: CanGc) -> DomRoot<D::TimeRanges>;
2469 fn Seekable(&self, r#_can_gc: CanGc) -> DomRoot<D::TimeRanges>;
2470 fn Ended(&self, ) -> bool;
2471 fn Autoplay(&self, ) -> bool;
2472 fn SetAutoplay(&self, r#value: bool);
2473 fn Loop(&self, ) -> bool;
2474 fn SetLoop(&self, r#value: bool);
2475 fn Play(&self, r#_comp: InRealm, r#_can_gc: CanGc) -> Rc<D::Promise>;
2476 fn Pause(&self, r#_can_gc: CanGc);
2477 fn Controls(&self, ) -> bool;
2478 fn SetControls(&self, r#value: bool);
2479 fn GetVolume(&self, ) -> Fallible<Finite<f64>>;
2480 fn SetVolume(&self, r#value: Finite<f64>) -> ErrorResult;
2481 fn Muted(&self, ) -> bool;
2482 fn SetMuted(&self, r#value: bool);
2483 fn DefaultMuted(&self, ) -> bool;
2484 fn SetDefaultMuted(&self, r#value: bool);
2485 fn AudioTracks(&self, r#_can_gc: CanGc) -> DomRoot<D::AudioTrackList>;
2486 fn VideoTracks(&self, r#_can_gc: CanGc) -> DomRoot<D::VideoTrackList>;
2487 fn TextTracks(&self, r#_can_gc: CanGc) -> DomRoot<D::TextTrackList>;
2488 fn AddTextTrack(&self, r#kind: TextTrackKind, r#label: DOMString, r#language: DOMString, r#_can_gc: CanGc) -> DomRoot<D::TextTrack>;
2489}
2490static sMethods_specs: ThreadUnsafeOnceLock<&[&[JSFunctionSpec]]> = ThreadUnsafeOnceLock::new();
2491
2492pub(crate) fn init_sMethods_specs<D: DomTypes>() {
2493 sMethods_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
2494 JSFunctionSpec {
2495 name: JSPropertySpec_Name { string_: c"load".as_ptr() },
2496 call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { load_methodinfo.get() } as *const _ as *const JSJitInfo },
2497 nargs: 0,
2498 flags: (JSPROP_ENUMERATE) as u16,
2499 selfHostedName: ptr::null()
2500 },
2501 JSFunctionSpec {
2502 name: JSPropertySpec_Name { string_: c"canPlayType".as_ptr() },
2503 call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { canPlayType_methodinfo.get() } as *const _ as *const JSJitInfo },
2504 nargs: 1,
2505 flags: (JSPROP_ENUMERATE) as u16,
2506 selfHostedName: ptr::null()
2507 },
2508 JSFunctionSpec {
2509 name: JSPropertySpec_Name { string_: c"fastSeek".as_ptr() },
2510 call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { fastSeek_methodinfo.get() } as *const _ as *const JSJitInfo },
2511 nargs: 1,
2512 flags: (JSPROP_ENUMERATE) as u16,
2513 selfHostedName: ptr::null()
2514 },
2515 JSFunctionSpec {
2516 name: JSPropertySpec_Name { string_: c"play".as_ptr() },
2517 call: JSNativeWrapper { op: Some(generic_method::<true>), info: unsafe { play_methodinfo.get() } as *const _ as *const JSJitInfo },
2518 nargs: 0,
2519 flags: (JSPROP_ENUMERATE) as u16,
2520 selfHostedName: ptr::null()
2521 },
2522 JSFunctionSpec {
2523 name: JSPropertySpec_Name { string_: c"pause".as_ptr() },
2524 call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { pause_methodinfo.get() } as *const _ as *const JSJitInfo },
2525 nargs: 0,
2526 flags: (JSPROP_ENUMERATE) as u16,
2527 selfHostedName: ptr::null()
2528 },
2529 JSFunctionSpec {
2530 name: JSPropertySpec_Name { string_: c"addTextTrack".as_ptr() },
2531 call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { addTextTrack_methodinfo.get() } as *const _ as *const JSJitInfo },
2532 nargs: 1,
2533 flags: (JSPROP_ENUMERATE) as u16,
2534 selfHostedName: ptr::null()
2535 },
2536 JSFunctionSpec {
2537 name: JSPropertySpec_Name { string_: ptr::null() },
2538 call: JSNativeWrapper { op: None, info: ptr::null() },
2539 nargs: 0,
2540 flags: 0,
2541 selfHostedName: ptr::null()
2542 }]))[..]
2543])));
2544}static sMethods: ThreadUnsafeOnceLock<&[Guard<&[JSFunctionSpec]>]> = ThreadUnsafeOnceLock::new();
2545
2546pub(crate) fn init_sMethods_prefs<D: DomTypes>() {
2547 sMethods.set(Box::leak(Box::new([ Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sMethods_specs.get() })[0])])));
2548}static sAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
2549
2550pub(crate) fn init_sAttributes_specs<D: DomTypes>() {
2551 sAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
2552 JSPropertySpec {
2553 name: JSPropertySpec_Name { string_: c"error".as_ptr() },
2554 attributes_: (JSPROP_ENUMERATE),
2555 kind_: (JSPropertySpec_Kind::NativeAccessor),
2556 u: JSPropertySpec_AccessorsOrValue {
2557 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2558 getter: JSPropertySpec_Accessor {
2559 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { error_getterinfo.get() } },
2560 },
2561 setter: JSPropertySpec_Accessor {
2562 native: JSNativeWrapper { op: None, info: ptr::null() },
2563 }
2564 }
2565 }
2566 }
2567,
2568 JSPropertySpec {
2569 name: JSPropertySpec_Name { string_: c"src".as_ptr() },
2570 attributes_: (JSPROP_ENUMERATE),
2571 kind_: (JSPropertySpec_Kind::NativeAccessor),
2572 u: JSPropertySpec_AccessorsOrValue {
2573 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2574 getter: JSPropertySpec_Accessor {
2575 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { src_getterinfo.get() } },
2576 },
2577 setter: JSPropertySpec_Accessor {
2578 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { src_setterinfo.get() } },
2579 }
2580 }
2581 }
2582 }
2583,
2584 JSPropertySpec {
2585 name: JSPropertySpec_Name { string_: c"srcObject".as_ptr() },
2586 attributes_: (JSPROP_ENUMERATE),
2587 kind_: (JSPropertySpec_Kind::NativeAccessor),
2588 u: JSPropertySpec_AccessorsOrValue {
2589 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2590 getter: JSPropertySpec_Accessor {
2591 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { srcObject_getterinfo.get() } },
2592 },
2593 setter: JSPropertySpec_Accessor {
2594 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { srcObject_setterinfo.get() } },
2595 }
2596 }
2597 }
2598 }
2599,
2600 JSPropertySpec {
2601 name: JSPropertySpec_Name { string_: c"currentSrc".as_ptr() },
2602 attributes_: (JSPROP_ENUMERATE),
2603 kind_: (JSPropertySpec_Kind::NativeAccessor),
2604 u: JSPropertySpec_AccessorsOrValue {
2605 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2606 getter: JSPropertySpec_Accessor {
2607 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { currentSrc_getterinfo.get() } },
2608 },
2609 setter: JSPropertySpec_Accessor {
2610 native: JSNativeWrapper { op: None, info: ptr::null() },
2611 }
2612 }
2613 }
2614 }
2615,
2616 JSPropertySpec {
2617 name: JSPropertySpec_Name { string_: c"crossOrigin".as_ptr() },
2618 attributes_: (JSPROP_ENUMERATE),
2619 kind_: (JSPropertySpec_Kind::NativeAccessor),
2620 u: JSPropertySpec_AccessorsOrValue {
2621 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2622 getter: JSPropertySpec_Accessor {
2623 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { crossOrigin_getterinfo.get() } },
2624 },
2625 setter: JSPropertySpec_Accessor {
2626 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { crossOrigin_setterinfo.get() } },
2627 }
2628 }
2629 }
2630 }
2631,
2632 JSPropertySpec {
2633 name: JSPropertySpec_Name { string_: c"networkState".as_ptr() },
2634 attributes_: (JSPROP_ENUMERATE),
2635 kind_: (JSPropertySpec_Kind::NativeAccessor),
2636 u: JSPropertySpec_AccessorsOrValue {
2637 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2638 getter: JSPropertySpec_Accessor {
2639 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { networkState_getterinfo.get() } },
2640 },
2641 setter: JSPropertySpec_Accessor {
2642 native: JSNativeWrapper { op: None, info: ptr::null() },
2643 }
2644 }
2645 }
2646 }
2647,
2648 JSPropertySpec {
2649 name: JSPropertySpec_Name { string_: c"preload".as_ptr() },
2650 attributes_: (JSPROP_ENUMERATE),
2651 kind_: (JSPropertySpec_Kind::NativeAccessor),
2652 u: JSPropertySpec_AccessorsOrValue {
2653 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2654 getter: JSPropertySpec_Accessor {
2655 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { preload_getterinfo.get() } },
2656 },
2657 setter: JSPropertySpec_Accessor {
2658 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { preload_setterinfo.get() } },
2659 }
2660 }
2661 }
2662 }
2663,
2664 JSPropertySpec {
2665 name: JSPropertySpec_Name { string_: c"buffered".as_ptr() },
2666 attributes_: (JSPROP_ENUMERATE),
2667 kind_: (JSPropertySpec_Kind::NativeAccessor),
2668 u: JSPropertySpec_AccessorsOrValue {
2669 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2670 getter: JSPropertySpec_Accessor {
2671 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { buffered_getterinfo.get() } },
2672 },
2673 setter: JSPropertySpec_Accessor {
2674 native: JSNativeWrapper { op: None, info: ptr::null() },
2675 }
2676 }
2677 }
2678 }
2679,
2680 JSPropertySpec {
2681 name: JSPropertySpec_Name { string_: c"readyState".as_ptr() },
2682 attributes_: (JSPROP_ENUMERATE),
2683 kind_: (JSPropertySpec_Kind::NativeAccessor),
2684 u: JSPropertySpec_AccessorsOrValue {
2685 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2686 getter: JSPropertySpec_Accessor {
2687 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { readyState_getterinfo.get() } },
2688 },
2689 setter: JSPropertySpec_Accessor {
2690 native: JSNativeWrapper { op: None, info: ptr::null() },
2691 }
2692 }
2693 }
2694 }
2695,
2696 JSPropertySpec {
2697 name: JSPropertySpec_Name { string_: c"seeking".as_ptr() },
2698 attributes_: (JSPROP_ENUMERATE),
2699 kind_: (JSPropertySpec_Kind::NativeAccessor),
2700 u: JSPropertySpec_AccessorsOrValue {
2701 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2702 getter: JSPropertySpec_Accessor {
2703 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { seeking_getterinfo.get() } },
2704 },
2705 setter: JSPropertySpec_Accessor {
2706 native: JSNativeWrapper { op: None, info: ptr::null() },
2707 }
2708 }
2709 }
2710 }
2711,
2712 JSPropertySpec {
2713 name: JSPropertySpec_Name { string_: c"currentTime".as_ptr() },
2714 attributes_: (JSPROP_ENUMERATE),
2715 kind_: (JSPropertySpec_Kind::NativeAccessor),
2716 u: JSPropertySpec_AccessorsOrValue {
2717 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2718 getter: JSPropertySpec_Accessor {
2719 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { currentTime_getterinfo.get() } },
2720 },
2721 setter: JSPropertySpec_Accessor {
2722 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { currentTime_setterinfo.get() } },
2723 }
2724 }
2725 }
2726 }
2727,
2728 JSPropertySpec {
2729 name: JSPropertySpec_Name { string_: c"duration".as_ptr() },
2730 attributes_: (JSPROP_ENUMERATE),
2731 kind_: (JSPropertySpec_Kind::NativeAccessor),
2732 u: JSPropertySpec_AccessorsOrValue {
2733 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2734 getter: JSPropertySpec_Accessor {
2735 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { duration_getterinfo.get() } },
2736 },
2737 setter: JSPropertySpec_Accessor {
2738 native: JSNativeWrapper { op: None, info: ptr::null() },
2739 }
2740 }
2741 }
2742 }
2743,
2744 JSPropertySpec {
2745 name: JSPropertySpec_Name { string_: c"paused".as_ptr() },
2746 attributes_: (JSPROP_ENUMERATE),
2747 kind_: (JSPropertySpec_Kind::NativeAccessor),
2748 u: JSPropertySpec_AccessorsOrValue {
2749 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2750 getter: JSPropertySpec_Accessor {
2751 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { paused_getterinfo.get() } },
2752 },
2753 setter: JSPropertySpec_Accessor {
2754 native: JSNativeWrapper { op: None, info: ptr::null() },
2755 }
2756 }
2757 }
2758 }
2759,
2760 JSPropertySpec {
2761 name: JSPropertySpec_Name { string_: c"defaultPlaybackRate".as_ptr() },
2762 attributes_: (JSPROP_ENUMERATE),
2763 kind_: (JSPropertySpec_Kind::NativeAccessor),
2764 u: JSPropertySpec_AccessorsOrValue {
2765 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2766 getter: JSPropertySpec_Accessor {
2767 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { defaultPlaybackRate_getterinfo.get() } },
2768 },
2769 setter: JSPropertySpec_Accessor {
2770 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { defaultPlaybackRate_setterinfo.get() } },
2771 }
2772 }
2773 }
2774 }
2775,
2776 JSPropertySpec {
2777 name: JSPropertySpec_Name { string_: c"playbackRate".as_ptr() },
2778 attributes_: (JSPROP_ENUMERATE),
2779 kind_: (JSPropertySpec_Kind::NativeAccessor),
2780 u: JSPropertySpec_AccessorsOrValue {
2781 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2782 getter: JSPropertySpec_Accessor {
2783 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { playbackRate_getterinfo.get() } },
2784 },
2785 setter: JSPropertySpec_Accessor {
2786 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { playbackRate_setterinfo.get() } },
2787 }
2788 }
2789 }
2790 }
2791,
2792 JSPropertySpec {
2793 name: JSPropertySpec_Name { string_: c"played".as_ptr() },
2794 attributes_: (JSPROP_ENUMERATE),
2795 kind_: (JSPropertySpec_Kind::NativeAccessor),
2796 u: JSPropertySpec_AccessorsOrValue {
2797 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2798 getter: JSPropertySpec_Accessor {
2799 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { played_getterinfo.get() } },
2800 },
2801 setter: JSPropertySpec_Accessor {
2802 native: JSNativeWrapper { op: None, info: ptr::null() },
2803 }
2804 }
2805 }
2806 }
2807,
2808 JSPropertySpec {
2809 name: JSPropertySpec_Name { string_: c"seekable".as_ptr() },
2810 attributes_: (JSPROP_ENUMERATE),
2811 kind_: (JSPropertySpec_Kind::NativeAccessor),
2812 u: JSPropertySpec_AccessorsOrValue {
2813 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2814 getter: JSPropertySpec_Accessor {
2815 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { seekable_getterinfo.get() } },
2816 },
2817 setter: JSPropertySpec_Accessor {
2818 native: JSNativeWrapper { op: None, info: ptr::null() },
2819 }
2820 }
2821 }
2822 }
2823,
2824 JSPropertySpec {
2825 name: JSPropertySpec_Name { string_: c"ended".as_ptr() },
2826 attributes_: (JSPROP_ENUMERATE),
2827 kind_: (JSPropertySpec_Kind::NativeAccessor),
2828 u: JSPropertySpec_AccessorsOrValue {
2829 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2830 getter: JSPropertySpec_Accessor {
2831 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { ended_getterinfo.get() } },
2832 },
2833 setter: JSPropertySpec_Accessor {
2834 native: JSNativeWrapper { op: None, info: ptr::null() },
2835 }
2836 }
2837 }
2838 }
2839,
2840 JSPropertySpec {
2841 name: JSPropertySpec_Name { string_: c"autoplay".as_ptr() },
2842 attributes_: (JSPROP_ENUMERATE),
2843 kind_: (JSPropertySpec_Kind::NativeAccessor),
2844 u: JSPropertySpec_AccessorsOrValue {
2845 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2846 getter: JSPropertySpec_Accessor {
2847 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { autoplay_getterinfo.get() } },
2848 },
2849 setter: JSPropertySpec_Accessor {
2850 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { autoplay_setterinfo.get() } },
2851 }
2852 }
2853 }
2854 }
2855,
2856 JSPropertySpec {
2857 name: JSPropertySpec_Name { string_: c"loop".as_ptr() },
2858 attributes_: (JSPROP_ENUMERATE),
2859 kind_: (JSPropertySpec_Kind::NativeAccessor),
2860 u: JSPropertySpec_AccessorsOrValue {
2861 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2862 getter: JSPropertySpec_Accessor {
2863 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { loop_getterinfo.get() } },
2864 },
2865 setter: JSPropertySpec_Accessor {
2866 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { loop_setterinfo.get() } },
2867 }
2868 }
2869 }
2870 }
2871,
2872 JSPropertySpec {
2873 name: JSPropertySpec_Name { string_: c"controls".as_ptr() },
2874 attributes_: (JSPROP_ENUMERATE),
2875 kind_: (JSPropertySpec_Kind::NativeAccessor),
2876 u: JSPropertySpec_AccessorsOrValue {
2877 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2878 getter: JSPropertySpec_Accessor {
2879 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { controls_getterinfo.get() } },
2880 },
2881 setter: JSPropertySpec_Accessor {
2882 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { controls_setterinfo.get() } },
2883 }
2884 }
2885 }
2886 }
2887,
2888 JSPropertySpec {
2889 name: JSPropertySpec_Name { string_: c"volume".as_ptr() },
2890 attributes_: (JSPROP_ENUMERATE),
2891 kind_: (JSPropertySpec_Kind::NativeAccessor),
2892 u: JSPropertySpec_AccessorsOrValue {
2893 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2894 getter: JSPropertySpec_Accessor {
2895 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { volume_getterinfo.get() } },
2896 },
2897 setter: JSPropertySpec_Accessor {
2898 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { volume_setterinfo.get() } },
2899 }
2900 }
2901 }
2902 }
2903,
2904 JSPropertySpec {
2905 name: JSPropertySpec_Name { string_: c"muted".as_ptr() },
2906 attributes_: (JSPROP_ENUMERATE),
2907 kind_: (JSPropertySpec_Kind::NativeAccessor),
2908 u: JSPropertySpec_AccessorsOrValue {
2909 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2910 getter: JSPropertySpec_Accessor {
2911 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { muted_getterinfo.get() } },
2912 },
2913 setter: JSPropertySpec_Accessor {
2914 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { muted_setterinfo.get() } },
2915 }
2916 }
2917 }
2918 }
2919,
2920 JSPropertySpec {
2921 name: JSPropertySpec_Name { string_: c"defaultMuted".as_ptr() },
2922 attributes_: (JSPROP_ENUMERATE),
2923 kind_: (JSPropertySpec_Kind::NativeAccessor),
2924 u: JSPropertySpec_AccessorsOrValue {
2925 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2926 getter: JSPropertySpec_Accessor {
2927 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { defaultMuted_getterinfo.get() } },
2928 },
2929 setter: JSPropertySpec_Accessor {
2930 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { defaultMuted_setterinfo.get() } },
2931 }
2932 }
2933 }
2934 }
2935,
2936 JSPropertySpec {
2937 name: JSPropertySpec_Name { string_: c"audioTracks".as_ptr() },
2938 attributes_: (JSPROP_ENUMERATE),
2939 kind_: (JSPropertySpec_Kind::NativeAccessor),
2940 u: JSPropertySpec_AccessorsOrValue {
2941 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2942 getter: JSPropertySpec_Accessor {
2943 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { audioTracks_getterinfo.get() } },
2944 },
2945 setter: JSPropertySpec_Accessor {
2946 native: JSNativeWrapper { op: None, info: ptr::null() },
2947 }
2948 }
2949 }
2950 }
2951,
2952 JSPropertySpec {
2953 name: JSPropertySpec_Name { string_: c"videoTracks".as_ptr() },
2954 attributes_: (JSPROP_ENUMERATE),
2955 kind_: (JSPropertySpec_Kind::NativeAccessor),
2956 u: JSPropertySpec_AccessorsOrValue {
2957 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2958 getter: JSPropertySpec_Accessor {
2959 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { videoTracks_getterinfo.get() } },
2960 },
2961 setter: JSPropertySpec_Accessor {
2962 native: JSNativeWrapper { op: None, info: ptr::null() },
2963 }
2964 }
2965 }
2966 }
2967,
2968 JSPropertySpec {
2969 name: JSPropertySpec_Name { string_: c"textTracks".as_ptr() },
2970 attributes_: (JSPROP_ENUMERATE),
2971 kind_: (JSPropertySpec_Kind::NativeAccessor),
2972 u: JSPropertySpec_AccessorsOrValue {
2973 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2974 getter: JSPropertySpec_Accessor {
2975 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { textTracks_getterinfo.get() } },
2976 },
2977 setter: JSPropertySpec_Accessor {
2978 native: JSNativeWrapper { op: None, info: ptr::null() },
2979 }
2980 }
2981 }
2982 }
2983,
2984 JSPropertySpec::ZERO]))[..]
2985,
2986&Box::leak(Box::new([
2987 JSPropertySpec {
2988 name: JSPropertySpec_Name { symbol_: SymbolCode::toStringTag as usize + 1 },
2989 attributes_: (JSPROP_READONLY),
2990 kind_: (JSPropertySpec_Kind::Value),
2991 u: JSPropertySpec_AccessorsOrValue {
2992 value: JSPropertySpec_ValueWrapper {
2993 type_: JSPropertySpec_ValueWrapper_Type::String,
2994 __bindgen_anon_1: JSPropertySpec_ValueWrapper__bindgen_ty_1 {
2995 string: c"HTMLMediaElement".as_ptr(),
2996 }
2997 }
2998 }
2999 }
3000,
3001 JSPropertySpec::ZERO]))[..]
3002])));
3003}static sAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
3004
3005pub(crate) fn init_sAttributes_prefs<D: DomTypes>() {
3006 sAttributes.set(Box::leak(Box::new([ Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sAttributes_specs.get() })[0]),
3007 Guard::new(&[Condition::Satisfied], (unsafe { sAttributes_specs.get() })[1])])));
3008}static sConstants_specs: ThreadUnsafeOnceLock<&[&[ConstantSpec]]> = ThreadUnsafeOnceLock::new();
3009
3010pub(crate) fn init_sConstants_specs<D: DomTypes>() {
3011 sConstants_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
3012 ConstantSpec { name: c"NETWORK_EMPTY", value: ConstantVal::Int(0) },
3013 ConstantSpec { name: c"NETWORK_IDLE", value: ConstantVal::Int(1) },
3014 ConstantSpec { name: c"NETWORK_LOADING", value: ConstantVal::Int(2) },
3015 ConstantSpec { name: c"NETWORK_NO_SOURCE", value: ConstantVal::Int(3) },
3016 ConstantSpec { name: c"HAVE_NOTHING", value: ConstantVal::Int(0) },
3017 ConstantSpec { name: c"HAVE_METADATA", value: ConstantVal::Int(1) },
3018 ConstantSpec { name: c"HAVE_CURRENT_DATA", value: ConstantVal::Int(2) },
3019 ConstantSpec { name: c"HAVE_FUTURE_DATA", value: ConstantVal::Int(3) },
3020 ConstantSpec { name: c"HAVE_ENOUGH_DATA", value: ConstantVal::Int(4) }]))[..]
3021])));
3022}static sConstants: ThreadUnsafeOnceLock<&[Guard<&[ConstantSpec]>]> = ThreadUnsafeOnceLock::new();
3023
3024pub(crate) fn init_sConstants_prefs<D: DomTypes>() {
3025 sConstants.set(Box::leak(Box::new([ Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sConstants_specs.get() })[0])])));
3026}
3027pub fn GetProtoObject<D: DomTypes>
3028(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
3029 get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::HTMLMediaElement), CreateInterfaceObjects::<D>, rval)
3031}
3032
3033
3034static PrototypeClass: JSClass = JSClass {
3035 name: c"HTMLMediaElementPrototype".as_ptr(),
3036 flags:
3037 (0 ) << JSCLASS_RESERVED_SLOTS_SHIFT,
3039 cOps: ptr::null(),
3040 spec: ptr::null(),
3041 ext: ptr::null(),
3042 oOps: ptr::null(),
3043};
3044
3045
3046static INTERFACE_OBJECT_CLASS: ThreadUnsafeOnceLock<NonCallbackInterfaceObjectClass> = ThreadUnsafeOnceLock::new();
3047
3048pub(crate) fn init_interface_object<D: DomTypes>() {
3049 INTERFACE_OBJECT_CLASS.set(NonCallbackInterfaceObjectClass::new(
3050 Box::leak(Box::new(InterfaceConstructorBehavior::throw())),
3051 b"function HTMLMediaElement() {\n [native code]\n}",
3052 PrototypeList::ID::HTMLMediaElement,
3053 4,
3054 ));
3055}
3056
3057pub fn GetConstructorObject<D: DomTypes>
3058(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
3059 get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::Constructor(PrototypeList::Constructor::HTMLMediaElement), CreateInterfaceObjects::<D>, rval)
3061}
3062
3063pub fn DefineDOMInterface<D: DomTypes>
3064(cx: SafeJSContext, global: HandleObject){
3065 define_dom_interface(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::HTMLMediaElement),CreateInterfaceObjects::<D>, ConstructorEnabled::<D>)
3066}
3067
3068pub fn ConstructorEnabled<D: DomTypes>
3069(aCx: SafeJSContext, aObj: HandleObject) -> bool{
3070 is_exposed_in(aObj, Globals::WINDOW)
3071}
3072
3073unsafe fn CreateInterfaceObjects<D: DomTypes>
3074(cx: SafeJSContext, global: HandleObject, cache: *mut ProtoOrIfaceArray){
3075
3076 rooted!(&in(cx) let mut prototype_proto = ptr::null_mut::<JSObject>());
3077 HTMLElement_Binding::GetProtoObject::<D>(cx, global, prototype_proto.handle_mut());
3078 assert!(!prototype_proto.is_null());
3079
3080 rooted!(&in(cx) let mut prototype = ptr::null_mut::<JSObject>());
3081 create_interface_prototype_object::<D>(cx,
3082 global,
3083 prototype_proto.handle(),
3084 &PrototypeClass,
3085 sMethods.get(),
3086 sAttributes.get(),
3087 sConstants.get(),
3088 &[],
3089 prototype.handle_mut());
3090 assert!(!prototype.is_null());
3091 assert!((*cache)[PrototypeList::ID::HTMLMediaElement as usize].is_null());
3092 (*cache)[PrototypeList::ID::HTMLMediaElement as usize] = prototype.get();
3093 <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::HTMLMediaElement as isize),
3094 ptr::null_mut(),
3095 prototype.get());
3096
3097 rooted!(&in(cx) let mut interface_proto = ptr::null_mut::<JSObject>());
3098
3099 HTMLElement_Binding::GetConstructorObject::<D>(cx, global, interface_proto.handle_mut());
3100
3101 assert!(!interface_proto.is_null());
3102
3103 rooted!(&in(cx) let mut interface = ptr::null_mut::<JSObject>());
3104 create_noncallback_interface_object::<D>(cx,
3105 global,
3106 interface_proto.handle(),
3107 INTERFACE_OBJECT_CLASS.get(),
3108 &[],
3109 &[],
3110 sConstants.get(),
3111 prototype.handle(),
3112 c"HTMLMediaElement",
3113 0,
3114 &[],
3115 interface.handle_mut());
3116 assert!(!interface.is_null());
3117
3118 assert!((*cache)[PrototypeList::Constructor::HTMLMediaElement as usize].is_null());
3119 (*cache)[PrototypeList::Constructor::HTMLMediaElement as usize] = interface.get();
3120 <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::Constructor::HTMLMediaElement as isize),
3121 ptr::null_mut(),
3122 interface.get());
3123
3124}
3125
3126
3127 pub(crate) fn init_statics<D: DomTypes>() {
3128 init_interface_object::<D>();
3129
3130 crate::codegen::GenericBindings::HTMLMediaElementBinding::HTMLMediaElement_Binding::init_load_methodinfo::<D>();
3131crate::codegen::GenericBindings::HTMLMediaElementBinding::HTMLMediaElement_Binding::init_canPlayType_methodinfo::<D>();
3132crate::codegen::GenericBindings::HTMLMediaElementBinding::HTMLMediaElement_Binding::init_fastSeek_methodinfo::<D>();
3133crate::codegen::GenericBindings::HTMLMediaElementBinding::HTMLMediaElement_Binding::init_play_methodinfo::<D>();
3134crate::codegen::GenericBindings::HTMLMediaElementBinding::HTMLMediaElement_Binding::init_pause_methodinfo::<D>();
3135crate::codegen::GenericBindings::HTMLMediaElementBinding::HTMLMediaElement_Binding::init_addTextTrack_methodinfo::<D>();
3136 init_error_getterinfo::<D>();
3137init_src_getterinfo::<D>();
3138init_srcObject_getterinfo::<D>();
3139init_currentSrc_getterinfo::<D>();
3140init_crossOrigin_getterinfo::<D>();
3141init_networkState_getterinfo::<D>();
3142init_preload_getterinfo::<D>();
3143init_buffered_getterinfo::<D>();
3144init_readyState_getterinfo::<D>();
3145init_seeking_getterinfo::<D>();
3146init_currentTime_getterinfo::<D>();
3147init_duration_getterinfo::<D>();
3148init_paused_getterinfo::<D>();
3149init_defaultPlaybackRate_getterinfo::<D>();
3150init_playbackRate_getterinfo::<D>();
3151init_played_getterinfo::<D>();
3152init_seekable_getterinfo::<D>();
3153init_ended_getterinfo::<D>();
3154init_autoplay_getterinfo::<D>();
3155init_loop_getterinfo::<D>();
3156init_controls_getterinfo::<D>();
3157init_volume_getterinfo::<D>();
3158init_muted_getterinfo::<D>();
3159init_defaultMuted_getterinfo::<D>();
3160init_audioTracks_getterinfo::<D>();
3161init_videoTracks_getterinfo::<D>();
3162init_textTracks_getterinfo::<D>();
3163 init_src_setterinfo::<D>();
3164init_srcObject_setterinfo::<D>();
3165init_crossOrigin_setterinfo::<D>();
3166init_preload_setterinfo::<D>();
3167init_currentTime_setterinfo::<D>();
3168init_defaultPlaybackRate_setterinfo::<D>();
3169init_playbackRate_setterinfo::<D>();
3170init_autoplay_setterinfo::<D>();
3171init_loop_setterinfo::<D>();
3172init_controls_setterinfo::<D>();
3173init_volume_setterinfo::<D>();
3174init_muted_setterinfo::<D>();
3175init_defaultMuted_setterinfo::<D>();
3176
3177 init_sMethods_specs::<D>();
3178init_sMethods_prefs::<D>();
3179init_sAttributes_specs::<D>();
3180init_sAttributes_prefs::<D>();
3181init_sConstants_specs::<D>();
3182init_sConstants_prefs::<D>();
3183 }
3184 }