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