#[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
impl HTMLOptionElement
fn __assert_parent_type(&self)
Source§impl HTMLOptionElement
impl HTMLOptionElement
fn new_inherited( local_name: LocalName, prefix: Option<Prefix>, document: &Document, ) -> HTMLOptionElement
pub(crate) fn new( cx: &mut JSContext, local_name: LocalName, prefix: Option<Prefix>, document: &Document, proto: Option<HandleObject<'_>>, ) -> DomRoot<HTMLOptionElement>
Sourcepub(crate) fn set_selectedness(&self, no_gc: &NoGC, selected: bool) -> bool
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.
pub(crate) fn set_dirtiness(&self, dirtiness: bool)
Sourcefn pick_if_selected_in_select(
&self,
cx: &mut JSContext,
select: &HTMLSelectElement,
)
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.
fn pick_if_selected_in_cached_select(&self, cx: &mut JSContext)
fn update_select_validity(&self, cx: &mut JSContext)
Sourcepub(crate) fn displayed_label(&self) -> DOMString
pub(crate) fn displayed_label(&self) -> DOMString
https://html.spec.whatwg.org/multipage/#concept-option-label
Note that this is not equivalent to https://html.spec.whatwg.org/multipage/#dom-option-label.
Sourcepub(crate) fn cached_nearest_ancestor_select(
&self,
) -> Option<DomRoot<HTMLSelectElement>>
pub(crate) fn cached_nearest_ancestor_select( &self, ) -> Option<DomRoot<HTMLSelectElement>>
Sourcepub(crate) fn nearest_ancestor_select(
&self,
) -> Option<DomRoot<HTMLSelectElement>>
pub(crate) fn nearest_ancestor_select( &self, ) -> Option<DomRoot<HTMLSelectElement>>
Sourcepub(crate) fn maybe_clone_an_option_into_selectedcontent(
&self,
cx: &mut JSContext,
)
pub(crate) fn maybe_clone_an_option_into_selectedcontent( &self, cx: &mut JSContext, )
Sourcepub(crate) fn clone_an_option_into_selectedcontent(
&self,
cx: &mut JSContext,
selectedcontent: &Element,
)
pub(crate) fn clone_an_option_into_selectedcontent( &self, cx: &mut JSContext, selectedcontent: &Element, )
Sourcefn update_nearest_ancestor_selection(
&self,
cx: &mut JSContext,
) -> Vec<DomRoot<HTMLSelectElement>> ⓘ
fn update_nearest_ancestor_selection( &self, cx: &mut JSContext, ) -> Vec<DomRoot<HTMLSelectElement>> ⓘ
Sourcefn ask_for_a_reset(&self, cx: &mut JSContext)
fn ask_for_a_reset(&self, cx: &mut JSContext)
Sourcepub(crate) fn update_disabled_state(&self, no_gc: &NoGC)
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.
fn is_disabled_by_parent_optgroup(&self, no_gc: &NoGC) -> bool
Trait Implementations§
§impl Castable for HTMLOptionElement
impl Castable for HTMLOptionElement
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
impl DomObject for HTMLOptionElement
type ReflectorType = <HTMLElement as DomObject>::ReflectorType
Source§fn reflector(&self) -> &Reflector<Self::ReflectorType>
fn reflector(&self) -> &Reflector<Self::ReflectorType>
Source§impl Drop for HTMLOptionElement
impl Drop for HTMLOptionElement
impl Eq for HTMLOptionElement
Source§impl HTMLOptionElementMethods<DomTypeHolder> for HTMLOptionElement
impl HTMLOptionElementMethods<DomTypeHolder> for HTMLOptionElement
Source§fn Option(
cx: &mut JSContext,
window: &Window,
proto: Option<HandleObject<'_>>,
text: DOMString,
value: Option<DOMString>,
default_selected: bool,
selected: bool,
) -> Fallible<DomRoot<HTMLOptionElement>>
fn Option( cx: &mut JSContext, window: &Window, proto: Option<HandleObject<'_>>, text: DOMString, value: Option<DOMString>, default_selected: bool, selected: bool, ) -> Fallible<DomRoot<HTMLOptionElement>>
Source§fn SetSelected(&self, cx: &mut JSContext, selected: bool)
fn SetSelected(&self, cx: &mut JSContext, selected: bool)
fn Disabled(&self) -> bool
fn SetDisabled(&self, cx: &mut JSContext, value: bool)
fn SetValue(&self, cx: &mut JSContext, value: DOMString)
fn SetLabel(&self, cx: &mut JSContext, value: DOMString)
fn DefaultSelected(&self) -> bool
fn SetDefaultSelected(&self, cx: &mut JSContext, value: bool)
Source§impl HasParent for HTMLOptionElement
impl HasParent for HTMLOptionElement
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 HTMLOptionElement
impl IDLInterface for HTMLOptionElement
Source§const PROTO_ID: ID = PrototypeList::ID::HTMLOptionElement
const PROTO_ID: ID = PrototypeList::ID::HTMLOptionElement
Source§const PROTO_FIRST: u16 = 270
const PROTO_FIRST: u16 = 270
Source§const PROTO_LAST: u16 = 270
const PROTO_LAST: u16 = 270
Source§impl MallocSizeOf for HTMLOptionElement
impl MallocSizeOf for HTMLOptionElement
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl MutDomObject for HTMLOptionElement
impl MutDomObject for HTMLOptionElement
Source§impl PartialEq for HTMLOptionElement
impl PartialEq for HTMLOptionElement
Source§impl ToJSValConvertible for HTMLOptionElement
impl ToJSValConvertible for HTMLOptionElement
Source§fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
self to a JSVal. JSAPI failure causes a panic.Source§impl Traceable for HTMLOptionElement
impl Traceable for HTMLOptionElement
Source§impl VirtualMethods for HTMLOptionElement
impl VirtualMethods for HTMLOptionElement
Source§fn moving_steps(&self, cx: &mut JSContext, context: &MoveContext<'_>)
fn moving_steps(&self, cx: &mut JSContext, context: &MoveContext<'_>)
Source§fn super_type(&self) -> Option<&dyn VirtualMethods>
fn super_type(&self) -> Option<&dyn VirtualMethods>
Source§fn attribute_mutated(
&self,
cx: &mut JSContext,
attr: AttrRef<'_>,
mutation: AttributeMutation<'_>,
)
fn attribute_mutated( &self, cx: &mut JSContext, attr: AttrRef<'_>, mutation: AttributeMutation<'_>, )
Source§fn bind_to_tree(&self, cx: &mut JSContext, context: &BindContext<'_>)
fn bind_to_tree(&self, cx: &mut JSContext, context: &BindContext<'_>)
Source§fn unbind_from_tree(&self, cx: &mut JSContext, context: &UnbindContext<'_>)
fn unbind_from_tree(&self, cx: &mut JSContext, context: &UnbindContext<'_>)
Source§fn children_changed(&self, cx: &mut JSContext, mutation: &ChildrenMutation<'_>)
fn children_changed(&self, cx: &mut JSContext, mutation: &ChildrenMutation<'_>)
Source§fn attribute_affects_presentational_hints(&self, attr: AttrRef<'_>) -> bool
fn attribute_affects_presentational_hints(&self, attr: AttrRef<'_>) -> bool
true if given attribute attr affects style of the
given element.Source§fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue
name
on this element.Source§fn post_connection_steps(&self, cx: &mut JSContext)
fn post_connection_steps(&self, cx: &mut JSContext)
Source§fn handle_event(&self, cx: &mut JSContext, event: &Event)
fn handle_event(&self, cx: &mut JSContext, event: &Event)
Source§fn is_valid_command_steps(&self, command: CommandState) -> bool
fn is_valid_command_steps(&self, command: CommandState) -> bool
Source§fn command_steps(
&self,
cx: &mut JSContext,
button: DomRoot<HTMLButtonElement>,
command: CommandState,
) -> bool
fn command_steps( &self, cx: &mut JSContext, button: DomRoot<HTMLButtonElement>, command: CommandState, ) -> bool
Source§fn adopting_steps(&self, cx: &mut JSContext, old_doc: &Document)
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,
)
fn cloning_steps( &self, cx: &mut JSContext, copy: &Node, maybe_doc: Option<&Document>, clone_children: CloneChildrenFlag, )
Source§fn pop(&self, cx: &mut JSContext)
fn pop(&self, cx: &mut JSContext)
fn focus_visible_applies(&self) -> bool
Auto Trait Implementations§
impl !Freeze for HTMLOptionElement
impl !RefUnwindSafe for HTMLOptionElement
impl !Send for HTMLOptionElement
impl !Sync for HTMLOptionElement
impl !UnwindSafe for HTMLOptionElement
impl Unpin for HTMLOptionElement
impl UnsafeUnpin for HTMLOptionElement
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
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<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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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