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

1/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */
2
3#![allow(non_camel_case_types,non_upper_case_globals,unsafe_op_in_unsafe_fn,unused_imports,unused_variables,unused_assignments,unused_mut,clippy::approx_constant,clippy::enum_variant_names,clippy::let_unit_value,clippy::needless_return,clippy::too_many_arguments,clippy::unnecessary_cast,clippy::upper_case_acronyms)]
4
5use crate::codegen::GenericBindings::ElementBinding::Element_Binding;
6use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
7use crate::codegen::GenericBindings::HTMLCollectionBinding::HTMLCollection_Binding;
8use crate::codegen::GenericBindings::HTMLElementBinding::HTMLElement_Binding;
9use crate::codegen::GenericBindings::NodeBinding::Node_Binding;
10use crate::codegen::GenericBindings::NodeListBinding::NodeList_Binding;
11use crate::import::base::*;
12
13
14#[repr(usize)]
15#[derive(Copy, Clone, Debug, JSTraceable, MallocSizeOf, PartialEq)]
16pub enum SelectionMode {
17    Preserve,
18    Select,
19    Start,
20    End
21}
22pub mod SelectionModeValues {
23
24    use crate::utils::find_enum_value;
25    use js::conversions::ConversionResult;
26    use js::conversions::FromJSValConvertible;
27    use js::conversions::ToJSValConvertible;
28    use js::context::RawJSContext;
29    use js::rust::HandleValue;
30    use js::rust::MutableHandleValue;
31    use js::jsval::JSVal;
32
33    pub(crate) const pairs: &[(&str, super::SelectionMode)] = &[
34        ("preserve", super::SelectionMode::Preserve),
35        ("select", super::SelectionMode::Select),
36        ("start", super::SelectionMode::Start),
37        ("end", super::SelectionMode::End),
38    ];
39
40    impl super::SelectionMode {
41        pub fn as_str(&self) -> &'static str {
42            pairs[*self as usize].0
43        }
44    }
45
46    impl Default for super::SelectionMode {
47        fn default() -> super::SelectionMode {
48            pairs[0].1
49        }
50    }
51
52    impl std::str::FromStr for super::SelectionMode {
53        type Err = ();
54
55        fn from_str(s: &str) -> Result<Self, Self::Err> {
56            pairs
57                .iter()
58                .find(|&&(key, _)| s == key)
59                .map(|&(_, ev)| ev)
60                .ok_or(())
61        }
62    }
63
64    impl ToJSValConvertible for super::SelectionMode {
65        unsafe fn to_jsval(&self, cx: *mut RawJSContext, rval: MutableHandleValue) {
66            pairs[*self as usize].0.to_jsval(cx, rval);
67        }
68    }
69
70    impl FromJSValConvertible for super::SelectionMode {
71        type Config = ();
72        unsafe fn from_jsval(cx: *mut RawJSContext, value: HandleValue, _option: ())
73                             -> Result<ConversionResult<super::SelectionMode>, ()> {
74            match find_enum_value(cx, value, pairs) {
75                Err(_) => Err(()),
76                Ok((None, search)) => {
77                    Ok(ConversionResult::Failure(
78                        format!("'{}' is not a valid enum value for enumeration 'SelectionMode'.", search).into()
79                    ))
80                }
81                Ok((Some(&value), _)) => Ok(ConversionResult::Success(value)),
82            }
83        }
84    }
85        } // mod SelectionModeValues
86
87pub use self::HTMLFormElement_Binding::{Wrap, HTMLFormElementMethods, GetProtoObject, GetConstructorObject, DefineDOMInterface};
88pub mod HTMLFormElement_Binding {
89use crate::codegen::GenericBindings::ElementBinding::Element_Binding;
90use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
91use crate::codegen::GenericBindings::HTMLCollectionBinding::HTMLCollection_Binding;
92use crate::codegen::GenericBindings::HTMLElementBinding::HTMLElement_Binding;
93use crate::codegen::GenericBindings::NodeBinding::Node_Binding;
94use crate::codegen::GenericBindings::NodeListBinding::NodeList_Binding;
95use crate::import::module::*;
96
97unsafe extern "C" fn get_acceptCharset<D: DomTypes>
98(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
99    let mut result = false;
100    wrap_panic(&mut || result = (|| {
101        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
102        let this = &*(this as *const D::HTMLFormElement);
103        <D as DomHelpers<D>>::push_new_element_queue();
104
105        let result: DOMString = this.AcceptCharset();
106        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
107
108
109        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
110        return true;
111    })());
112    result
113}
114
115unsafe extern "C" fn set_acceptCharset<D: DomTypes>
116(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
117    let mut result = false;
118    wrap_panic(&mut || result = (|| {
119        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
120        let this = &*(this as *const D::HTMLFormElement);
121        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
122            Ok(ConversionResult::Success(value)) => value,
123            Ok(ConversionResult::Failure(error)) => {
124                throw_type_error(cx.raw_cx(), &error);
125        return false;
126
127            }
128            _ => {
129                return false;
130
131            },
132        }
133        ;
134        <D as DomHelpers<D>>::push_new_element_queue();
135
136        let result: () = this.SetAcceptCharset(arg0);
137        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
138
139
140        true
141    })());
142    result
143}
144
145
146static acceptCharset_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
147
148pub(crate) fn init_acceptCharset_getterinfo<D: DomTypes>() {
149    acceptCharset_getterinfo.set(JSJitInfo {
150    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
151        getter: Some(get_acceptCharset::<D>)
152    },
153    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
154        protoID: PrototypeList::ID::HTMLFormElement as u16,
155    },
156    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
157    _bitfield_align_1: [],
158    _bitfield_1: __BindgenBitfieldUnit::new(
159        new_jsjitinfo_bitfield_1!(
160            JSJitInfo_OpType::Getter as u8,
161            JSJitInfo_AliasSet::AliasEverything as u8,
162            JSValueType::JSVAL_TYPE_STRING as u8,
163            true,
164            false,
165            false,
166            false,
167            false,
168            false,
169            0,
170        ).to_ne_bytes()
171    ),
172});
173}
174static acceptCharset_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
175
176pub(crate) fn init_acceptCharset_setterinfo<D: DomTypes>() {
177    acceptCharset_setterinfo.set(JSJitInfo {
178    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
179        setter: Some(set_acceptCharset::<D>)
180    },
181    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
182        protoID: PrototypeList::ID::HTMLFormElement as u16,
183    },
184    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
185    _bitfield_align_1: [],
186    _bitfield_1: __BindgenBitfieldUnit::new(
187        new_jsjitinfo_bitfield_1!(
188            JSJitInfo_OpType::Setter as u8,
189            JSJitInfo_AliasSet::AliasEverything as u8,
190            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
191            false,
192            false,
193            false,
194            false,
195            false,
196            false,
197            0,
198        ).to_ne_bytes()
199    ),
200});
201}
202unsafe extern "C" fn get_action<D: DomTypes>
203(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
204    let mut result = false;
205    wrap_panic(&mut || result = (|| {
206        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
207        let this = &*(this as *const D::HTMLFormElement);
208        <D as DomHelpers<D>>::push_new_element_queue();
209
210        let result: DOMString = this.Action();
211        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
212
213
214        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
215        return true;
216    })());
217    result
218}
219
220unsafe extern "C" fn set_action<D: DomTypes>
221(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
222    let mut result = false;
223    wrap_panic(&mut || result = (|| {
224        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
225        let this = &*(this as *const D::HTMLFormElement);
226        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
227            Ok(ConversionResult::Success(value)) => value,
228            Ok(ConversionResult::Failure(error)) => {
229                throw_type_error(cx.raw_cx(), &error);
230        return false;
231
232            }
233            _ => {
234                return false;
235
236            },
237        }
238        ;
239        <D as DomHelpers<D>>::push_new_element_queue();
240
241        let result: () = this.SetAction(arg0);
242        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
243
244
245        true
246    })());
247    result
248}
249
250
251static action_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
252
253pub(crate) fn init_action_getterinfo<D: DomTypes>() {
254    action_getterinfo.set(JSJitInfo {
255    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
256        getter: Some(get_action::<D>)
257    },
258    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
259        protoID: PrototypeList::ID::HTMLFormElement as u16,
260    },
261    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
262    _bitfield_align_1: [],
263    _bitfield_1: __BindgenBitfieldUnit::new(
264        new_jsjitinfo_bitfield_1!(
265            JSJitInfo_OpType::Getter as u8,
266            JSJitInfo_AliasSet::AliasEverything as u8,
267            JSValueType::JSVAL_TYPE_STRING as u8,
268            true,
269            false,
270            false,
271            false,
272            false,
273            false,
274            0,
275        ).to_ne_bytes()
276    ),
277});
278}
279static action_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
280
281pub(crate) fn init_action_setterinfo<D: DomTypes>() {
282    action_setterinfo.set(JSJitInfo {
283    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
284        setter: Some(set_action::<D>)
285    },
286    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
287        protoID: PrototypeList::ID::HTMLFormElement as u16,
288    },
289    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
290    _bitfield_align_1: [],
291    _bitfield_1: __BindgenBitfieldUnit::new(
292        new_jsjitinfo_bitfield_1!(
293            JSJitInfo_OpType::Setter as u8,
294            JSJitInfo_AliasSet::AliasEverything as u8,
295            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
296            false,
297            false,
298            false,
299            false,
300            false,
301            false,
302            0,
303        ).to_ne_bytes()
304    ),
305});
306}
307unsafe extern "C" fn get_autocomplete<D: DomTypes>
308(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
309    let mut result = false;
310    wrap_panic(&mut || result = (|| {
311        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
312        let this = &*(this as *const D::HTMLFormElement);
313        <D as DomHelpers<D>>::push_new_element_queue();
314
315        let result: DOMString = this.Autocomplete();
316        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
317
318
319        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
320        return true;
321    })());
322    result
323}
324
325unsafe extern "C" fn set_autocomplete<D: DomTypes>
326(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
327    let mut result = false;
328    wrap_panic(&mut || result = (|| {
329        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
330        let this = &*(this as *const D::HTMLFormElement);
331        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
332            Ok(ConversionResult::Success(value)) => value,
333            Ok(ConversionResult::Failure(error)) => {
334                throw_type_error(cx.raw_cx(), &error);
335        return false;
336
337            }
338            _ => {
339                return false;
340
341            },
342        }
343        ;
344        <D as DomHelpers<D>>::push_new_element_queue();
345
346        let result: () = this.SetAutocomplete(arg0);
347        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
348
349
350        true
351    })());
352    result
353}
354
355
356static autocomplete_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
357
358pub(crate) fn init_autocomplete_getterinfo<D: DomTypes>() {
359    autocomplete_getterinfo.set(JSJitInfo {
360    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
361        getter: Some(get_autocomplete::<D>)
362    },
363    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
364        protoID: PrototypeList::ID::HTMLFormElement as u16,
365    },
366    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
367    _bitfield_align_1: [],
368    _bitfield_1: __BindgenBitfieldUnit::new(
369        new_jsjitinfo_bitfield_1!(
370            JSJitInfo_OpType::Getter as u8,
371            JSJitInfo_AliasSet::AliasEverything as u8,
372            JSValueType::JSVAL_TYPE_STRING as u8,
373            true,
374            false,
375            false,
376            false,
377            false,
378            false,
379            0,
380        ).to_ne_bytes()
381    ),
382});
383}
384static autocomplete_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
385
386pub(crate) fn init_autocomplete_setterinfo<D: DomTypes>() {
387    autocomplete_setterinfo.set(JSJitInfo {
388    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
389        setter: Some(set_autocomplete::<D>)
390    },
391    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
392        protoID: PrototypeList::ID::HTMLFormElement as u16,
393    },
394    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
395    _bitfield_align_1: [],
396    _bitfield_1: __BindgenBitfieldUnit::new(
397        new_jsjitinfo_bitfield_1!(
398            JSJitInfo_OpType::Setter as u8,
399            JSJitInfo_AliasSet::AliasEverything as u8,
400            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
401            false,
402            false,
403            false,
404            false,
405            false,
406            false,
407            0,
408        ).to_ne_bytes()
409    ),
410});
411}
412unsafe extern "C" fn get_enctype<D: DomTypes>
413(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
414    let mut result = false;
415    wrap_panic(&mut || result = (|| {
416        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
417        let this = &*(this as *const D::HTMLFormElement);
418        <D as DomHelpers<D>>::push_new_element_queue();
419
420        let result: DOMString = this.Enctype();
421        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
422
423
424        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
425        return true;
426    })());
427    result
428}
429
430unsafe extern "C" fn set_enctype<D: DomTypes>
431(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
432    let mut result = false;
433    wrap_panic(&mut || result = (|| {
434        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
435        let this = &*(this as *const D::HTMLFormElement);
436        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
437            Ok(ConversionResult::Success(value)) => value,
438            Ok(ConversionResult::Failure(error)) => {
439                throw_type_error(cx.raw_cx(), &error);
440        return false;
441
442            }
443            _ => {
444                return false;
445
446            },
447        }
448        ;
449        <D as DomHelpers<D>>::push_new_element_queue();
450
451        let result: () = this.SetEnctype(arg0);
452        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
453
454
455        true
456    })());
457    result
458}
459
460
461static enctype_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
462
463pub(crate) fn init_enctype_getterinfo<D: DomTypes>() {
464    enctype_getterinfo.set(JSJitInfo {
465    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
466        getter: Some(get_enctype::<D>)
467    },
468    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
469        protoID: PrototypeList::ID::HTMLFormElement as u16,
470    },
471    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
472    _bitfield_align_1: [],
473    _bitfield_1: __BindgenBitfieldUnit::new(
474        new_jsjitinfo_bitfield_1!(
475            JSJitInfo_OpType::Getter as u8,
476            JSJitInfo_AliasSet::AliasEverything as u8,
477            JSValueType::JSVAL_TYPE_STRING as u8,
478            true,
479            false,
480            false,
481            false,
482            false,
483            false,
484            0,
485        ).to_ne_bytes()
486    ),
487});
488}
489static enctype_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
490
491pub(crate) fn init_enctype_setterinfo<D: DomTypes>() {
492    enctype_setterinfo.set(JSJitInfo {
493    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
494        setter: Some(set_enctype::<D>)
495    },
496    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
497        protoID: PrototypeList::ID::HTMLFormElement as u16,
498    },
499    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
500    _bitfield_align_1: [],
501    _bitfield_1: __BindgenBitfieldUnit::new(
502        new_jsjitinfo_bitfield_1!(
503            JSJitInfo_OpType::Setter as u8,
504            JSJitInfo_AliasSet::AliasEverything as u8,
505            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
506            false,
507            false,
508            false,
509            false,
510            false,
511            false,
512            0,
513        ).to_ne_bytes()
514    ),
515});
516}
517unsafe extern "C" fn get_encoding<D: DomTypes>
518(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
519    let mut result = false;
520    wrap_panic(&mut || result = (|| {
521        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
522        let this = &*(this as *const D::HTMLFormElement);
523        <D as DomHelpers<D>>::push_new_element_queue();
524
525        let result: DOMString = this.Encoding();
526        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
527
528
529        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
530        return true;
531    })());
532    result
533}
534
535unsafe extern "C" fn set_encoding<D: DomTypes>
536(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> 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::HTMLFormElement);
541        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
542            Ok(ConversionResult::Success(value)) => value,
543            Ok(ConversionResult::Failure(error)) => {
544                throw_type_error(cx.raw_cx(), &error);
545        return false;
546
547            }
548            _ => {
549                return false;
550
551            },
552        }
553        ;
554        <D as DomHelpers<D>>::push_new_element_queue();
555
556        let result: () = this.SetEncoding(arg0);
557        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
558
559
560        true
561    })());
562    result
563}
564
565
566static encoding_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
567
568pub(crate) fn init_encoding_getterinfo<D: DomTypes>() {
569    encoding_getterinfo.set(JSJitInfo {
570    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
571        getter: Some(get_encoding::<D>)
572    },
573    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
574        protoID: PrototypeList::ID::HTMLFormElement as u16,
575    },
576    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
577    _bitfield_align_1: [],
578    _bitfield_1: __BindgenBitfieldUnit::new(
579        new_jsjitinfo_bitfield_1!(
580            JSJitInfo_OpType::Getter as u8,
581            JSJitInfo_AliasSet::AliasEverything as u8,
582            JSValueType::JSVAL_TYPE_STRING as u8,
583            true,
584            false,
585            false,
586            false,
587            false,
588            false,
589            0,
590        ).to_ne_bytes()
591    ),
592});
593}
594static encoding_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
595
596pub(crate) fn init_encoding_setterinfo<D: DomTypes>() {
597    encoding_setterinfo.set(JSJitInfo {
598    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
599        setter: Some(set_encoding::<D>)
600    },
601    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
602        protoID: PrototypeList::ID::HTMLFormElement as u16,
603    },
604    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
605    _bitfield_align_1: [],
606    _bitfield_1: __BindgenBitfieldUnit::new(
607        new_jsjitinfo_bitfield_1!(
608            JSJitInfo_OpType::Setter as u8,
609            JSJitInfo_AliasSet::AliasEverything as u8,
610            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
611            false,
612            false,
613            false,
614            false,
615            false,
616            false,
617            0,
618        ).to_ne_bytes()
619    ),
620});
621}
622unsafe extern "C" fn get_method<D: DomTypes>
623(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
624    let mut result = false;
625    wrap_panic(&mut || result = (|| {
626        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
627        let this = &*(this as *const D::HTMLFormElement);
628        <D as DomHelpers<D>>::push_new_element_queue();
629
630        let result: DOMString = this.Method();
631        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
632
633
634        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
635        return true;
636    })());
637    result
638}
639
640unsafe extern "C" fn set_method<D: DomTypes>
641(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> 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::HTMLFormElement);
646        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
647            Ok(ConversionResult::Success(value)) => value,
648            Ok(ConversionResult::Failure(error)) => {
649                throw_type_error(cx.raw_cx(), &error);
650        return false;
651
652            }
653            _ => {
654                return false;
655
656            },
657        }
658        ;
659        <D as DomHelpers<D>>::push_new_element_queue();
660
661        let result: () = this.SetMethod(arg0);
662        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
663
664
665        true
666    })());
667    result
668}
669
670
671static method_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
672
673pub(crate) fn init_method_getterinfo<D: DomTypes>() {
674    method_getterinfo.set(JSJitInfo {
675    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
676        getter: Some(get_method::<D>)
677    },
678    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
679        protoID: PrototypeList::ID::HTMLFormElement as u16,
680    },
681    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
682    _bitfield_align_1: [],
683    _bitfield_1: __BindgenBitfieldUnit::new(
684        new_jsjitinfo_bitfield_1!(
685            JSJitInfo_OpType::Getter as u8,
686            JSJitInfo_AliasSet::AliasEverything as u8,
687            JSValueType::JSVAL_TYPE_STRING as u8,
688            true,
689            false,
690            false,
691            false,
692            false,
693            false,
694            0,
695        ).to_ne_bytes()
696    ),
697});
698}
699static method_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
700
701pub(crate) fn init_method_setterinfo<D: DomTypes>() {
702    method_setterinfo.set(JSJitInfo {
703    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
704        setter: Some(set_method::<D>)
705    },
706    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
707        protoID: PrototypeList::ID::HTMLFormElement as u16,
708    },
709    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
710    _bitfield_align_1: [],
711    _bitfield_1: __BindgenBitfieldUnit::new(
712        new_jsjitinfo_bitfield_1!(
713            JSJitInfo_OpType::Setter as u8,
714            JSJitInfo_AliasSet::AliasEverything as u8,
715            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
716            false,
717            false,
718            false,
719            false,
720            false,
721            false,
722            0,
723        ).to_ne_bytes()
724    ),
725});
726}
727unsafe extern "C" fn get_name<D: DomTypes>
728(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
729    let mut result = false;
730    wrap_panic(&mut || result = (|| {
731        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
732        let this = &*(this as *const D::HTMLFormElement);
733        <D as DomHelpers<D>>::push_new_element_queue();
734
735        let result: DOMString = this.Name();
736        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
737
738
739        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
740        return true;
741    })());
742    result
743}
744
745unsafe extern "C" fn set_name<D: DomTypes>
746(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
747    let mut result = false;
748    wrap_panic(&mut || result = (|| {
749        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
750        let this = &*(this as *const D::HTMLFormElement);
751        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
752            Ok(ConversionResult::Success(value)) => value,
753            Ok(ConversionResult::Failure(error)) => {
754                throw_type_error(cx.raw_cx(), &error);
755        return false;
756
757            }
758            _ => {
759                return false;
760
761            },
762        }
763        ;
764        <D as DomHelpers<D>>::push_new_element_queue();
765
766        let result: () = this.SetName(arg0);
767        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
768
769
770        true
771    })());
772    result
773}
774
775
776static name_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
777
778pub(crate) fn init_name_getterinfo<D: DomTypes>() {
779    name_getterinfo.set(JSJitInfo {
780    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
781        getter: Some(get_name::<D>)
782    },
783    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
784        protoID: PrototypeList::ID::HTMLFormElement as u16,
785    },
786    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
787    _bitfield_align_1: [],
788    _bitfield_1: __BindgenBitfieldUnit::new(
789        new_jsjitinfo_bitfield_1!(
790            JSJitInfo_OpType::Getter as u8,
791            JSJitInfo_AliasSet::AliasEverything as u8,
792            JSValueType::JSVAL_TYPE_STRING as u8,
793            true,
794            false,
795            false,
796            false,
797            false,
798            false,
799            0,
800        ).to_ne_bytes()
801    ),
802});
803}
804static name_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
805
806pub(crate) fn init_name_setterinfo<D: DomTypes>() {
807    name_setterinfo.set(JSJitInfo {
808    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
809        setter: Some(set_name::<D>)
810    },
811    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
812        protoID: PrototypeList::ID::HTMLFormElement as u16,
813    },
814    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
815    _bitfield_align_1: [],
816    _bitfield_1: __BindgenBitfieldUnit::new(
817        new_jsjitinfo_bitfield_1!(
818            JSJitInfo_OpType::Setter as u8,
819            JSJitInfo_AliasSet::AliasEverything as u8,
820            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
821            false,
822            false,
823            false,
824            false,
825            false,
826            false,
827            0,
828        ).to_ne_bytes()
829    ),
830});
831}
832unsafe extern "C" fn get_noValidate<D: DomTypes>
833(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
834    let mut result = false;
835    wrap_panic(&mut || result = (|| {
836        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
837        let this = &*(this as *const D::HTMLFormElement);
838        <D as DomHelpers<D>>::push_new_element_queue();
839
840        let result: bool = this.NoValidate();
841        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
842
843
844        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
845        return true;
846    })());
847    result
848}
849
850unsafe extern "C" fn set_noValidate<D: DomTypes>
851(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
852    let mut result = false;
853    wrap_panic(&mut || result = (|| {
854        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
855        let this = &*(this as *const D::HTMLFormElement);
856        let arg0: bool = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
857            Ok(ConversionResult::Success(value)) => value,
858            Ok(ConversionResult::Failure(error)) => {
859                throw_type_error(cx.raw_cx(), &error);
860        return false;
861
862            }
863            _ => {
864                return false;
865
866            },
867        }
868        ;
869        <D as DomHelpers<D>>::push_new_element_queue();
870
871        let result: () = this.SetNoValidate(arg0);
872        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
873
874
875        true
876    })());
877    result
878}
879
880
881static noValidate_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
882
883pub(crate) fn init_noValidate_getterinfo<D: DomTypes>() {
884    noValidate_getterinfo.set(JSJitInfo {
885    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
886        getter: Some(get_noValidate::<D>)
887    },
888    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
889        protoID: PrototypeList::ID::HTMLFormElement as u16,
890    },
891    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
892    _bitfield_align_1: [],
893    _bitfield_1: __BindgenBitfieldUnit::new(
894        new_jsjitinfo_bitfield_1!(
895            JSJitInfo_OpType::Getter as u8,
896            JSJitInfo_AliasSet::AliasEverything as u8,
897            JSValueType::JSVAL_TYPE_BOOLEAN as u8,
898            true,
899            false,
900            false,
901            false,
902            false,
903            false,
904            0,
905        ).to_ne_bytes()
906    ),
907});
908}
909static noValidate_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
910
911pub(crate) fn init_noValidate_setterinfo<D: DomTypes>() {
912    noValidate_setterinfo.set(JSJitInfo {
913    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
914        setter: Some(set_noValidate::<D>)
915    },
916    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
917        protoID: PrototypeList::ID::HTMLFormElement as u16,
918    },
919    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
920    _bitfield_align_1: [],
921    _bitfield_1: __BindgenBitfieldUnit::new(
922        new_jsjitinfo_bitfield_1!(
923            JSJitInfo_OpType::Setter as u8,
924            JSJitInfo_AliasSet::AliasEverything as u8,
925            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
926            false,
927            false,
928            false,
929            false,
930            false,
931            false,
932            0,
933        ).to_ne_bytes()
934    ),
935});
936}
937unsafe extern "C" fn get_target<D: DomTypes>
938(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
939    let mut result = false;
940    wrap_panic(&mut || result = (|| {
941        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
942        let this = &*(this as *const D::HTMLFormElement);
943        <D as DomHelpers<D>>::push_new_element_queue();
944
945        let result: DOMString = this.Target();
946        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
947
948
949        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
950        return true;
951    })());
952    result
953}
954
955unsafe extern "C" fn set_target<D: DomTypes>
956(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
957    let mut result = false;
958    wrap_panic(&mut || result = (|| {
959        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
960        let this = &*(this as *const D::HTMLFormElement);
961        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
962            Ok(ConversionResult::Success(value)) => value,
963            Ok(ConversionResult::Failure(error)) => {
964                throw_type_error(cx.raw_cx(), &error);
965        return false;
966
967            }
968            _ => {
969                return false;
970
971            },
972        }
973        ;
974        <D as DomHelpers<D>>::push_new_element_queue();
975
976        let result: () = this.SetTarget(arg0);
977        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
978
979
980        true
981    })());
982    result
983}
984
985
986static target_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
987
988pub(crate) fn init_target_getterinfo<D: DomTypes>() {
989    target_getterinfo.set(JSJitInfo {
990    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
991        getter: Some(get_target::<D>)
992    },
993    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
994        protoID: PrototypeList::ID::HTMLFormElement as u16,
995    },
996    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
997    _bitfield_align_1: [],
998    _bitfield_1: __BindgenBitfieldUnit::new(
999        new_jsjitinfo_bitfield_1!(
1000            JSJitInfo_OpType::Getter as u8,
1001            JSJitInfo_AliasSet::AliasEverything as u8,
1002            JSValueType::JSVAL_TYPE_STRING as u8,
1003            true,
1004            false,
1005            false,
1006            false,
1007            false,
1008            false,
1009            0,
1010        ).to_ne_bytes()
1011    ),
1012});
1013}
1014static target_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1015
1016pub(crate) fn init_target_setterinfo<D: DomTypes>() {
1017    target_setterinfo.set(JSJitInfo {
1018    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1019        setter: Some(set_target::<D>)
1020    },
1021    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1022        protoID: PrototypeList::ID::HTMLFormElement as u16,
1023    },
1024    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1025    _bitfield_align_1: [],
1026    _bitfield_1: __BindgenBitfieldUnit::new(
1027        new_jsjitinfo_bitfield_1!(
1028            JSJitInfo_OpType::Setter as u8,
1029            JSJitInfo_AliasSet::AliasEverything as u8,
1030            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1031            false,
1032            false,
1033            false,
1034            false,
1035            false,
1036            false,
1037            0,
1038        ).to_ne_bytes()
1039    ),
1040});
1041}
1042unsafe extern "C" fn get_rel<D: DomTypes>
1043(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1044    let mut result = false;
1045    wrap_panic(&mut || result = (|| {
1046        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1047        let this = &*(this as *const D::HTMLFormElement);
1048        <D as DomHelpers<D>>::push_new_element_queue();
1049
1050        let result: DOMString = this.Rel();
1051        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
1052
1053
1054        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1055        return true;
1056    })());
1057    result
1058}
1059
1060unsafe extern "C" fn set_rel<D: DomTypes>
1061(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
1062    let mut result = false;
1063    wrap_panic(&mut || result = (|| {
1064        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1065        let this = &*(this as *const D::HTMLFormElement);
1066        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
1067            Ok(ConversionResult::Success(value)) => value,
1068            Ok(ConversionResult::Failure(error)) => {
1069                throw_type_error(cx.raw_cx(), &error);
1070        return false;
1071
1072            }
1073            _ => {
1074                return false;
1075
1076            },
1077        }
1078        ;
1079        <D as DomHelpers<D>>::push_new_element_queue();
1080
1081        let result: () = this.SetRel(arg0, CanGc::note());
1082        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
1083
1084
1085        true
1086    })());
1087    result
1088}
1089
1090
1091static rel_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1092
1093pub(crate) fn init_rel_getterinfo<D: DomTypes>() {
1094    rel_getterinfo.set(JSJitInfo {
1095    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1096        getter: Some(get_rel::<D>)
1097    },
1098    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1099        protoID: PrototypeList::ID::HTMLFormElement as u16,
1100    },
1101    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1102    _bitfield_align_1: [],
1103    _bitfield_1: __BindgenBitfieldUnit::new(
1104        new_jsjitinfo_bitfield_1!(
1105            JSJitInfo_OpType::Getter as u8,
1106            JSJitInfo_AliasSet::AliasEverything as u8,
1107            JSValueType::JSVAL_TYPE_STRING as u8,
1108            true,
1109            false,
1110            false,
1111            false,
1112            false,
1113            false,
1114            0,
1115        ).to_ne_bytes()
1116    ),
1117});
1118}
1119static rel_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1120
1121pub(crate) fn init_rel_setterinfo<D: DomTypes>() {
1122    rel_setterinfo.set(JSJitInfo {
1123    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1124        setter: Some(set_rel::<D>)
1125    },
1126    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1127        protoID: PrototypeList::ID::HTMLFormElement as u16,
1128    },
1129    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1130    _bitfield_align_1: [],
1131    _bitfield_1: __BindgenBitfieldUnit::new(
1132        new_jsjitinfo_bitfield_1!(
1133            JSJitInfo_OpType::Setter as u8,
1134            JSJitInfo_AliasSet::AliasEverything as u8,
1135            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1136            false,
1137            false,
1138            false,
1139            false,
1140            false,
1141            false,
1142            0,
1143        ).to_ne_bytes()
1144    ),
1145});
1146}
1147unsafe extern "C" fn get_relList<D: DomTypes>
1148(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1149    let mut result = false;
1150    wrap_panic(&mut || result = (|| {
1151        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1152        let this = &*(this as *const D::HTMLFormElement);
1153        let result: DomRoot<D::DOMTokenList> = this.RelList(CanGc::note());
1154
1155        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1156        return true;
1157    })());
1158    result
1159}
1160
1161unsafe extern "C" fn set_relList<D: DomTypes>
1162(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
1163    let mut result = false;
1164    wrap_panic(&mut || result = (|| {
1165
1166        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1167        rooted!(&in(cx) let mut v = UndefinedValue());
1168        if !JS_GetProperty(cx.raw_cx(), HandleObject::from_raw(obj), c"relList".as_ptr(), v.handle_mut()) {
1169            return false;
1170        }
1171        if !v.is_object() {
1172            throw_type_error(cx.raw_cx(), "Value.relList is not an object.");
1173            return false;
1174        }
1175        rooted!(&in(cx) let target_obj = v.to_object());
1176        JS_SetProperty(cx.raw_cx(), target_obj.handle(), c"value".as_ptr(), HandleValue::from_raw(args.get(0)))
1177
1178    })());
1179    result
1180}
1181
1182
1183static relList_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1184
1185pub(crate) fn init_relList_getterinfo<D: DomTypes>() {
1186    relList_getterinfo.set(JSJitInfo {
1187    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1188        getter: Some(get_relList::<D>)
1189    },
1190    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1191        protoID: PrototypeList::ID::HTMLFormElement as u16,
1192    },
1193    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1194    _bitfield_align_1: [],
1195    _bitfield_1: __BindgenBitfieldUnit::new(
1196        new_jsjitinfo_bitfield_1!(
1197            JSJitInfo_OpType::Getter as u8,
1198            JSJitInfo_AliasSet::AliasNone as u8,
1199            JSValueType::JSVAL_TYPE_OBJECT as u8,
1200            true,
1201            true,
1202            false,
1203            false,
1204            false,
1205            false,
1206            0,
1207        ).to_ne_bytes()
1208    ),
1209});
1210}
1211static relList_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1212
1213pub(crate) fn init_relList_setterinfo<D: DomTypes>() {
1214    relList_setterinfo.set(JSJitInfo {
1215    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1216        setter: Some(set_relList::<D>)
1217    },
1218    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1219        protoID: PrototypeList::ID::HTMLFormElement as u16,
1220    },
1221    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1222    _bitfield_align_1: [],
1223    _bitfield_1: __BindgenBitfieldUnit::new(
1224        new_jsjitinfo_bitfield_1!(
1225            JSJitInfo_OpType::Setter as u8,
1226            JSJitInfo_AliasSet::AliasEverything as u8,
1227            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1228            false,
1229            false,
1230            false,
1231            false,
1232            false,
1233            false,
1234            0,
1235        ).to_ne_bytes()
1236    ),
1237});
1238}
1239unsafe extern "C" fn get_elements<D: DomTypes>
1240(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1241    let mut result = false;
1242    wrap_panic(&mut || result = (|| {
1243        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1244        let this = &*(this as *const D::HTMLFormElement);
1245        let result: DomRoot<D::HTMLFormControlsCollection> = this.Elements(CanGc::note());
1246
1247        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1248        return true;
1249    })());
1250    result
1251}
1252
1253
1254static elements_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1255
1256pub(crate) fn init_elements_getterinfo<D: DomTypes>() {
1257    elements_getterinfo.set(JSJitInfo {
1258    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1259        getter: Some(get_elements::<D>)
1260    },
1261    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1262        protoID: PrototypeList::ID::HTMLFormElement as u16,
1263    },
1264    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1265    _bitfield_align_1: [],
1266    _bitfield_1: __BindgenBitfieldUnit::new(
1267        new_jsjitinfo_bitfield_1!(
1268            JSJitInfo_OpType::Getter as u8,
1269            JSJitInfo_AliasSet::AliasNone as u8,
1270            JSValueType::JSVAL_TYPE_OBJECT as u8,
1271            true,
1272            true,
1273            false,
1274            false,
1275            false,
1276            false,
1277            0,
1278        ).to_ne_bytes()
1279    ),
1280});
1281}
1282unsafe extern "C" fn get_length<D: DomTypes>
1283(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1284    let mut result = false;
1285    wrap_panic(&mut || result = (|| {
1286        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1287        let this = &*(this as *const D::HTMLFormElement);
1288        let result: u32 = this.Length();
1289
1290        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1291        return true;
1292    })());
1293    result
1294}
1295
1296
1297static length_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1298
1299pub(crate) fn init_length_getterinfo<D: DomTypes>() {
1300    length_getterinfo.set(JSJitInfo {
1301    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1302        getter: Some(get_length::<D>)
1303    },
1304    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1305        protoID: PrototypeList::ID::HTMLFormElement as u16,
1306    },
1307    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1308    _bitfield_align_1: [],
1309    _bitfield_1: __BindgenBitfieldUnit::new(
1310        new_jsjitinfo_bitfield_1!(
1311            JSJitInfo_OpType::Getter as u8,
1312            JSJitInfo_AliasSet::AliasEverything as u8,
1313            JSValueType::JSVAL_TYPE_DOUBLE as u8,
1314            true,
1315            false,
1316            false,
1317            false,
1318            false,
1319            false,
1320            0,
1321        ).to_ne_bytes()
1322    ),
1323});
1324}
1325unsafe extern "C" fn submit<D: DomTypes>
1326(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
1327    let mut result = false;
1328    wrap_panic(&mut || result = (|| {
1329        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1330        let this = &*(this as *const D::HTMLFormElement);
1331        let args = &*args;
1332        let argc = args.argc_;
1333        let result: () = this.Submit(CanGc::note());
1334
1335        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1336        return true;
1337    })());
1338    result
1339}
1340
1341
1342static submit_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1343
1344pub(crate) fn init_submit_methodinfo<D: DomTypes>() {
1345    submit_methodinfo.set(JSJitInfo {
1346    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1347        method: Some(submit::<D>)
1348    },
1349    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1350        protoID: PrototypeList::ID::HTMLFormElement as u16,
1351    },
1352    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1353    _bitfield_align_1: [],
1354    _bitfield_1: __BindgenBitfieldUnit::new(
1355        new_jsjitinfo_bitfield_1!(
1356            JSJitInfo_OpType::Method as u8,
1357            JSJitInfo_AliasSet::AliasEverything as u8,
1358            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1359            true,
1360            false,
1361            false,
1362            false,
1363            false,
1364            false,
1365            0,
1366        ).to_ne_bytes()
1367    ),
1368});
1369}
1370unsafe extern "C" fn requestSubmit<D: DomTypes>
1371(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
1372    let mut result = false;
1373    wrap_panic(&mut || result = (|| {
1374        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1375        let this = &*(this as *const D::HTMLFormElement);
1376        let args = &*args;
1377        let argc = args.argc_;
1378        let arg0: Option<DomRoot<D::HTMLElement>> = if args.get(0).is_undefined() {
1379            None
1380        } else if HandleValue::from_raw(args.get(0)).get().is_object() {
1381            Some(match root_from_handlevalue(HandleValue::from_raw(args.get(0)), SafeJSContext::from_ptr(cx.raw_cx())) {
1382                Ok(val) => val,
1383                Err(()) => {
1384                    throw_type_error(cx.raw_cx(), "value does not implement interface HTMLElement.");
1385                    return false;
1386
1387                }
1388            }
1389            )
1390        } else if HandleValue::from_raw(args.get(0)).get().is_null_or_undefined() {
1391            None
1392        } else {
1393            throw_type_error(cx.raw_cx(), "Value is not an object.");
1394            return false;
1395
1396        };
1397        let result: Result<(), Error> = this.RequestSubmit(arg0.as_deref(), CanGc::note());
1398        let result = match result {
1399            Ok(result) => result,
1400            Err(e) => {
1401                <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());
1402                return false;
1403            },
1404        };
1405
1406        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1407        return true;
1408    })());
1409    result
1410}
1411
1412
1413static requestSubmit_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1414
1415pub(crate) fn init_requestSubmit_methodinfo<D: DomTypes>() {
1416    requestSubmit_methodinfo.set(JSJitInfo {
1417    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1418        method: Some(requestSubmit::<D>)
1419    },
1420    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1421        protoID: PrototypeList::ID::HTMLFormElement as u16,
1422    },
1423    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1424    _bitfield_align_1: [],
1425    _bitfield_1: __BindgenBitfieldUnit::new(
1426        new_jsjitinfo_bitfield_1!(
1427            JSJitInfo_OpType::Method as u8,
1428            JSJitInfo_AliasSet::AliasEverything as u8,
1429            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1430            false,
1431            false,
1432            false,
1433            false,
1434            false,
1435            false,
1436            0,
1437        ).to_ne_bytes()
1438    ),
1439});
1440}
1441unsafe extern "C" fn reset<D: DomTypes>
1442(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
1443    let mut result = false;
1444    wrap_panic(&mut || result = (|| {
1445        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1446        let this = &*(this as *const D::HTMLFormElement);
1447        let args = &*args;
1448        let argc = args.argc_;
1449        <D as DomHelpers<D>>::push_new_element_queue();
1450
1451        let result: () = this.Reset(CanGc::note());
1452        <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
1453
1454
1455        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1456        return true;
1457    })());
1458    result
1459}
1460
1461
1462static reset_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1463
1464pub(crate) fn init_reset_methodinfo<D: DomTypes>() {
1465    reset_methodinfo.set(JSJitInfo {
1466    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1467        method: Some(reset::<D>)
1468    },
1469    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1470        protoID: PrototypeList::ID::HTMLFormElement as u16,
1471    },
1472    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1473    _bitfield_align_1: [],
1474    _bitfield_1: __BindgenBitfieldUnit::new(
1475        new_jsjitinfo_bitfield_1!(
1476            JSJitInfo_OpType::Method as u8,
1477            JSJitInfo_AliasSet::AliasEverything as u8,
1478            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1479            true,
1480            false,
1481            false,
1482            false,
1483            false,
1484            false,
1485            0,
1486        ).to_ne_bytes()
1487    ),
1488});
1489}
1490unsafe extern "C" fn checkValidity<D: DomTypes>
1491(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
1492    let mut result = false;
1493    wrap_panic(&mut || result = (|| {
1494        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1495        let this = &*(this as *const D::HTMLFormElement);
1496        let args = &*args;
1497        let argc = args.argc_;
1498        let result: bool = this.CheckValidity(CanGc::note());
1499
1500        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1501        return true;
1502    })());
1503    result
1504}
1505
1506
1507static checkValidity_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1508
1509pub(crate) fn init_checkValidity_methodinfo<D: DomTypes>() {
1510    checkValidity_methodinfo.set(JSJitInfo {
1511    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1512        method: Some(checkValidity::<D>)
1513    },
1514    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1515        protoID: PrototypeList::ID::HTMLFormElement as u16,
1516    },
1517    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1518    _bitfield_align_1: [],
1519    _bitfield_1: __BindgenBitfieldUnit::new(
1520        new_jsjitinfo_bitfield_1!(
1521            JSJitInfo_OpType::Method as u8,
1522            JSJitInfo_AliasSet::AliasEverything as u8,
1523            JSValueType::JSVAL_TYPE_BOOLEAN as u8,
1524            true,
1525            false,
1526            false,
1527            false,
1528            false,
1529            false,
1530            0,
1531        ).to_ne_bytes()
1532    ),
1533});
1534}
1535unsafe extern "C" fn reportValidity<D: DomTypes>
1536(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
1537    let mut result = false;
1538    wrap_panic(&mut || result = (|| {
1539        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1540        let this = &*(this as *const D::HTMLFormElement);
1541        let args = &*args;
1542        let argc = args.argc_;
1543        let result: bool = this.ReportValidity(CanGc::note());
1544
1545        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1546        return true;
1547    })());
1548    result
1549}
1550
1551
1552static reportValidity_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1553
1554pub(crate) fn init_reportValidity_methodinfo<D: DomTypes>() {
1555    reportValidity_methodinfo.set(JSJitInfo {
1556    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1557        method: Some(reportValidity::<D>)
1558    },
1559    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1560        protoID: PrototypeList::ID::HTMLFormElement as u16,
1561    },
1562    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1563    _bitfield_align_1: [],
1564    _bitfield_1: __BindgenBitfieldUnit::new(
1565        new_jsjitinfo_bitfield_1!(
1566            JSJitInfo_OpType::Method as u8,
1567            JSJitInfo_AliasSet::AliasEverything as u8,
1568            JSValueType::JSVAL_TYPE_BOOLEAN as u8,
1569            true,
1570            false,
1571            false,
1572            false,
1573            false,
1574            false,
1575            0,
1576        ).to_ne_bytes()
1577    ),
1578});
1579}
1580unsafe extern "C" fn _finalize<D: DomTypes>
1581(_cx: *mut GCContext, obj: *mut JSObject){
1582    wrap_panic(&mut || {
1583
1584        let this = native_from_object_static::<D::HTMLFormElement>(obj).unwrap();
1585        finalize_common(this);
1586    })
1587}
1588
1589unsafe extern "C" fn _trace<D: DomTypes>
1590(trc: *mut JSTracer, obj: *mut JSObject){
1591    wrap_panic(&mut || {
1592
1593        let this = native_from_object_static::<D::HTMLFormElement>(obj).unwrap();
1594        if this.is_null() { return; } // GC during obj creation
1595        (*this).trace(trc);
1596    })
1597}
1598
1599pub unsafe fn DefineProxyHandler<D: DomTypes>
1600() -> *const libc::c_void{
1601
1602    init_proxy_handler_dom_class::<D>();
1603
1604    let traps = ProxyTraps {
1605        enter: None,
1606        getOwnPropertyDescriptor: Some(getOwnPropertyDescriptor::<D>),
1607        defineProperty: Some(proxyhandler::define_property),
1608        ownPropertyKeys: Some(own_property_keys::<D>),
1609        delete_: Some(proxyhandler::delete),
1610        enumerate: None,
1611        getPrototypeIfOrdinary: Some(proxyhandler::get_prototype_if_ordinary),
1612        getPrototype: None,
1613        setPrototype: None,
1614        setImmutablePrototype: None,
1615        preventExtensions: Some(proxyhandler::prevent_extensions),
1616        isExtensible: Some(proxyhandler::is_extensible),
1617        has: None,
1618        get: Some(get::<D>),
1619        set: None,
1620        call: None,
1621        construct: None,
1622        hasOwn: Some(hasOwn::<D>),
1623        getOwnEnumerablePropertyKeys: Some(getOwnEnumerablePropertyKeys::<D>),
1624        nativeCall: None,
1625        objectClassIs: None,
1626        className: Some(className),
1627        fun_toString: None,
1628        boxedValue_unbox: None,
1629        defaultValue: None,
1630        trace: Some(_trace::<D>),
1631        finalize: Some(_finalize::<D>),
1632        objectMoved: None,
1633        isCallable: None,
1634        isConstructor: None,
1635    };
1636
1637    CreateProxyHandler(&traps, unsafe { Class.get() }.as_void_ptr())
1638}
1639
1640#[inline] unsafe fn UnwrapProxy<D: DomTypes>
1641(obj: RawHandleObject) -> *const D::HTMLFormElement{
1642
1643            let mut slot = UndefinedValue();
1644            GetProxyReservedSlot(obj.get(), 0, &mut slot);
1645            let box_ = slot.to_private() as *const D::HTMLFormElement;
1646    return box_;
1647}
1648
1649
1650pub static Class: ThreadUnsafeOnceLock<DOMClass> = ThreadUnsafeOnceLock::new();
1651
1652pub(crate) fn init_proxy_handler_dom_class<D: DomTypes>() {
1653    Class.set(
1654DOMClass {
1655    interface_chain: [ PrototypeList::ID::EventTarget, PrototypeList::ID::Node, PrototypeList::ID::Element, PrototypeList::ID::HTMLElement, PrototypeList::ID::HTMLFormElement, PrototypeList::ID::Last ],
1656    depth: 4,
1657    type_id: crate::codegen::InheritTypes::TopTypeId { eventtarget: (crate::codegen::InheritTypes::EventTargetTypeId::Node(crate::codegen::InheritTypes::NodeTypeId::Element(crate::codegen::InheritTypes::ElementTypeId::HTMLElement(crate::codegen::InheritTypes::HTMLElementTypeId::HTMLFormElement)))) },
1658    malloc_size_of: malloc_size_of_including_raw_self::<D::HTMLFormElement> as unsafe fn(&mut _, _) -> _,
1659    global: Globals::EMPTY,
1660});
1661}
1662
1663unsafe extern "C" fn own_property_keys<D: DomTypes>
1664(cx: *mut RawJSContext, proxy: RawHandleObject, props: RawMutableHandleIdVector) -> bool{
1665    let mut result = false;
1666    wrap_panic(&mut || result = (|| {
1667        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1668        let mut cx = CurrentRealm::assert(&mut cx);
1669        let cx = &mut cx;
1670        let unwrapped_proxy = UnwrapProxy::<D>(proxy);
1671        for i in 0..(*unwrapped_proxy).Length() {
1672            rooted!(&in(cx) let mut rooted_jsid: jsid);
1673            int_to_jsid(i as i32, rooted_jsid.handle_mut());
1674            AppendToIdVector(props, rooted_jsid.handle());
1675        }
1676        for name in (*unwrapped_proxy).SupportedPropertyNames() {
1677            let cstring = CString::new(name).unwrap();
1678            let jsstring = JS_AtomizeAndPinString(cx.raw_cx(), cstring.as_ptr());
1679            rooted!(&in(cx) let rooted = jsstring);
1680            rooted!(&in(cx) let mut rooted_jsid: jsid);
1681            RUST_INTERNED_STRING_TO_JSID(cx.raw_cx(), rooted.handle().get(), rooted_jsid.handle_mut());
1682            AppendToIdVector(props, rooted_jsid.handle());
1683        }
1684        rooted!(&in(cx) let mut expando = ptr::null_mut::<JSObject>());
1685        get_expando_object(proxy, expando.handle_mut());
1686        if !expando.is_null() &&
1687            !GetPropertyKeys(cx.raw_cx(), expando.handle(), JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, props) {
1688            return false;
1689        }
1690
1691        true
1692
1693    })());
1694    result
1695}
1696
1697unsafe extern "C" fn getOwnEnumerablePropertyKeys<D: DomTypes>
1698(cx: *mut RawJSContext, proxy: RawHandleObject, props: RawMutableHandleIdVector) -> bool{
1699    let mut result = false;
1700    wrap_panic(&mut || result = (|| {
1701        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1702        let unwrapped_proxy = UnwrapProxy::<D>(proxy);
1703        let mut cx = CurrentRealm::assert(&mut cx);
1704        let cx = &mut cx;
1705        for i in 0..(*unwrapped_proxy).Length() {
1706            rooted!(&in(cx) let mut rooted_jsid: jsid);
1707            int_to_jsid(i as i32, rooted_jsid.handle_mut());
1708            AppendToIdVector(props, rooted_jsid.handle());
1709        }
1710        rooted!(&in(cx) let mut expando = ptr::null_mut::<JSObject>());
1711        get_expando_object(proxy, expando.handle_mut());
1712        if !expando.is_null() &&
1713            !GetPropertyKeys(cx.raw_cx(), expando.handle(), JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, props) {
1714            return false;
1715        }
1716
1717        true
1718
1719    })());
1720    result
1721}
1722
1723unsafe extern "C" fn getOwnPropertyDescriptor<D: DomTypes>
1724(cx: *mut RawJSContext, proxy: RawHandleObject, id: RawHandleId, mut desc: RawMutableHandle<PropertyDescriptor>, is_none: *mut bool) -> bool{
1725    let mut result = false;
1726    wrap_panic(&mut || result = (|| {
1727        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1728        let mut cx = CurrentRealm::assert(&mut cx);
1729        let cx = &mut cx;
1730        let index = get_array_index_from_id(Handle::from_raw(id));
1731        if let Some(index) = index {
1732            let this = UnwrapProxy::<D>(proxy);
1733            let this = &*this;
1734            let result: Option<DomRoot<D::Element>> = this.IndexedGetter(index, CanGc::note());
1735
1736            if let Some(result) = result {
1737                rooted!(&in(cx) let mut rval = UndefinedValue());
1738                (result).to_jsval(cx.raw_cx(), rval.handle_mut());
1739                set_property_descriptor(
1740                    MutableHandle::from_raw(desc),
1741                    rval.handle(),
1742                    (JSPROP_ENUMERATE | JSPROP_READONLY) as u32,
1743                    &mut *is_none
1744                );
1745                return true;
1746            }
1747        }
1748        rooted!(&in(cx) let mut expando = ptr::null_mut::<JSObject>());
1749        get_expando_object(proxy, expando.handle_mut());
1750        //if (!xpc::WrapperFactory::IsXrayWrapper(proxy) && (expando = GetExpandoObject(proxy))) {
1751        let proxy_lt = Handle::from_raw(proxy);
1752        let id_lt = Handle::from_raw(id);
1753        if !expando.is_null() {
1754            rooted!(&in(cx) let mut ignored = ptr::null_mut::<JSObject>());
1755            if !JS_GetPropertyDescriptorById(cx.raw_cx(), expando.handle().into(), id, desc, ignored.handle_mut().into(), is_none) {
1756                return false;
1757            }
1758            if !*is_none {
1759                // Pretend the property lives on the wrapper.
1760                return true;
1761            }
1762        }
1763
1764        if index.is_none() && (id.is_string() || id.is_int()) {
1765            let mut has_on_proto = false;
1766            if !has_property_on_prototype(cx.raw_cx(), proxy_lt, id_lt, &mut has_on_proto) {
1767                return false;
1768            }
1769            if !has_on_proto {
1770                        let name = jsid_to_string(cx.raw_cx(), Handle::from_raw(id)).expect("Not a string-convertible JSID?");
1771                let this = UnwrapProxy::<D>(proxy);
1772                let this = &*this;
1773                let result: Option<GenericUnionTypes::RadioNodeListOrElement::<D>> = this.NamedGetter(name, CanGc::note());
1774
1775                if let Some(result) = result {
1776                    rooted!(&in(cx) let mut rval = UndefinedValue());
1777                    (result).to_jsval(cx.raw_cx(), rval.handle_mut());
1778                    set_property_descriptor(
1779                        MutableHandle::from_raw(desc),
1780                        rval.handle(),
1781                        (JSPROP_READONLY) as u32,
1782                        &mut *is_none
1783                    );
1784                    return true;
1785                }
1786            }
1787        }
1788        true
1789    })());
1790    result
1791}
1792
1793unsafe extern "C" fn className(cx: *mut RawJSContext, _proxy: RawHandleObject) -> *const libc::c_char{
1794    c"HTMLFormElement".as_ptr()
1795}
1796
1797unsafe extern "C" fn get<D: DomTypes>
1798(cx: *mut RawJSContext, proxy: RawHandleObject, receiver: RawHandleValue, id: RawHandleId, vp: RawMutableHandleValue) -> bool{
1799    let mut result = false;
1800    wrap_panic(&mut || result = (|| {
1801
1802        //MOZ_ASSERT(!xpc::WrapperFactory::IsXrayWrapper(proxy),
1803        //"Should not have a XrayWrapper here");
1804        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1805        let mut cx = CurrentRealm::assert(&mut cx);
1806        let cx = &mut cx;
1807
1808
1809
1810        let proxy_lt = Handle::from_raw(proxy);
1811        let mut vp_lt = MutableHandle::from_raw(vp);
1812        let id_lt = Handle::from_raw(id);
1813        let receiver_lt = Handle::from_raw(receiver);
1814
1815        let index = get_array_index_from_id(id_lt);
1816        if let Some(index) = index {
1817            let this = UnwrapProxy::<D>(proxy);
1818            let this = &*this;
1819            let result: Option<DomRoot<D::Element>> = this.IndexedGetter(index, CanGc::note());
1820
1821            if let Some(result) = result {
1822
1823                (result).to_jsval(cx.raw_cx(), vp_lt);
1824                return true;
1825            }
1826            // Even if we don't have this index, we don't forward the
1827            // get on to our expando object.
1828        } else {
1829            rooted!(&in(cx) let mut expando = ptr::null_mut::<JSObject>());
1830            get_expando_object(proxy, expando.handle_mut());
1831            if !expando.is_null() {
1832                let mut hasProp = false;
1833                if !JS_HasPropertyById(cx.raw_cx(), expando.handle().into(), id, &mut hasProp) {
1834                    return false;
1835                }
1836
1837                if hasProp {
1838                    return JS_ForwardGetPropertyTo(cx.raw_cx(), expando.handle().into(), id, receiver, vp);
1839                }
1840            }
1841        }
1842
1843        let mut found = false;
1844        if !get_property_on_prototype(cx.raw_cx(), proxy_lt, receiver_lt, id_lt, &mut found, vp_lt.reborrow()) {
1845            return false;
1846        }
1847
1848        if found {
1849            return true;
1850        }
1851        if index.is_none() && (id.is_string() || id.is_int()) {
1852            let name = jsid_to_string(cx.raw_cx(), Handle::from_raw(id)).expect("Not a string-convertible JSID?");
1853            let this = UnwrapProxy::<D>(proxy);
1854            let this = &*this;
1855            let result: Option<GenericUnionTypes::RadioNodeListOrElement::<D>> = this.NamedGetter(name, CanGc::note());
1856
1857            if let Some(result) = result {
1858
1859                (result).to_jsval(cx.raw_cx(), vp_lt);
1860                return true;
1861            }}
1862
1863        vp.set(UndefinedValue());
1864        true
1865    })());
1866    result
1867}
1868
1869unsafe extern "C" fn hasOwn<D: DomTypes>
1870(cx: *mut RawJSContext, proxy: RawHandleObject, id: RawHandleId, bp: *mut bool) -> bool{
1871    let mut result = false;
1872    wrap_panic(&mut || result = (|| {
1873        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1874        let mut cx = CurrentRealm::assert(&mut cx);
1875        let cx = &mut cx;
1876        let index = get_array_index_from_id(Handle::from_raw(id));
1877        if let Some(index) = index {
1878            let this = UnwrapProxy::<D>(proxy);
1879            let this = &*this;
1880            let result: Option<DomRoot<D::Element>> = this.IndexedGetter(index, CanGc::note());
1881
1882            *bp = result.is_some();
1883            return true;
1884        }
1885
1886        rooted!(&in(cx) let mut expando = ptr::null_mut::<JSObject>());
1887        let proxy_lt = Handle::from_raw(proxy);
1888        let id_lt = Handle::from_raw(id);
1889        get_expando_object(proxy, expando.handle_mut());
1890        if !expando.is_null() {
1891            let ok = JS_HasPropertyById(cx.raw_cx(), expando.handle().into(), id, bp);
1892            if !ok || *bp {
1893                return ok;
1894            }
1895        }
1896
1897        if index.is_none() && (id.is_string() || id.is_int()) {
1898            let mut has_on_proto = false;
1899            if !has_property_on_prototype(cx.raw_cx(), proxy_lt, id_lt, &mut has_on_proto) {
1900                return false;
1901            }
1902            if !has_on_proto {
1903                        let name = jsid_to_string(cx.raw_cx(), Handle::from_raw(id)).expect("Not a string-convertible JSID?");
1904                let this = UnwrapProxy::<D>(proxy);
1905                let this = &*this;
1906                let result: Option<GenericUnionTypes::RadioNodeListOrElement::<D>> = this.NamedGetter(name, CanGc::note());
1907
1908                *bp = result.is_some();
1909                return true;
1910            }
1911        }
1912
1913        *bp = false;
1914        true
1915    })());
1916    result
1917}
1918
1919#[cfg_attr(crown, allow(crown::unrooted_must_root))] pub unsafe fn Wrap<D: DomTypes>
1920(cx: SafeJSContext, scope: &D::GlobalScope, given_proto: Option<HandleObject>, object: Box<D::HTMLFormElement>, _can_gc: CanGc) -> DomRoot<D::HTMLFormElement>{
1921
1922    let raw = Root::new(MaybeUnreflectedDom::from_box(object));
1923
1924    let scope = scope.reflector().get_jsobject();
1925    assert!(!scope.get().is_null());
1926    assert!(((*get_object_class(scope.get())).flags & JSCLASS_IS_GLOBAL) != 0);
1927    let _ac = JSAutoRealm::new(cx.raw_cx(), scope.get());
1928
1929    rooted!(&in(cx) let mut canonical_proto = ptr::null_mut::<JSObject>());
1930    GetProtoObject::<D>(cx, scope, canonical_proto.handle_mut());
1931    assert!(!canonical_proto.is_null());
1932
1933
1934    let handler: *const libc::c_void =
1935        RegisterBindings::proxy_handlers::HTMLFormElement
1936        .load(std::sync::atomic::Ordering::Acquire);
1937    rooted!(&in(cx) let obj = NewProxyObject(
1938        cx.raw_cx(),
1939        handler,
1940        Handle::from_raw(UndefinedHandleValue),
1941        canonical_proto.get(),
1942        ptr::null(),
1943        false,
1944    ));
1945    assert!(!obj.is_null());
1946    SetProxyReservedSlot(
1947        obj.get(),
1948        0,
1949        &PrivateValue(raw.as_ptr() as *const libc::c_void),
1950    );
1951
1952    let root = raw.reflect_with(obj.get());
1953
1954
1955
1956    DomRoot::from_ref(&*root)
1957}
1958
1959pub trait HTMLFormElementMethods<D: DomTypes> {
1960    fn AcceptCharset(&self, ) -> DOMString;
1961    fn SetAcceptCharset(&self, r#value: DOMString);
1962    fn Action(&self, ) -> DOMString;
1963    fn SetAction(&self, r#value: DOMString);
1964    fn Autocomplete(&self, ) -> DOMString;
1965    fn SetAutocomplete(&self, r#value: DOMString);
1966    fn Enctype(&self, ) -> DOMString;
1967    fn SetEnctype(&self, r#value: DOMString);
1968    fn Encoding(&self, ) -> DOMString;
1969    fn SetEncoding(&self, r#value: DOMString);
1970    fn Method(&self, ) -> DOMString;
1971    fn SetMethod(&self, r#value: DOMString);
1972    fn Name(&self, ) -> DOMString;
1973    fn SetName(&self, r#value: DOMString);
1974    fn NoValidate(&self, ) -> bool;
1975    fn SetNoValidate(&self, r#value: bool);
1976    fn Target(&self, ) -> DOMString;
1977    fn SetTarget(&self, r#value: DOMString);
1978    fn Rel(&self, ) -> DOMString;
1979    fn SetRel(&self, r#value: DOMString, r#_can_gc: CanGc);
1980    fn RelList(&self, r#_can_gc: CanGc) -> DomRoot<D::DOMTokenList>;
1981    fn Elements(&self, r#_can_gc: CanGc) -> DomRoot<D::HTMLFormControlsCollection>;
1982    fn Length(&self, ) -> u32;
1983    fn Submit(&self, r#_can_gc: CanGc);
1984    fn RequestSubmit(&self, r#submitter: Option<&D::HTMLElement>, r#_can_gc: CanGc) -> Fallible<()>;
1985    fn Reset(&self, r#_can_gc: CanGc);
1986    fn CheckValidity(&self, r#_can_gc: CanGc) -> bool;
1987    fn ReportValidity(&self, r#_can_gc: CanGc) -> bool;
1988    fn IndexedGetter(&self, r#index: u32, r#_can_gc: CanGc) -> Option<DomRoot<D::Element>>;
1989    fn SupportedPropertyNames(&self, ) -> Vec<DOMString>;
1990    fn NamedGetter(&self, r#name: DOMString, r#_can_gc: CanGc) -> Option<GenericUnionTypes::RadioNodeListOrElement::<D>>;
1991}
1992static sMethods_specs: ThreadUnsafeOnceLock<&[&[JSFunctionSpec]]> = ThreadUnsafeOnceLock::new();
1993
1994pub(crate) fn init_sMethods_specs<D: DomTypes>() {
1995    sMethods_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
1996    JSFunctionSpec {
1997        name: JSPropertySpec_Name { string_: c"submit".as_ptr() },
1998        call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { submit_methodinfo.get() } as *const _ as *const JSJitInfo },
1999        nargs: 0,
2000        flags: (JSPROP_ENUMERATE) as u16,
2001        selfHostedName: ptr::null()
2002    },
2003    JSFunctionSpec {
2004        name: JSPropertySpec_Name { string_: c"requestSubmit".as_ptr() },
2005        call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { requestSubmit_methodinfo.get() } as *const _ as *const JSJitInfo },
2006        nargs: 0,
2007        flags: (JSPROP_ENUMERATE) as u16,
2008        selfHostedName: ptr::null()
2009    },
2010    JSFunctionSpec {
2011        name: JSPropertySpec_Name { string_: c"reset".as_ptr() },
2012        call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { reset_methodinfo.get() } as *const _ as *const JSJitInfo },
2013        nargs: 0,
2014        flags: (JSPROP_ENUMERATE) as u16,
2015        selfHostedName: ptr::null()
2016    },
2017    JSFunctionSpec {
2018        name: JSPropertySpec_Name { string_: c"checkValidity".as_ptr() },
2019        call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { checkValidity_methodinfo.get() } as *const _ as *const JSJitInfo },
2020        nargs: 0,
2021        flags: (JSPROP_ENUMERATE) as u16,
2022        selfHostedName: ptr::null()
2023    },
2024    JSFunctionSpec {
2025        name: JSPropertySpec_Name { string_: c"reportValidity".as_ptr() },
2026        call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { reportValidity_methodinfo.get() } as *const _ as *const JSJitInfo },
2027        nargs: 0,
2028        flags: (JSPROP_ENUMERATE) as u16,
2029        selfHostedName: ptr::null()
2030    },
2031    JSFunctionSpec {
2032        name: JSPropertySpec_Name { string_: ptr::null() },
2033        call: JSNativeWrapper { op: None, info: ptr::null() },
2034        nargs: 0,
2035        flags: 0,
2036        selfHostedName: ptr::null()
2037    }]))[..]
2038,
2039&Box::leak(Box::new([
2040    JSFunctionSpec {
2041        name: JSPropertySpec_Name { symbol_: SymbolCode::iterator as usize + 1 },
2042        call: JSNativeWrapper { op: None, info: ptr::null() },
2043        nargs: 0,
2044        flags: 0,
2045        selfHostedName: c"$ArrayValues".as_ptr()
2046    },
2047    JSFunctionSpec {
2048        name: JSPropertySpec_Name { string_: ptr::null() },
2049        call: JSNativeWrapper { op: None, info: ptr::null() },
2050        nargs: 0,
2051        flags: 0,
2052        selfHostedName: ptr::null()
2053    }]))[..]
2054])));
2055}static sMethods: ThreadUnsafeOnceLock<&[Guard<&[JSFunctionSpec]>]> = ThreadUnsafeOnceLock::new();
2056
2057pub(crate) fn init_sMethods_prefs<D: DomTypes>() {
2058    sMethods.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sMethods_specs.get() })[0]),
2059    Guard::new(&[Condition::Satisfied], (unsafe { sMethods_specs.get() })[1])])));
2060}static sAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
2061
2062pub(crate) fn init_sAttributes_specs<D: DomTypes>() {
2063    sAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
2064    JSPropertySpec {
2065                    name: JSPropertySpec_Name { string_: c"acceptCharset".as_ptr() },
2066                    attributes_: (JSPROP_ENUMERATE),
2067                    kind_: (JSPropertySpec_Kind::NativeAccessor),
2068                    u: JSPropertySpec_AccessorsOrValue {
2069                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2070                            getter: JSPropertySpec_Accessor {
2071                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { acceptCharset_getterinfo.get() } },
2072                            },
2073                            setter: JSPropertySpec_Accessor {
2074                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { acceptCharset_setterinfo.get() } },
2075                            }
2076                        }
2077                    }
2078                }
2079,
2080    JSPropertySpec {
2081                    name: JSPropertySpec_Name { string_: c"action".as_ptr() },
2082                    attributes_: (JSPROP_ENUMERATE),
2083                    kind_: (JSPropertySpec_Kind::NativeAccessor),
2084                    u: JSPropertySpec_AccessorsOrValue {
2085                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2086                            getter: JSPropertySpec_Accessor {
2087                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { action_getterinfo.get() } },
2088                            },
2089                            setter: JSPropertySpec_Accessor {
2090                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { action_setterinfo.get() } },
2091                            }
2092                        }
2093                    }
2094                }
2095,
2096    JSPropertySpec {
2097                    name: JSPropertySpec_Name { string_: c"autocomplete".as_ptr() },
2098                    attributes_: (JSPROP_ENUMERATE),
2099                    kind_: (JSPropertySpec_Kind::NativeAccessor),
2100                    u: JSPropertySpec_AccessorsOrValue {
2101                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2102                            getter: JSPropertySpec_Accessor {
2103                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { autocomplete_getterinfo.get() } },
2104                            },
2105                            setter: JSPropertySpec_Accessor {
2106                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { autocomplete_setterinfo.get() } },
2107                            }
2108                        }
2109                    }
2110                }
2111,
2112    JSPropertySpec {
2113                    name: JSPropertySpec_Name { string_: c"enctype".as_ptr() },
2114                    attributes_: (JSPROP_ENUMERATE),
2115                    kind_: (JSPropertySpec_Kind::NativeAccessor),
2116                    u: JSPropertySpec_AccessorsOrValue {
2117                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2118                            getter: JSPropertySpec_Accessor {
2119                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { enctype_getterinfo.get() } },
2120                            },
2121                            setter: JSPropertySpec_Accessor {
2122                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { enctype_setterinfo.get() } },
2123                            }
2124                        }
2125                    }
2126                }
2127,
2128    JSPropertySpec {
2129                    name: JSPropertySpec_Name { string_: c"encoding".as_ptr() },
2130                    attributes_: (JSPROP_ENUMERATE),
2131                    kind_: (JSPropertySpec_Kind::NativeAccessor),
2132                    u: JSPropertySpec_AccessorsOrValue {
2133                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2134                            getter: JSPropertySpec_Accessor {
2135                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { encoding_getterinfo.get() } },
2136                            },
2137                            setter: JSPropertySpec_Accessor {
2138                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { encoding_setterinfo.get() } },
2139                            }
2140                        }
2141                    }
2142                }
2143,
2144    JSPropertySpec {
2145                    name: JSPropertySpec_Name { string_: c"method".as_ptr() },
2146                    attributes_: (JSPROP_ENUMERATE),
2147                    kind_: (JSPropertySpec_Kind::NativeAccessor),
2148                    u: JSPropertySpec_AccessorsOrValue {
2149                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2150                            getter: JSPropertySpec_Accessor {
2151                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { method_getterinfo.get() } },
2152                            },
2153                            setter: JSPropertySpec_Accessor {
2154                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { method_setterinfo.get() } },
2155                            }
2156                        }
2157                    }
2158                }
2159,
2160    JSPropertySpec {
2161                    name: JSPropertySpec_Name { string_: c"name".as_ptr() },
2162                    attributes_: (JSPROP_ENUMERATE),
2163                    kind_: (JSPropertySpec_Kind::NativeAccessor),
2164                    u: JSPropertySpec_AccessorsOrValue {
2165                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2166                            getter: JSPropertySpec_Accessor {
2167                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { name_getterinfo.get() } },
2168                            },
2169                            setter: JSPropertySpec_Accessor {
2170                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { name_setterinfo.get() } },
2171                            }
2172                        }
2173                    }
2174                }
2175,
2176    JSPropertySpec {
2177                    name: JSPropertySpec_Name { string_: c"noValidate".as_ptr() },
2178                    attributes_: (JSPROP_ENUMERATE),
2179                    kind_: (JSPropertySpec_Kind::NativeAccessor),
2180                    u: JSPropertySpec_AccessorsOrValue {
2181                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2182                            getter: JSPropertySpec_Accessor {
2183                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { noValidate_getterinfo.get() } },
2184                            },
2185                            setter: JSPropertySpec_Accessor {
2186                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { noValidate_setterinfo.get() } },
2187                            }
2188                        }
2189                    }
2190                }
2191,
2192    JSPropertySpec {
2193                    name: JSPropertySpec_Name { string_: c"target".as_ptr() },
2194                    attributes_: (JSPROP_ENUMERATE),
2195                    kind_: (JSPropertySpec_Kind::NativeAccessor),
2196                    u: JSPropertySpec_AccessorsOrValue {
2197                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2198                            getter: JSPropertySpec_Accessor {
2199                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { target_getterinfo.get() } },
2200                            },
2201                            setter: JSPropertySpec_Accessor {
2202                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { target_setterinfo.get() } },
2203                            }
2204                        }
2205                    }
2206                }
2207,
2208    JSPropertySpec {
2209                    name: JSPropertySpec_Name { string_: c"rel".as_ptr() },
2210                    attributes_: (JSPROP_ENUMERATE),
2211                    kind_: (JSPropertySpec_Kind::NativeAccessor),
2212                    u: JSPropertySpec_AccessorsOrValue {
2213                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2214                            getter: JSPropertySpec_Accessor {
2215                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { rel_getterinfo.get() } },
2216                            },
2217                            setter: JSPropertySpec_Accessor {
2218                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { rel_setterinfo.get() } },
2219                            }
2220                        }
2221                    }
2222                }
2223,
2224    JSPropertySpec {
2225                    name: JSPropertySpec_Name { string_: c"relList".as_ptr() },
2226                    attributes_: (JSPROP_ENUMERATE),
2227                    kind_: (JSPropertySpec_Kind::NativeAccessor),
2228                    u: JSPropertySpec_AccessorsOrValue {
2229                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2230                            getter: JSPropertySpec_Accessor {
2231                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { relList_getterinfo.get() } },
2232                            },
2233                            setter: JSPropertySpec_Accessor {
2234                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { relList_setterinfo.get() } },
2235                            }
2236                        }
2237                    }
2238                }
2239,
2240    JSPropertySpec {
2241                    name: JSPropertySpec_Name { string_: c"elements".as_ptr() },
2242                    attributes_: (JSPROP_ENUMERATE),
2243                    kind_: (JSPropertySpec_Kind::NativeAccessor),
2244                    u: JSPropertySpec_AccessorsOrValue {
2245                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2246                            getter: JSPropertySpec_Accessor {
2247                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { elements_getterinfo.get() } },
2248                            },
2249                            setter: JSPropertySpec_Accessor {
2250                                native: JSNativeWrapper { op: None, info: ptr::null() },
2251                            }
2252                        }
2253                    }
2254                }
2255,
2256    JSPropertySpec {
2257                    name: JSPropertySpec_Name { string_: c"length".as_ptr() },
2258                    attributes_: (JSPROP_ENUMERATE),
2259                    kind_: (JSPropertySpec_Kind::NativeAccessor),
2260                    u: JSPropertySpec_AccessorsOrValue {
2261                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
2262                            getter: JSPropertySpec_Accessor {
2263                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { length_getterinfo.get() } },
2264                            },
2265                            setter: JSPropertySpec_Accessor {
2266                                native: JSNativeWrapper { op: None, info: ptr::null() },
2267                            }
2268                        }
2269                    }
2270                }
2271,
2272    JSPropertySpec::ZERO]))[..]
2273,
2274&Box::leak(Box::new([
2275    JSPropertySpec {
2276                    name: JSPropertySpec_Name { symbol_: SymbolCode::toStringTag as usize + 1 },
2277                    attributes_: (JSPROP_READONLY),
2278                    kind_: (JSPropertySpec_Kind::Value),
2279                    u: JSPropertySpec_AccessorsOrValue {
2280                        value: JSPropertySpec_ValueWrapper {
2281                            type_: JSPropertySpec_ValueWrapper_Type::String,
2282                            __bindgen_anon_1: JSPropertySpec_ValueWrapper__bindgen_ty_1 {
2283                                string: c"HTMLFormElement".as_ptr(),
2284                            }
2285                        }
2286                    }
2287                }
2288,
2289    JSPropertySpec::ZERO]))[..]
2290])));
2291}static sAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
2292
2293pub(crate) fn init_sAttributes_prefs<D: DomTypes>() {
2294    sAttributes.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sAttributes_specs.get() })[0]),
2295    Guard::new(&[Condition::Satisfied], (unsafe { sAttributes_specs.get() })[1])])));
2296}
2297pub fn GetProtoObject<D: DomTypes>
2298(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
2299    /* Get the interface prototype object for this class.  This will create the
2300       object as needed. */get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::HTMLFormElement), CreateInterfaceObjects::<D>, rval)
2301}
2302
2303
2304static PrototypeClass: JSClass = JSClass {
2305    name: c"HTMLFormElementPrototype".as_ptr(),
2306    flags:
2307        // JSCLASS_HAS_RESERVED_SLOTS()
2308        (0 ) << JSCLASS_RESERVED_SLOTS_SHIFT,
2309    cOps: ptr::null(),
2310    spec: ptr::null(),
2311    ext: ptr::null(),
2312    oOps: ptr::null(),
2313};
2314
2315unsafe extern "C" fn _constructor<D: DomTypes>
2316(cx: *mut RawJSContext, argc: u32, vp: *mut JSVal) -> bool{
2317    let mut result = false;
2318    wrap_panic(&mut || result = {
2319        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
2320        let args = CallArgs::from_vp(vp, argc);
2321        let global = D::GlobalScope::from_object(JS_CALLEE(cx.raw_cx(), vp).to_object());
2322
2323                        <D as DomHelpers<D>>::call_html_constructor::<D::HTMLFormElement>(
2324                            SafeJSContext::from_ptr(cx.raw_cx()),
2325                            &args,
2326                            &global,
2327                            PrototypeList::ID::HTMLFormElement,
2328                            CreateInterfaceObjects::<D>,
2329                            CanGc::note()
2330                        )
2331
2332    });
2333    result
2334}
2335
2336
2337static INTERFACE_OBJECT_CLASS: ThreadUnsafeOnceLock<NonCallbackInterfaceObjectClass> = ThreadUnsafeOnceLock::new();
2338
2339pub(crate) fn init_interface_object<D: DomTypes>() {
2340    INTERFACE_OBJECT_CLASS.set(NonCallbackInterfaceObjectClass::new(
2341        Box::leak(Box::new(InterfaceConstructorBehavior::call(_constructor::<D>))),
2342        b"function HTMLFormElement() {\n    [native code]\n}",
2343        PrototypeList::ID::HTMLFormElement,
2344        4,
2345    ));
2346}
2347
2348pub fn GetConstructorObject<D: DomTypes>
2349(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
2350    /* Get the interface object for this class.  This will create the object as
2351       needed. */get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::Constructor(PrototypeList::Constructor::HTMLFormElement), CreateInterfaceObjects::<D>, rval)
2352}
2353
2354pub fn DefineDOMInterface<D: DomTypes>
2355(cx: SafeJSContext, global: HandleObject){
2356    define_dom_interface(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::HTMLFormElement),CreateInterfaceObjects::<D>, ConstructorEnabled::<D>)
2357}
2358
2359pub fn ConstructorEnabled<D: DomTypes>
2360(aCx: SafeJSContext, aObj: HandleObject) -> bool{
2361    is_exposed_in(aObj, Globals::WINDOW)
2362}
2363
2364unsafe fn CreateInterfaceObjects<D: DomTypes>
2365(cx: SafeJSContext, global: HandleObject, cache: *mut ProtoOrIfaceArray){
2366
2367    rooted!(&in(cx) let mut prototype_proto = ptr::null_mut::<JSObject>());
2368    HTMLElement_Binding::GetProtoObject::<D>(cx, global, prototype_proto.handle_mut());
2369    assert!(!prototype_proto.is_null());
2370
2371    rooted!(&in(cx) let mut prototype = ptr::null_mut::<JSObject>());
2372    create_interface_prototype_object::<D>(cx,
2373                                      global,
2374                                      prototype_proto.handle(),
2375                                      &PrototypeClass,
2376                                      sMethods.get(),
2377                                      sAttributes.get(),
2378                                      &[],
2379                                      &[],
2380                                      prototype.handle_mut());
2381    assert!(!prototype.is_null());
2382    assert!((*cache)[PrototypeList::ID::HTMLFormElement as usize].is_null());
2383    (*cache)[PrototypeList::ID::HTMLFormElement as usize] = prototype.get();
2384    <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::HTMLFormElement as isize),
2385                                  ptr::null_mut(),
2386                                  prototype.get());
2387
2388    rooted!(&in(cx) let mut interface_proto = ptr::null_mut::<JSObject>());
2389
2390    HTMLElement_Binding::GetConstructorObject::<D>(cx, global, interface_proto.handle_mut());
2391
2392    assert!(!interface_proto.is_null());
2393
2394    rooted!(&in(cx) let mut interface = ptr::null_mut::<JSObject>());
2395    create_noncallback_interface_object::<D>(cx,
2396                                        global,
2397                                        interface_proto.handle(),
2398                                        INTERFACE_OBJECT_CLASS.get(),
2399                                        &[],
2400                                        &[],
2401                                        &[],
2402                                        prototype.handle(),
2403                                        c"HTMLFormElement",
2404                                        0,
2405                                        &[],
2406                                        interface.handle_mut());
2407    assert!(!interface.is_null());
2408
2409    assert!((*cache)[PrototypeList::Constructor::HTMLFormElement as usize].is_null());
2410    (*cache)[PrototypeList::Constructor::HTMLFormElement as usize] = interface.get();
2411    <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::Constructor::HTMLFormElement as isize),
2412                                  ptr::null_mut(),
2413                                  interface.get());
2414
2415}
2416
2417
2418        pub(crate) fn init_statics<D: DomTypes>() {
2419            init_interface_object::<D>();
2420
2421            crate::codegen::GenericBindings::HTMLFormElementBinding::HTMLFormElement_Binding::init_submit_methodinfo::<D>();
2422crate::codegen::GenericBindings::HTMLFormElementBinding::HTMLFormElement_Binding::init_requestSubmit_methodinfo::<D>();
2423crate::codegen::GenericBindings::HTMLFormElementBinding::HTMLFormElement_Binding::init_reset_methodinfo::<D>();
2424crate::codegen::GenericBindings::HTMLFormElementBinding::HTMLFormElement_Binding::init_checkValidity_methodinfo::<D>();
2425crate::codegen::GenericBindings::HTMLFormElementBinding::HTMLFormElement_Binding::init_reportValidity_methodinfo::<D>();
2426            init_acceptCharset_getterinfo::<D>();
2427init_action_getterinfo::<D>();
2428init_autocomplete_getterinfo::<D>();
2429init_enctype_getterinfo::<D>();
2430init_encoding_getterinfo::<D>();
2431init_method_getterinfo::<D>();
2432init_name_getterinfo::<D>();
2433init_noValidate_getterinfo::<D>();
2434init_target_getterinfo::<D>();
2435init_rel_getterinfo::<D>();
2436init_relList_getterinfo::<D>();
2437init_elements_getterinfo::<D>();
2438init_length_getterinfo::<D>();
2439            init_acceptCharset_setterinfo::<D>();
2440init_action_setterinfo::<D>();
2441init_autocomplete_setterinfo::<D>();
2442init_enctype_setterinfo::<D>();
2443init_encoding_setterinfo::<D>();
2444init_method_setterinfo::<D>();
2445init_name_setterinfo::<D>();
2446init_noValidate_setterinfo::<D>();
2447init_target_setterinfo::<D>();
2448init_rel_setterinfo::<D>();
2449init_relList_setterinfo::<D>();
2450
2451            init_sMethods_specs::<D>();
2452init_sMethods_prefs::<D>();
2453init_sAttributes_specs::<D>();
2454init_sAttributes_prefs::<D>();
2455        }
2456        } // mod HTMLFormElement_Binding
2457
2458