Skip to main content

HTMLOptionElement

Struct HTMLOptionElement 

Source
#[repr(C)]
pub(crate) struct HTMLOptionElement { htmlelement: HTMLElement, selectedness: Cell<bool>, dirtiness: Cell<bool>, cached_nearest_ancestor_select: MutNullableDom<HTMLSelectElement>, }

Fields§

§htmlelement: HTMLElement§selectedness: Cell<bool>§dirtiness: Cell<bool>§cached_nearest_ancestor_select: MutNullableDom<HTMLSelectElement>

Implementations§

Source§

impl HTMLOptionElement

Source§

impl HTMLOptionElement

Source

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

Source

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

Source

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

Set the selectedness value of this HTMLOptionElement returning true if anything changed.

Note: This does not update the containing <select> element.

Source

pub(crate) fn set_dirtiness(&self, dirtiness: bool)

Source

fn pick_if_selected_in_select( &self, cx: &mut JSContext, select: &HTMLSelectElement, )

From https://html.spec.whatwg.org/multipage/#the-select-element:

If the multiple attribute is absent, whenever an option element in the select element’s list of options has its selectedness set to true, and whenever an option element with its selectedness set to true is added to the select element’s list of options, the user agent must set the selectedness of all the other option elements in its list of options to false.

Source

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

Source

fn index(&self, no_gc: &NoGC) -> i32

Source

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

Source

pub(crate) fn displayed_label(&self) -> DOMString

Source

pub(crate) fn cached_nearest_ancestor_select( &self, ) -> Option<DomRoot<HTMLSelectElement>>

Source

pub(crate) fn nearest_ancestor_select( &self, ) -> Option<DomRoot<HTMLSelectElement>>

Source

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

Source

pub(crate) fn clone_an_option_into_selectedcontent( &self, cx: &mut JSContext, selectedcontent: &Element, )

Source

fn update_nearest_ancestor_selection( &self, cx: &mut JSContext, ) -> Vec<DomRoot<HTMLSelectElement>> ⓘ

Source

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

Source

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

Update the disabled state of this HTMLOptionElement based on its disabled attribute and whether or not its owning HTMLOptGroupElement is disabled.

Source

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

Trait Implementations§

§

impl Castable for HTMLOptionElement

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 HTMLOptionElement

§

impl DerivedFrom<EventTarget> for HTMLOptionElement

§

impl DerivedFrom<HTMLElement> for HTMLOptionElement

§

impl DerivedFrom<Node> for HTMLOptionElement

Source§

impl DomObject for HTMLOptionElement

Source§

type ReflectorType = <HTMLElement as DomObject>::ReflectorType

Source§

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

Returns the receiver’s reflector.
Source§

impl DomObjectWrap<DomTypeHolder> for HTMLOptionElement

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 HTMLOptionElement

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 HTMLOptionElement

Source§

impl HTMLOptionElementMethods<DomTypeHolder> for HTMLOptionElement

Source§

impl HasParent for HTMLOptionElement

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 HTMLOptionElement

Source§

const PROTO_ID: ID = PrototypeList::ID::HTMLOptionElement

The concrete type represented by this interface instance.
Source§

const PROTO_FIRST: u16 = 270

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

const PROTO_LAST: u16 = 270

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 HTMLOptionElement

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 HTMLOptionElement

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 HTMLOptionElement

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 HTMLOptionElement

Source§

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

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

impl Traceable for HTMLOptionElement

Source§

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

Trace self.
Source§

impl VirtualMethods for HTMLOptionElement

Source§

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

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 bind_to_tree(&self, cx: &mut JSContext, context: &BindContext<'_>)

Called when a Node is appended to a tree.
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 attribute_affects_presentational_hints(&self, attr: AttrRef<'_>) -> bool

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

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 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 handle_event(&self, cx: &mut JSContext, event: &Event)

Called during event dispatch after the bubbling phase completes.
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