1#![allow(non_camel_case_types,non_upper_case_globals,unsafe_op_in_unsafe_fn,unused_imports,unused_variables,unused_assignments,unused_mut,clippy::approx_constant,clippy::enum_variant_names,clippy::let_unit_value,clippy::needless_return,clippy::too_many_arguments,clippy::unnecessary_cast,clippy::upper_case_acronyms)]
4
5use crate::codegen::GenericBindings::ElementBinding::Element_Binding;
6use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
7use crate::codegen::GenericBindings::HTMLElementBinding::HTMLElement_Binding;
8use crate::codegen::GenericBindings::NodeBinding::Node_Binding;
9use crate::import::base::*;
10
11pub use self::HTMLButtonElement_Binding::{Wrap, HTMLButtonElementMethods, GetProtoObject, GetConstructorObject, DefineDOMInterface};
12pub mod HTMLButtonElement_Binding {
13use crate::codegen::GenericBindings::ElementBinding::Element_Binding;
14use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
15use crate::codegen::GenericBindings::HTMLElementBinding::HTMLElement_Binding;
16use crate::codegen::GenericBindings::NodeBinding::Node_Binding;
17use crate::import::module::*;
18
19unsafe extern "C" fn get_disabled<D: DomTypes>
20(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
21 let mut result = false;
22 wrap_panic(&mut || result = (|| {
23 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
24 let this = &*(this as *const D::HTMLButtonElement);
25 <D as DomHelpers<D>>::push_new_element_queue();
26
27 let result: bool = this.Disabled();
28 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
29
30
31 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
32 return true;
33 })());
34 result
35}
36
37unsafe extern "C" fn set_disabled<D: DomTypes>
38(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
39 let mut result = false;
40 wrap_panic(&mut || result = (|| {
41 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
42 let this = &*(this as *const D::HTMLButtonElement);
43 let arg0: bool = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
44 Ok(ConversionResult::Success(value)) => value,
45 Ok(ConversionResult::Failure(error)) => {
46 throw_type_error(cx.raw_cx(), &error);
47 return false;
48
49 }
50 _ => {
51 return false;
52
53 },
54 }
55 ;
56 <D as DomHelpers<D>>::push_new_element_queue();
57
58 let result: () = this.SetDisabled(arg0);
59 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
60
61
62 true
63 })());
64 result
65}
66
67
68static disabled_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
69
70pub(crate) fn init_disabled_getterinfo<D: DomTypes>() {
71 disabled_getterinfo.set(JSJitInfo {
72 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
73 getter: Some(get_disabled::<D>)
74 },
75 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
76 protoID: PrototypeList::ID::HTMLButtonElement as u16,
77 },
78 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
79 _bitfield_align_1: [],
80 _bitfield_1: __BindgenBitfieldUnit::new(
81 new_jsjitinfo_bitfield_1!(
82 JSJitInfo_OpType::Getter as u8,
83 JSJitInfo_AliasSet::AliasEverything as u8,
84 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
85 true,
86 false,
87 false,
88 false,
89 false,
90 false,
91 0,
92 ).to_ne_bytes()
93 ),
94});
95}
96static disabled_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
97
98pub(crate) fn init_disabled_setterinfo<D: DomTypes>() {
99 disabled_setterinfo.set(JSJitInfo {
100 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
101 setter: Some(set_disabled::<D>)
102 },
103 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
104 protoID: PrototypeList::ID::HTMLButtonElement as u16,
105 },
106 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
107 _bitfield_align_1: [],
108 _bitfield_1: __BindgenBitfieldUnit::new(
109 new_jsjitinfo_bitfield_1!(
110 JSJitInfo_OpType::Setter as u8,
111 JSJitInfo_AliasSet::AliasEverything as u8,
112 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
113 false,
114 false,
115 false,
116 false,
117 false,
118 false,
119 0,
120 ).to_ne_bytes()
121 ),
122});
123}
124unsafe extern "C" fn get_form<D: DomTypes>
125(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
126 let mut result = false;
127 wrap_panic(&mut || result = (|| {
128 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
129 let this = &*(this as *const D::HTMLButtonElement);
130 let result: Option<DomRoot<D::HTMLFormElement>> = this.GetForm();
131
132 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
133 return true;
134 })());
135 result
136}
137
138
139static form_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
140
141pub(crate) fn init_form_getterinfo<D: DomTypes>() {
142 form_getterinfo.set(JSJitInfo {
143 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
144 getter: Some(get_form::<D>)
145 },
146 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
147 protoID: PrototypeList::ID::HTMLButtonElement as u16,
148 },
149 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
150 _bitfield_align_1: [],
151 _bitfield_1: __BindgenBitfieldUnit::new(
152 new_jsjitinfo_bitfield_1!(
153 JSJitInfo_OpType::Getter as u8,
154 JSJitInfo_AliasSet::AliasEverything as u8,
155 JSValueType::JSVAL_TYPE_UNKNOWN as u8,
156 true,
157 false,
158 false,
159 false,
160 false,
161 false,
162 0,
163 ).to_ne_bytes()
164 ),
165});
166}
167unsafe extern "C" fn get_formAction<D: DomTypes>
168(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
169 let mut result = false;
170 wrap_panic(&mut || result = (|| {
171 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
172 let this = &*(this as *const D::HTMLButtonElement);
173 <D as DomHelpers<D>>::push_new_element_queue();
174
175 let result: DOMString = this.FormAction();
176 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
177
178
179 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
180 return true;
181 })());
182 result
183}
184
185unsafe extern "C" fn set_formAction<D: DomTypes>
186(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
187 let mut result = false;
188 wrap_panic(&mut || result = (|| {
189 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
190 let this = &*(this as *const D::HTMLButtonElement);
191 let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
192 Ok(ConversionResult::Success(value)) => value,
193 Ok(ConversionResult::Failure(error)) => {
194 throw_type_error(cx.raw_cx(), &error);
195 return false;
196
197 }
198 _ => {
199 return false;
200
201 },
202 }
203 ;
204 <D as DomHelpers<D>>::push_new_element_queue();
205
206 let result: () = this.SetFormAction(arg0);
207 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
208
209
210 true
211 })());
212 result
213}
214
215
216static formAction_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
217
218pub(crate) fn init_formAction_getterinfo<D: DomTypes>() {
219 formAction_getterinfo.set(JSJitInfo {
220 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
221 getter: Some(get_formAction::<D>)
222 },
223 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
224 protoID: PrototypeList::ID::HTMLButtonElement as u16,
225 },
226 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
227 _bitfield_align_1: [],
228 _bitfield_1: __BindgenBitfieldUnit::new(
229 new_jsjitinfo_bitfield_1!(
230 JSJitInfo_OpType::Getter as u8,
231 JSJitInfo_AliasSet::AliasEverything as u8,
232 JSValueType::JSVAL_TYPE_STRING as u8,
233 true,
234 false,
235 false,
236 false,
237 false,
238 false,
239 0,
240 ).to_ne_bytes()
241 ),
242});
243}
244static formAction_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
245
246pub(crate) fn init_formAction_setterinfo<D: DomTypes>() {
247 formAction_setterinfo.set(JSJitInfo {
248 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
249 setter: Some(set_formAction::<D>)
250 },
251 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
252 protoID: PrototypeList::ID::HTMLButtonElement as u16,
253 },
254 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
255 _bitfield_align_1: [],
256 _bitfield_1: __BindgenBitfieldUnit::new(
257 new_jsjitinfo_bitfield_1!(
258 JSJitInfo_OpType::Setter as u8,
259 JSJitInfo_AliasSet::AliasEverything as u8,
260 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
261 false,
262 false,
263 false,
264 false,
265 false,
266 false,
267 0,
268 ).to_ne_bytes()
269 ),
270});
271}
272unsafe extern "C" fn get_formEnctype<D: DomTypes>
273(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
274 let mut result = false;
275 wrap_panic(&mut || result = (|| {
276 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
277 let this = &*(this as *const D::HTMLButtonElement);
278 <D as DomHelpers<D>>::push_new_element_queue();
279
280 let result: DOMString = this.FormEnctype();
281 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
282
283
284 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
285 return true;
286 })());
287 result
288}
289
290unsafe extern "C" fn set_formEnctype<D: DomTypes>
291(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
292 let mut result = false;
293 wrap_panic(&mut || result = (|| {
294 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
295 let this = &*(this as *const D::HTMLButtonElement);
296 let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
297 Ok(ConversionResult::Success(value)) => value,
298 Ok(ConversionResult::Failure(error)) => {
299 throw_type_error(cx.raw_cx(), &error);
300 return false;
301
302 }
303 _ => {
304 return false;
305
306 },
307 }
308 ;
309 <D as DomHelpers<D>>::push_new_element_queue();
310
311 let result: () = this.SetFormEnctype(arg0);
312 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
313
314
315 true
316 })());
317 result
318}
319
320
321static formEnctype_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
322
323pub(crate) fn init_formEnctype_getterinfo<D: DomTypes>() {
324 formEnctype_getterinfo.set(JSJitInfo {
325 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
326 getter: Some(get_formEnctype::<D>)
327 },
328 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
329 protoID: PrototypeList::ID::HTMLButtonElement as u16,
330 },
331 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
332 _bitfield_align_1: [],
333 _bitfield_1: __BindgenBitfieldUnit::new(
334 new_jsjitinfo_bitfield_1!(
335 JSJitInfo_OpType::Getter as u8,
336 JSJitInfo_AliasSet::AliasEverything as u8,
337 JSValueType::JSVAL_TYPE_STRING as u8,
338 true,
339 false,
340 false,
341 false,
342 false,
343 false,
344 0,
345 ).to_ne_bytes()
346 ),
347});
348}
349static formEnctype_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
350
351pub(crate) fn init_formEnctype_setterinfo<D: DomTypes>() {
352 formEnctype_setterinfo.set(JSJitInfo {
353 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
354 setter: Some(set_formEnctype::<D>)
355 },
356 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
357 protoID: PrototypeList::ID::HTMLButtonElement as u16,
358 },
359 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
360 _bitfield_align_1: [],
361 _bitfield_1: __BindgenBitfieldUnit::new(
362 new_jsjitinfo_bitfield_1!(
363 JSJitInfo_OpType::Setter as u8,
364 JSJitInfo_AliasSet::AliasEverything as u8,
365 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
366 false,
367 false,
368 false,
369 false,
370 false,
371 false,
372 0,
373 ).to_ne_bytes()
374 ),
375});
376}
377unsafe extern "C" fn get_formMethod<D: DomTypes>
378(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
379 let mut result = false;
380 wrap_panic(&mut || result = (|| {
381 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
382 let this = &*(this as *const D::HTMLButtonElement);
383 <D as DomHelpers<D>>::push_new_element_queue();
384
385 let result: DOMString = this.FormMethod();
386 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
387
388
389 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
390 return true;
391 })());
392 result
393}
394
395unsafe extern "C" fn set_formMethod<D: DomTypes>
396(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
397 let mut result = false;
398 wrap_panic(&mut || result = (|| {
399 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
400 let this = &*(this as *const D::HTMLButtonElement);
401 let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
402 Ok(ConversionResult::Success(value)) => value,
403 Ok(ConversionResult::Failure(error)) => {
404 throw_type_error(cx.raw_cx(), &error);
405 return false;
406
407 }
408 _ => {
409 return false;
410
411 },
412 }
413 ;
414 <D as DomHelpers<D>>::push_new_element_queue();
415
416 let result: () = this.SetFormMethod(arg0);
417 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
418
419
420 true
421 })());
422 result
423}
424
425
426static formMethod_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
427
428pub(crate) fn init_formMethod_getterinfo<D: DomTypes>() {
429 formMethod_getterinfo.set(JSJitInfo {
430 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
431 getter: Some(get_formMethod::<D>)
432 },
433 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
434 protoID: PrototypeList::ID::HTMLButtonElement as u16,
435 },
436 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
437 _bitfield_align_1: [],
438 _bitfield_1: __BindgenBitfieldUnit::new(
439 new_jsjitinfo_bitfield_1!(
440 JSJitInfo_OpType::Getter as u8,
441 JSJitInfo_AliasSet::AliasEverything as u8,
442 JSValueType::JSVAL_TYPE_STRING as u8,
443 true,
444 false,
445 false,
446 false,
447 false,
448 false,
449 0,
450 ).to_ne_bytes()
451 ),
452});
453}
454static formMethod_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
455
456pub(crate) fn init_formMethod_setterinfo<D: DomTypes>() {
457 formMethod_setterinfo.set(JSJitInfo {
458 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
459 setter: Some(set_formMethod::<D>)
460 },
461 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
462 protoID: PrototypeList::ID::HTMLButtonElement as u16,
463 },
464 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
465 _bitfield_align_1: [],
466 _bitfield_1: __BindgenBitfieldUnit::new(
467 new_jsjitinfo_bitfield_1!(
468 JSJitInfo_OpType::Setter as u8,
469 JSJitInfo_AliasSet::AliasEverything as u8,
470 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
471 false,
472 false,
473 false,
474 false,
475 false,
476 false,
477 0,
478 ).to_ne_bytes()
479 ),
480});
481}
482unsafe extern "C" fn get_formNoValidate<D: DomTypes>
483(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
484 let mut result = false;
485 wrap_panic(&mut || result = (|| {
486 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
487 let this = &*(this as *const D::HTMLButtonElement);
488 <D as DomHelpers<D>>::push_new_element_queue();
489
490 let result: bool = this.FormNoValidate();
491 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
492
493
494 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
495 return true;
496 })());
497 result
498}
499
500unsafe extern "C" fn set_formNoValidate<D: DomTypes>
501(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
502 let mut result = false;
503 wrap_panic(&mut || result = (|| {
504 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
505 let this = &*(this as *const D::HTMLButtonElement);
506 let arg0: bool = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
507 Ok(ConversionResult::Success(value)) => value,
508 Ok(ConversionResult::Failure(error)) => {
509 throw_type_error(cx.raw_cx(), &error);
510 return false;
511
512 }
513 _ => {
514 return false;
515
516 },
517 }
518 ;
519 <D as DomHelpers<D>>::push_new_element_queue();
520
521 let result: () = this.SetFormNoValidate(arg0);
522 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
523
524
525 true
526 })());
527 result
528}
529
530
531static formNoValidate_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
532
533pub(crate) fn init_formNoValidate_getterinfo<D: DomTypes>() {
534 formNoValidate_getterinfo.set(JSJitInfo {
535 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
536 getter: Some(get_formNoValidate::<D>)
537 },
538 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
539 protoID: PrototypeList::ID::HTMLButtonElement as u16,
540 },
541 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
542 _bitfield_align_1: [],
543 _bitfield_1: __BindgenBitfieldUnit::new(
544 new_jsjitinfo_bitfield_1!(
545 JSJitInfo_OpType::Getter as u8,
546 JSJitInfo_AliasSet::AliasEverything as u8,
547 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
548 true,
549 false,
550 false,
551 false,
552 false,
553 false,
554 0,
555 ).to_ne_bytes()
556 ),
557});
558}
559static formNoValidate_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
560
561pub(crate) fn init_formNoValidate_setterinfo<D: DomTypes>() {
562 formNoValidate_setterinfo.set(JSJitInfo {
563 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
564 setter: Some(set_formNoValidate::<D>)
565 },
566 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
567 protoID: PrototypeList::ID::HTMLButtonElement as u16,
568 },
569 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
570 _bitfield_align_1: [],
571 _bitfield_1: __BindgenBitfieldUnit::new(
572 new_jsjitinfo_bitfield_1!(
573 JSJitInfo_OpType::Setter as u8,
574 JSJitInfo_AliasSet::AliasEverything as u8,
575 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
576 false,
577 false,
578 false,
579 false,
580 false,
581 false,
582 0,
583 ).to_ne_bytes()
584 ),
585});
586}
587unsafe extern "C" fn get_formTarget<D: DomTypes>
588(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
589 let mut result = false;
590 wrap_panic(&mut || result = (|| {
591 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
592 let this = &*(this as *const D::HTMLButtonElement);
593 <D as DomHelpers<D>>::push_new_element_queue();
594
595 let result: DOMString = this.FormTarget();
596 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
597
598
599 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
600 return true;
601 })());
602 result
603}
604
605unsafe extern "C" fn set_formTarget<D: DomTypes>
606(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
607 let mut result = false;
608 wrap_panic(&mut || result = (|| {
609 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
610 let this = &*(this as *const D::HTMLButtonElement);
611 let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
612 Ok(ConversionResult::Success(value)) => value,
613 Ok(ConversionResult::Failure(error)) => {
614 throw_type_error(cx.raw_cx(), &error);
615 return false;
616
617 }
618 _ => {
619 return false;
620
621 },
622 }
623 ;
624 <D as DomHelpers<D>>::push_new_element_queue();
625
626 let result: () = this.SetFormTarget(arg0);
627 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
628
629
630 true
631 })());
632 result
633}
634
635
636static formTarget_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
637
638pub(crate) fn init_formTarget_getterinfo<D: DomTypes>() {
639 formTarget_getterinfo.set(JSJitInfo {
640 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
641 getter: Some(get_formTarget::<D>)
642 },
643 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
644 protoID: PrototypeList::ID::HTMLButtonElement as u16,
645 },
646 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
647 _bitfield_align_1: [],
648 _bitfield_1: __BindgenBitfieldUnit::new(
649 new_jsjitinfo_bitfield_1!(
650 JSJitInfo_OpType::Getter as u8,
651 JSJitInfo_AliasSet::AliasEverything as u8,
652 JSValueType::JSVAL_TYPE_STRING as u8,
653 true,
654 false,
655 false,
656 false,
657 false,
658 false,
659 0,
660 ).to_ne_bytes()
661 ),
662});
663}
664static formTarget_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
665
666pub(crate) fn init_formTarget_setterinfo<D: DomTypes>() {
667 formTarget_setterinfo.set(JSJitInfo {
668 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
669 setter: Some(set_formTarget::<D>)
670 },
671 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
672 protoID: PrototypeList::ID::HTMLButtonElement as u16,
673 },
674 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
675 _bitfield_align_1: [],
676 _bitfield_1: __BindgenBitfieldUnit::new(
677 new_jsjitinfo_bitfield_1!(
678 JSJitInfo_OpType::Setter as u8,
679 JSJitInfo_AliasSet::AliasEverything as u8,
680 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
681 false,
682 false,
683 false,
684 false,
685 false,
686 false,
687 0,
688 ).to_ne_bytes()
689 ),
690});
691}
692unsafe extern "C" fn get_name<D: DomTypes>
693(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
694 let mut result = false;
695 wrap_panic(&mut || result = (|| {
696 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
697 let this = &*(this as *const D::HTMLButtonElement);
698 <D as DomHelpers<D>>::push_new_element_queue();
699
700 let result: DOMString = this.Name();
701 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
702
703
704 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
705 return true;
706 })());
707 result
708}
709
710unsafe extern "C" fn set_name<D: DomTypes>
711(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
712 let mut result = false;
713 wrap_panic(&mut || result = (|| {
714 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
715 let this = &*(this as *const D::HTMLButtonElement);
716 let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
717 Ok(ConversionResult::Success(value)) => value,
718 Ok(ConversionResult::Failure(error)) => {
719 throw_type_error(cx.raw_cx(), &error);
720 return false;
721
722 }
723 _ => {
724 return false;
725
726 },
727 }
728 ;
729 <D as DomHelpers<D>>::push_new_element_queue();
730
731 let result: () = this.SetName(arg0);
732 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
733
734
735 true
736 })());
737 result
738}
739
740
741static name_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
742
743pub(crate) fn init_name_getterinfo<D: DomTypes>() {
744 name_getterinfo.set(JSJitInfo {
745 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
746 getter: Some(get_name::<D>)
747 },
748 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
749 protoID: PrototypeList::ID::HTMLButtonElement as u16,
750 },
751 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
752 _bitfield_align_1: [],
753 _bitfield_1: __BindgenBitfieldUnit::new(
754 new_jsjitinfo_bitfield_1!(
755 JSJitInfo_OpType::Getter as u8,
756 JSJitInfo_AliasSet::AliasEverything as u8,
757 JSValueType::JSVAL_TYPE_STRING as u8,
758 true,
759 false,
760 false,
761 false,
762 false,
763 false,
764 0,
765 ).to_ne_bytes()
766 ),
767});
768}
769static name_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
770
771pub(crate) fn init_name_setterinfo<D: DomTypes>() {
772 name_setterinfo.set(JSJitInfo {
773 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
774 setter: Some(set_name::<D>)
775 },
776 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
777 protoID: PrototypeList::ID::HTMLButtonElement as u16,
778 },
779 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
780 _bitfield_align_1: [],
781 _bitfield_1: __BindgenBitfieldUnit::new(
782 new_jsjitinfo_bitfield_1!(
783 JSJitInfo_OpType::Setter as u8,
784 JSJitInfo_AliasSet::AliasEverything as u8,
785 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
786 false,
787 false,
788 false,
789 false,
790 false,
791 false,
792 0,
793 ).to_ne_bytes()
794 ),
795});
796}
797unsafe extern "C" fn get_type<D: DomTypes>
798(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
799 let mut result = false;
800 wrap_panic(&mut || result = (|| {
801 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
802 let this = &*(this as *const D::HTMLButtonElement);
803 <D as DomHelpers<D>>::push_new_element_queue();
804
805 let result: DOMString = this.Type();
806 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
807
808
809 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
810 return true;
811 })());
812 result
813}
814
815unsafe extern "C" fn set_type<D: DomTypes>
816(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
817 let mut result = false;
818 wrap_panic(&mut || result = (|| {
819 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
820 let this = &*(this as *const D::HTMLButtonElement);
821 let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
822 Ok(ConversionResult::Success(value)) => value,
823 Ok(ConversionResult::Failure(error)) => {
824 throw_type_error(cx.raw_cx(), &error);
825 return false;
826
827 }
828 _ => {
829 return false;
830
831 },
832 }
833 ;
834 <D as DomHelpers<D>>::push_new_element_queue();
835
836 let result: () = this.SetType(arg0);
837 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
838
839
840 true
841 })());
842 result
843}
844
845
846static type_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
847
848pub(crate) fn init_type_getterinfo<D: DomTypes>() {
849 type_getterinfo.set(JSJitInfo {
850 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
851 getter: Some(get_type::<D>)
852 },
853 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
854 protoID: PrototypeList::ID::HTMLButtonElement as u16,
855 },
856 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
857 _bitfield_align_1: [],
858 _bitfield_1: __BindgenBitfieldUnit::new(
859 new_jsjitinfo_bitfield_1!(
860 JSJitInfo_OpType::Getter as u8,
861 JSJitInfo_AliasSet::AliasEverything as u8,
862 JSValueType::JSVAL_TYPE_STRING as u8,
863 true,
864 false,
865 false,
866 false,
867 false,
868 false,
869 0,
870 ).to_ne_bytes()
871 ),
872});
873}
874static type_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
875
876pub(crate) fn init_type_setterinfo<D: DomTypes>() {
877 type_setterinfo.set(JSJitInfo {
878 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
879 setter: Some(set_type::<D>)
880 },
881 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
882 protoID: PrototypeList::ID::HTMLButtonElement as u16,
883 },
884 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
885 _bitfield_align_1: [],
886 _bitfield_1: __BindgenBitfieldUnit::new(
887 new_jsjitinfo_bitfield_1!(
888 JSJitInfo_OpType::Setter as u8,
889 JSJitInfo_AliasSet::AliasEverything as u8,
890 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
891 false,
892 false,
893 false,
894 false,
895 false,
896 false,
897 0,
898 ).to_ne_bytes()
899 ),
900});
901}
902unsafe extern "C" fn get_value<D: DomTypes>
903(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
904 let mut result = false;
905 wrap_panic(&mut || result = (|| {
906 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
907 let this = &*(this as *const D::HTMLButtonElement);
908 <D as DomHelpers<D>>::push_new_element_queue();
909
910 let result: DOMString = this.Value();
911 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
912
913
914 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
915 return true;
916 })());
917 result
918}
919
920unsafe extern "C" fn set_value<D: DomTypes>
921(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
922 let mut result = false;
923 wrap_panic(&mut || result = (|| {
924 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
925 let this = &*(this as *const D::HTMLButtonElement);
926 let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
927 Ok(ConversionResult::Success(value)) => value,
928 Ok(ConversionResult::Failure(error)) => {
929 throw_type_error(cx.raw_cx(), &error);
930 return false;
931
932 }
933 _ => {
934 return false;
935
936 },
937 }
938 ;
939 <D as DomHelpers<D>>::push_new_element_queue();
940
941 let result: () = this.SetValue(arg0);
942 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
943
944
945 true
946 })());
947 result
948}
949
950
951static value_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
952
953pub(crate) fn init_value_getterinfo<D: DomTypes>() {
954 value_getterinfo.set(JSJitInfo {
955 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
956 getter: Some(get_value::<D>)
957 },
958 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
959 protoID: PrototypeList::ID::HTMLButtonElement as u16,
960 },
961 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
962 _bitfield_align_1: [],
963 _bitfield_1: __BindgenBitfieldUnit::new(
964 new_jsjitinfo_bitfield_1!(
965 JSJitInfo_OpType::Getter as u8,
966 JSJitInfo_AliasSet::AliasEverything as u8,
967 JSValueType::JSVAL_TYPE_STRING as u8,
968 true,
969 false,
970 false,
971 false,
972 false,
973 false,
974 0,
975 ).to_ne_bytes()
976 ),
977});
978}
979static value_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
980
981pub(crate) fn init_value_setterinfo<D: DomTypes>() {
982 value_setterinfo.set(JSJitInfo {
983 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
984 setter: Some(set_value::<D>)
985 },
986 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
987 protoID: PrototypeList::ID::HTMLButtonElement as u16,
988 },
989 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
990 _bitfield_align_1: [],
991 _bitfield_1: __BindgenBitfieldUnit::new(
992 new_jsjitinfo_bitfield_1!(
993 JSJitInfo_OpType::Setter as u8,
994 JSJitInfo_AliasSet::AliasEverything as u8,
995 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
996 false,
997 false,
998 false,
999 false,
1000 false,
1001 false,
1002 0,
1003 ).to_ne_bytes()
1004 ),
1005});
1006}
1007unsafe extern "C" fn get_willValidate<D: DomTypes>
1008(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1009 let mut result = false;
1010 wrap_panic(&mut || result = (|| {
1011 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1012 let this = &*(this as *const D::HTMLButtonElement);
1013 let result: bool = this.WillValidate();
1014
1015 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1016 return true;
1017 })());
1018 result
1019}
1020
1021
1022static willValidate_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1023
1024pub(crate) fn init_willValidate_getterinfo<D: DomTypes>() {
1025 willValidate_getterinfo.set(JSJitInfo {
1026 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1027 getter: Some(get_willValidate::<D>)
1028 },
1029 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1030 protoID: PrototypeList::ID::HTMLButtonElement as u16,
1031 },
1032 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1033 _bitfield_align_1: [],
1034 _bitfield_1: __BindgenBitfieldUnit::new(
1035 new_jsjitinfo_bitfield_1!(
1036 JSJitInfo_OpType::Getter as u8,
1037 JSJitInfo_AliasSet::AliasEverything as u8,
1038 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
1039 true,
1040 false,
1041 false,
1042 false,
1043 false,
1044 false,
1045 0,
1046 ).to_ne_bytes()
1047 ),
1048});
1049}
1050unsafe extern "C" fn get_validity<D: DomTypes>
1051(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1052 let mut result = false;
1053 wrap_panic(&mut || result = (|| {
1054 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1055 let this = &*(this as *const D::HTMLButtonElement);
1056 let result: DomRoot<D::ValidityState> = this.Validity(CanGc::note());
1057
1058 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1059 return true;
1060 })());
1061 result
1062}
1063
1064
1065static validity_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1066
1067pub(crate) fn init_validity_getterinfo<D: DomTypes>() {
1068 validity_getterinfo.set(JSJitInfo {
1069 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1070 getter: Some(get_validity::<D>)
1071 },
1072 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1073 protoID: PrototypeList::ID::HTMLButtonElement as u16,
1074 },
1075 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1076 _bitfield_align_1: [],
1077 _bitfield_1: __BindgenBitfieldUnit::new(
1078 new_jsjitinfo_bitfield_1!(
1079 JSJitInfo_OpType::Getter as u8,
1080 JSJitInfo_AliasSet::AliasEverything as u8,
1081 JSValueType::JSVAL_TYPE_OBJECT as u8,
1082 true,
1083 false,
1084 false,
1085 false,
1086 false,
1087 false,
1088 0,
1089 ).to_ne_bytes()
1090 ),
1091});
1092}
1093unsafe extern "C" fn get_validationMessage<D: DomTypes>
1094(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1095 let mut result = false;
1096 wrap_panic(&mut || result = (|| {
1097 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1098 let this = &*(this as *const D::HTMLButtonElement);
1099 let result: DOMString = this.ValidationMessage();
1100
1101 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1102 return true;
1103 })());
1104 result
1105}
1106
1107
1108static validationMessage_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1109
1110pub(crate) fn init_validationMessage_getterinfo<D: DomTypes>() {
1111 validationMessage_getterinfo.set(JSJitInfo {
1112 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1113 getter: Some(get_validationMessage::<D>)
1114 },
1115 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1116 protoID: PrototypeList::ID::HTMLButtonElement as u16,
1117 },
1118 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1119 _bitfield_align_1: [],
1120 _bitfield_1: __BindgenBitfieldUnit::new(
1121 new_jsjitinfo_bitfield_1!(
1122 JSJitInfo_OpType::Getter as u8,
1123 JSJitInfo_AliasSet::AliasEverything as u8,
1124 JSValueType::JSVAL_TYPE_STRING as u8,
1125 true,
1126 false,
1127 false,
1128 false,
1129 false,
1130 false,
1131 0,
1132 ).to_ne_bytes()
1133 ),
1134});
1135}
1136unsafe extern "C" fn checkValidity<D: DomTypes>
1137(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
1138 let mut result = false;
1139 wrap_panic(&mut || result = (|| {
1140 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1141 let this = &*(this as *const D::HTMLButtonElement);
1142 let args = &*args;
1143 let argc = args.argc_;
1144 let result: bool = this.CheckValidity(CanGc::note());
1145
1146 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1147 return true;
1148 })());
1149 result
1150}
1151
1152
1153static checkValidity_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1154
1155pub(crate) fn init_checkValidity_methodinfo<D: DomTypes>() {
1156 checkValidity_methodinfo.set(JSJitInfo {
1157 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1158 method: Some(checkValidity::<D>)
1159 },
1160 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1161 protoID: PrototypeList::ID::HTMLButtonElement as u16,
1162 },
1163 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1164 _bitfield_align_1: [],
1165 _bitfield_1: __BindgenBitfieldUnit::new(
1166 new_jsjitinfo_bitfield_1!(
1167 JSJitInfo_OpType::Method as u8,
1168 JSJitInfo_AliasSet::AliasEverything as u8,
1169 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
1170 true,
1171 false,
1172 false,
1173 false,
1174 false,
1175 false,
1176 0,
1177 ).to_ne_bytes()
1178 ),
1179});
1180}
1181unsafe extern "C" fn reportValidity<D: DomTypes>
1182(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
1183 let mut result = false;
1184 wrap_panic(&mut || result = (|| {
1185 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1186 let this = &*(this as *const D::HTMLButtonElement);
1187 let args = &*args;
1188 let argc = args.argc_;
1189 let result: bool = this.ReportValidity(CanGc::note());
1190
1191 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1192 return true;
1193 })());
1194 result
1195}
1196
1197
1198static reportValidity_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1199
1200pub(crate) fn init_reportValidity_methodinfo<D: DomTypes>() {
1201 reportValidity_methodinfo.set(JSJitInfo {
1202 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1203 method: Some(reportValidity::<D>)
1204 },
1205 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1206 protoID: PrototypeList::ID::HTMLButtonElement as u16,
1207 },
1208 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1209 _bitfield_align_1: [],
1210 _bitfield_1: __BindgenBitfieldUnit::new(
1211 new_jsjitinfo_bitfield_1!(
1212 JSJitInfo_OpType::Method as u8,
1213 JSJitInfo_AliasSet::AliasEverything as u8,
1214 JSValueType::JSVAL_TYPE_BOOLEAN as u8,
1215 true,
1216 false,
1217 false,
1218 false,
1219 false,
1220 false,
1221 0,
1222 ).to_ne_bytes()
1223 ),
1224});
1225}
1226unsafe extern "C" fn setCustomValidity<D: DomTypes>
1227(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
1228 let mut result = false;
1229 wrap_panic(&mut || result = (|| {
1230 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1231 let this = &*(this as *const D::HTMLButtonElement);
1232 let args = &*args;
1233 let argc = args.argc_;
1234
1235 if argc < 1 {
1236 throw_type_error(cx.raw_cx(), "Not enough arguments to \"HTMLButtonElement.setCustomValidity\".");
1237 return false;
1238 }
1239 let arg0: DOMString = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
1240 Ok(ConversionResult::Success(value)) => value,
1241 Ok(ConversionResult::Failure(error)) => {
1242 throw_type_error(cx.raw_cx(), &error);
1243 return false;
1244
1245 }
1246 _ => {
1247 return false;
1248
1249 },
1250 }
1251 ;
1252 let result: () = this.SetCustomValidity(arg0, CanGc::note());
1253
1254 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1255 return true;
1256 })());
1257 result
1258}
1259
1260
1261static setCustomValidity_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1262
1263pub(crate) fn init_setCustomValidity_methodinfo<D: DomTypes>() {
1264 setCustomValidity_methodinfo.set(JSJitInfo {
1265 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1266 method: Some(setCustomValidity::<D>)
1267 },
1268 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1269 protoID: PrototypeList::ID::HTMLButtonElement as u16,
1270 },
1271 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1272 _bitfield_align_1: [],
1273 _bitfield_1: __BindgenBitfieldUnit::new(
1274 new_jsjitinfo_bitfield_1!(
1275 JSJitInfo_OpType::Method as u8,
1276 JSJitInfo_AliasSet::AliasEverything as u8,
1277 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
1278 false,
1279 false,
1280 false,
1281 false,
1282 false,
1283 false,
1284 0,
1285 ).to_ne_bytes()
1286 ),
1287});
1288}
1289unsafe extern "C" fn get_labels<D: DomTypes>
1290(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
1291 let mut result = false;
1292 wrap_panic(&mut || result = (|| {
1293 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1294 let this = &*(this as *const D::HTMLButtonElement);
1295 let result: DomRoot<D::NodeList> = this.Labels();
1296
1297 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
1298 return true;
1299 })());
1300 result
1301}
1302
1303
1304static labels_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
1305
1306pub(crate) fn init_labels_getterinfo<D: DomTypes>() {
1307 labels_getterinfo.set(JSJitInfo {
1308 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
1309 getter: Some(get_labels::<D>)
1310 },
1311 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
1312 protoID: PrototypeList::ID::HTMLButtonElement as u16,
1313 },
1314 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
1315 _bitfield_align_1: [],
1316 _bitfield_1: __BindgenBitfieldUnit::new(
1317 new_jsjitinfo_bitfield_1!(
1318 JSJitInfo_OpType::Getter as u8,
1319 JSJitInfo_AliasSet::AliasEverything as u8,
1320 JSValueType::JSVAL_TYPE_OBJECT as u8,
1321 true,
1322 false,
1323 false,
1324 false,
1325 false,
1326 false,
1327 0,
1328 ).to_ne_bytes()
1329 ),
1330});
1331}
1332unsafe extern "C" fn _finalize<D: DomTypes>
1333(_cx: *mut GCContext, obj: *mut JSObject){
1334 wrap_panic(&mut || {
1335
1336 let this = native_from_object_static::<D::HTMLButtonElement>(obj).unwrap();
1337 finalize_common(this);
1338 })
1339}
1340
1341unsafe extern "C" fn _trace<D: DomTypes>
1342(trc: *mut JSTracer, obj: *mut JSObject){
1343 wrap_panic(&mut || {
1344
1345 let this = native_from_object_static::<D::HTMLButtonElement>(obj).unwrap();
1346 if this.is_null() { return; } (*this).trace(trc);
1348 })
1349}
1350
1351
1352static CLASS_OPS: ThreadUnsafeOnceLock<JSClassOps> = ThreadUnsafeOnceLock::new();
1353
1354pub(crate) fn init_class_ops<D: DomTypes>() {
1355 CLASS_OPS.set(JSClassOps {
1356 addProperty: None,
1357 delProperty: None,
1358 enumerate: None,
1359 newEnumerate: None,
1360 resolve: None,
1361 mayResolve: None,
1362 finalize: Some(_finalize::<D>),
1363 call: None,
1364 construct: None,
1365 trace: Some(_trace::<D>),
1366 });
1367}
1368
1369pub static Class: ThreadUnsafeOnceLock<DOMJSClass> = ThreadUnsafeOnceLock::new();
1370
1371pub(crate) fn init_domjs_class<D: DomTypes>() {
1372 init_class_ops::<D>();
1373 Class.set(DOMJSClass {
1374 base: JSClass {
1375 name: c"HTMLButtonElement".as_ptr(),
1376 flags: JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE |
1377 (((1) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT)
1378 ,
1379 cOps: unsafe { CLASS_OPS.get() },
1380 spec: ptr::null(),
1381 ext: ptr::null(),
1382 oOps: ptr::null(),
1383 },
1384 dom_class:
1385DOMClass {
1386 interface_chain: [ PrototypeList::ID::EventTarget, PrototypeList::ID::Node, PrototypeList::ID::Element, PrototypeList::ID::HTMLElement, PrototypeList::ID::HTMLButtonElement, PrototypeList::ID::Last ],
1387 depth: 4,
1388 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::HTMLButtonElement)))) },
1389 malloc_size_of: malloc_size_of_including_raw_self::<D::HTMLButtonElement> as unsafe fn(&mut _, _) -> _,
1390 global: Globals::EMPTY,
1391},
1392 });
1393}
1394
1395#[cfg_attr(crown, allow(crown::unrooted_must_root))] pub unsafe fn Wrap<D: DomTypes>
1396(cx: SafeJSContext, scope: &D::GlobalScope, given_proto: Option<HandleObject>, object: Box<D::HTMLButtonElement>, _can_gc: CanGc) -> DomRoot<D::HTMLButtonElement>{
1397
1398 let raw = Root::new(MaybeUnreflectedDom::from_box(object));
1399
1400 let scope = scope.reflector().get_jsobject();
1401 assert!(!scope.get().is_null());
1402 assert!(((*get_object_class(scope.get())).flags & JSCLASS_IS_GLOBAL) != 0);
1403 let _ac = JSAutoRealm::new(cx.raw_cx(), scope.get());
1404
1405 rooted!(&in(cx) let mut canonical_proto = ptr::null_mut::<JSObject>());
1406 GetProtoObject::<D>(cx, scope, canonical_proto.handle_mut());
1407 assert!(!canonical_proto.is_null());
1408
1409
1410 rooted!(&in(cx) let mut proto = ptr::null_mut::<JSObject>());
1411 if let Some(given) = given_proto {
1412 proto.set(*given);
1413 if get_context_realm(cx.raw_cx()) != get_object_realm(*given) {
1414 assert!(JS_WrapObject(cx.raw_cx(), proto.handle_mut()));
1415 }
1416 } else {
1417 proto.set(*canonical_proto);
1418 }
1419 rooted!(&in(cx) let obj = JS_NewObjectWithGivenProto(
1420 cx.raw_cx(),
1421 &Class.get().base,
1422 proto.handle(),
1423 ));
1424 assert!(!obj.is_null());
1425 JS_SetReservedSlot(
1426 obj.get(),
1427 DOM_OBJECT_SLOT,
1428 &PrivateValue(raw.as_ptr() as *const libc::c_void),
1429 );
1430
1431 let root = raw.reflect_with(obj.get());
1432
1433
1434
1435 DomRoot::from_ref(&*root)
1436}
1437
1438pub trait HTMLButtonElementMethods<D: DomTypes> {
1439 fn Disabled(&self, ) -> bool;
1440 fn SetDisabled(&self, r#value: bool);
1441 fn GetForm(&self, ) -> Option<DomRoot<D::HTMLFormElement>>;
1442 fn FormAction(&self, ) -> DOMString;
1443 fn SetFormAction(&self, r#value: DOMString);
1444 fn FormEnctype(&self, ) -> DOMString;
1445 fn SetFormEnctype(&self, r#value: DOMString);
1446 fn FormMethod(&self, ) -> DOMString;
1447 fn SetFormMethod(&self, r#value: DOMString);
1448 fn FormNoValidate(&self, ) -> bool;
1449 fn SetFormNoValidate(&self, r#value: bool);
1450 fn FormTarget(&self, ) -> DOMString;
1451 fn SetFormTarget(&self, r#value: DOMString);
1452 fn Name(&self, ) -> DOMString;
1453 fn SetName(&self, r#value: DOMString);
1454 fn Type(&self, ) -> DOMString;
1455 fn SetType(&self, r#value: DOMString);
1456 fn Value(&self, ) -> DOMString;
1457 fn SetValue(&self, r#value: DOMString);
1458 fn WillValidate(&self, ) -> bool;
1459 fn Validity(&self, r#_can_gc: CanGc) -> DomRoot<D::ValidityState>;
1460 fn ValidationMessage(&self, ) -> DOMString;
1461 fn CheckValidity(&self, r#_can_gc: CanGc) -> bool;
1462 fn ReportValidity(&self, r#_can_gc: CanGc) -> bool;
1463 fn SetCustomValidity(&self, r#error: DOMString, r#_can_gc: CanGc);
1464 fn Labels(&self, ) -> DomRoot<D::NodeList>;
1465}
1466static sMethods_specs: ThreadUnsafeOnceLock<&[&[JSFunctionSpec]]> = ThreadUnsafeOnceLock::new();
1467
1468pub(crate) fn init_sMethods_specs<D: DomTypes>() {
1469 sMethods_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
1470 JSFunctionSpec {
1471 name: JSPropertySpec_Name { string_: c"checkValidity".as_ptr() },
1472 call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { checkValidity_methodinfo.get() } as *const _ as *const JSJitInfo },
1473 nargs: 0,
1474 flags: (JSPROP_ENUMERATE) as u16,
1475 selfHostedName: ptr::null()
1476 },
1477 JSFunctionSpec {
1478 name: JSPropertySpec_Name { string_: c"reportValidity".as_ptr() },
1479 call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { reportValidity_methodinfo.get() } as *const _ as *const JSJitInfo },
1480 nargs: 0,
1481 flags: (JSPROP_ENUMERATE) as u16,
1482 selfHostedName: ptr::null()
1483 },
1484 JSFunctionSpec {
1485 name: JSPropertySpec_Name { string_: c"setCustomValidity".as_ptr() },
1486 call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { setCustomValidity_methodinfo.get() } as *const _ as *const JSJitInfo },
1487 nargs: 1,
1488 flags: (JSPROP_ENUMERATE) as u16,
1489 selfHostedName: ptr::null()
1490 },
1491 JSFunctionSpec {
1492 name: JSPropertySpec_Name { string_: ptr::null() },
1493 call: JSNativeWrapper { op: None, info: ptr::null() },
1494 nargs: 0,
1495 flags: 0,
1496 selfHostedName: ptr::null()
1497 }]))[..]
1498])));
1499}static sMethods: ThreadUnsafeOnceLock<&[Guard<&[JSFunctionSpec]>]> = ThreadUnsafeOnceLock::new();
1500
1501pub(crate) fn init_sMethods_prefs<D: DomTypes>() {
1502 sMethods.set(Box::leak(Box::new([ Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sMethods_specs.get() })[0])])));
1503}static sAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
1504
1505pub(crate) fn init_sAttributes_specs<D: DomTypes>() {
1506 sAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
1507 JSPropertySpec {
1508 name: JSPropertySpec_Name { string_: c"disabled".as_ptr() },
1509 attributes_: (JSPROP_ENUMERATE),
1510 kind_: (JSPropertySpec_Kind::NativeAccessor),
1511 u: JSPropertySpec_AccessorsOrValue {
1512 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1513 getter: JSPropertySpec_Accessor {
1514 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { disabled_getterinfo.get() } },
1515 },
1516 setter: JSPropertySpec_Accessor {
1517 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { disabled_setterinfo.get() } },
1518 }
1519 }
1520 }
1521 }
1522,
1523 JSPropertySpec {
1524 name: JSPropertySpec_Name { string_: c"form".as_ptr() },
1525 attributes_: (JSPROP_ENUMERATE),
1526 kind_: (JSPropertySpec_Kind::NativeAccessor),
1527 u: JSPropertySpec_AccessorsOrValue {
1528 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1529 getter: JSPropertySpec_Accessor {
1530 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { form_getterinfo.get() } },
1531 },
1532 setter: JSPropertySpec_Accessor {
1533 native: JSNativeWrapper { op: None, info: ptr::null() },
1534 }
1535 }
1536 }
1537 }
1538,
1539 JSPropertySpec {
1540 name: JSPropertySpec_Name { string_: c"formAction".as_ptr() },
1541 attributes_: (JSPROP_ENUMERATE),
1542 kind_: (JSPropertySpec_Kind::NativeAccessor),
1543 u: JSPropertySpec_AccessorsOrValue {
1544 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1545 getter: JSPropertySpec_Accessor {
1546 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { formAction_getterinfo.get() } },
1547 },
1548 setter: JSPropertySpec_Accessor {
1549 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { formAction_setterinfo.get() } },
1550 }
1551 }
1552 }
1553 }
1554,
1555 JSPropertySpec {
1556 name: JSPropertySpec_Name { string_: c"formEnctype".as_ptr() },
1557 attributes_: (JSPROP_ENUMERATE),
1558 kind_: (JSPropertySpec_Kind::NativeAccessor),
1559 u: JSPropertySpec_AccessorsOrValue {
1560 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1561 getter: JSPropertySpec_Accessor {
1562 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { formEnctype_getterinfo.get() } },
1563 },
1564 setter: JSPropertySpec_Accessor {
1565 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { formEnctype_setterinfo.get() } },
1566 }
1567 }
1568 }
1569 }
1570,
1571 JSPropertySpec {
1572 name: JSPropertySpec_Name { string_: c"formMethod".as_ptr() },
1573 attributes_: (JSPROP_ENUMERATE),
1574 kind_: (JSPropertySpec_Kind::NativeAccessor),
1575 u: JSPropertySpec_AccessorsOrValue {
1576 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1577 getter: JSPropertySpec_Accessor {
1578 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { formMethod_getterinfo.get() } },
1579 },
1580 setter: JSPropertySpec_Accessor {
1581 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { formMethod_setterinfo.get() } },
1582 }
1583 }
1584 }
1585 }
1586,
1587 JSPropertySpec {
1588 name: JSPropertySpec_Name { string_: c"formNoValidate".as_ptr() },
1589 attributes_: (JSPROP_ENUMERATE),
1590 kind_: (JSPropertySpec_Kind::NativeAccessor),
1591 u: JSPropertySpec_AccessorsOrValue {
1592 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1593 getter: JSPropertySpec_Accessor {
1594 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { formNoValidate_getterinfo.get() } },
1595 },
1596 setter: JSPropertySpec_Accessor {
1597 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { formNoValidate_setterinfo.get() } },
1598 }
1599 }
1600 }
1601 }
1602,
1603 JSPropertySpec {
1604 name: JSPropertySpec_Name { string_: c"formTarget".as_ptr() },
1605 attributes_: (JSPROP_ENUMERATE),
1606 kind_: (JSPropertySpec_Kind::NativeAccessor),
1607 u: JSPropertySpec_AccessorsOrValue {
1608 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1609 getter: JSPropertySpec_Accessor {
1610 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { formTarget_getterinfo.get() } },
1611 },
1612 setter: JSPropertySpec_Accessor {
1613 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { formTarget_setterinfo.get() } },
1614 }
1615 }
1616 }
1617 }
1618,
1619 JSPropertySpec {
1620 name: JSPropertySpec_Name { string_: c"name".as_ptr() },
1621 attributes_: (JSPROP_ENUMERATE),
1622 kind_: (JSPropertySpec_Kind::NativeAccessor),
1623 u: JSPropertySpec_AccessorsOrValue {
1624 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1625 getter: JSPropertySpec_Accessor {
1626 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { name_getterinfo.get() } },
1627 },
1628 setter: JSPropertySpec_Accessor {
1629 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { name_setterinfo.get() } },
1630 }
1631 }
1632 }
1633 }
1634,
1635 JSPropertySpec {
1636 name: JSPropertySpec_Name { string_: c"type".as_ptr() },
1637 attributes_: (JSPROP_ENUMERATE),
1638 kind_: (JSPropertySpec_Kind::NativeAccessor),
1639 u: JSPropertySpec_AccessorsOrValue {
1640 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1641 getter: JSPropertySpec_Accessor {
1642 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { type_getterinfo.get() } },
1643 },
1644 setter: JSPropertySpec_Accessor {
1645 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { type_setterinfo.get() } },
1646 }
1647 }
1648 }
1649 }
1650,
1651 JSPropertySpec {
1652 name: JSPropertySpec_Name { string_: c"value".as_ptr() },
1653 attributes_: (JSPROP_ENUMERATE),
1654 kind_: (JSPropertySpec_Kind::NativeAccessor),
1655 u: JSPropertySpec_AccessorsOrValue {
1656 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1657 getter: JSPropertySpec_Accessor {
1658 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { value_getterinfo.get() } },
1659 },
1660 setter: JSPropertySpec_Accessor {
1661 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { value_setterinfo.get() } },
1662 }
1663 }
1664 }
1665 }
1666,
1667 JSPropertySpec {
1668 name: JSPropertySpec_Name { string_: c"willValidate".as_ptr() },
1669 attributes_: (JSPROP_ENUMERATE),
1670 kind_: (JSPropertySpec_Kind::NativeAccessor),
1671 u: JSPropertySpec_AccessorsOrValue {
1672 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1673 getter: JSPropertySpec_Accessor {
1674 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { willValidate_getterinfo.get() } },
1675 },
1676 setter: JSPropertySpec_Accessor {
1677 native: JSNativeWrapper { op: None, info: ptr::null() },
1678 }
1679 }
1680 }
1681 }
1682,
1683 JSPropertySpec {
1684 name: JSPropertySpec_Name { string_: c"validity".as_ptr() },
1685 attributes_: (JSPROP_ENUMERATE),
1686 kind_: (JSPropertySpec_Kind::NativeAccessor),
1687 u: JSPropertySpec_AccessorsOrValue {
1688 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1689 getter: JSPropertySpec_Accessor {
1690 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { validity_getterinfo.get() } },
1691 },
1692 setter: JSPropertySpec_Accessor {
1693 native: JSNativeWrapper { op: None, info: ptr::null() },
1694 }
1695 }
1696 }
1697 }
1698,
1699 JSPropertySpec {
1700 name: JSPropertySpec_Name { string_: c"validationMessage".as_ptr() },
1701 attributes_: (JSPROP_ENUMERATE),
1702 kind_: (JSPropertySpec_Kind::NativeAccessor),
1703 u: JSPropertySpec_AccessorsOrValue {
1704 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1705 getter: JSPropertySpec_Accessor {
1706 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { validationMessage_getterinfo.get() } },
1707 },
1708 setter: JSPropertySpec_Accessor {
1709 native: JSNativeWrapper { op: None, info: ptr::null() },
1710 }
1711 }
1712 }
1713 }
1714,
1715 JSPropertySpec {
1716 name: JSPropertySpec_Name { string_: c"labels".as_ptr() },
1717 attributes_: (JSPROP_ENUMERATE),
1718 kind_: (JSPropertySpec_Kind::NativeAccessor),
1719 u: JSPropertySpec_AccessorsOrValue {
1720 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
1721 getter: JSPropertySpec_Accessor {
1722 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { labels_getterinfo.get() } },
1723 },
1724 setter: JSPropertySpec_Accessor {
1725 native: JSNativeWrapper { op: None, info: ptr::null() },
1726 }
1727 }
1728 }
1729 }
1730,
1731 JSPropertySpec::ZERO]))[..]
1732,
1733&Box::leak(Box::new([
1734 JSPropertySpec {
1735 name: JSPropertySpec_Name { symbol_: SymbolCode::toStringTag as usize + 1 },
1736 attributes_: (JSPROP_READONLY),
1737 kind_: (JSPropertySpec_Kind::Value),
1738 u: JSPropertySpec_AccessorsOrValue {
1739 value: JSPropertySpec_ValueWrapper {
1740 type_: JSPropertySpec_ValueWrapper_Type::String,
1741 __bindgen_anon_1: JSPropertySpec_ValueWrapper__bindgen_ty_1 {
1742 string: c"HTMLButtonElement".as_ptr(),
1743 }
1744 }
1745 }
1746 }
1747,
1748 JSPropertySpec::ZERO]))[..]
1749])));
1750}static sAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
1751
1752pub(crate) fn init_sAttributes_prefs<D: DomTypes>() {
1753 sAttributes.set(Box::leak(Box::new([ Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sAttributes_specs.get() })[0]),
1754 Guard::new(&[Condition::Satisfied], (unsafe { sAttributes_specs.get() })[1])])));
1755}
1756pub fn GetProtoObject<D: DomTypes>
1757(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
1758 get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::HTMLButtonElement), CreateInterfaceObjects::<D>, rval)
1760}
1761
1762
1763static PrototypeClass: JSClass = JSClass {
1764 name: c"HTMLButtonElementPrototype".as_ptr(),
1765 flags:
1766 (0 ) << JSCLASS_RESERVED_SLOTS_SHIFT,
1768 cOps: ptr::null(),
1769 spec: ptr::null(),
1770 ext: ptr::null(),
1771 oOps: ptr::null(),
1772};
1773
1774unsafe extern "C" fn _constructor<D: DomTypes>
1775(cx: *mut RawJSContext, argc: u32, vp: *mut JSVal) -> bool{
1776 let mut result = false;
1777 wrap_panic(&mut || result = {
1778 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
1779 let args = CallArgs::from_vp(vp, argc);
1780 let global = D::GlobalScope::from_object(JS_CALLEE(cx.raw_cx(), vp).to_object());
1781
1782 <D as DomHelpers<D>>::call_html_constructor::<D::HTMLButtonElement>(
1783 SafeJSContext::from_ptr(cx.raw_cx()),
1784 &args,
1785 &global,
1786 PrototypeList::ID::HTMLButtonElement,
1787 CreateInterfaceObjects::<D>,
1788 CanGc::note()
1789 )
1790
1791 });
1792 result
1793}
1794
1795
1796static INTERFACE_OBJECT_CLASS: ThreadUnsafeOnceLock<NonCallbackInterfaceObjectClass> = ThreadUnsafeOnceLock::new();
1797
1798pub(crate) fn init_interface_object<D: DomTypes>() {
1799 INTERFACE_OBJECT_CLASS.set(NonCallbackInterfaceObjectClass::new(
1800 Box::leak(Box::new(InterfaceConstructorBehavior::call(_constructor::<D>))),
1801 b"function HTMLButtonElement() {\n [native code]\n}",
1802 PrototypeList::ID::HTMLButtonElement,
1803 4,
1804 ));
1805}
1806
1807pub fn GetConstructorObject<D: DomTypes>
1808(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
1809 get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::Constructor(PrototypeList::Constructor::HTMLButtonElement), CreateInterfaceObjects::<D>, rval)
1811}
1812
1813pub fn DefineDOMInterface<D: DomTypes>
1814(cx: SafeJSContext, global: HandleObject){
1815 define_dom_interface(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::HTMLButtonElement),CreateInterfaceObjects::<D>, ConstructorEnabled::<D>)
1816}
1817
1818pub fn ConstructorEnabled<D: DomTypes>
1819(aCx: SafeJSContext, aObj: HandleObject) -> bool{
1820 is_exposed_in(aObj, Globals::WINDOW)
1821}
1822
1823unsafe fn CreateInterfaceObjects<D: DomTypes>
1824(cx: SafeJSContext, global: HandleObject, cache: *mut ProtoOrIfaceArray){
1825
1826 rooted!(&in(cx) let mut prototype_proto = ptr::null_mut::<JSObject>());
1827 HTMLElement_Binding::GetProtoObject::<D>(cx, global, prototype_proto.handle_mut());
1828 assert!(!prototype_proto.is_null());
1829
1830 rooted!(&in(cx) let mut prototype = ptr::null_mut::<JSObject>());
1831 create_interface_prototype_object::<D>(cx,
1832 global,
1833 prototype_proto.handle(),
1834 &PrototypeClass,
1835 sMethods.get(),
1836 sAttributes.get(),
1837 &[],
1838 &[],
1839 prototype.handle_mut());
1840 assert!(!prototype.is_null());
1841 assert!((*cache)[PrototypeList::ID::HTMLButtonElement as usize].is_null());
1842 (*cache)[PrototypeList::ID::HTMLButtonElement as usize] = prototype.get();
1843 <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::HTMLButtonElement as isize),
1844 ptr::null_mut(),
1845 prototype.get());
1846
1847 rooted!(&in(cx) let mut interface_proto = ptr::null_mut::<JSObject>());
1848
1849 HTMLElement_Binding::GetConstructorObject::<D>(cx, global, interface_proto.handle_mut());
1850
1851 assert!(!interface_proto.is_null());
1852
1853 rooted!(&in(cx) let mut interface = ptr::null_mut::<JSObject>());
1854 create_noncallback_interface_object::<D>(cx,
1855 global,
1856 interface_proto.handle(),
1857 INTERFACE_OBJECT_CLASS.get(),
1858 &[],
1859 &[],
1860 &[],
1861 prototype.handle(),
1862 c"HTMLButtonElement",
1863 0,
1864 &[],
1865 interface.handle_mut());
1866 assert!(!interface.is_null());
1867
1868 assert!((*cache)[PrototypeList::Constructor::HTMLButtonElement as usize].is_null());
1869 (*cache)[PrototypeList::Constructor::HTMLButtonElement as usize] = interface.get();
1870 <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::Constructor::HTMLButtonElement as isize),
1871 ptr::null_mut(),
1872 interface.get());
1873
1874}
1875
1876
1877 pub(crate) fn init_statics<D: DomTypes>() {
1878 init_interface_object::<D>();
1879 init_domjs_class::<D>();
1880 crate::codegen::GenericBindings::HTMLButtonElementBinding::HTMLButtonElement_Binding::init_checkValidity_methodinfo::<D>();
1881crate::codegen::GenericBindings::HTMLButtonElementBinding::HTMLButtonElement_Binding::init_reportValidity_methodinfo::<D>();
1882crate::codegen::GenericBindings::HTMLButtonElementBinding::HTMLButtonElement_Binding::init_setCustomValidity_methodinfo::<D>();
1883 init_disabled_getterinfo::<D>();
1884init_form_getterinfo::<D>();
1885init_formAction_getterinfo::<D>();
1886init_formEnctype_getterinfo::<D>();
1887init_formMethod_getterinfo::<D>();
1888init_formNoValidate_getterinfo::<D>();
1889init_formTarget_getterinfo::<D>();
1890init_name_getterinfo::<D>();
1891init_type_getterinfo::<D>();
1892init_value_getterinfo::<D>();
1893init_willValidate_getterinfo::<D>();
1894init_validity_getterinfo::<D>();
1895init_validationMessage_getterinfo::<D>();
1896init_labels_getterinfo::<D>();
1897 init_disabled_setterinfo::<D>();
1898init_formAction_setterinfo::<D>();
1899init_formEnctype_setterinfo::<D>();
1900init_formMethod_setterinfo::<D>();
1901init_formNoValidate_setterinfo::<D>();
1902init_formTarget_setterinfo::<D>();
1903init_name_setterinfo::<D>();
1904init_type_setterinfo::<D>();
1905init_value_setterinfo::<D>();
1906
1907 init_sMethods_specs::<D>();
1908init_sMethods_prefs::<D>();
1909init_sAttributes_specs::<D>();
1910init_sAttributes_prefs::<D>();
1911 }
1912 }