pub(crate) trait TextControlElement {
Show 34 methods
// Required methods
fn as_element(&self) -> ∈
fn text_input<'a>(
&'a self,
) -> AtomicRef<'a, TextInput<EmbedderClipboardProvider>>;
fn text_input_mut<'a>(
&'a self,
) -> AtomicRefMut<'a, TextInput<EmbedderClipboardProvider>>;
fn selection_api_applies(&self) -> bool;
fn has_selectable_text(&self) -> bool;
fn has_uncollapsed_selection(&self) -> bool;
fn set_dirty_value_flag(&self, value: bool);
fn select_all(&self);
fn maybe_update_shared_selection(&self);
fn placeholder_text<'a>(&'a self) -> Ref<'a, TracedDOMString>;
fn value_text(&self) -> DOMString;
fn read_only_or_disabled(&self) -> bool;
fn handle_text_content_changed(&self, cx: &mut JSContext);
fn handle_key_reaction(&self, cx: &mut JSContext, action: KeyReaction);
// Provided methods
fn is_password_field(&self) -> bool { ... }
fn insert_content(&self, cx: &mut JSContext, text_content: &str) { ... }
fn remove_the_contents_of_the_selection(&self, cx: &mut JSContext) { ... }
fn perform_editing_action(
&self,
cx: &mut JSContext,
action: EditingAction,
) -> bool { ... }
fn maybe_fire_beforeinput_event_for_editing_action(
&self,
cx: &mut JSContext,
action: &EditingAction,
) -> bool { ... }
fn fire_beforeinput_event(
&self,
cx: &mut JSContext,
data: Option<&str>,
input_type: InputEventType,
) -> bool { ... }
fn queue_input_event(
&self,
data: Option<String>,
input_type: InputEventType,
) { ... }
fn dom_select(&self, cx: &mut JSContext) { ... }
fn dom_start(&self) -> Option<Utf16CodeUnits> { ... }
fn set_dom_start(&self, start: Option<Utf16CodeUnits>) -> ErrorResult { ... }
fn dom_end(&self) -> Option<Utf16CodeUnits> { ... }
fn set_dom_end(&self, end: Option<Utf16CodeUnits>) -> ErrorResult { ... }
fn dom_direction(&self) -> Option<DOMString> { ... }
fn set_dom_direction(&self, direction: Option<DOMString>) -> ErrorResult { ... }
fn set_dom_range(
&self,
start: Utf16CodeUnits,
end: Utf16CodeUnits,
direction: Option<DOMString>,
) -> ErrorResult { ... }
fn set_dom_range_text(
&self,
cx: &mut JSContext,
replacement: DOMString,
start: Option<Utf16CodeUnits>,
end: Option<Utf16CodeUnits>,
selection_mode: SelectionMode,
) -> ErrorResult { ... }
fn start(&self) -> Utf16CodeUnits { ... }
fn end(&self) -> Utf16CodeUnits { ... }
fn direction(&self) -> SelectionDirection { ... }
fn set_range(
&self,
start: Option<Utf16CodeUnits>,
end: Option<Utf16CodeUnits>,
direction: Option<SelectionDirection>,
original_selection_state: Option<SelectionState>,
) { ... }
}Required Methods§
fn as_element(&self) -> &Element
fn text_input<'a>( &'a self, ) -> AtomicRef<'a, TextInput<EmbedderClipboardProvider>>
fn text_input_mut<'a>( &'a self, ) -> AtomicRefMut<'a, TextInput<EmbedderClipboardProvider>>
fn selection_api_applies(&self) -> bool
fn has_selectable_text(&self) -> bool
fn has_uncollapsed_selection(&self) -> bool
fn set_dirty_value_flag(&self, value: bool)
fn select_all(&self)
fn placeholder_text<'a>(&'a self) -> Ref<'a, TracedDOMString>
fn value_text(&self) -> DOMString
fn read_only_or_disabled(&self) -> bool
fn handle_text_content_changed(&self, cx: &mut JSContext)
fn handle_key_reaction(&self, cx: &mut JSContext, action: KeyReaction)
Provided Methods§
fn is_password_field(&self) -> bool
fn insert_content(&self, cx: &mut JSContext, text_content: &str)
fn remove_the_contents_of_the_selection(&self, cx: &mut JSContext)
fn perform_editing_action( &self, cx: &mut JSContext, action: EditingAction, ) -> bool
Sourcefn maybe_fire_beforeinput_event_for_editing_action(
&self,
cx: &mut JSContext,
action: &EditingAction,
) -> bool
fn maybe_fire_beforeinput_event_for_editing_action( &self, cx: &mut JSContext, action: &EditingAction, ) -> bool
Returns true if and only if the editing action should be canceled.
Sourcefn fire_beforeinput_event(
&self,
cx: &mut JSContext,
data: Option<&str>,
input_type: InputEventType,
) -> bool
fn fire_beforeinput_event( &self, cx: &mut JSContext, data: Option<&str>, input_type: InputEventType, ) -> bool
https://w3c.github.io/uievents/#event-type-beforeinput Returns true if and only if the beforeinput event flags indicate cancelation or the text control was hidden in the event listener.
Sourcefn queue_input_event(&self, data: Option<String>, input_type: InputEventType)
fn queue_input_event(&self, data: Option<String>, input_type: InputEventType)
Sourcefn dom_select(&self, cx: &mut JSContext)
fn dom_select(&self, cx: &mut JSContext)
Sourcefn dom_start(&self) -> Option<Utf16CodeUnits>
fn dom_start(&self) -> Option<Utf16CodeUnits>
Sourcefn set_dom_start(&self, start: Option<Utf16CodeUnits>) -> ErrorResult
fn set_dom_start(&self, start: Option<Utf16CodeUnits>) -> ErrorResult
Sourcefn dom_end(&self) -> Option<Utf16CodeUnits>
fn dom_end(&self) -> Option<Utf16CodeUnits>
Sourcefn set_dom_end(&self, end: Option<Utf16CodeUnits>) -> ErrorResult
fn set_dom_end(&self, end: Option<Utf16CodeUnits>) -> ErrorResult
Sourcefn dom_direction(&self) -> Option<DOMString>
fn dom_direction(&self) -> Option<DOMString>
Sourcefn set_dom_direction(&self, direction: Option<DOMString>) -> ErrorResult
fn set_dom_direction(&self, direction: Option<DOMString>) -> ErrorResult
Sourcefn set_dom_range(
&self,
start: Utf16CodeUnits,
end: Utf16CodeUnits,
direction: Option<DOMString>,
) -> ErrorResult
fn set_dom_range( &self, start: Utf16CodeUnits, end: Utf16CodeUnits, direction: Option<DOMString>, ) -> ErrorResult
Sourcefn set_dom_range_text(
&self,
cx: &mut JSContext,
replacement: DOMString,
start: Option<Utf16CodeUnits>,
end: Option<Utf16CodeUnits>,
selection_mode: SelectionMode,
) -> ErrorResult
fn set_dom_range_text( &self, cx: &mut JSContext, replacement: DOMString, start: Option<Utf16CodeUnits>, end: Option<Utf16CodeUnits>, selection_mode: SelectionMode, ) -> ErrorResult
fn start(&self) -> Utf16CodeUnits
fn end(&self) -> Utf16CodeUnits
fn direction(&self) -> SelectionDirection
Sourcefn set_range(
&self,
start: Option<Utf16CodeUnits>,
end: Option<Utf16CodeUnits>,
direction: Option<SelectionDirection>,
original_selection_state: Option<SelectionState>,
)
fn set_range( &self, start: Option<Utf16CodeUnits>, end: Option<Utf16CodeUnits>, direction: Option<SelectionDirection>, original_selection_state: Option<SelectionState>, )
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".