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::HTMLMeterElement_Binding::{Wrap, HTMLMeterElementMethods, GetProtoObject, GetConstructorObject, DefineDOMInterface};
12pub mod HTMLMeterElement_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_value<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::HTMLMeterElement);
25 <D as DomHelpers<D>>::push_new_element_queue();
26
27 let result: Finite<f64> = this.Value();
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_value<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::HTMLMeterElement);
43 let arg0: Finite<f64> = 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.SetValue(arg0, CanGc::note());
59 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
60
61
62 true
63 })());
64 result
65}
66
67
68static value_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
69
70pub(crate) fn init_value_getterinfo<D: DomTypes>() {
71 value_getterinfo.set(JSJitInfo {
72 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
73 getter: Some(get_value::<D>)
74 },
75 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
76 protoID: PrototypeList::ID::HTMLMeterElement 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_DOUBLE as u8,
85 true,
86 false,
87 false,
88 false,
89 false,
90 false,
91 0,
92 ).to_ne_bytes()
93 ),
94});
95}
96static value_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
97
98pub(crate) fn init_value_setterinfo<D: DomTypes>() {
99 value_setterinfo.set(JSJitInfo {
100 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
101 setter: Some(set_value::<D>)
102 },
103 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
104 protoID: PrototypeList::ID::HTMLMeterElement 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_min<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::HTMLMeterElement);
130 <D as DomHelpers<D>>::push_new_element_queue();
131
132 let result: Finite<f64> = this.Min();
133 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
134
135
136 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
137 return true;
138 })());
139 result
140}
141
142unsafe extern "C" fn set_min<D: DomTypes>
143(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
144 let mut result = false;
145 wrap_panic(&mut || result = (|| {
146 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
147 let this = &*(this as *const D::HTMLMeterElement);
148 let arg0: Finite<f64> = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
149 Ok(ConversionResult::Success(value)) => value,
150 Ok(ConversionResult::Failure(error)) => {
151 throw_type_error(cx.raw_cx(), &error);
152 return false;
153
154 }
155 _ => {
156 return false;
157
158 },
159 }
160 ;
161 <D as DomHelpers<D>>::push_new_element_queue();
162
163 let result: () = this.SetMin(arg0, CanGc::note());
164 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
165
166
167 true
168 })());
169 result
170}
171
172
173static min_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
174
175pub(crate) fn init_min_getterinfo<D: DomTypes>() {
176 min_getterinfo.set(JSJitInfo {
177 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
178 getter: Some(get_min::<D>)
179 },
180 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
181 protoID: PrototypeList::ID::HTMLMeterElement as u16,
182 },
183 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
184 _bitfield_align_1: [],
185 _bitfield_1: __BindgenBitfieldUnit::new(
186 new_jsjitinfo_bitfield_1!(
187 JSJitInfo_OpType::Getter as u8,
188 JSJitInfo_AliasSet::AliasEverything as u8,
189 JSValueType::JSVAL_TYPE_DOUBLE as u8,
190 true,
191 false,
192 false,
193 false,
194 false,
195 false,
196 0,
197 ).to_ne_bytes()
198 ),
199});
200}
201static min_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
202
203pub(crate) fn init_min_setterinfo<D: DomTypes>() {
204 min_setterinfo.set(JSJitInfo {
205 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
206 setter: Some(set_min::<D>)
207 },
208 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
209 protoID: PrototypeList::ID::HTMLMeterElement as u16,
210 },
211 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
212 _bitfield_align_1: [],
213 _bitfield_1: __BindgenBitfieldUnit::new(
214 new_jsjitinfo_bitfield_1!(
215 JSJitInfo_OpType::Setter as u8,
216 JSJitInfo_AliasSet::AliasEverything as u8,
217 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
218 false,
219 false,
220 false,
221 false,
222 false,
223 false,
224 0,
225 ).to_ne_bytes()
226 ),
227});
228}
229unsafe extern "C" fn get_max<D: DomTypes>
230(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
231 let mut result = false;
232 wrap_panic(&mut || result = (|| {
233 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
234 let this = &*(this as *const D::HTMLMeterElement);
235 <D as DomHelpers<D>>::push_new_element_queue();
236
237 let result: Finite<f64> = this.Max();
238 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
239
240
241 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
242 return true;
243 })());
244 result
245}
246
247unsafe extern "C" fn set_max<D: DomTypes>
248(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
249 let mut result = false;
250 wrap_panic(&mut || result = (|| {
251 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
252 let this = &*(this as *const D::HTMLMeterElement);
253 let arg0: Finite<f64> = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
254 Ok(ConversionResult::Success(value)) => value,
255 Ok(ConversionResult::Failure(error)) => {
256 throw_type_error(cx.raw_cx(), &error);
257 return false;
258
259 }
260 _ => {
261 return false;
262
263 },
264 }
265 ;
266 <D as DomHelpers<D>>::push_new_element_queue();
267
268 let result: () = this.SetMax(arg0, CanGc::note());
269 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
270
271
272 true
273 })());
274 result
275}
276
277
278static max_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
279
280pub(crate) fn init_max_getterinfo<D: DomTypes>() {
281 max_getterinfo.set(JSJitInfo {
282 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
283 getter: Some(get_max::<D>)
284 },
285 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
286 protoID: PrototypeList::ID::HTMLMeterElement as u16,
287 },
288 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
289 _bitfield_align_1: [],
290 _bitfield_1: __BindgenBitfieldUnit::new(
291 new_jsjitinfo_bitfield_1!(
292 JSJitInfo_OpType::Getter as u8,
293 JSJitInfo_AliasSet::AliasEverything as u8,
294 JSValueType::JSVAL_TYPE_DOUBLE as u8,
295 true,
296 false,
297 false,
298 false,
299 false,
300 false,
301 0,
302 ).to_ne_bytes()
303 ),
304});
305}
306static max_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
307
308pub(crate) fn init_max_setterinfo<D: DomTypes>() {
309 max_setterinfo.set(JSJitInfo {
310 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
311 setter: Some(set_max::<D>)
312 },
313 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
314 protoID: PrototypeList::ID::HTMLMeterElement as u16,
315 },
316 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
317 _bitfield_align_1: [],
318 _bitfield_1: __BindgenBitfieldUnit::new(
319 new_jsjitinfo_bitfield_1!(
320 JSJitInfo_OpType::Setter as u8,
321 JSJitInfo_AliasSet::AliasEverything as u8,
322 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
323 false,
324 false,
325 false,
326 false,
327 false,
328 false,
329 0,
330 ).to_ne_bytes()
331 ),
332});
333}
334unsafe extern "C" fn get_low<D: DomTypes>
335(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
336 let mut result = false;
337 wrap_panic(&mut || result = (|| {
338 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
339 let this = &*(this as *const D::HTMLMeterElement);
340 <D as DomHelpers<D>>::push_new_element_queue();
341
342 let result: Finite<f64> = this.Low();
343 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
344
345
346 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
347 return true;
348 })());
349 result
350}
351
352unsafe extern "C" fn set_low<D: DomTypes>
353(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
354 let mut result = false;
355 wrap_panic(&mut || result = (|| {
356 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
357 let this = &*(this as *const D::HTMLMeterElement);
358 let arg0: Finite<f64> = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
359 Ok(ConversionResult::Success(value)) => value,
360 Ok(ConversionResult::Failure(error)) => {
361 throw_type_error(cx.raw_cx(), &error);
362 return false;
363
364 }
365 _ => {
366 return false;
367
368 },
369 }
370 ;
371 <D as DomHelpers<D>>::push_new_element_queue();
372
373 let result: () = this.SetLow(arg0, CanGc::note());
374 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
375
376
377 true
378 })());
379 result
380}
381
382
383static low_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
384
385pub(crate) fn init_low_getterinfo<D: DomTypes>() {
386 low_getterinfo.set(JSJitInfo {
387 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
388 getter: Some(get_low::<D>)
389 },
390 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
391 protoID: PrototypeList::ID::HTMLMeterElement as u16,
392 },
393 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
394 _bitfield_align_1: [],
395 _bitfield_1: __BindgenBitfieldUnit::new(
396 new_jsjitinfo_bitfield_1!(
397 JSJitInfo_OpType::Getter as u8,
398 JSJitInfo_AliasSet::AliasEverything as u8,
399 JSValueType::JSVAL_TYPE_DOUBLE as u8,
400 true,
401 false,
402 false,
403 false,
404 false,
405 false,
406 0,
407 ).to_ne_bytes()
408 ),
409});
410}
411static low_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
412
413pub(crate) fn init_low_setterinfo<D: DomTypes>() {
414 low_setterinfo.set(JSJitInfo {
415 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
416 setter: Some(set_low::<D>)
417 },
418 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
419 protoID: PrototypeList::ID::HTMLMeterElement as u16,
420 },
421 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
422 _bitfield_align_1: [],
423 _bitfield_1: __BindgenBitfieldUnit::new(
424 new_jsjitinfo_bitfield_1!(
425 JSJitInfo_OpType::Setter as u8,
426 JSJitInfo_AliasSet::AliasEverything as u8,
427 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
428 false,
429 false,
430 false,
431 false,
432 false,
433 false,
434 0,
435 ).to_ne_bytes()
436 ),
437});
438}
439unsafe extern "C" fn get_high<D: DomTypes>
440(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
441 let mut result = false;
442 wrap_panic(&mut || result = (|| {
443 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
444 let this = &*(this as *const D::HTMLMeterElement);
445 <D as DomHelpers<D>>::push_new_element_queue();
446
447 let result: Finite<f64> = this.High();
448 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
449
450
451 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
452 return true;
453 })());
454 result
455}
456
457unsafe extern "C" fn set_high<D: DomTypes>
458(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
459 let mut result = false;
460 wrap_panic(&mut || result = (|| {
461 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
462 let this = &*(this as *const D::HTMLMeterElement);
463 let arg0: Finite<f64> = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
464 Ok(ConversionResult::Success(value)) => value,
465 Ok(ConversionResult::Failure(error)) => {
466 throw_type_error(cx.raw_cx(), &error);
467 return false;
468
469 }
470 _ => {
471 return false;
472
473 },
474 }
475 ;
476 <D as DomHelpers<D>>::push_new_element_queue();
477
478 let result: () = this.SetHigh(arg0, CanGc::note());
479 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
480
481
482 true
483 })());
484 result
485}
486
487
488static high_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
489
490pub(crate) fn init_high_getterinfo<D: DomTypes>() {
491 high_getterinfo.set(JSJitInfo {
492 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
493 getter: Some(get_high::<D>)
494 },
495 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
496 protoID: PrototypeList::ID::HTMLMeterElement as u16,
497 },
498 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
499 _bitfield_align_1: [],
500 _bitfield_1: __BindgenBitfieldUnit::new(
501 new_jsjitinfo_bitfield_1!(
502 JSJitInfo_OpType::Getter as u8,
503 JSJitInfo_AliasSet::AliasEverything as u8,
504 JSValueType::JSVAL_TYPE_DOUBLE as u8,
505 true,
506 false,
507 false,
508 false,
509 false,
510 false,
511 0,
512 ).to_ne_bytes()
513 ),
514});
515}
516static high_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
517
518pub(crate) fn init_high_setterinfo<D: DomTypes>() {
519 high_setterinfo.set(JSJitInfo {
520 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
521 setter: Some(set_high::<D>)
522 },
523 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
524 protoID: PrototypeList::ID::HTMLMeterElement as u16,
525 },
526 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
527 _bitfield_align_1: [],
528 _bitfield_1: __BindgenBitfieldUnit::new(
529 new_jsjitinfo_bitfield_1!(
530 JSJitInfo_OpType::Setter as u8,
531 JSJitInfo_AliasSet::AliasEverything as u8,
532 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
533 false,
534 false,
535 false,
536 false,
537 false,
538 false,
539 0,
540 ).to_ne_bytes()
541 ),
542});
543}
544unsafe extern "C" fn get_optimum<D: DomTypes>
545(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
546 let mut result = false;
547 wrap_panic(&mut || result = (|| {
548 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
549 let this = &*(this as *const D::HTMLMeterElement);
550 <D as DomHelpers<D>>::push_new_element_queue();
551
552 let result: Finite<f64> = this.Optimum();
553 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
554
555
556 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
557 return true;
558 })());
559 result
560}
561
562unsafe extern "C" fn set_optimum<D: DomTypes>
563(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
564 let mut result = false;
565 wrap_panic(&mut || result = (|| {
566 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
567 let this = &*(this as *const D::HTMLMeterElement);
568 let arg0: Finite<f64> = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
569 Ok(ConversionResult::Success(value)) => value,
570 Ok(ConversionResult::Failure(error)) => {
571 throw_type_error(cx.raw_cx(), &error);
572 return false;
573
574 }
575 _ => {
576 return false;
577
578 },
579 }
580 ;
581 <D as DomHelpers<D>>::push_new_element_queue();
582
583 let result: () = this.SetOptimum(arg0, CanGc::note());
584 <D as DomHelpers<D>>::pop_current_element_queue(CanGc::note());
585
586
587 true
588 })());
589 result
590}
591
592
593static optimum_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
594
595pub(crate) fn init_optimum_getterinfo<D: DomTypes>() {
596 optimum_getterinfo.set(JSJitInfo {
597 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
598 getter: Some(get_optimum::<D>)
599 },
600 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
601 protoID: PrototypeList::ID::HTMLMeterElement as u16,
602 },
603 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
604 _bitfield_align_1: [],
605 _bitfield_1: __BindgenBitfieldUnit::new(
606 new_jsjitinfo_bitfield_1!(
607 JSJitInfo_OpType::Getter as u8,
608 JSJitInfo_AliasSet::AliasEverything as u8,
609 JSValueType::JSVAL_TYPE_DOUBLE as u8,
610 true,
611 false,
612 false,
613 false,
614 false,
615 false,
616 0,
617 ).to_ne_bytes()
618 ),
619});
620}
621static optimum_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
622
623pub(crate) fn init_optimum_setterinfo<D: DomTypes>() {
624 optimum_setterinfo.set(JSJitInfo {
625 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
626 setter: Some(set_optimum::<D>)
627 },
628 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
629 protoID: PrototypeList::ID::HTMLMeterElement as u16,
630 },
631 __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
632 _bitfield_align_1: [],
633 _bitfield_1: __BindgenBitfieldUnit::new(
634 new_jsjitinfo_bitfield_1!(
635 JSJitInfo_OpType::Setter as u8,
636 JSJitInfo_AliasSet::AliasEverything as u8,
637 JSValueType::JSVAL_TYPE_UNDEFINED as u8,
638 false,
639 false,
640 false,
641 false,
642 false,
643 false,
644 0,
645 ).to_ne_bytes()
646 ),
647});
648}
649unsafe extern "C" fn get_labels<D: DomTypes>
650(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
651 let mut result = false;
652 wrap_panic(&mut || result = (|| {
653 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
654 let this = &*(this as *const D::HTMLMeterElement);
655 let result: DomRoot<D::NodeList> = this.Labels();
656
657 (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
658 return true;
659 })());
660 result
661}
662
663
664static labels_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
665
666pub(crate) fn init_labels_getterinfo<D: DomTypes>() {
667 labels_getterinfo.set(JSJitInfo {
668 __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
669 getter: Some(get_labels::<D>)
670 },
671 __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
672 protoID: PrototypeList::ID::HTMLMeterElement 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::Getter as u8,
679 JSJitInfo_AliasSet::AliasEverything as u8,
680 JSValueType::JSVAL_TYPE_OBJECT as u8,
681 true,
682 false,
683 false,
684 false,
685 false,
686 false,
687 0,
688 ).to_ne_bytes()
689 ),
690});
691}
692unsafe extern "C" fn _finalize<D: DomTypes>
693(_cx: *mut GCContext, obj: *mut JSObject){
694 wrap_panic(&mut || {
695
696 let this = native_from_object_static::<D::HTMLMeterElement>(obj).unwrap();
697 finalize_common(this);
698 })
699}
700
701unsafe extern "C" fn _trace<D: DomTypes>
702(trc: *mut JSTracer, obj: *mut JSObject){
703 wrap_panic(&mut || {
704
705 let this = native_from_object_static::<D::HTMLMeterElement>(obj).unwrap();
706 if this.is_null() { return; } (*this).trace(trc);
708 })
709}
710
711
712static CLASS_OPS: ThreadUnsafeOnceLock<JSClassOps> = ThreadUnsafeOnceLock::new();
713
714pub(crate) fn init_class_ops<D: DomTypes>() {
715 CLASS_OPS.set(JSClassOps {
716 addProperty: None,
717 delProperty: None,
718 enumerate: None,
719 newEnumerate: None,
720 resolve: None,
721 mayResolve: None,
722 finalize: Some(_finalize::<D>),
723 call: None,
724 construct: None,
725 trace: Some(_trace::<D>),
726 });
727}
728
729pub static Class: ThreadUnsafeOnceLock<DOMJSClass> = ThreadUnsafeOnceLock::new();
730
731pub(crate) fn init_domjs_class<D: DomTypes>() {
732 init_class_ops::<D>();
733 Class.set(DOMJSClass {
734 base: JSClass {
735 name: c"HTMLMeterElement".as_ptr(),
736 flags: JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE |
737 (((1) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT)
738 ,
739 cOps: unsafe { CLASS_OPS.get() },
740 spec: ptr::null(),
741 ext: ptr::null(),
742 oOps: ptr::null(),
743 },
744 dom_class:
745DOMClass {
746 interface_chain: [ PrototypeList::ID::EventTarget, PrototypeList::ID::Node, PrototypeList::ID::Element, PrototypeList::ID::HTMLElement, PrototypeList::ID::HTMLMeterElement, PrototypeList::ID::Last ],
747 depth: 4,
748 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::HTMLMeterElement)))) },
749 malloc_size_of: malloc_size_of_including_raw_self::<D::HTMLMeterElement> as unsafe fn(&mut _, _) -> _,
750 global: Globals::EMPTY,
751},
752 });
753}
754
755#[cfg_attr(crown, allow(crown::unrooted_must_root))] pub unsafe fn Wrap<D: DomTypes>
756(cx: SafeJSContext, scope: &D::GlobalScope, given_proto: Option<HandleObject>, object: Box<D::HTMLMeterElement>, _can_gc: CanGc) -> DomRoot<D::HTMLMeterElement>{
757
758 let raw = Root::new(MaybeUnreflectedDom::from_box(object));
759
760 let scope = scope.reflector().get_jsobject();
761 assert!(!scope.get().is_null());
762 assert!(((*get_object_class(scope.get())).flags & JSCLASS_IS_GLOBAL) != 0);
763 let _ac = JSAutoRealm::new(cx.raw_cx(), scope.get());
764
765 rooted!(&in(cx) let mut canonical_proto = ptr::null_mut::<JSObject>());
766 GetProtoObject::<D>(cx, scope, canonical_proto.handle_mut());
767 assert!(!canonical_proto.is_null());
768
769
770 rooted!(&in(cx) let mut proto = ptr::null_mut::<JSObject>());
771 if let Some(given) = given_proto {
772 proto.set(*given);
773 if get_context_realm(cx.raw_cx()) != get_object_realm(*given) {
774 assert!(JS_WrapObject(cx.raw_cx(), proto.handle_mut()));
775 }
776 } else {
777 proto.set(*canonical_proto);
778 }
779 rooted!(&in(cx) let obj = JS_NewObjectWithGivenProto(
780 cx.raw_cx(),
781 &Class.get().base,
782 proto.handle(),
783 ));
784 assert!(!obj.is_null());
785 JS_SetReservedSlot(
786 obj.get(),
787 DOM_OBJECT_SLOT,
788 &PrivateValue(raw.as_ptr() as *const libc::c_void),
789 );
790
791 let root = raw.reflect_with(obj.get());
792
793
794
795 DomRoot::from_ref(&*root)
796}
797
798pub trait HTMLMeterElementMethods<D: DomTypes> {
799 fn Value(&self, ) -> Finite<f64>;
800 fn SetValue(&self, r#value: Finite<f64>, r#_can_gc: CanGc);
801 fn Min(&self, ) -> Finite<f64>;
802 fn SetMin(&self, r#value: Finite<f64>, r#_can_gc: CanGc);
803 fn Max(&self, ) -> Finite<f64>;
804 fn SetMax(&self, r#value: Finite<f64>, r#_can_gc: CanGc);
805 fn Low(&self, ) -> Finite<f64>;
806 fn SetLow(&self, r#value: Finite<f64>, r#_can_gc: CanGc);
807 fn High(&self, ) -> Finite<f64>;
808 fn SetHigh(&self, r#value: Finite<f64>, r#_can_gc: CanGc);
809 fn Optimum(&self, ) -> Finite<f64>;
810 fn SetOptimum(&self, r#value: Finite<f64>, r#_can_gc: CanGc);
811 fn Labels(&self, ) -> DomRoot<D::NodeList>;
812}
813static sAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
814
815pub(crate) fn init_sAttributes_specs<D: DomTypes>() {
816 sAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
817 JSPropertySpec {
818 name: JSPropertySpec_Name { string_: c"value".as_ptr() },
819 attributes_: (JSPROP_ENUMERATE),
820 kind_: (JSPropertySpec_Kind::NativeAccessor),
821 u: JSPropertySpec_AccessorsOrValue {
822 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
823 getter: JSPropertySpec_Accessor {
824 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { value_getterinfo.get() } },
825 },
826 setter: JSPropertySpec_Accessor {
827 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { value_setterinfo.get() } },
828 }
829 }
830 }
831 }
832,
833 JSPropertySpec {
834 name: JSPropertySpec_Name { string_: c"min".as_ptr() },
835 attributes_: (JSPROP_ENUMERATE),
836 kind_: (JSPropertySpec_Kind::NativeAccessor),
837 u: JSPropertySpec_AccessorsOrValue {
838 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
839 getter: JSPropertySpec_Accessor {
840 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { min_getterinfo.get() } },
841 },
842 setter: JSPropertySpec_Accessor {
843 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { min_setterinfo.get() } },
844 }
845 }
846 }
847 }
848,
849 JSPropertySpec {
850 name: JSPropertySpec_Name { string_: c"max".as_ptr() },
851 attributes_: (JSPROP_ENUMERATE),
852 kind_: (JSPropertySpec_Kind::NativeAccessor),
853 u: JSPropertySpec_AccessorsOrValue {
854 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
855 getter: JSPropertySpec_Accessor {
856 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { max_getterinfo.get() } },
857 },
858 setter: JSPropertySpec_Accessor {
859 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { max_setterinfo.get() } },
860 }
861 }
862 }
863 }
864,
865 JSPropertySpec {
866 name: JSPropertySpec_Name { string_: c"low".as_ptr() },
867 attributes_: (JSPROP_ENUMERATE),
868 kind_: (JSPropertySpec_Kind::NativeAccessor),
869 u: JSPropertySpec_AccessorsOrValue {
870 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
871 getter: JSPropertySpec_Accessor {
872 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { low_getterinfo.get() } },
873 },
874 setter: JSPropertySpec_Accessor {
875 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { low_setterinfo.get() } },
876 }
877 }
878 }
879 }
880,
881 JSPropertySpec {
882 name: JSPropertySpec_Name { string_: c"high".as_ptr() },
883 attributes_: (JSPROP_ENUMERATE),
884 kind_: (JSPropertySpec_Kind::NativeAccessor),
885 u: JSPropertySpec_AccessorsOrValue {
886 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
887 getter: JSPropertySpec_Accessor {
888 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { high_getterinfo.get() } },
889 },
890 setter: JSPropertySpec_Accessor {
891 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { high_setterinfo.get() } },
892 }
893 }
894 }
895 }
896,
897 JSPropertySpec {
898 name: JSPropertySpec_Name { string_: c"optimum".as_ptr() },
899 attributes_: (JSPROP_ENUMERATE),
900 kind_: (JSPropertySpec_Kind::NativeAccessor),
901 u: JSPropertySpec_AccessorsOrValue {
902 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
903 getter: JSPropertySpec_Accessor {
904 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { optimum_getterinfo.get() } },
905 },
906 setter: JSPropertySpec_Accessor {
907 native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { optimum_setterinfo.get() } },
908 }
909 }
910 }
911 }
912,
913 JSPropertySpec {
914 name: JSPropertySpec_Name { string_: c"labels".as_ptr() },
915 attributes_: (JSPROP_ENUMERATE),
916 kind_: (JSPropertySpec_Kind::NativeAccessor),
917 u: JSPropertySpec_AccessorsOrValue {
918 accessors: JSPropertySpec_AccessorsOrValue_Accessors {
919 getter: JSPropertySpec_Accessor {
920 native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { labels_getterinfo.get() } },
921 },
922 setter: JSPropertySpec_Accessor {
923 native: JSNativeWrapper { op: None, info: ptr::null() },
924 }
925 }
926 }
927 }
928,
929 JSPropertySpec::ZERO]))[..]
930,
931&Box::leak(Box::new([
932 JSPropertySpec {
933 name: JSPropertySpec_Name { symbol_: SymbolCode::toStringTag as usize + 1 },
934 attributes_: (JSPROP_READONLY),
935 kind_: (JSPropertySpec_Kind::Value),
936 u: JSPropertySpec_AccessorsOrValue {
937 value: JSPropertySpec_ValueWrapper {
938 type_: JSPropertySpec_ValueWrapper_Type::String,
939 __bindgen_anon_1: JSPropertySpec_ValueWrapper__bindgen_ty_1 {
940 string: c"HTMLMeterElement".as_ptr(),
941 }
942 }
943 }
944 }
945,
946 JSPropertySpec::ZERO]))[..]
947])));
948}static sAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
949
950pub(crate) fn init_sAttributes_prefs<D: DomTypes>() {
951 sAttributes.set(Box::leak(Box::new([ Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sAttributes_specs.get() })[0]),
952 Guard::new(&[Condition::Satisfied], (unsafe { sAttributes_specs.get() })[1])])));
953}
954pub fn GetProtoObject<D: DomTypes>
955(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
956 get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::HTMLMeterElement), CreateInterfaceObjects::<D>, rval)
958}
959
960
961static PrototypeClass: JSClass = JSClass {
962 name: c"HTMLMeterElementPrototype".as_ptr(),
963 flags:
964 (0 ) << JSCLASS_RESERVED_SLOTS_SHIFT,
966 cOps: ptr::null(),
967 spec: ptr::null(),
968 ext: ptr::null(),
969 oOps: ptr::null(),
970};
971
972unsafe extern "C" fn _constructor<D: DomTypes>
973(cx: *mut RawJSContext, argc: u32, vp: *mut JSVal) -> bool{
974 let mut result = false;
975 wrap_panic(&mut || result = {
976 let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
977 let args = CallArgs::from_vp(vp, argc);
978 let global = D::GlobalScope::from_object(JS_CALLEE(cx.raw_cx(), vp).to_object());
979
980 <D as DomHelpers<D>>::call_html_constructor::<D::HTMLMeterElement>(
981 SafeJSContext::from_ptr(cx.raw_cx()),
982 &args,
983 &global,
984 PrototypeList::ID::HTMLMeterElement,
985 CreateInterfaceObjects::<D>,
986 CanGc::note()
987 )
988
989 });
990 result
991}
992
993
994static INTERFACE_OBJECT_CLASS: ThreadUnsafeOnceLock<NonCallbackInterfaceObjectClass> = ThreadUnsafeOnceLock::new();
995
996pub(crate) fn init_interface_object<D: DomTypes>() {
997 INTERFACE_OBJECT_CLASS.set(NonCallbackInterfaceObjectClass::new(
998 Box::leak(Box::new(InterfaceConstructorBehavior::call(_constructor::<D>))),
999 b"function HTMLMeterElement() {\n [native code]\n}",
1000 PrototypeList::ID::HTMLMeterElement,
1001 4,
1002 ));
1003}
1004
1005pub fn GetConstructorObject<D: DomTypes>
1006(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
1007 get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::Constructor(PrototypeList::Constructor::HTMLMeterElement), CreateInterfaceObjects::<D>, rval)
1009}
1010
1011pub fn DefineDOMInterface<D: DomTypes>
1012(cx: SafeJSContext, global: HandleObject){
1013 define_dom_interface(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::HTMLMeterElement),CreateInterfaceObjects::<D>, ConstructorEnabled::<D>)
1014}
1015
1016pub fn ConstructorEnabled<D: DomTypes>
1017(aCx: SafeJSContext, aObj: HandleObject) -> bool{
1018 is_exposed_in(aObj, Globals::WINDOW)
1019}
1020
1021unsafe fn CreateInterfaceObjects<D: DomTypes>
1022(cx: SafeJSContext, global: HandleObject, cache: *mut ProtoOrIfaceArray){
1023
1024 rooted!(&in(cx) let mut prototype_proto = ptr::null_mut::<JSObject>());
1025 HTMLElement_Binding::GetProtoObject::<D>(cx, global, prototype_proto.handle_mut());
1026 assert!(!prototype_proto.is_null());
1027
1028 rooted!(&in(cx) let mut prototype = ptr::null_mut::<JSObject>());
1029 create_interface_prototype_object::<D>(cx,
1030 global,
1031 prototype_proto.handle(),
1032 &PrototypeClass,
1033 &[],
1034 sAttributes.get(),
1035 &[],
1036 &[],
1037 prototype.handle_mut());
1038 assert!(!prototype.is_null());
1039 assert!((*cache)[PrototypeList::ID::HTMLMeterElement as usize].is_null());
1040 (*cache)[PrototypeList::ID::HTMLMeterElement as usize] = prototype.get();
1041 <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::HTMLMeterElement as isize),
1042 ptr::null_mut(),
1043 prototype.get());
1044
1045 rooted!(&in(cx) let mut interface_proto = ptr::null_mut::<JSObject>());
1046
1047 HTMLElement_Binding::GetConstructorObject::<D>(cx, global, interface_proto.handle_mut());
1048
1049 assert!(!interface_proto.is_null());
1050
1051 rooted!(&in(cx) let mut interface = ptr::null_mut::<JSObject>());
1052 create_noncallback_interface_object::<D>(cx,
1053 global,
1054 interface_proto.handle(),
1055 INTERFACE_OBJECT_CLASS.get(),
1056 &[],
1057 &[],
1058 &[],
1059 prototype.handle(),
1060 c"HTMLMeterElement",
1061 0,
1062 &[],
1063 interface.handle_mut());
1064 assert!(!interface.is_null());
1065
1066 assert!((*cache)[PrototypeList::Constructor::HTMLMeterElement as usize].is_null());
1067 (*cache)[PrototypeList::Constructor::HTMLMeterElement as usize] = interface.get();
1068 <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::Constructor::HTMLMeterElement as isize),
1069 ptr::null_mut(),
1070 interface.get());
1071
1072}
1073
1074
1075 pub(crate) fn init_statics<D: DomTypes>() {
1076 init_interface_object::<D>();
1077 init_domjs_class::<D>();
1078
1079 init_value_getterinfo::<D>();
1080init_min_getterinfo::<D>();
1081init_max_getterinfo::<D>();
1082init_low_getterinfo::<D>();
1083init_high_getterinfo::<D>();
1084init_optimum_getterinfo::<D>();
1085init_labels_getterinfo::<D>();
1086 init_value_setterinfo::<D>();
1087init_min_setterinfo::<D>();
1088init_max_setterinfo::<D>();
1089init_low_setterinfo::<D>();
1090init_high_setterinfo::<D>();
1091init_optimum_setterinfo::<D>();
1092
1093 init_sAttributes_specs::<D>();
1094init_sAttributes_prefs::<D>();
1095 }
1096 }