Skip to main content

HTMLSelectElement

Struct HTMLSelectElement 

Source
#[repr(C)]
pub(crate) struct HTMLSelectElement { htmlelement: HTMLElement, options: MutNullableDom<HTMLOptionsCollection>, selected_options: MutNullableDom<HTMLCollection>, form_owner: MutNullableDom<HTMLFormElement>, labels_node_list: MutNullableDom<NodeList>, validity_state: MutNullableDom<ValidityState>, shadow_tree: DomRefCell<Option<ShadowTree>>, }

Fields§

§htmlelement: HTMLElement§options: MutNullableDom<HTMLOptionsCollection>§selected_options: MutNullableDom<HTMLCollection>§form_owner: MutNullableDom<HTMLFormElement>§labels_node_list: MutNullableDom<NodeList>§validity_state: MutNullableDom<ValidityState>§shadow_tree: DomRefCell<Option<ShadowTree>>

Implementations§

Source§

impl HTMLSelectElement

Source§

impl HTMLSelectElement

Source

fn new_inherited( local_name: LocalName, prefix: Option<Prefix>, document: &Document, ) -> HTMLSelectElement

Source

pub(crate) fn new( cx: &mut JSContext, local_name: LocalName, prefix: Option<Prefix>, document: &Document, proto: Option<HandleObject<'_>>, ) -> DomRoot<HTMLSelectElement>

Source

pub(crate) fn list_of_options<'b>( &self, no_gc: &'b NoGC, ) -> impl Iterator<Item = UnrootedDom<'b, HTMLOptionElement>> + use<'b>

Source

fn get_placeholder_label_option( &self, no_gc: &NoGC, ) -> Option<DomRoot<HTMLOptionElement>>

https://html.spec.whatwg.org/multipage/#placeholder-label-option

If a select element has a required attribute specified, and has a display size of 1; and if the value of the first option element in the select element’s list of options (if any) is the empty string, and that option element does not have an ancestor optgroup in between itself and the select element, then that option is the select element’s placeholder label option.

If a select element has a required attribute specified, does not have a multiple attribute specified, and has a display size of 1, then the select element must have a placeholder label option.

Source

pub(crate) fn reset(&self, no_gc: &NoGC)

Source

pub(crate) fn selectedness_setting_algorithm(&self, no_gc: &NoGC) -> bool

Source

pub(crate) fn push_form_data(&self, no_gc: &NoGC, data_set: &mut Vec<FormDatum>)

Source

pub(crate) fn pick_option(&self, no_gc: &NoGC, picked: &HTMLOptionElement)

Source

fn display_size(&self) -> u32

Source

pub(crate) fn update_shadow_tree(&self, cx: &mut JSContext)

Source

pub(crate) fn selected_option<'b>( &self, no_gc: &'b NoGC, ) -> Option<UnrootedDom<'b, HTMLOptionElement>>

Source

pub(crate) fn selected_options<'b>( &self, no_gc: &'b NoGC, ) -> Vec<UnrootedDom<'b, HTMLOptionElement>>

Source

pub(crate) fn show_menu(&self, cx: &mut JSContext)

Source

pub(crate) fn handle_embedder_response( &self, cx: &mut JSContext, selected_values: Vec<usize>, )

Source

fn multiple_attribute_mutated( &self, cx: &mut JSContext, mutation: AttributeMutation<'_>, )

Source

fn send_update_notifications(&self)

Source

fn may_have_embedder_control(&self) -> bool

Source

pub(crate) fn get_enabled_selectedcontent(&self) -> Option<DomRoot<Element>>

Source

pub(crate) fn update_a_selects_descendant_selectedcontent_elements( &self, cx: &mut JSContext, )

Source

fn update_a_selected_content( &self, cx: &mut JSContext, selected_content: &Element, )

Trait Implementations§

Source§

impl Activatable for HTMLSelectElement

§

impl Castable for HTMLSelectElement

Source§

fn is<T>(&self) -> bool
where T: DerivedFrom<Self>,

Check whether a DOM object implements one of its deriving interfaces.
Source§

fn upcast<T>(&self) -> &T
where T: Castable, Self: DerivedFrom<T>,

Cast a DOM object upwards to one of the interfaces it derives from.
Source§

fn downcast<T>(&self) -> Option<&T>
where T: DerivedFrom<Self>,

Cast a DOM object downwards to one of the interfaces it might implement.
§

impl DerivedFrom<Element> for HTMLSelectElement

§

impl DerivedFrom<EventTarget> for HTMLSelectElement

§

impl DerivedFrom<HTMLElement> for HTMLSelectElement

§

impl DerivedFrom<Node> for HTMLSelectElement

Source§

impl DomObject for HTMLSelectElement

Source§

type ReflectorType = <HTMLElement as DomObject>::ReflectorType

Source§

fn reflector(&self) -> &Reflector<Self::ReflectorType>

Returns the receiver’s reflector.
Source§

impl DomObjectWrap<DomTypeHolder> for HTMLSelectElement

Source§

const WRAP: unsafe fn(&mut JSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>) -> Root<Dom<Self>>

Function pointer to the general wrap function type
Source§

impl Drop for HTMLSelectElement

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Eq for HTMLSelectElement

Source§

impl FormControl for HTMLSelectElement

Source§

fn form_owner(&self) -> Option<DomRoot<HTMLFormElement>>

Source§

fn set_form_owner(&self, _cx: &mut JSContext, form: Option<&HTMLFormElement>)

Source§

fn to_html_element(&self) -> &HTMLElement

Source§

fn to_element(&self) -> &Element

Source§

fn is_listed(&self) -> bool

Source§

fn set_form_owner_from_parser(&self, cx: &mut JSContext, form: &HTMLFormElement)

Source§

fn reset_form_owner(&self, cx: &mut JSContext)

Source§

fn form_attribute_mutated( &self, cx: &mut JSContext, mutation: AttributeMutation<'_>, )

Source§

fn register_if_necessary(&self)

Source§

fn unregister_if_necessary(&self)

Source§

fn bind_form_control_to_tree(&self, cx: &mut JSContext)

Source§

fn unbind_form_control_from_tree(&self, cx: &mut JSContext)

Source§

fn get_form_attribute<InputFn, OwnerFn>( &self, attr: &LocalName, input: InputFn, owner: OwnerFn, ) -> DOMString
where InputFn: Fn(&Self) -> DOMString, OwnerFn: Fn(&HTMLFormElement) -> DOMString, Self: Sized,

Source§

fn get_form_boolean_attribute<InputFn, OwnerFn>( &self, attr: &LocalName, input: InputFn, owner: OwnerFn, ) -> bool
where InputFn: Fn(&Self) -> bool, OwnerFn: Fn(&HTMLFormElement) -> bool, Self: Sized,

Source§

fn is_candidate_for_constraint_validation(&self, no_gc: &NoGC) -> bool

Source§

fn moving_steps(&self, cx: &mut JSContext)

Source§

impl HTMLSelectElementMethods<DomTypeHolder> for HTMLSelectElement

Source§

fn Add( &self, cx: &mut JSContext, element: HTMLOptionElementOrHTMLOptGroupElement<DomTypeHolder>, before: Option<HTMLElementOrLong<DomTypeHolder>>, ) -> ErrorResult

Source§

fn GetForm(&self) -> Option<DomRoot<HTMLFormElement>>

Source§

fn Type(&self) -> DOMString

Source§

fn Options(&self, cx: &mut JSContext) -> DomRoot<HTMLOptionsCollection>

Source§

fn SelectedOptions(&self, cx: &mut JSContext) -> DomRoot<HTMLCollection>

Source§

fn Length(&self, cx: &mut JSContext) -> u32

Source§

fn SetLength(&self, cx: &mut JSContext, length: u32)

Source§

fn Item(&self, cx: &mut JSContext, index: u32) -> Option<DomRoot<Element>>

Source§

fn IndexedGetter( &self, cx: &mut JSContext, index: u32, ) -> Option<DomRoot<Element>>

Source§

fn IndexedSetter( &self, cx: &mut JSContext, index: u32, value: Option<&HTMLOptionElement>, ) -> ErrorResult

Source§

fn NamedItem( &self, cx: &mut JSContext, name: DOMString, ) -> Option<DomRoot<HTMLOptionElement>>

Source§

fn Remove_(&self, cx: &mut JSContext, index: i32)

Source§

fn Remove(&self, cx: &mut JSContext)

Source§

fn Value(&self, cx: &JSContext) -> DOMString

Source§

fn SetValue(&self, cx: &mut JSContext, value: DOMString)

Source§

fn SelectedIndex(&self, cx: &JSContext) -> i32

Source§

fn SetSelectedIndex(&self, cx: &mut JSContext, index: i32)

Source§

fn WillValidate(&self, no_gc: &NoGC) -> bool

Source§

fn Validity(&self, cx: &mut JSContext) -> DomRoot<ValidityState>

Source§

fn CheckValidity(&self, cx: &mut JSContext) -> bool

Source§

fn ReportValidity(&self, cx: &mut JSContext) -> bool

Source§

fn ValidationMessage(&self, cx: &mut JSContext) -> DOMString

Source§

fn SetCustomValidity(&self, cx: &mut JSContext, error: DOMString)

Source§

fn Disabled(&self) -> bool

Source§

fn SetDisabled(&self, cx: &mut JSContext, value: bool)

Source§

fn Multiple(&self) -> bool

Source§

fn SetMultiple(&self, cx: &mut JSContext, value: bool)

Source§

fn Name(&self) -> DOMString

Source§

fn SetName(&self, cx: &mut JSContext, value: DOMString)

Source§

fn Required(&self) -> bool

Source§

fn SetRequired(&self, cx: &mut JSContext, value: bool)

Source§

fn Size(&self) -> u32

Source§

fn SetSize(&self, cx: &mut JSContext, value: u32)

Source§

fn Labels(&self, cx: &mut JSContext) -> DomRoot<NodeList>

Source§

impl HasParent for HTMLSelectElement

Source§

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

Source§

type Parent = HTMLElement

Source§

impl IDLInterface for HTMLSelectElement

Source§

const PROTO_ID: ID = PrototypeList::ID::HTMLSelectElement

The concrete type represented by this interface instance.
Source§

const PROTO_FIRST: u16 = 279

First prototype ID in the DFS-ordered range for this interface and its descendants.
Source§

const PROTO_LAST: u16 = 279

Last prototype ID in the DFS-ordered range for this interface and its descendants.
Source§

fn derives(class: &'static DOMClass) -> bool

Returns whether the given DOM class derives that interface.
Source§

impl MallocSizeOf for HTMLSelectElement

Source§

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 HTMLSelectElement

Source§

unsafe fn init_reflector<Actual>(&self, obj: *mut JSObject)

Initializes the Reflector Read more
Source§

unsafe fn init_reflector_without_associated_memory(&self, obj: *mut JSObject)

Initializes the Reflector without recording any associated memory usage. Read more
Source§

impl PartialEq for HTMLSelectElement

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl ToJSValConvertible for HTMLSelectElement

Source§

fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)

Convert self to a JSVal. JSAPI failure causes a panic.
Source§

impl Traceable for HTMLSelectElement

Source§

unsafe fn trace(&self, tracer: *mut JSTracer)

Trace self.
Source§

impl UAShadowRoot<ShadowTree> for HTMLSelectElement

Source§

fn store_for_shadow_tree( &self, cx: &mut JSContext, shadow_root: DomRoot<ShadowRoot>, )

Source§

fn borrow_for_shadow_tree(&self) -> Ref<'_, Option<ShadowTree>>

Source§

fn ensure_shadow_tree( &self, cx: &mut JSContext, element: &Element, ) -> Ref<'_, ShadowTree>

Source§

fn should_mark_as_ua_widget(&self) -> bool

TODO: Remove this method and fix the media element controls to properly be clickable
Source§

impl Validatable for HTMLSelectElement

Source§

impl VirtualMethods for HTMLSelectElement

Source§

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, cx: &mut JSContext, attr: AttrRef<'_>, mutation: AttributeMutation<'_>, )

Source§

fn unbind_from_tree(&self, cx: &mut JSContext, context: &UnbindContext<'_>)

Called when a Node is removed from a tree. Implements removing steps: https://dom.spec.whatwg.org/#concept-node-remove-ext
Source§

fn children_changed(&self, cx: &mut JSContext, mutation: &ChildrenMutation<'_>)

Called on the parent when its children are changed.
Source§

fn parse_plain_attribute( &self, local_name: &LocalName, value: DOMString, ) -> AttrValue

Returns the right AttrValue variant for the attribute with name name on this element.
Source§

fn handle_event(&self, cx: &mut JSContext, event: &Event)

Called during event dispatch after the bubbling phase completes.
Source§

fn attribute_affects_presentational_hints(&self, attr: AttrRef<'_>) -> bool

Returns true if given attribute attr affects style of the given element.
Source§

fn post_connection_steps(&self, cx: &mut JSContext)

Invoked during a DOM tree mutation after a node becomes connected, once all related DOM tree mutations have been applied. https://dom.spec.whatwg.org/#concept-node-post-connection-ext
Source§

fn moving_steps(&self, cx: &mut JSContext, context: &MoveContext<'_>)

Source§

fn bind_to_tree(&self, cx: &mut JSContext, context: &BindContext<'_>)

Called when a Node is appended to a tree.
Source§

fn is_valid_command_steps(&self, command: CommandState) -> bool

Source§

fn command_steps( &self, cx: &mut JSContext, button: DomRoot<HTMLButtonElement>, command: CommandState, ) -> bool

Source§

fn adopting_steps(&self, cx: &mut JSContext, old_doc: &Document)

Source§

fn cloning_steps( &self, cx: &mut JSContext, copy: &Node, maybe_doc: Option<&Document>, clone_children: CloneChildrenFlag, )

Source§

fn pop(&self, cx: &mut JSContext)

Called on an element when it is popped off the stack of open elements of a parser.
Source§

fn focus_visible_applies(&self) -> bool

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<D, T> DomGlobalGeneric<D> for T
where D: DomTypes, T: DomObject,

Source§

fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>
where Self: Sized,

Returns the [GlobalScope] of the realm that the DomObject was created in. If this object is a Node, this will be different from it’s owning Document if adopted by. For Nodes it’s almost always better to use NodeTraits::owning_global.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ThisReflector for T
where T: DomObject,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more