#![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::*;
#[repr(usize)]
#[derive(Copy, Clone, Debug, JSTraceable, MallocSizeOf, PartialEq)]
pub enum SelectionMode {
Preserve,
Select,
Start,
End
}
pub mod SelectionModeValues {
use crate::dom::bindings::conversions::ConversionResult;
use crate::dom::bindings::conversions::FromJSValConvertible;
use crate::dom::bindings::conversions::ToJSValConvertible;
use crate::dom::bindings::utils::find_enum_value;
use js::jsapi::JSContext;
use js::rust::HandleValue;
use js::rust::MutableHandleValue;
use js::jsval::JSVal;
pub const pairs: &[(&str, super::SelectionMode)] = &[
("preserve", super::SelectionMode::Preserve),
("select", super::SelectionMode::Select),
("start", super::SelectionMode::Start),
("end", super::SelectionMode::End),
];
impl super::SelectionMode {
pub fn as_str(&self) -> &'static str {
pairs[*self as usize].0
}
}
impl Default for super::SelectionMode {
fn default() -> super::SelectionMode {
pairs[0].1
}
}
impl ToJSValConvertible for super::SelectionMode {
unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue) {
pairs[*self as usize].0.to_jsval(cx, rval);
}
}
impl FromJSValConvertible for super::SelectionMode {
type Config = ();
unsafe fn from_jsval(cx: *mut JSContext, value: HandleValue, _option: ())
-> Result<ConversionResult<super::SelectionMode>, ()> {
match find_enum_value(cx, value, pairs) {
Err(_) => Err(()),
Ok((None, search)) => {
Ok(ConversionResult::Failure(
format!("'{}' is not a valid enum value for enumeration 'SelectionMode'.", search).into()
))
}
Ok((Some(&value), _)) => Ok(ConversionResult::Success(value)),
}
}
}
} pub use self::HTMLFormElement_Binding::{Wrap, HTMLFormElementMethods, GetProtoObject, GetConstructorObject, DefineDOMInterface};
pub mod HTMLFormElement_Binding {
use crate::dom;
use crate::dom::bindings::codegen::Bindings::ElementBinding::Element_Binding;
use crate::dom::bindings::codegen::Bindings::EventTargetBinding::EventTarget_Binding;
use crate::dom::bindings::codegen::Bindings::HTMLCollectionBinding::HTMLCollection_Binding;
use crate::dom::bindings::codegen::Bindings::HTMLElementBinding::HTMLElement_Binding;
use crate::dom::bindings::codegen::Bindings::NodeBinding::Node_Binding;
use crate::dom::bindings::codegen::Bindings::NodeListBinding::NodeList_Binding;
use crate::dom::bindings::import::module::*;
use crate::dom::types::DOMTokenList;
use crate::dom::types::Element;
use crate::dom::types::EventTarget;
use crate::dom::types::HTMLCollection;
use crate::dom::types::HTMLElement;
use crate::dom::types::HTMLFormControlsCollection;
use crate::dom::types::HTMLFormElement;
use crate::dom::types::Node;
use crate::dom::types::NodeList;
use crate::dom::types::RadioNodeList;
unsafe extern fn get_acceptCharset(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 HTMLFormElement);
push_new_element_queue();
let result: DOMString = this.AcceptCharset();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
unsafe extern fn set_acceptCharset(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 HTMLFormElement);
let arg0: 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.SetAcceptCharset(arg0);
pop_current_element_queue();
true
})());
result
}
const acceptCharset_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_acceptCharset)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_STRING as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
const acceptCharset_setterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
setter: Some(set_acceptCharset)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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_action(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 HTMLFormElement);
push_new_element_queue();
let result: DOMString = this.Action();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
unsafe extern fn set_action(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 HTMLFormElement);
let arg0: 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.SetAction(arg0);
pop_current_element_queue();
true
})());
result
}
const action_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_action)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_STRING as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
const action_setterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
setter: Some(set_action)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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_autocomplete(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 HTMLFormElement);
push_new_element_queue();
let result: DOMString = this.Autocomplete();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
unsafe extern fn set_autocomplete(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 HTMLFormElement);
let arg0: 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.SetAutocomplete(arg0);
pop_current_element_queue();
true
})());
result
}
const autocomplete_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_autocomplete)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_STRING as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
const autocomplete_setterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
setter: Some(set_autocomplete)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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_enctype(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 HTMLFormElement);
push_new_element_queue();
let result: DOMString = this.Enctype();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
unsafe extern fn set_enctype(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 HTMLFormElement);
let arg0: 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.SetEnctype(arg0);
pop_current_element_queue();
true
})());
result
}
const enctype_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_enctype)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_STRING as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
const enctype_setterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
setter: Some(set_enctype)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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_encoding(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 HTMLFormElement);
push_new_element_queue();
let result: DOMString = this.Encoding();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
unsafe extern fn set_encoding(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 HTMLFormElement);
let arg0: 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.SetEncoding(arg0);
pop_current_element_queue();
true
})());
result
}
const encoding_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_encoding)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_STRING as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
const encoding_setterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
setter: Some(set_encoding)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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_method(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 HTMLFormElement);
push_new_element_queue();
let result: DOMString = this.Method();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
unsafe extern fn set_method(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 HTMLFormElement);
let arg0: 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.SetMethod(arg0);
pop_current_element_queue();
true
})());
result
}
const method_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_method)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_STRING as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
const method_setterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
setter: Some(set_method)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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_name(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 HTMLFormElement);
push_new_element_queue();
let result: DOMString = this.Name();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
unsafe extern fn set_name(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 HTMLFormElement);
let arg0: 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.SetName(arg0);
pop_current_element_queue();
true
})());
result
}
const name_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_name)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_STRING as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
const name_setterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
setter: Some(set_name)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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_noValidate(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 HTMLFormElement);
push_new_element_queue();
let result: bool = this.NoValidate();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
unsafe extern fn set_noValidate(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 HTMLFormElement);
let arg0: bool = 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: () = this.SetNoValidate(arg0);
pop_current_element_queue();
true
})());
result
}
const noValidate_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_noValidate)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_BOOLEAN as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
const noValidate_setterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
setter: Some(set_noValidate)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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_target(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 HTMLFormElement);
push_new_element_queue();
let result: DOMString = this.Target();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
unsafe extern fn set_target(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 HTMLFormElement);
let arg0: 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.SetTarget(arg0);
pop_current_element_queue();
true
})());
result
}
const target_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_target)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_STRING as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
const target_setterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
setter: Some(set_target)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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_rel(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 HTMLFormElement);
push_new_element_queue();
let result: DOMString = this.Rel();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
unsafe extern fn set_rel(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 HTMLFormElement);
let arg0: 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.SetRel(arg0);
pop_current_element_queue();
true
})());
result
}
const rel_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_rel)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_STRING as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
const rel_setterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
setter: Some(set_rel)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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_relList(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 HTMLFormElement);
let result: DomRoot<DOMTokenList> = this.RelList();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
unsafe extern fn set_relList(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);
rooted!(in(*cx) let mut v = UndefinedValue());
if !JS_GetProperty(*cx, HandleObject::from_raw(obj), b"relList\0" as *const u8 as *const libc::c_char, v.handle_mut()) {
return false;
}
if !v.is_object() {
throw_type_error(*cx, "Value.relList is not an object.");
return false;
}
rooted!(in(*cx) let target_obj = v.to_object());
JS_SetProperty(*cx, target_obj.handle(), b"value\0" as *const u8 as *const libc::c_char, HandleValue::from_raw(args.get(0)))
})());
result
}
const relList_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_relList)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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()
),
};
const relList_setterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
setter: Some(set_relList)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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_elements(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 HTMLFormElement);
let result: DomRoot<HTMLFormControlsCollection> = this.Elements();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const elements_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_elements)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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_length(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 HTMLFormElement);
let result: u32 = this.Length();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const length_getterinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
getter: Some(get_length)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Getter as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_DOUBLE as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn submit(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 HTMLFormElement);
let args = &*args;
let argc = args.argc_;
let result: () = this.Submit();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const submit_methodinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(submit)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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 requestSubmit(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 HTMLFormElement);
let args = &*args;
let argc = args.argc_;
let arg0: Option<DomRoot<HTMLElement>> = if args.get(0).is_undefined() {
None
} else 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 HTMLElement.");
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: Result<(), Error> = this.RequestSubmit(arg0.as_deref());
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 requestSubmit_methodinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(requestSubmit)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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,
false,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn reset(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 HTMLFormElement);
let args = &*args;
let argc = args.argc_;
push_new_element_queue();
let result: () = this.Reset();
pop_current_element_queue();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const reset_methodinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(reset)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_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 checkValidity(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 HTMLFormElement);
let args = &*args;
let argc = args.argc_;
let result: bool = this.CheckValidity();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const checkValidity_methodinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(checkValidity)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_BOOLEAN as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn reportValidity(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 HTMLFormElement);
let args = &*args;
let argc = args.argc_;
let result: bool = this.ReportValidity();
(result).to_jsval(*cx, MutableHandleValue::from_raw(args.rval()));
return true;
})());
result
}
const reportValidity_methodinfo: JSJitInfo = JSJitInfo {
__bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
method: Some(reportValidity)
},
__bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
protoID: PrototypeList::ID::HTMLFormElement as u16,
},
__bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 4 },
_bitfield_align_1: [],
_bitfield_1: __BindgenBitfieldUnit::new(
new_jsjitinfo_bitfield_1!(
JSJitInfo_OpType::Method as u8,
JSJitInfo_AliasSet::AliasEverything as u8,
JSValueType::JSVAL_TYPE_BOOLEAN as u8,
true,
false,
false,
false,
false,
false,
0,
).to_ne_bytes()
),
};
unsafe extern fn _finalize(_cx: *mut GCContext, obj: *mut JSObject) {
wrap_panic(&mut || {
let this = native_from_object_static::<HTMLFormElement>(obj).unwrap();
finalize_common(this);
})
}
unsafe extern fn _trace(trc: *mut JSTracer, obj: *mut JSObject) {
wrap_panic(&mut || {
let this = native_from_object_static::<HTMLFormElement>(obj).unwrap();
if this.is_null() { return; } (*this).trace(trc);
})
}
pub unsafe fn DefineProxyHandler() -> *const libc::c_void {
let traps = ProxyTraps {
enter: None,
getOwnPropertyDescriptor: Some(getOwnPropertyDescriptor),
defineProperty: Some(proxyhandler::define_property),
ownPropertyKeys: Some(own_property_keys),
delete_: Some(proxyhandler::delete),
enumerate: None,
getPrototypeIfOrdinary: Some(proxyhandler::get_prototype_if_ordinary),
getPrototype: None,
setPrototype: None,
setImmutablePrototype: None,
preventExtensions: Some(proxyhandler::prevent_extensions),
isExtensible: Some(proxyhandler::is_extensible),
has: None,
get: Some(get),
set: None,
call: None,
construct: None,
hasOwn: Some(hasOwn),
getOwnEnumerablePropertyKeys: Some(getOwnEnumerablePropertyKeys),
nativeCall: None,
objectClassIs: None,
className: Some(className),
fun_toString: None,
boxedValue_unbox: None,
defaultValue: None,
trace: Some(_trace),
finalize: Some(_finalize),
objectMoved: None,
isCallable: None,
isConstructor: None,
};
CreateProxyHandler(&traps, Class.as_void_ptr())
}
#[inline] unsafe fn UnwrapProxy(obj: RawHandleObject) -> *const HTMLFormElement {
let mut slot = UndefinedValue();
GetProxyReservedSlot(obj.get(), 0, &mut slot);
let box_ = slot.to_private() as *const HTMLFormElement;
return box_;
}
static Class: DOMClass = DOMClass {
interface_chain: [ PrototypeList::ID::EventTarget, PrototypeList::ID::Node, PrototypeList::ID::Element, PrototypeList::ID::HTMLElement, PrototypeList::ID::HTMLFormElement, PrototypeList::ID::Last ],
depth: 4,
type_id: crate::dom::bindings::codegen::InheritTypes::TopTypeId { eventtarget: (crate::dom::bindings::codegen::InheritTypes::EventTargetTypeId::Node(crate::dom::bindings::codegen::InheritTypes::NodeTypeId::Element(crate::dom::bindings::codegen::InheritTypes::ElementTypeId::HTMLElement(crate::dom::bindings::codegen::InheritTypes::HTMLElementTypeId::HTMLFormElement)))) },
malloc_size_of: malloc_size_of_including_raw_self::<HTMLFormElement> as unsafe fn(&mut _, _) -> _,
global: InterfaceObjectMap::Globals::EMPTY,
};
unsafe extern fn own_property_keys(cx: *mut JSContext, proxy: RawHandleObject, props: RawMutableHandleIdVector) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let unwrapped_proxy = UnwrapProxy(proxy);
for i in 0..(*unwrapped_proxy).Length() {
rooted!(in(*cx) let mut rooted_jsid: jsid);
int_to_jsid(i as i32, rooted_jsid.handle_mut());
AppendToIdVector(props, rooted_jsid.handle());
}
for name in (*unwrapped_proxy).SupportedPropertyNames() {
let cstring = CString::new(name).unwrap();
let jsstring = JS_AtomizeAndPinString(*cx, cstring.as_ptr());
rooted!(in(*cx) let rooted = jsstring);
rooted!(in(*cx) let mut rooted_jsid: jsid);
RUST_INTERNED_STRING_TO_JSID(*cx, rooted.handle().get(), rooted_jsid.handle_mut());
AppendToIdVector(props, rooted_jsid.handle());
}
rooted!(in(*cx) let mut expando = ptr::null_mut::<JSObject>());
get_expando_object(proxy, expando.handle_mut());
if !expando.is_null() &&
!GetPropertyKeys(*cx, expando.handle(), JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, props) {
return false;
}
true
})());
result
}
unsafe extern fn getOwnEnumerablePropertyKeys(cx: *mut JSContext, proxy: RawHandleObject, props: RawMutableHandleIdVector) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let unwrapped_proxy = UnwrapProxy(proxy);
for i in 0..(*unwrapped_proxy).Length() {
rooted!(in(*cx) let mut rooted_jsid: jsid);
int_to_jsid(i as i32, rooted_jsid.handle_mut());
AppendToIdVector(props, rooted_jsid.handle());
}
rooted!(in(*cx) let mut expando = ptr::null_mut::<JSObject>());
get_expando_object(proxy, expando.handle_mut());
if !expando.is_null() &&
!GetPropertyKeys(*cx, expando.handle(), JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, props) {
return false;
}
true
})());
result
}
unsafe extern fn getOwnPropertyDescriptor(cx: *mut JSContext, proxy: RawHandleObject, id: RawHandleId, mut desc: RawMutableHandle<PropertyDescriptor>, is_none: *mut bool) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let index = get_array_index_from_id(*cx, Handle::from_raw(id));
if let Some(index) = index {
let this = UnwrapProxy(proxy);
let this = &*this;
let result: Option<DomRoot<Element>> = this.IndexedGetter(index);
if let Some(result) = result {
rooted!(in(*cx) let mut rval = UndefinedValue());
(result).to_jsval(*cx, rval.handle_mut());
set_property_descriptor(
MutableHandle::from_raw(desc),
rval.handle(),
(JSPROP_ENUMERATE | JSPROP_READONLY) as u32,
&mut *is_none
);
return true;
}
}
rooted!(in(*cx) let mut expando = ptr::null_mut::<JSObject>());
get_expando_object(proxy, expando.handle_mut());
let proxy_lt = Handle::from_raw(proxy);
let id_lt = Handle::from_raw(id);
if !expando.is_null() {
rooted!(in(*cx) let mut ignored = ptr::null_mut::<JSObject>());
if !JS_GetPropertyDescriptorById(*cx, expando.handle().into(), id, desc, ignored.handle_mut().into(), is_none) {
return false;
}
if !*is_none {
return true;
}
}
if index.is_none() && (id.is_string() || id.is_int()) {
let mut has_on_proto = false;
if !has_property_on_prototype(*cx, proxy_lt, id_lt, &mut has_on_proto) {
return false;
}
if !has_on_proto {
let name = jsid_to_string(*cx, Handle::from_raw(id)).expect("Not a string-convertible JSID?");
let this = UnwrapProxy(proxy);
let this = &*this;
let result: Option<UnionTypes::RadioNodeListOrElement> = this.NamedGetter(name);
if let Some(result) = result {
rooted!(in(*cx) let mut rval = UndefinedValue());
(result).to_jsval(*cx, rval.handle_mut());
set_property_descriptor(
MutableHandle::from_raw(desc),
rval.handle(),
(JSPROP_READONLY) as u32,
&mut *is_none
);
return true;
}
}
}
true
})());
result
}
unsafe extern fn className(cx: *mut JSContext, _proxy: RawHandleObject) -> *const libc::c_char {
b"HTMLFormElement\0" as *const u8 as *const libc::c_char
}
unsafe extern fn get(cx: *mut JSContext, proxy: RawHandleObject, receiver: RawHandleValue, id: RawHandleId, vp: RawMutableHandleValue) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let proxy_lt = Handle::from_raw(proxy);
let vp_lt = MutableHandle::from_raw(vp);
let id_lt = Handle::from_raw(id);
let receiver_lt = Handle::from_raw(receiver);
let index = get_array_index_from_id(*cx, id_lt);
if let Some(index) = index {
let this = UnwrapProxy(proxy);
let this = &*this;
let result: Option<DomRoot<Element>> = this.IndexedGetter(index);
if let Some(result) = result {
(result).to_jsval(*cx, vp_lt);
return true;
} } else {
rooted!(in(*cx) let mut expando = ptr::null_mut::<JSObject>());
get_expando_object(proxy, expando.handle_mut());
if !expando.is_null() {
let mut hasProp = false;
if !JS_HasPropertyById(*cx, expando.handle().into(), id, &mut hasProp) {
return false;
}
if hasProp {
return JS_ForwardGetPropertyTo(*cx, expando.handle().into(), id, receiver, vp);
}
}
}
let mut found = false;
if !get_property_on_prototype(*cx, proxy_lt, receiver_lt, id_lt, &mut found, vp_lt) {
return false;
}
if found {
return true;
}
if index.is_none() && (id.is_string() || id.is_int()) {
let name = jsid_to_string(*cx, Handle::from_raw(id)).expect("Not a string-convertible JSID?");
let this = UnwrapProxy(proxy);
let this = &*this;
let result: Option<UnionTypes::RadioNodeListOrElement> = this.NamedGetter(name);
if let Some(result) = result {
(result).to_jsval(*cx, vp_lt);
return true;
}}
vp.set(UndefinedValue());
true
})());
result
}
unsafe extern fn hasOwn(cx: *mut JSContext, proxy: RawHandleObject, id: RawHandleId, bp: *mut bool) -> bool {
let mut result = false;
wrap_panic(&mut || result = (|| {
let cx = SafeJSContext::from_ptr(cx);
let index = get_array_index_from_id(*cx, Handle::from_raw(id));
if let Some(index) = index {
let this = UnwrapProxy(proxy);
let this = &*this;
let result: Option<DomRoot<Element>> = this.IndexedGetter(index);
*bp = result.is_some();
return true;
}
rooted!(in(*cx) let mut expando = ptr::null_mut::<JSObject>());
let proxy_lt = Handle::from_raw(proxy);
let id_lt = Handle::from_raw(id);
get_expando_object(proxy, expando.handle_mut());
if !expando.is_null() {
let ok = JS_HasPropertyById(*cx, expando.handle().into(), id, bp);
if !ok || *bp {
return ok;
}
}
if index.is_none() && (id.is_string() || id.is_int()) {
let mut has_on_proto = false;
if !has_property_on_prototype(*cx, proxy_lt, id_lt, &mut has_on_proto) {
return false;
}
if !has_on_proto {
let name = jsid_to_string(*cx, Handle::from_raw(id)).expect("Not a string-convertible JSID?");
let this = UnwrapProxy(proxy);
let this = &*this;
let result: Option<UnionTypes::RadioNodeListOrElement> = this.NamedGetter(name);
*bp = result.is_some();
return true;
}
}
*bp = false;
true
})());
result
}
pub unsafe fn Wrap(cx: SafeJSContext, scope: &GlobalScope, given_proto: Option<HandleObject>, object: Box<HTMLFormElement>) -> DomRoot<HTMLFormElement> {
let raw = Root::new(MaybeUnreflectedDom::from_box(object));
let scope = scope.reflector().get_jsobject();
assert!(!scope.get().is_null());
assert!(((*get_object_class(scope.get())).flags & JSCLASS_IS_GLOBAL) != 0);
let _ac = JSAutoRealm::new(*cx, scope.get());
rooted!(in(*cx) let mut canonical_proto = ptr::null_mut::<JSObject>());
GetProtoObject(cx, scope, canonical_proto.handle_mut());
assert!(!canonical_proto.is_null());
let handler: *const libc::c_void =
RegisterBindings::proxy_handlers::HTMLFormElement
.load(std::sync::atomic::Ordering::Acquire);
rooted!(in(*cx) let obj = NewProxyObject(
*cx,
handler,
Handle::from_raw(UndefinedHandleValue),
canonical_proto.get(),
ptr::null(),
false,
));
assert!(!obj.is_null());
SetProxyReservedSlot(
obj.get(),
0,
&PrivateValue(raw.as_ptr() as *const libc::c_void),
);
let root = raw.reflect_with(obj.get());
DomRoot::from_ref(&*root)
}
impl DomObjectWrap for dom::htmlformelement::HTMLFormElement {
const WRAP: unsafe fn(
SafeJSContext,
&GlobalScope,
Option<HandleObject>,
Box<Self>,
) -> Root<Dom<Self>> = Wrap;
}
impl IDLInterface for HTMLFormElement {
#[inline]
fn derives(class: &'static DOMClass) -> bool {
ptr::eq(class, &Class)
}
}
impl PartialEq for HTMLFormElement {
fn eq(&self, other: &HTMLFormElement) -> bool {
self as *const HTMLFormElement == other
}
}
pub trait HTMLFormElementMethods {
fn AcceptCharset(&self) -> DOMString;
fn SetAcceptCharset(&self, value: DOMString);
fn Action(&self) -> DOMString;
fn SetAction(&self, value: DOMString);
fn Autocomplete(&self) -> DOMString;
fn SetAutocomplete(&self, value: DOMString);
fn Enctype(&self) -> DOMString;
fn SetEnctype(&self, value: DOMString);
fn Encoding(&self) -> DOMString;
fn SetEncoding(&self, value: DOMString);
fn Method(&self) -> DOMString;
fn SetMethod(&self, value: DOMString);
fn Name(&self) -> DOMString;
fn SetName(&self, value: DOMString);
fn NoValidate(&self) -> bool;
fn SetNoValidate(&self, value: bool);
fn Target(&self) -> DOMString;
fn SetTarget(&self, value: DOMString);
fn Rel(&self) -> DOMString;
fn SetRel(&self, value: DOMString);
fn RelList(&self) -> DomRoot<DOMTokenList>;
fn Elements(&self) -> DomRoot<HTMLFormControlsCollection>;
fn Length(&self) -> u32;
fn Submit(&self);
fn RequestSubmit(&self, submitter: Option<&HTMLElement>) -> Fallible<()>;
fn Reset(&self);
fn CheckValidity(&self) -> bool;
fn ReportValidity(&self) -> bool;
fn IndexedGetter(&self, index: u32) -> Option<DomRoot<Element>>;
fn SupportedPropertyNames(&self) -> Vec<DOMString>;
fn NamedGetter(&self, name: DOMString) -> Option<UnionTypes::RadioNodeListOrElement>;
}
const sMethods_specs: &[&[JSFunctionSpec]] = &[
&[
JSFunctionSpec {
name: JSPropertySpec_Name { string_: b"submit\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &submit_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"requestSubmit\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &requestSubmit_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"reset\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &reset_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"checkValidity\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &checkValidity_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"reportValidity\0" as *const u8 as *const libc::c_char },
call: JSNativeWrapper { op: Some(generic_method), info: &reportValidity_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_: ptr::null() },
call: JSNativeWrapper { op: None, info: ptr::null() },
nargs: 0,
flags: 0,
selfHostedName: ptr::null()
}]
,
&[
JSFunctionSpec {
name: JSPropertySpec_Name { symbol_: SymbolCode::iterator as usize + 1 },
call: JSNativeWrapper { op: None, info: ptr::null() },
nargs: 0,
flags: 0,
selfHostedName: b"$ArrayValues\0" as *const u8 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]),
Guard::new(Condition::Satisfied, sMethods_specs[1])
];
const sAttributes_specs: &[&[JSPropertySpec]] = &[
&[
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"acceptCharset\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: &acceptCharset_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_setter), info: &acceptCharset_setterinfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"action\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: &action_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_setter), info: &action_setterinfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"autocomplete\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: &autocomplete_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_setter), info: &autocomplete_setterinfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"enctype\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: &enctype_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_setter), info: &enctype_setterinfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"encoding\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: &encoding_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_setter), info: &encoding_setterinfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"method\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: &method_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_setter), info: &method_setterinfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"name\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: &name_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_setter), info: &name_setterinfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"noValidate\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: &noValidate_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_setter), info: &noValidate_setterinfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"target\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: &target_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_setter), info: &target_setterinfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"rel\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: &rel_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_setter), info: &rel_setterinfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"relList\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: &relList_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: Some(generic_setter), info: &relList_setterinfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"elements\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: &elements_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
JSPropertySpec {
name: JSPropertySpec_Name { string_: b"length\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: &length_getterinfo },
},
setter: JSPropertySpec_Accessor {
native: JSNativeWrapper { op: None, info: 0 as *const JSJitInfo },
}
}
}
}
,
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"HTMLFormElement\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])
];
pub fn GetProtoObject(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject) {
get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::HTMLFormElement), CreateInterfaceObjects, rval)
}
static PrototypeClass: JSClass = JSClass {
name: b"HTMLFormElementPrototype\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(),
};
unsafe extern fn _constructor(cx: *mut JSContext, argc: u32, vp: *mut JSVal) -> bool {
let mut result = false;
wrap_panic(&mut || result = {
let cx = SafeJSContext::from_ptr(cx);
let args = CallArgs::from_vp(vp, argc);
let global = GlobalScope::from_object(JS_CALLEE(*cx, vp).to_object());
let global = DomRoot::downcast::<dom::types::Window>(global).unwrap();
dom::bindings::htmlconstructor::call_html_constructor::<dom::types::HTMLFormElement>(
cx,
&args,
&global,
PrototypeList::ID::HTMLFormElement,
CreateInterfaceObjects,
)
});
result
}
static INTERFACE_OBJECT_CLASS: NonCallbackInterfaceObjectClass =
NonCallbackInterfaceObjectClass::new(
{
const BEHAVIOR: InterfaceConstructorBehavior = InterfaceConstructorBehavior::call(_constructor);
&BEHAVIOR
},
b"function HTMLFormElement() {\n [native code]\n}",
PrototypeList::ID::HTMLFormElement,
4);
pub fn GetConstructorObject(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject) {
get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::Constructor(PrototypeList::Constructor::HTMLFormElement), CreateInterfaceObjects, rval)
}
pub fn DefineDOMInterface(cx: SafeJSContext, global: HandleObject) {
define_dom_interface(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::HTMLFormElement), 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>());
HTMLElement_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,
&[],
&[],
prototype.handle_mut());
assert!(!prototype.is_null());
assert!((*cache)[PrototypeList::ID::HTMLFormElement as usize].is_null());
(*cache)[PrototypeList::ID::HTMLFormElement as usize] = prototype.get();
<*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::HTMLFormElement as isize),
ptr::null_mut(),
prototype.get());
rooted!(in(*cx) let mut interface_proto = ptr::null_mut::<JSObject>());
HTMLElement_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,
&[],
&[],
&[],
prototype.handle(),
b"HTMLFormElement\0",
0,
&[],
interface.handle_mut());
assert!(!interface.is_null());
assert!((*cache)[PrototypeList::Constructor::HTMLFormElement as usize].is_null());
(*cache)[PrototypeList::Constructor::HTMLFormElement as usize] = interface.get();
<*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::Constructor::HTMLFormElement as isize),
ptr::null_mut(),
interface.get());
}
}