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<'_>>, can_gc: CanGc, ) -> 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, can_gc: CanGc, ) -> 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<FormSubmitterElement<'_>>,
encoding: Option<&'static Encoding>,
) -> Vec<FormDatum>
pub fn form_datums( &self, submitter: Option<FormSubmitterElement<'_>>, 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>>, can_gc: CanGc)
fn sanitize_value(&self, value: &mut DOMString)
fn selection(&self) -> TextControlSelection<'_, Self>
fn implicit_submission(&self, can_gc: CanGc)
sourcefn convert_string_to_number(&self, value: &DOMString) -> Option<f64>
fn convert_string_to_number(&self, value: &DOMString) -> Option<f64>
sourcefn convert_number_to_string(&self, value: f64) -> Option<DOMString>
fn convert_number_to_string(&self, value: f64) -> Option<DOMString>
fn convert_string_to_naive_datetime( &self, value: DOMString, ) -> Option<OffsetDateTime>
sourcefn convert_datetime_to_dom_string(&self, value: OffsetDateTime) -> DOMString
fn convert_datetime_to_dom_string(&self, value: OffsetDateTime) -> DOMString
https://html.spec.whatwg.org/multipage/#concept-input-value-date-string This does the safe Rust part of conversion; the unsafe JS Date part is in SetValueAsDate
Trait Implementations§
source§impl Activatable for HTMLInputElement
impl Activatable for HTMLInputElement
source§fn activation_behavior(
&self,
_event: &Event,
_target: &EventTarget,
can_gc: CanGc,
)
fn activation_behavior( &self, _event: &Event, _target: &EventTarget, can_gc: CanGc, )
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 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>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::HTMLInputElementBinding::HTMLInputElement_Binding::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>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::htmlinputelement::HTMLInputElement>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::HTMLInputElementBinding::HTMLInputElement_Binding::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>, script_runtime::CanGc) -> 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(&self) -> &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, ) -> DOMString
fn get_form_boolean_attribute<InputFn, OwnerFn>( &self, attr: &LocalName, input: InputFn, owner: OwnerFn, ) -> bool
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, can_gc: CanGc) -> 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, can_gc: CanGc, ) -> Result<(), Error>
fn ValueAsNumber(&self) -> f64
fn SetValueAsNumber(&self, value: f64, can_gc: CanGc) -> 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>, can_gc: CanGc)
fn StepUp(&self, n: i32, can_gc: CanGc) -> Result<(), Error>
fn StepDown(&self, n: i32, can_gc: CanGc) -> Result<(), Error>
fn WillValidate(&self) -> bool
fn Validity(&self) -> Root<Dom<ValidityState>>
fn CheckValidity(&self, can_gc: CanGc) -> bool
fn ReportValidity(&self, can_gc: CanGc) -> 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 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§impl PartialEq for HTMLInputElement
impl PartialEq for HTMLInputElement
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 Traceable for HTMLInputElement
impl Traceable for HTMLInputElement
source§impl Validatable for HTMLInputElement
impl Validatable for HTMLInputElement
fn as_element(&self) -> &Element
source§fn validity_state(&self) -> Root<Dom<ValidityState>>
fn validity_state(&self) -> Root<Dom<ValidityState>>
source§fn is_instance_validatable(&self) -> bool
fn is_instance_validatable(&self) -> bool
fn perform_validation(&self, validate_flags: ValidationFlags) -> ValidationFlags
source§fn satisfies_constraints(&self) -> bool
fn satisfies_constraints(&self) -> bool
source§fn check_validity(&self, can_gc: CanGc) -> bool
fn check_validity(&self, can_gc: CanGc) -> bool
source§fn report_validity(&self, can_gc: CanGc) -> bool
fn report_validity(&self, can_gc: CanGc) -> bool
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
impl Eq for HTMLInputElement
Auto Trait Implementations§
impl !Freeze for HTMLInputElement
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
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