script_bindings/home/runner/work/servo/servo/target/debug/build/script_bindings-d55f55d5af1efaee/out/Bindings/
CSSKeyframesRuleBinding.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::CSSRuleBinding::CSSRule_Binding;
6use crate::import::base::*;
7
8pub use self::CSSKeyframesRule_Binding::{Wrap, CSSKeyframesRuleMethods, GetProtoObject, DefineDOMInterface};
9pub mod CSSKeyframesRule_Binding {
10use crate::codegen::GenericBindings::CSSRuleBinding::CSSRule_Binding;
11use crate::import::module::*;
12
13unsafe extern "C" fn get_name<D: DomTypes>
14(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
15    let mut result = false;
16    wrap_panic(&mut || result = (|| {
17        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
18        let this = &*(this as *const D::CSSKeyframesRule);
19        let result: DOMString = this.Name();
20
21        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
22        return true;
23    })());
24    result
25}
26
27unsafe extern "C" fn set_name<D: DomTypes>
28(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
29    let mut result = false;
30    wrap_panic(&mut || result = (|| {
31        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
32        let this = &*(this as *const D::CSSKeyframesRule);
33        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
34            Ok(ConversionResult::Success(value)) => value,
35            Ok(ConversionResult::Failure(error)) => {
36                throw_type_error(cx.raw_cx(), &error);
37        return false;
38
39            }
40            _ => {
41                return false;
42
43            },
44        }
45        ;
46        let result: Result<(), Error> = this.SetName(arg0);
47        let result = match result {
48            Ok(result) => result,
49            Err(e) => {
50                <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());
51                return false;
52            },
53        };
54
55        true
56    })());
57    result
58}
59
60
61static name_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
62
63pub(crate) fn init_name_getterinfo<D: DomTypes>() {
64    name_getterinfo.set(JSJitInfo {
65    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
66        getter: Some(get_name::<D>)
67    },
68    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
69        protoID: PrototypeList::ID::CSSKeyframesRule as u16,
70    },
71    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
72    _bitfield_align_1: [],
73    _bitfield_1: __BindgenBitfieldUnit::new(
74        new_jsjitinfo_bitfield_1!(
75            JSJitInfo_OpType::Getter as u8,
76            JSJitInfo_AliasSet::AliasEverything as u8,
77            JSValueType::JSVAL_TYPE_STRING as u8,
78            true,
79            false,
80            false,
81            false,
82            false,
83            false,
84            0,
85        ).to_ne_bytes()
86    ),
87});
88}
89static name_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
90
91pub(crate) fn init_name_setterinfo<D: DomTypes>() {
92    name_setterinfo.set(JSJitInfo {
93    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
94        setter: Some(set_name::<D>)
95    },
96    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
97        protoID: PrototypeList::ID::CSSKeyframesRule as u16,
98    },
99    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
100    _bitfield_align_1: [],
101    _bitfield_1: __BindgenBitfieldUnit::new(
102        new_jsjitinfo_bitfield_1!(
103            JSJitInfo_OpType::Setter as u8,
104            JSJitInfo_AliasSet::AliasEverything as u8,
105            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
106            false,
107            false,
108            false,
109            false,
110            false,
111            false,
112            0,
113        ).to_ne_bytes()
114    ),
115});
116}
117unsafe extern "C" fn get_cssRules<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::CSSKeyframesRule);
123        let result: DomRoot<D::CSSRuleList> = this.CssRules(CanGc::note());
124
125        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
126        return true;
127    })());
128    result
129}
130
131
132static cssRules_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
133
134pub(crate) fn init_cssRules_getterinfo<D: DomTypes>() {
135    cssRules_getterinfo.set(JSJitInfo {
136    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
137        getter: Some(get_cssRules::<D>)
138    },
139    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
140        protoID: PrototypeList::ID::CSSKeyframesRule 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_OBJECT 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 appendRule<D: DomTypes>
161(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> 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::CSSKeyframesRule);
166        let args = &*args;
167        let argc = args.argc_;
168
169        if argc < 1 {
170            throw_type_error(cx.raw_cx(), "Not enough arguments to \"CSSKeyframesRule.appendRule\".");
171            return false;
172        }
173        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
174            Ok(ConversionResult::Success(value)) => value,
175            Ok(ConversionResult::Failure(error)) => {
176                throw_type_error(cx.raw_cx(), &error);
177        return false;
178
179            }
180            _ => {
181                return false;
182
183            },
184        }
185        ;
186        let result: () = this.AppendRule(arg0, CanGc::note());
187
188        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
189        return true;
190    })());
191    result
192}
193
194
195static appendRule_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
196
197pub(crate) fn init_appendRule_methodinfo<D: DomTypes>() {
198    appendRule_methodinfo.set(JSJitInfo {
199    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
200        method: Some(appendRule::<D>)
201    },
202    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
203        protoID: PrototypeList::ID::CSSKeyframesRule as u16,
204    },
205    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
206    _bitfield_align_1: [],
207    _bitfield_1: __BindgenBitfieldUnit::new(
208        new_jsjitinfo_bitfield_1!(
209            JSJitInfo_OpType::Method as u8,
210            JSJitInfo_AliasSet::AliasEverything as u8,
211            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
212            false,
213            false,
214            false,
215            false,
216            false,
217            false,
218            0,
219        ).to_ne_bytes()
220    ),
221});
222}
223unsafe extern "C" fn deleteRule<D: DomTypes>
224(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
225    let mut result = false;
226    wrap_panic(&mut || result = (|| {
227        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
228        let this = &*(this as *const D::CSSKeyframesRule);
229        let args = &*args;
230        let argc = args.argc_;
231
232        if argc < 1 {
233            throw_type_error(cx.raw_cx(), "Not enough arguments to \"CSSKeyframesRule.deleteRule\".");
234            return false;
235        }
236        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
237            Ok(ConversionResult::Success(value)) => value,
238            Ok(ConversionResult::Failure(error)) => {
239                throw_type_error(cx.raw_cx(), &error);
240        return false;
241
242            }
243            _ => {
244                return false;
245
246            },
247        }
248        ;
249        let result: () = this.DeleteRule(arg0, CanGc::note());
250
251        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
252        return true;
253    })());
254    result
255}
256
257
258static deleteRule_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
259
260pub(crate) fn init_deleteRule_methodinfo<D: DomTypes>() {
261    deleteRule_methodinfo.set(JSJitInfo {
262    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
263        method: Some(deleteRule::<D>)
264    },
265    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
266        protoID: PrototypeList::ID::CSSKeyframesRule as u16,
267    },
268    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
269    _bitfield_align_1: [],
270    _bitfield_1: __BindgenBitfieldUnit::new(
271        new_jsjitinfo_bitfield_1!(
272            JSJitInfo_OpType::Method as u8,
273            JSJitInfo_AliasSet::AliasEverything as u8,
274            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
275            false,
276            false,
277            false,
278            false,
279            false,
280            false,
281            0,
282        ).to_ne_bytes()
283    ),
284});
285}
286unsafe extern "C" fn findRule<D: DomTypes>
287(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
288    let mut result = false;
289    wrap_panic(&mut || result = (|| {
290        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
291        let this = &*(this as *const D::CSSKeyframesRule);
292        let args = &*args;
293        let argc = args.argc_;
294
295        if argc < 1 {
296            throw_type_error(cx.raw_cx(), "Not enough arguments to \"CSSKeyframesRule.findRule\".");
297            return false;
298        }
299        let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
300            Ok(ConversionResult::Success(value)) => value,
301            Ok(ConversionResult::Failure(error)) => {
302                throw_type_error(cx.raw_cx(), &error);
303        return false;
304
305            }
306            _ => {
307                return false;
308
309            },
310        }
311        ;
312        let result: Option<DomRoot<D::CSSKeyframeRule>> = this.FindRule(arg0, CanGc::note());
313
314        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
315        return true;
316    })());
317    result
318}
319
320
321static findRule_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
322
323pub(crate) fn init_findRule_methodinfo<D: DomTypes>() {
324    findRule_methodinfo.set(JSJitInfo {
325    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
326        method: Some(findRule::<D>)
327    },
328    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
329        protoID: PrototypeList::ID::CSSKeyframesRule as u16,
330    },
331    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
332    _bitfield_align_1: [],
333    _bitfield_1: __BindgenBitfieldUnit::new(
334        new_jsjitinfo_bitfield_1!(
335            JSJitInfo_OpType::Method as u8,
336            JSJitInfo_AliasSet::AliasEverything as u8,
337            JSValueType::JSVAL_TYPE_UNKNOWN as u8,
338            false,
339            false,
340            false,
341            false,
342            false,
343            false,
344            0,
345        ).to_ne_bytes()
346    ),
347});
348}
349unsafe extern "C" fn _finalize<D: DomTypes>
350(_cx: *mut GCContext, obj: *mut JSObject){
351    wrap_panic(&mut || {
352
353        let this = native_from_object_static::<D::CSSKeyframesRule>(obj).unwrap();
354        finalize_common(this);
355    })
356}
357
358unsafe extern "C" fn _trace<D: DomTypes>
359(trc: *mut JSTracer, obj: *mut JSObject){
360    wrap_panic(&mut || {
361
362        let this = native_from_object_static::<D::CSSKeyframesRule>(obj).unwrap();
363        if this.is_null() { return; } // GC during obj creation
364        (*this).trace(trc);
365    })
366}
367
368
369static CLASS_OPS: ThreadUnsafeOnceLock<JSClassOps> = ThreadUnsafeOnceLock::new();
370
371pub(crate) fn init_class_ops<D: DomTypes>() {
372    CLASS_OPS.set(JSClassOps {
373        addProperty: None,
374        delProperty: None,
375        enumerate: None,
376        newEnumerate: None,
377        resolve: None,
378        mayResolve: None,
379        finalize: Some(_finalize::<D>),
380        call: None,
381        construct: None,
382        trace: Some(_trace::<D>),
383    });
384}
385
386pub static Class: ThreadUnsafeOnceLock<DOMJSClass> = ThreadUnsafeOnceLock::new();
387
388pub(crate) fn init_domjs_class<D: DomTypes>() {
389    init_class_ops::<D>();
390    Class.set(DOMJSClass {
391        base: JSClass {
392            name: c"CSSKeyframesRule".as_ptr(),
393            flags: JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE |
394                   (((1) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT)
395                   /* JSCLASS_HAS_RESERVED_SLOTS(1) */,
396            cOps: unsafe { CLASS_OPS.get() },
397            spec: ptr::null(),
398            ext: ptr::null(),
399            oOps: ptr::null(),
400        },
401        dom_class:
402DOMClass {
403    interface_chain: [ PrototypeList::ID::CSSRule, PrototypeList::ID::CSSKeyframesRule, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last ],
404    depth: 1,
405    type_id: crate::codegen::InheritTypes::TopTypeId { cssrule: (crate::codegen::InheritTypes::CSSRuleTypeId::CSSKeyframesRule) },
406    malloc_size_of: malloc_size_of_including_raw_self::<D::CSSKeyframesRule> as unsafe fn(&mut _, _) -> _,
407    global: Globals::EMPTY,
408},
409    });
410}
411
412#[cfg_attr(crown, allow(crown::unrooted_must_root))] pub unsafe fn Wrap<D: DomTypes>
413(cx: SafeJSContext, scope: &D::GlobalScope, given_proto: Option<HandleObject>, object: Box<D::CSSKeyframesRule>, _can_gc: CanGc) -> DomRoot<D::CSSKeyframesRule>{
414
415    let raw = Root::new(MaybeUnreflectedDom::from_box(object));
416
417    let scope = scope.reflector().get_jsobject();
418    assert!(!scope.get().is_null());
419    assert!(((*get_object_class(scope.get())).flags & JSCLASS_IS_GLOBAL) != 0);
420    let _ac = JSAutoRealm::new(cx.raw_cx(), scope.get());
421
422    rooted!(&in(cx) let mut canonical_proto = ptr::null_mut::<JSObject>());
423    GetProtoObject::<D>(cx, scope, canonical_proto.handle_mut());
424    assert!(!canonical_proto.is_null());
425
426
427    rooted!(&in(cx) let mut proto = ptr::null_mut::<JSObject>());
428    if let Some(given) = given_proto {
429        proto.set(*given);
430        if get_context_realm(cx.raw_cx()) != get_object_realm(*given) {
431            assert!(JS_WrapObject(cx.raw_cx(), proto.handle_mut()));
432        }
433    } else {
434        proto.set(*canonical_proto);
435    }
436    rooted!(&in(cx) let obj = JS_NewObjectWithGivenProto(
437        cx.raw_cx(),
438        &Class.get().base,
439        proto.handle(),
440    ));
441    assert!(!obj.is_null());
442    JS_SetReservedSlot(
443        obj.get(),
444        DOM_OBJECT_SLOT,
445        &PrivateValue(raw.as_ptr() as *const libc::c_void),
446    );
447
448    let root = raw.reflect_with(obj.get());
449
450
451
452    DomRoot::from_ref(&*root)
453}
454
455pub trait CSSKeyframesRuleMethods<D: DomTypes> {
456    fn Name(&self, ) -> DOMString;
457    fn SetName(&self, r#value: DOMString) -> ErrorResult;
458    fn CssRules(&self, r#_can_gc: CanGc) -> DomRoot<D::CSSRuleList>;
459    fn AppendRule(&self, r#rule: DOMString, r#_can_gc: CanGc);
460    fn DeleteRule(&self, r#select: DOMString, r#_can_gc: CanGc);
461    fn FindRule(&self, r#select: DOMString, r#_can_gc: CanGc) -> Option<DomRoot<D::CSSKeyframeRule>>;
462}
463static sMethods_specs: ThreadUnsafeOnceLock<&[&[JSFunctionSpec]]> = ThreadUnsafeOnceLock::new();
464
465pub(crate) fn init_sMethods_specs<D: DomTypes>() {
466    sMethods_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
467    JSFunctionSpec {
468        name: JSPropertySpec_Name { string_: c"appendRule".as_ptr() },
469        call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { appendRule_methodinfo.get() } as *const _ as *const JSJitInfo },
470        nargs: 1,
471        flags: (JSPROP_ENUMERATE) as u16,
472        selfHostedName: ptr::null()
473    },
474    JSFunctionSpec {
475        name: JSPropertySpec_Name { string_: c"deleteRule".as_ptr() },
476        call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { deleteRule_methodinfo.get() } as *const _ as *const JSJitInfo },
477        nargs: 1,
478        flags: (JSPROP_ENUMERATE) as u16,
479        selfHostedName: ptr::null()
480    },
481    JSFunctionSpec {
482        name: JSPropertySpec_Name { string_: c"findRule".as_ptr() },
483        call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { findRule_methodinfo.get() } as *const _ as *const JSJitInfo },
484        nargs: 1,
485        flags: (JSPROP_ENUMERATE) as u16,
486        selfHostedName: ptr::null()
487    },
488    JSFunctionSpec {
489        name: JSPropertySpec_Name { string_: ptr::null() },
490        call: JSNativeWrapper { op: None, info: ptr::null() },
491        nargs: 0,
492        flags: 0,
493        selfHostedName: ptr::null()
494    }]))[..]
495])));
496}static sMethods: ThreadUnsafeOnceLock<&[Guard<&[JSFunctionSpec]>]> = ThreadUnsafeOnceLock::new();
497
498pub(crate) fn init_sMethods_prefs<D: DomTypes>() {
499    sMethods.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sMethods_specs.get() })[0])])));
500}static sAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
501
502pub(crate) fn init_sAttributes_specs<D: DomTypes>() {
503    sAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
504    JSPropertySpec {
505                    name: JSPropertySpec_Name { string_: c"name".as_ptr() },
506                    attributes_: (JSPROP_ENUMERATE),
507                    kind_: (JSPropertySpec_Kind::NativeAccessor),
508                    u: JSPropertySpec_AccessorsOrValue {
509                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
510                            getter: JSPropertySpec_Accessor {
511                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { name_getterinfo.get() } },
512                            },
513                            setter: JSPropertySpec_Accessor {
514                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { name_setterinfo.get() } },
515                            }
516                        }
517                    }
518                }
519,
520    JSPropertySpec {
521                    name: JSPropertySpec_Name { string_: c"cssRules".as_ptr() },
522                    attributes_: (JSPROP_ENUMERATE),
523                    kind_: (JSPropertySpec_Kind::NativeAccessor),
524                    u: JSPropertySpec_AccessorsOrValue {
525                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
526                            getter: JSPropertySpec_Accessor {
527                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { cssRules_getterinfo.get() } },
528                            },
529                            setter: JSPropertySpec_Accessor {
530                                native: JSNativeWrapper { op: None, info: ptr::null() },
531                            }
532                        }
533                    }
534                }
535,
536    JSPropertySpec::ZERO]))[..]
537,
538&Box::leak(Box::new([
539    JSPropertySpec {
540                    name: JSPropertySpec_Name { symbol_: SymbolCode::toStringTag as usize + 1 },
541                    attributes_: (JSPROP_READONLY),
542                    kind_: (JSPropertySpec_Kind::Value),
543                    u: JSPropertySpec_AccessorsOrValue {
544                        value: JSPropertySpec_ValueWrapper {
545                            type_: JSPropertySpec_ValueWrapper_Type::String,
546                            __bindgen_anon_1: JSPropertySpec_ValueWrapper__bindgen_ty_1 {
547                                string: c"CSSKeyframesRule".as_ptr(),
548                            }
549                        }
550                    }
551                }
552,
553    JSPropertySpec::ZERO]))[..]
554])));
555}static sAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
556
557pub(crate) fn init_sAttributes_prefs<D: DomTypes>() {
558    sAttributes.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sAttributes_specs.get() })[0]),
559    Guard::new(&[Condition::Satisfied], (unsafe { sAttributes_specs.get() })[1])])));
560}
561pub fn GetProtoObject<D: DomTypes>
562(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
563    /* Get the interface prototype object for this class.  This will create the
564       object as needed. */get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::CSSKeyframesRule), CreateInterfaceObjects::<D>, rval)
565}
566
567
568static PrototypeClass: JSClass = JSClass {
569    name: c"CSSKeyframesRulePrototype".as_ptr(),
570    flags:
571        // JSCLASS_HAS_RESERVED_SLOTS()
572        (0 ) << JSCLASS_RESERVED_SLOTS_SHIFT,
573    cOps: ptr::null(),
574    spec: ptr::null(),
575    ext: ptr::null(),
576    oOps: ptr::null(),
577};
578
579
580static INTERFACE_OBJECT_CLASS: ThreadUnsafeOnceLock<NonCallbackInterfaceObjectClass> = ThreadUnsafeOnceLock::new();
581
582pub(crate) fn init_interface_object<D: DomTypes>() {
583    INTERFACE_OBJECT_CLASS.set(NonCallbackInterfaceObjectClass::new(
584        Box::leak(Box::new(InterfaceConstructorBehavior::throw())),
585        b"function CSSKeyframesRule() {\n    [native code]\n}",
586        PrototypeList::ID::CSSKeyframesRule,
587        1,
588    ));
589}
590
591pub fn DefineDOMInterface<D: DomTypes>
592(cx: SafeJSContext, global: HandleObject){
593    define_dom_interface(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::CSSKeyframesRule),CreateInterfaceObjects::<D>, ConstructorEnabled::<D>)
594}
595
596pub fn ConstructorEnabled<D: DomTypes>
597(aCx: SafeJSContext, aObj: HandleObject) -> bool{
598    is_exposed_in(aObj, Globals::WINDOW)
599}
600
601unsafe fn CreateInterfaceObjects<D: DomTypes>
602(cx: SafeJSContext, global: HandleObject, cache: *mut ProtoOrIfaceArray){
603
604    rooted!(&in(cx) let mut prototype_proto = ptr::null_mut::<JSObject>());
605    CSSRule_Binding::GetProtoObject::<D>(cx, global, prototype_proto.handle_mut());
606    assert!(!prototype_proto.is_null());
607
608    rooted!(&in(cx) let mut prototype = ptr::null_mut::<JSObject>());
609    create_interface_prototype_object::<D>(cx,
610                                      global,
611                                      prototype_proto.handle(),
612                                      &PrototypeClass,
613                                      sMethods.get(),
614                                      sAttributes.get(),
615                                      &[],
616                                      &[],
617                                      prototype.handle_mut());
618    assert!(!prototype.is_null());
619    assert!((*cache)[PrototypeList::ID::CSSKeyframesRule as usize].is_null());
620    (*cache)[PrototypeList::ID::CSSKeyframesRule as usize] = prototype.get();
621    <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::CSSKeyframesRule as isize),
622                                  ptr::null_mut(),
623                                  prototype.get());
624
625    rooted!(&in(cx) let mut interface_proto = ptr::null_mut::<JSObject>());
626
627    CSSRule_Binding::GetConstructorObject::<D>(cx, global, interface_proto.handle_mut());
628
629    assert!(!interface_proto.is_null());
630
631    rooted!(&in(cx) let mut interface = ptr::null_mut::<JSObject>());
632    create_noncallback_interface_object::<D>(cx,
633                                        global,
634                                        interface_proto.handle(),
635                                        INTERFACE_OBJECT_CLASS.get(),
636                                        &[],
637                                        &[],
638                                        &[],
639                                        prototype.handle(),
640                                        c"CSSKeyframesRule",
641                                        0,
642                                        &[],
643                                        interface.handle_mut());
644    assert!(!interface.is_null());
645}
646
647
648        pub(crate) fn init_statics<D: DomTypes>() {
649            init_interface_object::<D>();
650            init_domjs_class::<D>();
651            crate::codegen::GenericBindings::CSSKeyframesRuleBinding::CSSKeyframesRule_Binding::init_appendRule_methodinfo::<D>();
652crate::codegen::GenericBindings::CSSKeyframesRuleBinding::CSSKeyframesRule_Binding::init_deleteRule_methodinfo::<D>();
653crate::codegen::GenericBindings::CSSKeyframesRuleBinding::CSSKeyframesRule_Binding::init_findRule_methodinfo::<D>();
654            init_name_getterinfo::<D>();
655init_cssRules_getterinfo::<D>();
656            init_name_setterinfo::<D>();
657
658            init_sMethods_specs::<D>();
659init_sMethods_prefs::<D>();
660init_sAttributes_specs::<D>();
661init_sAttributes_prefs::<D>();
662        }
663        } // mod CSSKeyframesRule_Binding
664
665