script_bindings/home/runner/work/servo/servo/target/debug/build/script_bindings-d55f55d5af1efaee/out/Bindings/
SubmitEventBinding.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::EventBinding::Event_Binding;
7use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
8use crate::codegen::GenericBindings::NodeBinding::Node_Binding;
9use crate::import::base::*;
10
11#[derive(JSTraceable)]
12pub struct SubmitEventInit<D: DomTypes> {
13    pub parent: crate::codegen::GenericBindings::EventBinding::EventInit,
14    pub submitter: Option<DomRoot<D::HTMLElement>>,
15}
16impl<D: DomTypes> Default for SubmitEventInit<D> {
17    fn default() -> Self {
18        Self::empty()
19    }
20}
21
22impl<D: DomTypes> SubmitEventInit<D> {
23    pub fn empty() -> Self {
24        Self {
25                parent: crate::codegen::GenericBindings::EventBinding::EventInit::empty(),
26                submitter: None,
27        }
28    }
29    pub fn new(cx: SafeJSContext, val: HandleValue, can_gc: CanGc)
30                      -> Result<ConversionResult<SubmitEventInit<D>>, ()> {
31        unsafe {
32            let object = if val.get().is_null_or_undefined() {
33                ptr::null_mut()
34            } else if val.get().is_object() {
35                val.get().to_object()
36            } else {
37                return Ok(ConversionResult::Failure("Value is not an object.".into()));
38            };
39            rooted!(&in(cx) let object = object);
40        let dictionary = SubmitEventInit {
41                parent: {
42                    match crate::codegen::GenericBindings::EventBinding::EventInit::new(cx, val, can_gc)? {
43                        ConversionResult::Success(v) => v,
44                        ConversionResult::Failure(error) => {
45                            throw_type_error(cx.raw_cx(), &error);
46                            return Err(());
47                        }
48                    }
49                },
50                submitter: {
51                    rooted!(&in(cx) let mut rval = UndefinedValue());
52                    if get_dictionary_property(cx.raw_cx(), object.handle(), "submitter", rval.handle_mut(), can_gc)? && !rval.is_undefined() {
53                            if rval.handle().get().is_object() {
54                                Some(match root_from_handlevalue(rval.handle(), SafeJSContext::from_ptr(cx.raw_cx())) {
55                                    Ok(val) => val,
56                                    Err(()) => {
57                                        throw_type_error(cx.raw_cx(), "value does not implement interface HTMLElement.");
58                                        return Err(());
59
60                                    }
61                                }
62                                )
63                            } else if rval.handle().get().is_null_or_undefined() {
64                                None
65                            } else {
66                                throw_type_error(cx.raw_cx(), "Value is not an object.");
67                                return Err(());
68
69                            }
70                    } else {
71                            None
72                    }
73                },
74        };
75            Ok(ConversionResult::Success(dictionary))
76        }
77    }
78}
79
80impl<D: DomTypes> FromJSValConvertible for SubmitEventInit<D> {
81    type Config = ();
82    unsafe fn from_jsval(cx: *mut RawJSContext, value: HandleValue, _option: ())
83                         -> Result<ConversionResult<SubmitEventInit<D>>, ()> {
84        SubmitEventInit::new(SafeJSContext::from_ptr(cx), value, CanGc::note())
85    }
86}
87
88impl<D: DomTypes> SubmitEventInit<D> {
89    #[allow(clippy::wrong_self_convention)]
90    pub unsafe fn to_jsobject(&self, cx: *mut RawJSContext, mut obj: MutableHandleObject) {
91        self.parent.to_jsobject(cx, obj.reborrow());
92        let submitter = &self.submitter;
93        rooted!(in(cx) let mut submitter_js = UndefinedValue());
94        submitter.to_jsval(cx, submitter_js.handle_mut());
95        set_dictionary_property(SafeJSContext::from_ptr(cx), obj.handle(), "submitter", submitter_js.handle()).unwrap();
96    }
97}
98
99impl<D: DomTypes> ToJSValConvertible for SubmitEventInit<D> {
100    unsafe fn to_jsval(&self, cx: *mut RawJSContext, mut rval: MutableHandleValue) {
101        rooted!(in(cx) let mut obj = JS_NewObject(cx, ptr::null()));
102        self.to_jsobject(cx, obj.handle_mut());
103        rval.set(ObjectOrNullValue(obj.get()))
104    }
105}
106
107
108pub use self::SubmitEvent_Binding::{Wrap, SubmitEventMethods, GetProtoObject, DefineDOMInterface};
109pub mod SubmitEvent_Binding {
110use crate::codegen::GenericBindings::ElementBinding::Element_Binding;
111use crate::codegen::GenericBindings::EventBinding::Event_Binding;
112use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
113use crate::codegen::GenericBindings::NodeBinding::Node_Binding;
114use crate::codegen::GenericBindings::SubmitEventBinding::SubmitEventInit;
115use crate::import::module::*;
116
117unsafe extern "C" fn get_submitter<D: DomTypes>
118(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
119    let mut result = false;
120    wrap_panic(&mut || result = (|| {
121        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
122        let this = &*(this as *const D::SubmitEvent);
123        let result: Option<DomRoot<D::HTMLElement>> = this.GetSubmitter();
124
125        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
126        return true;
127    })());
128    result
129}
130
131
132static submitter_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
133
134pub(crate) fn init_submitter_getterinfo<D: DomTypes>() {
135    submitter_getterinfo.set(JSJitInfo {
136    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
137        getter: Some(get_submitter::<D>)
138    },
139    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
140        protoID: PrototypeList::ID::SubmitEvent as u16,
141    },
142    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
143    _bitfield_align_1: [],
144    _bitfield_1: __BindgenBitfieldUnit::new(
145        new_jsjitinfo_bitfield_1!(
146            JSJitInfo_OpType::Getter as u8,
147            JSJitInfo_AliasSet::AliasEverything as u8,
148            JSValueType::JSVAL_TYPE_UNKNOWN as u8,
149            true,
150            false,
151            false,
152            false,
153            false,
154            false,
155            0,
156        ).to_ne_bytes()
157    ),
158});
159}
160unsafe extern "C" fn get_isTrusted<D: DomTypes>
161(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
162    let mut result = false;
163    wrap_panic(&mut || result = (|| {
164        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
165        let this = &*(this as *const D::SubmitEvent);
166        let result: bool = this.IsTrusted();
167
168        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
169        return true;
170    })());
171    result
172}
173
174
175static isTrusted_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
176
177pub(crate) fn init_isTrusted_getterinfo<D: DomTypes>() {
178    isTrusted_getterinfo.set(JSJitInfo {
179    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
180        getter: Some(get_isTrusted::<D>)
181    },
182    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
183        protoID: PrototypeList::ID::SubmitEvent as u16,
184    },
185    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
186    _bitfield_align_1: [],
187    _bitfield_1: __BindgenBitfieldUnit::new(
188        new_jsjitinfo_bitfield_1!(
189            JSJitInfo_OpType::Getter as u8,
190            JSJitInfo_AliasSet::AliasEverything as u8,
191            JSValueType::JSVAL_TYPE_BOOLEAN as u8,
192            true,
193            false,
194            false,
195            false,
196            false,
197            false,
198            0,
199        ).to_ne_bytes()
200    ),
201});
202}
203unsafe extern "C" fn _finalize<D: DomTypes>
204(_cx: *mut GCContext, obj: *mut JSObject){
205    wrap_panic(&mut || {
206
207        let this = native_from_object_static::<D::SubmitEvent>(obj).unwrap();
208        finalize_common(this);
209    })
210}
211
212unsafe extern "C" fn _trace<D: DomTypes>
213(trc: *mut JSTracer, obj: *mut JSObject){
214    wrap_panic(&mut || {
215
216        let this = native_from_object_static::<D::SubmitEvent>(obj).unwrap();
217        if this.is_null() { return; } // GC during obj creation
218        (*this).trace(trc);
219    })
220}
221
222
223static CLASS_OPS: ThreadUnsafeOnceLock<JSClassOps> = ThreadUnsafeOnceLock::new();
224
225pub(crate) fn init_class_ops<D: DomTypes>() {
226    CLASS_OPS.set(JSClassOps {
227        addProperty: None,
228        delProperty: None,
229        enumerate: None,
230        newEnumerate: None,
231        resolve: None,
232        mayResolve: None,
233        finalize: Some(_finalize::<D>),
234        call: None,
235        construct: None,
236        trace: Some(_trace::<D>),
237    });
238}
239
240pub static Class: ThreadUnsafeOnceLock<DOMJSClass> = ThreadUnsafeOnceLock::new();
241
242pub(crate) fn init_domjs_class<D: DomTypes>() {
243    init_class_ops::<D>();
244    Class.set(DOMJSClass {
245        base: JSClass {
246            name: c"SubmitEvent".as_ptr(),
247            flags: JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE |
248                   (((1) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT)
249                   /* JSCLASS_HAS_RESERVED_SLOTS(1) */,
250            cOps: unsafe { CLASS_OPS.get() },
251            spec: ptr::null(),
252            ext: ptr::null(),
253            oOps: ptr::null(),
254        },
255        dom_class:
256DOMClass {
257    interface_chain: [ PrototypeList::ID::Event, PrototypeList::ID::SubmitEvent, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last ],
258    depth: 1,
259    type_id: crate::codegen::InheritTypes::TopTypeId { event: (crate::codegen::InheritTypes::EventTypeId::SubmitEvent) },
260    malloc_size_of: malloc_size_of_including_raw_self::<D::SubmitEvent> as unsafe fn(&mut _, _) -> _,
261    global: Globals::EMPTY,
262},
263    });
264}
265
266#[cfg_attr(crown, allow(crown::unrooted_must_root))] pub unsafe fn Wrap<D: DomTypes>
267(cx: SafeJSContext, scope: &D::GlobalScope, given_proto: Option<HandleObject>, object: Box<D::SubmitEvent>, _can_gc: CanGc) -> DomRoot<D::SubmitEvent>{
268
269    let raw = Root::new(MaybeUnreflectedDom::from_box(object));
270
271    let scope = scope.reflector().get_jsobject();
272    assert!(!scope.get().is_null());
273    assert!(((*get_object_class(scope.get())).flags & JSCLASS_IS_GLOBAL) != 0);
274    let _ac = JSAutoRealm::new(cx.raw_cx(), scope.get());
275
276    rooted!(&in(cx) let mut canonical_proto = ptr::null_mut::<JSObject>());
277    GetProtoObject::<D>(cx, scope, canonical_proto.handle_mut());
278    assert!(!canonical_proto.is_null());
279
280
281    rooted!(&in(cx) let mut proto = ptr::null_mut::<JSObject>());
282    if let Some(given) = given_proto {
283        proto.set(*given);
284        if get_context_realm(cx.raw_cx()) != get_object_realm(*given) {
285            assert!(JS_WrapObject(cx.raw_cx(), proto.handle_mut()));
286        }
287    } else {
288        proto.set(*canonical_proto);
289    }
290    rooted!(&in(cx) let obj = JS_NewObjectWithGivenProto(
291        cx.raw_cx(),
292        &Class.get().base,
293        proto.handle(),
294    ));
295    assert!(!obj.is_null());
296    JS_SetReservedSlot(
297        obj.get(),
298        DOM_OBJECT_SLOT,
299        &PrivateValue(raw.as_ptr() as *const libc::c_void),
300    );
301
302    let root = raw.reflect_with(obj.get());
303
304
305    let mut slot = UndefinedValue();
306    JS_GetReservedSlot(canonical_proto.get(), DOM_PROTO_UNFORGEABLE_HOLDER_SLOT, &mut slot);
307    rooted!(&in(cx) let mut unforgeable_holder = ptr::null_mut::<JSObject>());
308    unforgeable_holder.handle_mut().set(slot.to_object());
309    assert!(JS_InitializePropertiesFromCompatibleNativeObject(cx.raw_cx(), obj.handle(), unforgeable_holder.handle()));
310
311
312    DomRoot::from_ref(&*root)
313}
314
315pub trait SubmitEventMethods<D: DomTypes> {
316    fn GetSubmitter(&self, ) -> Option<DomRoot<D::HTMLElement>>;
317    fn IsTrusted(&self, ) -> bool;
318    fn Constructor(r#global: &D::Window, r#proto: Option<HandleObject>, r#can_gc: CanGc, r#typeArg: DOMString, r#eventInitDict: &crate::codegen::GenericBindings::SubmitEventBinding::SubmitEventInit<D>) -> DomRoot<D::SubmitEvent>;
319}
320static sAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
321
322pub(crate) fn init_sAttributes_specs<D: DomTypes>() {
323    sAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
324    JSPropertySpec {
325                    name: JSPropertySpec_Name { string_: c"submitter".as_ptr() },
326                    attributes_: (JSPROP_ENUMERATE),
327                    kind_: (JSPropertySpec_Kind::NativeAccessor),
328                    u: JSPropertySpec_AccessorsOrValue {
329                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
330                            getter: JSPropertySpec_Accessor {
331                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { submitter_getterinfo.get() } },
332                            },
333                            setter: JSPropertySpec_Accessor {
334                                native: JSNativeWrapper { op: None, info: ptr::null() },
335                            }
336                        }
337                    }
338                }
339,
340    JSPropertySpec::ZERO]))[..]
341,
342&Box::leak(Box::new([
343    JSPropertySpec {
344                    name: JSPropertySpec_Name { symbol_: SymbolCode::toStringTag as usize + 1 },
345                    attributes_: (JSPROP_READONLY),
346                    kind_: (JSPropertySpec_Kind::Value),
347                    u: JSPropertySpec_AccessorsOrValue {
348                        value: JSPropertySpec_ValueWrapper {
349                            type_: JSPropertySpec_ValueWrapper_Type::String,
350                            __bindgen_anon_1: JSPropertySpec_ValueWrapper__bindgen_ty_1 {
351                                string: c"SubmitEvent".as_ptr(),
352                            }
353                        }
354                    }
355                }
356,
357    JSPropertySpec::ZERO]))[..]
358])));
359}static sAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
360
361pub(crate) fn init_sAttributes_prefs<D: DomTypes>() {
362    sAttributes.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sAttributes_specs.get() })[0]),
363    Guard::new(&[Condition::Satisfied], (unsafe { sAttributes_specs.get() })[1])])));
364}static sLegacyUnforgeableAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
365
366pub(crate) fn init_sLegacyUnforgeableAttributes_specs<D: DomTypes>() {
367    sLegacyUnforgeableAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
368    JSPropertySpec {
369                    name: JSPropertySpec_Name { string_: c"isTrusted".as_ptr() },
370                    attributes_: (JSPROP_ENUMERATE | JSPROP_PERMANENT),
371                    kind_: (JSPropertySpec_Kind::NativeAccessor),
372                    u: JSPropertySpec_AccessorsOrValue {
373                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
374                            getter: JSPropertySpec_Accessor {
375                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { isTrusted_getterinfo.get() } },
376                            },
377                            setter: JSPropertySpec_Accessor {
378                                native: JSNativeWrapper { op: None, info: ptr::null() },
379                            }
380                        }
381                    }
382                }
383,
384    JSPropertySpec::ZERO]))[..]
385])));
386}static sLegacyUnforgeableAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
387
388pub(crate) fn init_sLegacyUnforgeableAttributes_prefs<D: DomTypes>() {
389    sLegacyUnforgeableAttributes.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW),Condition::Exposed(Globals::SERVICE_WORKER_GLOBAL_SCOPE),Condition::Exposed(Globals::PAINT_WORKLET_GLOBAL_SCOPE),Condition::Exposed(Globals::DEDICATED_WORKER_GLOBAL_SCOPE),Condition::Exposed(Globals::DEBUGGER_GLOBAL_SCOPE),Condition::Exposed(Globals::DISSIMILAR_ORIGIN_WINDOW),Condition::Exposed(Globals::TEST_WORKLET_GLOBAL_SCOPE)], (unsafe { sLegacyUnforgeableAttributes_specs.get() })[0])])));
390}
391pub fn GetProtoObject<D: DomTypes>
392(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
393    /* Get the interface prototype object for this class.  This will create the
394       object as needed. */get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::SubmitEvent), CreateInterfaceObjects::<D>, rval)
395}
396
397
398static PrototypeClass: JSClass = JSClass {
399    name: c"SubmitEventPrototype".as_ptr(),
400    flags:
401        // JSCLASS_HAS_RESERVED_SLOTS()
402        (1 & JSCLASS_RESERVED_SLOTS_MASK ) << JSCLASS_RESERVED_SLOTS_SHIFT,
403    cOps: ptr::null(),
404    spec: ptr::null(),
405    ext: ptr::null(),
406    oOps: ptr::null(),
407};
408
409unsafe extern "C" fn _constructor<D: DomTypes>
410(cx: *mut RawJSContext, argc: u32, vp: *mut JSVal) -> bool{
411    let mut result = false;
412    wrap_panic(&mut || result = {
413        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
414        let args = CallArgs::from_vp(vp, argc);
415        let global = D::GlobalScope::from_object(JS_CALLEE(cx.raw_cx(), vp).to_object());
416
417                    call_default_constructor::<D>(
418                        SafeJSContext::from_ptr(cx.raw_cx()),
419                        &args,
420                        &global,
421                        PrototypeList::ID::SubmitEvent,
422                        "SubmitEvent",
423                        CreateInterfaceObjects::<D>,
424                        |cx: SafeJSContext, args: &CallArgs, global: &D::GlobalScope, desired_proto: HandleObject| {
425
426        if argc < 1 {
427            throw_type_error(cx.raw_cx(), "Not enough arguments to \"SubmitEvent.constructor\".");
428            return false;
429        }
430        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
431            Ok(ConversionResult::Success(value)) => value,
432            Ok(ConversionResult::Failure(error)) => {
433                throw_type_error(cx.raw_cx(), &error);
434        return false;
435
436            }
437            _ => {
438                return false;
439
440            },
441        }
442        ;
443        let arg1: crate::codegen::GenericBindings::SubmitEventBinding::SubmitEventInit<D> = if args.get(1).is_undefined() {
444            crate::codegen::GenericBindings::SubmitEventBinding::SubmitEventInit::empty()
445        } else {
446            match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(1)), ()) {
447                Ok(ConversionResult::Success(value)) => value,
448                Ok(ConversionResult::Failure(error)) => {
449                    throw_type_error(cx.raw_cx(), &error);
450            return false;
451
452                }
453                _ => {
454                    return false;
455
456                },
457            }
458
459        };
460        let result: DomRoot<D::SubmitEvent> = <D::SubmitEvent>::Constructor(global.downcast::<D::Window>().unwrap(), Some(desired_proto), CanGc::note(), arg0, &arg1);
461
462        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
463        return true;
464                        }
465                    )
466
467    });
468    result
469}
470
471
472static INTERFACE_OBJECT_CLASS: ThreadUnsafeOnceLock<NonCallbackInterfaceObjectClass> = ThreadUnsafeOnceLock::new();
473
474pub(crate) fn init_interface_object<D: DomTypes>() {
475    INTERFACE_OBJECT_CLASS.set(NonCallbackInterfaceObjectClass::new(
476        Box::leak(Box::new(InterfaceConstructorBehavior::call(_constructor::<D>))),
477        b"function SubmitEvent() {\n    [native code]\n}",
478        PrototypeList::ID::SubmitEvent,
479        1,
480    ));
481}
482
483pub fn DefineDOMInterface<D: DomTypes>
484(cx: SafeJSContext, global: HandleObject){
485    define_dom_interface(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::SubmitEvent),CreateInterfaceObjects::<D>, ConstructorEnabled::<D>)
486}
487
488pub fn ConstructorEnabled<D: DomTypes>
489(aCx: SafeJSContext, aObj: HandleObject) -> bool{
490    is_exposed_in(aObj, Globals::WINDOW)
491}
492
493unsafe fn CreateInterfaceObjects<D: DomTypes>
494(cx: SafeJSContext, global: HandleObject, cache: *mut ProtoOrIfaceArray){
495
496    rooted!(&in(cx) let mut prototype_proto = ptr::null_mut::<JSObject>());
497    Event_Binding::GetProtoObject::<D>(cx, global, prototype_proto.handle_mut());
498    assert!(!prototype_proto.is_null());
499
500    rooted!(&in(cx) let mut prototype = ptr::null_mut::<JSObject>());
501    create_interface_prototype_object::<D>(cx,
502                                      global,
503                                      prototype_proto.handle(),
504                                      &PrototypeClass,
505                                      &[],
506                                      sAttributes.get(),
507                                      &[],
508                                      &[],
509                                      prototype.handle_mut());
510    assert!(!prototype.is_null());
511    assert!((*cache)[PrototypeList::ID::SubmitEvent as usize].is_null());
512    (*cache)[PrototypeList::ID::SubmitEvent as usize] = prototype.get();
513    <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::SubmitEvent as isize),
514                                  ptr::null_mut(),
515                                  prototype.get());
516
517    rooted!(&in(cx) let mut interface_proto = ptr::null_mut::<JSObject>());
518
519    Event_Binding::GetConstructorObject::<D>(cx, global, interface_proto.handle_mut());
520
521    assert!(!interface_proto.is_null());
522
523    rooted!(&in(cx) let mut interface = ptr::null_mut::<JSObject>());
524    create_noncallback_interface_object::<D>(cx,
525                                        global,
526                                        interface_proto.handle(),
527                                        INTERFACE_OBJECT_CLASS.get(),
528                                        &[],
529                                        &[],
530                                        &[],
531                                        prototype.handle(),
532                                        c"SubmitEvent",
533                                        1,
534                                        &[],
535                                        interface.handle_mut());
536    assert!(!interface.is_null());
537
538    rooted!(&in(cx) let mut unforgeable_holder = ptr::null_mut::<JSObject>());
539    unforgeable_holder.handle_mut().set(
540        JS_NewObjectWithoutMetadata(cx.raw_cx(), &Class.get().base as *const JSClass, prototype.handle()));
541    assert!(!unforgeable_holder.is_null());
542
543    define_guarded_properties::<D>(cx, unforgeable_holder.handle(), unsafe { sLegacyUnforgeableAttributes.get() }, global);
544    let val = ObjectValue(unforgeable_holder.get());
545    JS_SetReservedSlot(prototype.get(), DOM_PROTO_UNFORGEABLE_HOLDER_SLOT, &val)
546}
547
548
549        pub(crate) fn init_statics<D: DomTypes>() {
550            init_interface_object::<D>();
551            init_domjs_class::<D>();
552
553            init_submitter_getterinfo::<D>();
554init_isTrusted_getterinfo::<D>();
555
556
557            init_sAttributes_specs::<D>();
558init_sAttributes_prefs::<D>();
559init_sLegacyUnforgeableAttributes_specs::<D>();
560init_sLegacyUnforgeableAttributes_prefs::<D>();
561        }
562        } // mod SubmitEvent_Binding
563
564