pub struct SelectElement {
pub(crate) id: EmbedderControlId,
pub(crate) position: DeviceIntRect,
pub(crate) constellation_proxy: ConstellationProxy,
pub(crate) select_element_request: SelectElementRequest,
pub(crate) response_sent: bool,
}Expand description
Represents a dialog triggered by clicking a <select> element.
Fields§
§id: EmbedderControlId§position: DeviceIntRect§constellation_proxy: ConstellationProxy§select_element_request: SelectElementRequest§response_sent: boolImplementations§
Source§impl SelectElement
impl SelectElement
Sourcepub fn id(&self) -> EmbedderControlId
pub fn id(&self) -> EmbedderControlId
Return the EmbedderControlId associated with this element.
Sourcepub fn position(&self) -> DeviceIntRect
pub fn position(&self) -> DeviceIntRect
Return the area occupied by the <select> element that triggered the prompt.
The embedder should use this value to position the prompt that is shown to the user.
Sourcepub fn options(&self) -> &[SelectElementOptionOrOptgroup]
pub fn options(&self) -> &[SelectElementOptionOrOptgroup]
Consecutive <option> elements outside of an <optgroup> will be combined
into a single anonymous group without a label.
Sourcepub fn select(&mut self, selected_options: Vec<usize>)
pub fn select(&mut self, selected_options: Vec<usize>)
Set the options that are selected.
selected_options is a vector of indices into the array returned by Self::options.
If other options have previously been selected, this set of options will replace them.
Sourcepub fn selected_options(&self) -> Vec<usize>
pub fn selected_options(&self) -> Vec<usize>
Get the currently selected options, represented by indices into the array
returned by Self::options.
Sourcepub fn allow_select_multiple(&self) -> bool
pub fn allow_select_multiple(&self) -> bool
Whether this <select> supports selecting multiple options.
Sourcepub fn submit(self)
pub fn submit(self)
Resolve the prompt with the options that have been selected by calling Self::select previously.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SelectElement
impl RefUnwindSafe for SelectElement
impl Send for SelectElement
impl Sync for SelectElement
impl Unpin for SelectElement
impl UnsafeUnpin for SelectElement
impl UnwindSafe for SelectElement
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
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>
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