#![allow(non_camel_case_types,non_upper_case_globals,unused_imports,unused_variables,unused_assignments,unused_mut,clippy::approx_constant,clippy::let_unit_value,clippy::needless_return,clippy::too_many_arguments,clippy::unnecessary_cast,clippy::upper_case_acronyms)]
use crate::dom::bindings::import::base::*;
#[derive(JSTraceable)]
pub struct GetRootNodeOptions {
pub composed: bool,
}
impl GetRootNodeOptions {
pub fn empty() -> Self {
Self {
composed: false,
}
}
pub fn new(cx: SafeJSContext, val: HandleValue)
-> Result<ConversionResult<GetRootNodeOptions>, ()> {
unsafe {
let object = if val.get().is_null_or_undefined() {
ptr::null_mut()
} else if val.get().is_object() {
val.get().to_object()
} else {
return Ok(ConversionResult::Failure("Value is not an object.".into()));
};
rooted!(in(*cx) let object = object);
let dictionary = GetRootNodeOptions {
composed: {
rooted!(in(*cx) let mut rval = UndefinedValue());
if get_dictionary_property(*cx, object.handle(), "composed", rval.handle_mut())? && !rval.is_undefined() {
match FromJSValConvertible::from_jsval(*cx, rval.handle(), ()) {
Ok(ConversionResult::Success(v)) => v,
Ok(ConversionResult::Failure(error)) => {
throw_type_error(*cx, &error);
return Err(());
}
_ => { return Err(());
}
}
} else {
false
}
},
};
Ok(ConversionResult::Success(dictionary))
}
}
}
impl FromJSValConvertible for GetRootNodeOptions {
type Config = ();
unsafe fn from_jsval(cx: *mut JSContext, value: HandleValue, _option: ())
-> Result<ConversionResult<GetRootNodeOptions>, ()> {
GetRootNodeOptions::new(SafeJSContext::from_ptr(cx), value)
}
}
impl GetRootNodeOptions {
pub(crate) unsafe fn to_jsobject(&self, cx: *mut JSContext, mut obj: MutableHandleObject) {
let composed = &self.composed;
rooted!(in(cx) let mut composed_js = UndefinedValue());
composed.to_jsval(cx, composed_js.handle_mut());
set_dictionary_property(cx, obj.handle(), "composed", composed_js.handle()).unwrap();
}
}
impl ToJSValConvertible for GetRootNodeOptions {
unsafe fn to_jsval(&self, cx: *mut JSContext, mut rval: MutableHandleValue) {
rooted!(in(cx) let mut obj = JS_NewObject(cx, ptr::null()));
self.to_jsobject(cx, obj.handle_mut());
rval.set(ObjectOrNullValue(obj.get()))
}
}
pub use self::Node_Binding::{NodeConstants, NodeMethods, GetProtoObject, GetConstructorObject, DefineDOMInterface};
pub mod Node_Binding {
use crate::dom;
use crate::dom::bindings::codegen::Bindings::EventTargetBinding::EventTarget_Binding;
use crate::dom::bindings::codegen::Bindings::NodeBinding::GetRootNodeOptions;
use crate::dom::bindings::codegen::Bindings::NodeBinding::Node_Binding;
use crate::dom::bindings::import::module::*;
use crate::dom::types::Document;
use crate::dom::types::Element;
use crate::dom::types::EventTarget;
use crate::dom::types::Node;
use crate::dom::types::NodeList;
unsafe extern fn get_nodeType(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let result: u16 = this.NodeType();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const nodeType_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_nodeType)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasNone as u8,
JSValueType::JSVAL_TYPE_INT32 as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn get_nodeName(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let result: DOMString = this.NodeName();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const nodeName_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_nodeName)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_STRING as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn get_baseURI(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let result: USVString = this.BaseURI();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const baseURI_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_baseURI)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_STRING as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn get_isConnected(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let result: bool = this.IsConnected();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const isConnected_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_isConnected)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_BOOLEAN as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn get_ownerDocument(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let result: Option<DomRoot<Document>> = this.GetOwnerDocument();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const ownerDocument_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_ownerDocument)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_UNKNOWN as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn getRootNode(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
let arg0: crate::dom::bindings::codegen::Bindings::NodeBinding::GetRootNodeOptions = if args.get(0).is_undefined() {
crate::dom::bindings::codegen::Bindings::NodeBinding::GetRootNodeOptions::empty()
} else {
match FromJSValConvertible::from_jsval(*cx, HandleValue::from_raw(args.get(0)), ()) {
Ok(ConversionResult::Success(dictionary)) => dictionary,
Ok(ConversionResult::Failure(error)) => {
throw_type_error(*cx, &error);
return false;
}
_ => { return false;
},
}
};
let result: DomRoot<Node> = this.GetRootNode(&arg0);
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const getRootNode_methodinfo_argTypes: [i32; 2] = [ JSJitInfo_ArgType::Object as i32, JSJitInfo_ArgType::ArgTypeListEnd as i32 ];
const getRootNode_methodinfo: JSTypedMethodJitInfo = JSTypedMethodJitInfo {
base: JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(getRootNode)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_OBJECT as u8,
false,
true,
false,
false,
false,
true,
0,
).to_ne_bytes()
),
},
argTypes: &getRootNode_methodinfo_argTypes as *const _ as *const JSJitInfo_ArgType,
};
unsafe extern fn get_parentNode(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let result: Option<DomRoot<Node>> = this.GetParentNode();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const parentNode_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_parentNode)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_UNKNOWN as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn get_parentElement(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let result: Option<DomRoot<Element>> = this.GetParentElement();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const parentElement_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_parentElement)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_UNKNOWN as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn hasChildNodes(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
let result: bool = this.HasChildNodes();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const hasChildNodes_methodinfo_argTypes: [i32; 1] = [ JSJitInfo_ArgType::ArgTypeListEnd as i32 ];
const hasChildNodes_methodinfo: JSTypedMethodJitInfo = JSTypedMethodJitInfo {
base: JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(hasChildNodes)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_BOOLEAN as u8,
true,
true,
false,
false,
false,
true,
0,
).to_ne_bytes()
),
},
argTypes: &hasChildNodes_methodinfo_argTypes as *const _ as *const JSJitInfo_ArgType,
};
unsafe extern fn get_childNodes(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let result: DomRoot<NodeList> = this.ChildNodes();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const childNodes_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_childNodes)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasNone as u8,
JSValueType::JSVAL_TYPE_OBJECT as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn get_firstChild(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let result: Option<DomRoot<Node>> = this.GetFirstChild();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const firstChild_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_firstChild)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_UNKNOWN as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn get_lastChild(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let result: Option<DomRoot<Node>> = this.GetLastChild();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const lastChild_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_lastChild)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_UNKNOWN as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn get_previousSibling(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let result: Option<DomRoot<Node>> = this.GetPreviousSibling();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const previousSibling_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_previousSibling)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_UNKNOWN as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn get_nextSibling(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let result: Option<DomRoot<Node>> = this.GetNextSibling();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const nextSibling_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_nextSibling)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_UNKNOWN as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn get_nodeValue(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
push_new_element_queue();
let result: Option<DOMString> = this.GetNodeValue();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
unsafe extern fn set_nodeValue(cx: *mut JSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let arg0: Option<DOMString> = match FromJSValConvertible::from_jsval(*cx, HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
Ok(ConversionResult::Success(strval)) => strval,
Ok(ConversionResult::Failure(error)) => {
throw_type_error(*cx, &error);
return false;
}
_ => { return false;
},
};
push_new_element_queue();
let result: () = this.SetNodeValue(arg0);
pop_current_element_queue();
true
})());
result
}
const nodeValue_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_nodeValue)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_UNKNOWN as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
const nodeValue_setterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
setter: Some(set_nodeValue)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Setter as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_UNDEFINED as u8,
false,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn get_textContent(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
push_new_element_queue();
let result: Option<DOMString> = this.GetTextContent();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
unsafe extern fn set_textContent(cx: *mut JSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let arg0: Option<DOMString> = match FromJSValConvertible::from_jsval(*cx, HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
Ok(ConversionResult::Success(strval)) => strval,
Ok(ConversionResult::Failure(error)) => {
throw_type_error(*cx, &error);
return false;
}
_ => { return false;
},
};
push_new_element_queue();
let result: () = this.SetTextContent(arg0);
pop_current_element_queue();
true
})());
result
}
const textContent_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_textContent)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_UNKNOWN as u8,
true,
true,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
const textContent_setterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
setter: Some(set_textContent)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Setter as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_UNDEFINED as u8,
false,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn normalize(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
push_new_element_queue();
let result: () = this.Normalize();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const normalize_methodinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(normalize)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_UNDEFINED as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn cloneNode(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
let arg0: bool = if args.get(0).is_undefined() {
false
} else {
match FromJSValConvertible::from_jsval(*cx, HandleValue::from_raw(args.get(0)), ()) {
Ok(ConversionResult::Success(v)) => v,
Ok(ConversionResult::Failure(error)) => {
throw_type_error(*cx, &error);
return false;
}
_ => { return false;
}
}
};
push_new_element_queue();
let result: Result<DomRoot<Node>, Error> = this.CloneNode(arg0);
pop_current_element_queue();
let result = match result {
Ok(result) => result,
Err(e) => {
throw_dom_exception(cx, &this.global(), e);
return false;
},
};
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const cloneNode_methodinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(cloneNode)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_OBJECT as u8,
false,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn isEqualNode(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
if argc < 1 {
throw_type_error(*cx, "Not enough arguments to \"Node.isEqualNode\".");
return false;
}
let arg0: Option<DomRoot<Node>> = if HandleValue::from_raw(args.get(0)).get().is_object() {
Some(match root_from_handlevalue(HandleValue::from_raw(args.get(0)), *cx) {
Ok(val) => val,
Err(()) => {
throw_type_error(*cx, "value does not implement interface Node.");
return false;
}
}
)
} else if HandleValue::from_raw(args.get(0)).get().is_null_or_undefined() {
None
} else {
throw_type_error(*cx, "Value is not an object.");
return false;
};
let result: bool = this.IsEqualNode(arg0.as_deref());
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const isEqualNode_methodinfo_argTypes: [i32; 2] = [ JSJitInfo_ArgType::Null as i32 | JSJitInfo_ArgType::Object as i32, JSJitInfo_ArgType::ArgTypeListEnd as i32 ];
const isEqualNode_methodinfo: JSTypedMethodJitInfo = JSTypedMethodJitInfo {
base: JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(isEqualNode)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_BOOLEAN as u8,
false,
true,
false,
false,
false,
true,
0,
).to_ne_bytes()
),
},
argTypes: &isEqualNode_methodinfo_argTypes as *const _ as *const JSJitInfo_ArgType,
};
unsafe extern fn isSameNode(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
if argc < 1 {
throw_type_error(*cx, "Not enough arguments to \"Node.isSameNode\".");
return false;
}
let arg0: Option<DomRoot<Node>> = if HandleValue::from_raw(args.get(0)).get().is_object() {
Some(match root_from_handlevalue(HandleValue::from_raw(args.get(0)), *cx) {
Ok(val) => val,
Err(()) => {
throw_type_error(*cx, "value does not implement interface Node.");
return false;
}
}
)
} else if HandleValue::from_raw(args.get(0)).get().is_null_or_undefined() {
None
} else {
throw_type_error(*cx, "Value is not an object.");
return false;
};
let result: bool = this.IsSameNode(arg0.as_deref());
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const isSameNode_methodinfo_argTypes: [i32; 2] = [ JSJitInfo_ArgType::Null as i32 | JSJitInfo_ArgType::Object as i32, JSJitInfo_ArgType::ArgTypeListEnd as i32 ];
const isSameNode_methodinfo: JSTypedMethodJitInfo = JSTypedMethodJitInfo {
base: JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(isSameNode)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_BOOLEAN as u8,
false,
true,
false,
false,
false,
true,
0,
).to_ne_bytes()
),
},
argTypes: &isSameNode_methodinfo_argTypes as *const _ as *const JSJitInfo_ArgType,
};
unsafe extern fn compareDocumentPosition(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
if argc < 1 {
throw_type_error(*cx, "Not enough arguments to \"Node.compareDocumentPosition\".");
return false;
}
let arg0: DomRoot<Node> = if HandleValue::from_raw(args.get(0)).get().is_object() {
match root_from_handlevalue(HandleValue::from_raw(args.get(0)), *cx) {
Ok(val) => val,
Err(()) => {
throw_type_error(*cx, "value does not implement interface Node.");
return false;
}
}
} else {
throw_type_error(*cx, "Value is not an object.");
return false;
};
let result: u16 = this.CompareDocumentPosition(&arg0);
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const compareDocumentPosition_methodinfo_argTypes: [i32; 2] = [ JSJitInfo_ArgType::Object as i32, JSJitInfo_ArgType::ArgTypeListEnd as i32 ];
const compareDocumentPosition_methodinfo: JSTypedMethodJitInfo = JSTypedMethodJitInfo {
base: JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(compareDocumentPosition)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_INT32 as u8,
false,
true,
false,
false,
false,
true,
0,
).to_ne_bytes()
),
},
argTypes: &compareDocumentPosition_methodinfo_argTypes as *const _ as *const JSJitInfo_ArgType,
};
unsafe extern fn contains(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
if argc < 1 {
throw_type_error(*cx, "Not enough arguments to \"Node.contains\".");
return false;
}
let arg0: Option<DomRoot<Node>> = if HandleValue::from_raw(args.get(0)).get().is_object() {
Some(match root_from_handlevalue(HandleValue::from_raw(args.get(0)), *cx) {
Ok(val) => val,
Err(()) => {
throw_type_error(*cx, "value does not implement interface Node.");
return false;
}
}
)
} else if HandleValue::from_raw(args.get(0)).get().is_null_or_undefined() {
None
} else {
throw_type_error(*cx, "Value is not an object.");
return false;
};
let result: bool = this.Contains(arg0.as_deref());
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const contains_methodinfo_argTypes: [i32; 2] = [ JSJitInfo_ArgType::Null as i32 | JSJitInfo_ArgType::Object as i32, JSJitInfo_ArgType::ArgTypeListEnd as i32 ];
const contains_methodinfo: JSTypedMethodJitInfo = JSTypedMethodJitInfo {
base: JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(contains)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_BOOLEAN as u8,
false,
true,
false,
false,
false,
true,
0,
).to_ne_bytes()
),
},
argTypes: &contains_methodinfo_argTypes as *const _ as *const JSJitInfo_ArgType,
};
unsafe extern fn lookupPrefix(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
if argc < 1 {
throw_type_error(*cx, "Not enough arguments to \"Node.lookupPrefix\".");
return false;
}
let arg0: Option<DOMString> = match FromJSValConvertible::from_jsval(*cx, HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
Ok(ConversionResult::Success(strval)) => strval,
Ok(ConversionResult::Failure(error)) => {
throw_type_error(*cx, &error);
return false;
}
_ => { return false;
},
};
let result: Option<DOMString> = this.LookupPrefix(arg0);
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const lookupPrefix_methodinfo_argTypes: [i32; 2] = [ JSJitInfo_ArgType::Null as i32 | JSJitInfo_ArgType::String as i32, JSJitInfo_ArgType::ArgTypeListEnd as i32 ];
const lookupPrefix_methodinfo: JSTypedMethodJitInfo = JSTypedMethodJitInfo {
base: JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(lookupPrefix)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_UNKNOWN as u8,
false,
true,
false,
false,
false,
true,
0,
).to_ne_bytes()
),
},
argTypes: &lookupPrefix_methodinfo_argTypes as *const _ as *const JSJitInfo_ArgType,
};
unsafe extern fn lookupNamespaceURI(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
if argc < 1 {
throw_type_error(*cx, "Not enough arguments to \"Node.lookupNamespaceURI\".");
return false;
}
let arg0: Option<DOMString> = match FromJSValConvertible::from_jsval(*cx, HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
Ok(ConversionResult::Success(strval)) => strval,
Ok(ConversionResult::Failure(error)) => {
throw_type_error(*cx, &error);
return false;
}
_ => { return false;
},
};
let result: Option<DOMString> = this.LookupNamespaceURI(arg0);
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const lookupNamespaceURI_methodinfo_argTypes: [i32; 2] = [ JSJitInfo_ArgType::Null as i32 | JSJitInfo_ArgType::String as i32, JSJitInfo_ArgType::ArgTypeListEnd as i32 ];
const lookupNamespaceURI_methodinfo: JSTypedMethodJitInfo = JSTypedMethodJitInfo {
base: JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(lookupNamespaceURI)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_UNKNOWN as u8,
false,
true,
false,
false,
false,
true,
0,
).to_ne_bytes()
),
},
argTypes: &lookupNamespaceURI_methodinfo_argTypes as *const _ as *const JSJitInfo_ArgType,
};
unsafe extern fn isDefaultNamespace(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
if argc < 1 {
throw_type_error(*cx, "Not enough arguments to \"Node.isDefaultNamespace\".");
return false;
}
let arg0: Option<DOMString> = match FromJSValConvertible::from_jsval(*cx, HandleValue::from_raw(args.get(0)), StringificationBehavior::Default) {
Ok(ConversionResult::Success(strval)) => strval,
Ok(ConversionResult::Failure(error)) => {
throw_type_error(*cx, &error);
return false;
}
_ => { return false;
},
};
let result: bool = this.IsDefaultNamespace(arg0);
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const isDefaultNamespace_methodinfo_argTypes: [i32; 2] = [ JSJitInfo_ArgType::Null as i32 | JSJitInfo_ArgType::String as i32, JSJitInfo_ArgType::ArgTypeListEnd as i32 ];
const isDefaultNamespace_methodinfo: JSTypedMethodJitInfo = JSTypedMethodJitInfo {
base: JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(isDefaultNamespace)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasDOMSets as u8,
JSValueType::JSVAL_TYPE_BOOLEAN as u8,
false,
true,
false,
false,
false,
true,
0,
).to_ne_bytes()
),
},
argTypes: &isDefaultNamespace_methodinfo_argTypes as *const _ as *const JSJitInfo_ArgType,
};
unsafe extern fn insertBefore(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
if argc < 2 {
throw_type_error(*cx, "Not enough arguments to \"Node.insertBefore\".");
return false;
}
let arg0: DomRoot<Node> = if HandleValue::from_raw(args.get(0)).get().is_object() {
match root_from_handlevalue(HandleValue::from_raw(args.get(0)), *cx) {
Ok(val) => val,
Err(()) => {
throw_type_error(*cx, "value does not implement interface Node.");
return false;
}
}
} else {
throw_type_error(*cx, "Value is not an object.");
return false;
};
let arg1: Option<DomRoot<Node>> = if HandleValue::from_raw(args.get(1)).get().is_object() {
Some(match root_from_handlevalue(HandleValue::from_raw(args.get(1)), *cx) {
Ok(val) => val,
Err(()) => {
throw_type_error(*cx, "value does not implement interface Node.");
return false;
}
}
)
} else if HandleValue::from_raw(args.get(1)).get().is_null_or_undefined() {
None
} else {
throw_type_error(*cx, "Value is not an object.");
return false;
};
push_new_element_queue();
let result: Result<DomRoot<Node>, Error> = this.InsertBefore(&arg0, arg1.as_deref());
pop_current_element_queue();
let result = match result {
Ok(result) => result,
Err(e) => {
throw_dom_exception(cx, &this.global(), e);
return false;
},
};
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const insertBefore_methodinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(insertBefore)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_OBJECT as u8,
false,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn appendChild(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
if argc < 1 {
throw_type_error(*cx, "Not enough arguments to \"Node.appendChild\".");
return false;
}
let arg0: DomRoot<Node> = if HandleValue::from_raw(args.get(0)).get().is_object() {
match root_from_handlevalue(HandleValue::from_raw(args.get(0)), *cx) {
Ok(val) => val,
Err(()) => {
throw_type_error(*cx, "value does not implement interface Node.");
return false;
}
}
} else {
throw_type_error(*cx, "Value is not an object.");
return false;
};
push_new_element_queue();
let result: Result<DomRoot<Node>, Error> = this.AppendChild(&arg0);
pop_current_element_queue();
let result = match result {
Ok(result) => result,
Err(e) => {
throw_dom_exception(cx, &this.global(), e);
return false;
},
};
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const appendChild_methodinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(appendChild)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_OBJECT as u8,
false,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn replaceChild(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
if argc < 2 {
throw_type_error(*cx, "Not enough arguments to \"Node.replaceChild\".");
return false;
}
let arg0: DomRoot<Node> = if HandleValue::from_raw(args.get(0)).get().is_object() {
match root_from_handlevalue(HandleValue::from_raw(args.get(0)), *cx) {
Ok(val) => val,
Err(()) => {
throw_type_error(*cx, "value does not implement interface Node.");
return false;
}
}
} else {
throw_type_error(*cx, "Value is not an object.");
return false;
};
let arg1: DomRoot<Node> = if HandleValue::from_raw(args.get(1)).get().is_object() {
match root_from_handlevalue(HandleValue::from_raw(args.get(1)), *cx) {
Ok(val) => val,
Err(()) => {
throw_type_error(*cx, "value does not implement interface Node.");
return false;
}
}
} else {
throw_type_error(*cx, "Value is not an object.");
return false;
};
push_new_element_queue();
let result: Result<DomRoot<Node>, Error> = this.ReplaceChild(&arg0, &arg1);
pop_current_element_queue();
let result = match result {
Ok(result) => result,
Err(e) => {
throw_dom_exception(cx, &this.global(), e);
return false;
},
};
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const replaceChild_methodinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(replaceChild)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_OBJECT as u8,
false,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn removeChild(cx: *mut JSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let this = &*(this as *const Node);
let args = &*args;
let argc = args.argc_;
if argc < 1 {
throw_type_error(*cx, "Not enough arguments to \"Node.removeChild\".");
return false;
}
let arg0: DomRoot<Node> = if HandleValue::from_raw(args.get(0)).get().is_object() {
match root_from_handlevalue(HandleValue::from_raw(args.get(0)), *cx) {
Ok(val) => val,
Err(()) => {
throw_type_error(*cx, "value does not implement interface Node.");
return false;
}
}
} else {
throw_type_error(*cx, "Value is not an object.");
return false;
};
push_new_element_queue();
let result: Result<DomRoot<Node>, Error> = this.RemoveChild(&arg0);
pop_current_element_queue();
let result = match result {
Ok(result) => result,
Err(e) => {
throw_dom_exception(cx, &this.global(), e);
return false;
},
};
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const removeChild_methodinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(removeChild)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::Node as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_OBJECT as u8,
false,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
pub mod NodeConstants {
pub const ELEMENT_NODE: u16 = 1;
pub const ATTRIBUTE_NODE: u16 = 2;
pub const TEXT_NODE: u16 = 3;
pub const CDATA_SECTION_NODE: u16 = 4;
pub const ENTITY_REFERENCE_NODE: u16 = 5;
pub const ENTITY_NODE: u16 = 6;
pub const PROCESSING_INSTRUCTION_NODE: u16 = 7;
pub const COMMENT_NODE: u16 = 8;
pub const DOCUMENT_NODE: u16 = 9;
pub const DOCUMENT_TYPE_NODE: u16 = 10;
pub const DOCUMENT_FRAGMENT_NODE: u16 = 11;
pub const NOTATION_NODE: u16 = 12;
pub const DOCUMENT_POSITION_DISCONNECTED: u16 = 1;
pub const DOCUMENT_POSITION_PRECEDING: u16 = 2;
pub const DOCUMENT_POSITION_FOLLOWING: u16 = 4;
pub const DOCUMENT_POSITION_CONTAINS: u16 = 8;
pub const DOCUMENT_POSITION_CONTAINED_BY: u16 = 16;
pub const DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: u16 = 32;
} impl IDLInterface for Node {
#[inline]
fn derives(class: &'static DOMClass) -> bool {
class.interface_chain[1] == PrototypeList::ID::Node
}
}
impl PartialEq for Node {
fn eq(&self, other: &Node) -> bool {
self as *const Node == other
}
}
pub trait NodeMethods {
fn NodeType(&self) -> u16;
fn NodeName(&self) -> DOMString;
fn BaseURI(&self) -> USVString;
fn IsConnected(&self) -> bool;
fn GetOwnerDocument(&self) -> Option<DomRoot<Document>>;
fn GetRootNode(&self, options: &crate::dom::bindings::codegen::Bindings::NodeBinding::GetRootNodeOptions) -> DomRoot<Node>;
fn GetParentNode(&self) -> Option<DomRoot<Node>>;
fn GetParentElement(&self) -> Option<DomRoot<Element>>;
fn HasChildNodes(&self) -> bool;
fn ChildNodes(&self) -> DomRoot<NodeList>;
fn GetFirstChild(&self) -> Option<DomRoot<Node>>;
fn GetLastChild(&self) -> Option<DomRoot<Node>>;
fn GetPreviousSibling(&self) -> Option<DomRoot<Node>>;
fn GetNextSibling(&self) -> Option<DomRoot<Node>>;
fn GetNodeValue(&self) -> Option<DOMString>;
fn SetNodeValue(&self, value: Option<DOMString>);
fn GetTextContent(&self) -> Option<DOMString>;
fn SetTextContent(&self, value: Option<DOMString>);
fn Normalize(&self);
fn CloneNode(&self, deep: bool) -> Fallible<DomRoot<Node>>;
fn IsEqualNode(&self, node: Option<&Node>) -> bool;
fn IsSameNode(&self, otherNode: Option<&Node>) -> bool;
fn CompareDocumentPosition(&self, other: &Node) -> u16;
fn Contains(&self, other: Option<&Node>) -> bool;
fn LookupPrefix(&self, namespace: Option<DOMString>) -> Option<DOMString>;
fn LookupNamespaceURI(&self, prefix: Option<DOMString>) -> Option<DOMString>;
fn IsDefaultNamespace(&self, namespace: Option<DOMString>) -> bool;
fn InsertBefore(&self, node: &Node, child: Option<&Node>) -> Fallible<DomRoot<Node>>;
fn AppendChild(&self, node: &Node) -> Fallible<DomRoot<Node>>;
fn ReplaceChild(&self, node: &Node, child: &Node) -> Fallible<DomRoot<Node>>;
fn RemoveChild(&self, child: &Node) -> Fallible<DomRoot<Node>>;
}
const sMethods_specs: &[&[JSFunctionSpec]] = &[
&[
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"getRootNode\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &getRootNode_methodinfo as *const _ as *const JSJitInfo },
nargs: 0,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"hasChildNodes\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &hasChildNodes_methodinfo as *const _ as *const JSJitInfo },
nargs: 0,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"normalize\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &normalize_methodinfo as *const _ as *const JSJitInfo },
nargs: 0,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"cloneNode\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &cloneNode_methodinfo as *const _ as *const JSJitInfo },
nargs: 0,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"isEqualNode\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &isEqualNode_methodinfo as *const _ as *const JSJitInfo },
nargs: 1,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"isSameNode\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &isSameNode_methodinfo as *const _ as *const JSJitInfo },
nargs: 1,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"compareDocumentPosition\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &compareDocumentPosition_methodinfo as *const _ as *const JSJitInfo },
nargs: 1,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"contains\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &contains_methodinfo as *const _ as *const JSJitInfo },
nargs: 1,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"lookupPrefix\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &lookupPrefix_methodinfo as *const _ as *const JSJitInfo },
nargs: 1,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"lookupNamespaceURI\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &lookupNamespaceURI_methodinfo as *const _ as *const JSJitInfo },
nargs: 1,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"isDefaultNamespace\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &isDefaultNamespace_methodinfo as *const _ as *const JSJitInfo },
nargs: 1,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"insertBefore\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &insertBefore_methodinfo as *const _ as *const JSJitInfo },
nargs: 2,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"appendChild\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &appendChild_methodinfo as *const _ as *const JSJitInfo },
nargs: 1,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"replaceChild\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &replaceChild_methodinfo as *const _ as *const JSJitInfo },
nargs: 2,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"removeChild\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &removeChild_methodinfo as *const _ as *const JSJitInfo },
nargs: 1,
flags: (JSPROP_ENUMERATE) as u16,
selfHostedName: 0 as *const libc::c_char
},
JSFunctionSpec {
name: JSPropertySpec_Name { string_: ptr::null() },
call: JSNativeWrapper { op: None, info: ptr::null() },
nargs: 0,
flags: 0,
selfHostedName: ptr::null()
}]
];
const sMethods: &[Guard<&[JSFunctionSpec]>] = &[
Guard::new(Condition::Exposed(InterfaceObjectMap::Globals::WINDOW), sMethods_specs[0])
];
const sAttributes_specs: &[&[JSPropertySpec]] = &[
&[
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"nodeType\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &nodeType_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"nodeName\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &nodeName_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"baseURI\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &baseURI_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"isConnected\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &isConnected_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"ownerDocument\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &ownerDocument_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"parentNode\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &parentNode_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"parentElement\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &parentElement_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"childNodes\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &childNodes_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"firstChild\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &firstChild_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"lastChild\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &lastChild_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"previousSibling\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &previousSibling_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"nextSibling\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &nextSibling_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"nodeValue\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &nodeValue_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_setter), info: &nodeValue_setterinfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"textContent\0" as *const u8 as *const libc::c_char },
attributes_: (JSPROP_ENUMERATE),
kind_: (JSPropertySpec_Kind::NativeAccessor),
u: JSPropertySpec_AccessorsOrValue {
accessors: JSPropertySpec_AccessorsOrValue_Accessors {
getter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_getter), info: &textContent_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_setter), info: &textContent_setterinfo },
}
}
}
}
,
JSPropertySpec::ZERO]
,
&[
JSPropertySpec {
name: JSPropertySpec_Name { symbol_: SymbolCode::toStringTag as usize + 1 },
attributes_: (JSPROP_READONLY),
kind_: (JSPropertySpec_Kind::Value),
u: JSPropertySpec_AccessorsOrValue {
value: JSPropertySpec_ValueWrapper {
type_: JSPropertySpec_ValueWrapper_Type::String,
__bindgen_anon_1: JSPropertySpec_ValueWrapper__bindgen_ty_1 {
string: b"Node\0" as *const u8 as *const libc::c_char,
}
}
}
}
,
JSPropertySpec::ZERO]
];
const sAttributes: &[Guard<&[JSPropertySpec]>] = &[
Guard::new(Condition::Exposed(InterfaceObjectMap::Globals::WINDOW), sAttributes_specs[0]),
Guard::new(Condition::Satisfied, sAttributes_specs[1])
];
const sConstants_specs: &[&[ConstantSpec]] = &[
&[
ConstantSpec { name: b"ELEMENT_NODE\0", value: ConstantVal::IntVal(1) },
ConstantSpec { name: b"ATTRIBUTE_NODE\0", value: ConstantVal::IntVal(2) },
ConstantSpec { name: b"TEXT_NODE\0", value: ConstantVal::IntVal(3) },
ConstantSpec { name: b"CDATA_SECTION_NODE\0", value: ConstantVal::IntVal(4) },
ConstantSpec { name: b"ENTITY_REFERENCE_NODE\0", value: ConstantVal::IntVal(5) },
ConstantSpec { name: b"ENTITY_NODE\0", value: ConstantVal::IntVal(6) },
ConstantSpec { name: b"PROCESSING_INSTRUCTION_NODE\0", value: ConstantVal::IntVal(7) },
ConstantSpec { name: b"COMMENT_NODE\0", value: ConstantVal::IntVal(8) },
ConstantSpec { name: b"DOCUMENT_NODE\0", value: ConstantVal::IntVal(9) },
ConstantSpec { name: b"DOCUMENT_TYPE_NODE\0", value: ConstantVal::IntVal(10) },
ConstantSpec { name: b"DOCUMENT_FRAGMENT_NODE\0", value: ConstantVal::IntVal(11) },
ConstantSpec { name: b"NOTATION_NODE\0", value: ConstantVal::IntVal(12) },
ConstantSpec { name: b"DOCUMENT_POSITION_DISCONNECTED\0", value: ConstantVal::IntVal(1) },
ConstantSpec { name: b"DOCUMENT_POSITION_PRECEDING\0", value: ConstantVal::IntVal(2) },
ConstantSpec { name: b"DOCUMENT_POSITION_FOLLOWING\0", value: ConstantVal::IntVal(4) },
ConstantSpec { name: b"DOCUMENT_POSITION_CONTAINS\0", value: ConstantVal::IntVal(8) },
ConstantSpec { name: b"DOCUMENT_POSITION_CONTAINED_BY\0", value: ConstantVal::IntVal(16) },
ConstantSpec { name: b"DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC\0", value: ConstantVal::IntVal(32) }]
];
const sConstants: &[Guard<&[ConstantSpec]>] = &[
Guard::new(Condition::Exposed(InterfaceObjectMap::Globals::WINDOW), sConstants_specs[0])
];
pub fn GetProtoObject(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject) {
get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::Node), CreateInterfaceObjects, rval)
}
static PrototypeClass: JSClass = JSClass {
name: b"NodePrototype\0" as *const u8 as *const libc::c_char,
flags:
(0 ) << JSCLASS_RESERVED_SLOTS_SHIFT,
cOps: 0 as *const _,
spec: ptr::null(),
ext: ptr::null(),
oOps: ptr::null(),
};
static INTERFACE_OBJECT_CLASS: NonCallbackInterfaceObjectClass =
NonCallbackInterfaceObjectClass::new(
{
const BEHAVIOR: InterfaceConstructorBehavior = InterfaceConstructorBehavior::throw();
&BEHAVIOR
},
b"function Node() {\n [native code]\n}",
PrototypeList::ID::Node,
1);
pub fn GetConstructorObject(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject) {
get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::Constructor(PrototypeList::Constructor::Node), CreateInterfaceObjects, rval)
}
pub fn DefineDOMInterface(cx: SafeJSContext, global: HandleObject) {
define_dom_interface(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::Node), CreateInterfaceObjects, ConstructorEnabled)
}
fn ConstructorEnabled(aCx: SafeJSContext, aObj: HandleObject) -> bool {
is_exposed_in(aObj, InterfaceObjectMap::Globals::WINDOW)
}
unsafe fn CreateInterfaceObjects(cx: SafeJSContext, global: HandleObject, cache: *mut ProtoOrIfaceArray) {
rooted!(in(*cx) let mut prototype_proto = ptr::null_mut::<JSObject>());
EventTarget_Binding::GetProtoObject(cx, global, prototype_proto.handle_mut());
assert!(!prototype_proto.is_null());
rooted!(in(*cx) let mut prototype = ptr::null_mut::<JSObject>());
create_interface_prototype_object(cx,
global,
prototype_proto.handle(),
&PrototypeClass,
sMethods,
sAttributes,
sConstants,
&[],
prototype.handle_mut());
assert!(!prototype.is_null());
assert!((*cache)[PrototypeList::ID::Node as usize].is_null());
(*cache)[PrototypeList::ID::Node as usize] = prototype.get();
<*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::Node as isize),
ptr::null_mut(),
prototype.get());
rooted!(in(*cx) let mut interface_proto = ptr::null_mut::<JSObject>());
EventTarget_Binding::GetConstructorObject(cx, global, interface_proto.handle_mut());
assert!(!interface_proto.is_null());
rooted!(in(*cx) let mut interface = ptr::null_mut::<JSObject>());
create_noncallback_interface_object(cx,
global,
interface_proto.handle(),
&INTERFACE_OBJECT_CLASS,
&[],
&[],
sConstants,
prototype.handle(),
b"Node\0",
0,
&[],
interface.handle_mut());
assert!(!interface.is_null());
assert!((*cache)[PrototypeList::Constructor::Node as usize].is_null());
(*cache)[PrototypeList::Constructor::Node as usize] = interface.get();
<*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::Constructor::Node as isize),
ptr::null_mut(),
interface.get());
}
}