Struct script::dom::htmlinputelement::HTMLInputElement
source · #[repr(C)]pub struct HTMLInputElement {Show 14 fields
htmlelement: HTMLElement,
input_type: Cell<InputType>,
checked_changed: Cell<bool>,
placeholder: DomRefCell<DOMString>,
size: Cell<u32>,
maxlength: Cell<i32>,
minlength: Cell<i32>,
textinput: DomRefCell<TextInput<ScriptToConstellationChan>>,
value_dirty: Cell<bool>,
sanitization_flag: Cell<bool>,
filelist: MutNullableDom<FileList>,
form_owner: MutNullableDom<HTMLFormElement>,
labels_node_list: MutNullableDom<NodeList>,
validity_state: MutNullableDom<ValidityState>,
}
Fields§
§htmlelement: HTMLElement
§input_type: Cell<InputType>
§checked_changed: Cell<bool>
§placeholder: DomRefCell<DOMString>
§size: Cell<u32>
§maxlength: Cell<i32>
§minlength: Cell<i32>
§textinput: DomRefCell<TextInput<ScriptToConstellationChan>>
§value_dirty: Cell<bool>
§sanitization_flag: Cell<bool>
§filelist: MutNullableDom<FileList>
§form_owner: MutNullableDom<HTMLFormElement>
§labels_node_list: MutNullableDom<NodeList>
§validity_state: MutNullableDom<ValidityState>
Implementations§
source§impl HTMLInputElement
impl HTMLInputElement
fn __assert_parent_type(&self)
source§impl HTMLInputElement
impl HTMLInputElement
fn new_inherited(
local_name: LocalName,
prefix: Option<Prefix>,
document: &Document
) -> HTMLInputElement
pub fn new(
local_name: LocalName,
prefix: Option<Prefix>,
document: &Document,
proto: Option<HandleObject<'_>>
) -> Root<Dom<HTMLInputElement>>
pub fn auto_directionality(&self) -> Option<String>
pub fn directionality_from_value(value: &str) -> String
fn is_first_strong_character_rtl(value: &str) -> bool
fn value_mode(&self) -> ValueMode
pub fn input_type(&self) -> InputType
pub fn disable_sanitization(&self)
pub fn enable_sanitization(&self)
fn does_readonly_apply(&self) -> bool
fn does_minmaxlength_apply(&self) -> bool
fn does_pattern_apply(&self) -> bool
fn does_multiple_apply(&self) -> bool
fn does_value_as_number_apply(&self) -> bool
fn does_value_as_date_apply(&self) -> bool
fn allowed_value_step(&self) -> Option<f64>
fn minimum(&self) -> Option<f64>
fn maximum(&self) -> Option<f64>
fn stepped_minimum(&self) -> Option<f64>
fn stepped_maximum(&self) -> Option<f64>
fn default_minimum(&self) -> Option<f64>
fn default_maximum(&self) -> Option<f64>
fn default_range_value(&self) -> f64
fn default_step(&self) -> Option<f64>
fn step_scale_factor(&self) -> f64
fn step_base(&self) -> f64
fn default_step_base(&self) -> Option<f64>
fn step_up_or_down(&self, n: i32, dir: StepDirection) -> Result<(), Error>
fn suggestions_source_element(&self) -> Option<Root<Dom<HTMLDataListElement>>>
fn suffers_from_being_missing(&self, value: &DOMString) -> bool
fn suffers_from_type_mismatch(&self, value: &DOMString) -> bool
fn suffers_from_pattern_mismatch(&self, value: &DOMString) -> bool
fn suffers_from_bad_input(&self, value: &DOMString) -> bool
fn suffers_from_length_issues(&self, value: &DOMString) -> ValidationFlags
fn suffers_from_range_issues(&self, value: &DOMString) -> ValidationFlags
source§impl HTMLInputElement
impl HTMLInputElement
fn radio_group_updated(&self, group: Option<&Atom>)
sourcepub fn form_datums(
&self,
submitter: Option<FormSubmitter<'_>>,
encoding: Option<&'static Encoding>
) -> Vec<FormDatum> ⓘ
pub fn form_datums(
&self,
submitter: Option<FormSubmitter<'_>>,
encoding: Option<&'static Encoding>
) -> Vec<FormDatum> ⓘ
https://html.spec.whatwg.org/multipage/#constructing-the-form-data-set Steps range from 5.1 to 5.10 (specific to HTMLInputElement)
fn radio_group_name(&self) -> Option<Atom>
fn update_checked_state(&self, checked: bool, dirty: bool)
fn is_mutable(&self) -> bool
pub fn reset(&self)
fn update_placeholder_shown_state(&self)
fn select_files(&self, opt_test_paths: Option<Vec<DOMString>>)
fn sanitize_value(&self, value: &mut DOMString)
fn selection(&self) -> TextControlSelection<'_, Self>
fn implicit_submission(&self)
fn convert_string_to_number(&self, value: &DOMString) -> Result<f64, ()>
fn convert_number_to_string(&self, value: f64) -> Result<DOMString, ()>
fn convert_string_to_naive_datetime(
&self,
value: DOMString
) -> Result<NaiveDateTime, ()>
fn convert_naive_datetime_to_string(
&self,
value: NaiveDateTime
) -> Result<DOMString, ()>
Trait Implementations§
source§impl Activatable for HTMLInputElement
impl Activatable for HTMLInputElement
fn as_element(&self) -> &Element
fn is_instance_activatable(&self) -> bool
fn legacy_pre_activation_behavior(&self) -> Option<InputActivationState>
fn legacy_canceled_activation_behavior(
&self,
cache: Option<InputActivationState>
)
fn activation_behavior(&self, _event: &Event, _target: &EventTarget)
fn enter_formal_activation_state(&self)
fn exit_formal_activation_state(&self)
source§impl Castable for HTMLInputElement
impl Castable for HTMLInputElement
source§impl DomObject for HTMLInputElement
impl DomObject for HTMLInputElement
source§impl DomObjectWrap for HTMLInputElement
impl DomObjectWrap for HTMLInputElement
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::HTMLInputElementBinding::HTMLInputElementBinding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::htmlinputelement::HTMLInputElement>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::htmlinputelement::HTMLInputElement>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::HTMLInputElementBinding::HTMLInputElementBinding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::htmlinputelement::HTMLInputElement>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::htmlinputelement::HTMLInputElement>>}
Function pointer to the general wrap function type
source§impl FormControl for HTMLInputElement
impl FormControl for HTMLInputElement
fn form_owner(&self) -> Option<Root<Dom<HTMLFormElement>>>
fn set_form_owner(&self, form: Option<&HTMLFormElement>)
fn to_element<'a>(&'a self) -> &'a Element
fn is_listed(&self) -> bool
fn set_form_owner_from_parser(&self, form: &HTMLFormElement)
fn reset_form_owner(&self)
fn form_attribute_mutated(&self, mutation: AttributeMutation<'_>)
fn register_if_necessary(&self)
fn unregister_if_necessary(&self)
fn bind_form_control_to_tree(&self)
fn unbind_form_control_from_tree(&self)
fn get_form_attribute<InputFn, OwnerFn>(
&self,
attr: &LocalName,
input: InputFn,
owner: OwnerFn
) -> DOMStringwhere
InputFn: Fn(&Self) -> DOMString,
OwnerFn: Fn(&HTMLFormElement) -> DOMString,
Self: Sized,
fn get_form_boolean_attribute<InputFn, OwnerFn>(
&self,
attr: &LocalName,
input: InputFn,
owner: OwnerFn
) -> boolwhere
InputFn: Fn(&Self) -> bool,
OwnerFn: Fn(&HTMLFormElement) -> bool,
Self: Sized,
source§impl HTMLInputElementMethods for HTMLInputElement
impl HTMLInputElementMethods for HTMLInputElement
fn Accept(&self) -> DOMString
fn SetAccept(&self, value: DOMString)
fn Alt(&self) -> DOMString
fn SetAlt(&self, value: DOMString)
fn DirName(&self) -> DOMString
fn SetDirName(&self, value: DOMString)
fn Disabled(&self) -> bool
fn SetDisabled(&self, value: bool)
fn GetForm(&self) -> Option<Root<Dom<HTMLFormElement>>>
fn GetFiles(&self) -> Option<Root<Dom<FileList>>>
fn DefaultChecked(&self) -> bool
fn SetDefaultChecked(&self, value: bool)
fn Checked(&self) -> bool
fn SetChecked(&self, checked: bool)
fn ReadOnly(&self) -> bool
fn SetReadOnly(&self, value: bool)
fn Size(&self) -> u32
fn SetSize(&self, value: u32) -> Result<(), Error>
fn Type(&self) -> DOMString
fn SetType(&self, value: DOMString)
fn Value(&self) -> DOMString
fn SetValue(&self, value: DOMString) -> Result<(), Error>
fn DefaultValue(&self) -> DOMString
fn SetDefaultValue(&self, value: DOMString)
fn Min(&self) -> DOMString
fn SetMin(&self, value: DOMString)
fn GetList(&self) -> Option<Root<Dom<HTMLDataListElement>>>
fn GetValueAsDate(&self, cx: SafeJSContext) -> Option<NonNull<JSObject>>
fn SetValueAsDate(
&self,
cx: SafeJSContext,
value: *mut JSObject
) -> Result<(), Error>
fn ValueAsNumber(&self) -> f64
fn SetValueAsNumber(&self, value: f64) -> Result<(), Error>
fn Name(&self) -> DOMString
fn SetName(&self, value: DOMString)
fn Placeholder(&self) -> DOMString
fn SetPlaceholder(&self, value: DOMString)
fn FormAction(&self) -> DOMString
fn SetFormAction(&self, value: DOMString)
fn FormEnctype(&self) -> DOMString
fn SetFormEnctype(&self, value: DOMString)
fn FormMethod(&self) -> DOMString
fn SetFormMethod(&self, value: DOMString)
fn FormTarget(&self) -> DOMString
fn SetFormTarget(&self, value: DOMString)
fn FormNoValidate(&self) -> bool
fn SetFormNoValidate(&self, value: bool)
fn Max(&self) -> DOMString
fn SetMax(&self, value: DOMString)
fn MaxLength(&self) -> i32
fn SetMaxLength(&self, value: i32) -> Result<(), Error>
fn MinLength(&self) -> i32
fn SetMinLength(&self, value: i32) -> Result<(), Error>
fn Multiple(&self) -> bool
fn SetMultiple(&self, value: bool)
fn Pattern(&self) -> DOMString
fn SetPattern(&self, value: DOMString)
fn Required(&self) -> bool
fn SetRequired(&self, value: bool)
fn Src(&self) -> USVString
fn SetSrc(&self, value: USVString)
fn Step(&self) -> DOMString
fn SetStep(&self, value: DOMString)
fn Indeterminate(&self) -> bool
fn SetIndeterminate(&self, val: bool)
fn GetLabels(&self) -> Option<Root<Dom<NodeList>>>
fn Select(&self)
fn GetSelectionStart(&self) -> Option<u32>
fn SetSelectionStart(&self, start: Option<u32>) -> Result<(), Error>
fn GetSelectionEnd(&self) -> Option<u32>
fn SetSelectionEnd(&self, end: Option<u32>) -> Result<(), Error>
fn GetSelectionDirection(&self) -> Option<DOMString>
fn SetSelectionDirection(
&self,
direction: Option<DOMString>
) -> Result<(), Error>
fn SetSelectionRange(
&self,
start: u32,
end: u32,
direction: Option<DOMString>
) -> Result<(), Error>
fn SetRangeText(&self, replacement: DOMString) -> Result<(), Error>
fn SetRangeText_(
&self,
replacement: DOMString,
start: u32,
end: u32,
selection_mode: SelectionMode
) -> Result<(), Error>
fn SelectFiles(&self, paths: Vec<DOMString>)
fn StepUp(&self, n: i32) -> Result<(), Error>
fn StepDown(&self, n: i32) -> Result<(), Error>
fn WillValidate(&self) -> bool
fn Validity(&self) -> Root<Dom<ValidityState>>
fn CheckValidity(&self) -> bool
fn ReportValidity(&self) -> bool
fn ValidationMessage(&self) -> DOMString
fn SetCustomValidity(&self, error: DOMString)
source§impl HasParent for HTMLInputElement
impl HasParent for HTMLInputElement
source§fn as_parent(&self) -> &HTMLElement
fn as_parent(&self) -> &HTMLElement
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = HTMLElement
source§impl IDLInterface for HTMLInputElement
impl IDLInterface for HTMLInputElement
source§impl JSTraceable for HTMLInputElement
impl JSTraceable for HTMLInputElement
source§impl MallocSizeOf for HTMLInputElement
impl MallocSizeOf for HTMLInputElement
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl MutDomObject for HTMLInputElement
impl MutDomObject for HTMLInputElement
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
source§impl PartialEq<HTMLInputElement> for HTMLInputElement
impl PartialEq<HTMLInputElement> for HTMLInputElement
source§fn eq(&self, other: &HTMLInputElement) -> bool
fn eq(&self, other: &HTMLInputElement) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TextControlElement for HTMLInputElement
impl TextControlElement for HTMLInputElement
fn selection_api_applies(&self) -> bool
fn has_selectable_text(&self) -> bool
fn set_dirty_value_flag(&self, value: bool)
source§impl Validatable for HTMLInputElement
impl Validatable for HTMLInputElement
fn as_element(&self) -> &Element
fn validity_state(&self) -> Root<Dom<ValidityState>>
fn is_instance_validatable(&self) -> bool
fn perform_validation(&self, validate_flags: ValidationFlags) -> ValidationFlags
fn validate(&self, validate_flags: ValidationFlags) -> ValidationFlags
fn check_validity(&self) -> bool
fn report_validity(&self) -> bool
fn validation_message(&self) -> DOMString
source§impl VirtualMethods for HTMLInputElement
impl VirtualMethods for HTMLInputElement
source§fn super_type(&self) -> Option<&dyn VirtualMethods>
fn super_type(&self) -> Option<&dyn VirtualMethods>
Returns self as the superclass of the implementation for this trait,
if any.
source§fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation<'_>)
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation<'_>)
Called when attributes of a node are mutated.
https://dom.spec.whatwg.org/#attribute-is-set
https://dom.spec.whatwg.org/#attribute-is-removed
source§fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue
Returns the right AttrValue variant for the attribute with name
name
on this element.source§fn bind_to_tree(&self, context: &BindContext)
fn bind_to_tree(&self, context: &BindContext)
Called when a Node is appended to a tree, where ‘tree_connected’ indicates
whether the tree is part of a Document.
source§fn unbind_from_tree(&self, context: &UnbindContext<'_>)
fn unbind_from_tree(&self, context: &UnbindContext<'_>)
Called when a Node is removed from a tree, where ‘tree_connected’
indicates whether the tree is part of a Document.
Implements removing steps:
https://dom.spec.whatwg.org/#concept-node-remove-ext
source§fn handle_event(&self, event: &Event)
fn handle_event(&self, event: &Event)
Called during event dispatch after the bubbling phase completes.
source§fn cloning_steps(
&self,
copy: &Node,
maybe_doc: Option<&Document>,
clone_children: CloneChildrenFlag
)
fn cloning_steps(
&self,
copy: &Node,
maybe_doc: Option<&Document>,
clone_children: CloneChildrenFlag
)
source§fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool
fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool
Returns
true
if given attribute attr
affects style of the
given element.source§fn children_changed(&self, mutation: &ChildrenMutation<'_>)
fn children_changed(&self, mutation: &ChildrenMutation<'_>)
Called on the parent when its children are changed.
source§fn adopting_steps(&self, old_doc: &Document)
fn adopting_steps(&self, old_doc: &Document)
impl DerivedFrom<Element> for HTMLInputElement
impl DerivedFrom<EventTarget> for HTMLInputElement
impl DerivedFrom<HTMLElement> for HTMLInputElement
impl DerivedFrom<Node> for HTMLInputElement
Auto Trait Implementations§
impl !RefUnwindSafe for HTMLInputElement
impl !Send for HTMLInputElement
impl !Sync for HTMLInputElement
impl Unpin for HTMLInputElement
impl !UnwindSafe for HTMLInputElement
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert