pub(crate) struct DocumentEventHandler {
window: Dom<Window>,
pending_input_events: DomRefCell<Vec<ConstellationInputEvent>>,
mouse_move_event_index: DomRefCell<Option<usize>>,
last_click_info: DomRefCell<Option<(Instant, Point2D<f32, CSSPixel>)>>,
current_hover_target: MutNullableDom<Element>,
most_recent_mousemove_point: Cell<Option<Point2D<f32, CSSPixel>>>,
current_cursor: Cell<Option<Cursor>>,
active_touch_points: DomRefCell<Vec<Dom<Touch>>>,
active_keyboard_modifiers: Cell<Modifiers>,
}
Expand description
The DocumentEventHandler
is a structure responsible for handling input events for
the [crate::Document
] and storing data related to event handling. It exists to
decrease the size of the [crate::Document
] structure.
Fields§
§window: Dom<Window>
The Window
element for this DocumentEventHandler
.
pending_input_events: DomRefCell<Vec<ConstellationInputEvent>>
Pending input events, to be handled at the next rendering opportunity.
mouse_move_event_index: DomRefCell<Option<usize>>
The index of the last mouse move event in the pending compositor events queue.
last_click_info: DomRefCell<Option<(Instant, Point2D<f32, CSSPixel>)>>
§current_hover_target: MutNullableDom<Element>
The element that is currently hovered by the cursor.
most_recent_mousemove_point: Cell<Option<Point2D<f32, CSSPixel>>>
The most recent mouse movement point, used for processing mouseleave
events.
current_cursor: Cell<Option<Cursor>>
The currently set Cursor
or None
if the Document
isn’t being hovered
by the cursor.
active_touch_points: DomRefCell<Vec<Dom<Touch>>>
§active_keyboard_modifiers: Cell<Modifiers>
The active keyboard modifiers for the WebView. This is updated when receiving any input event.
Implementations§
Source§impl DocumentEventHandler
impl DocumentEventHandler
pub(crate) fn new(window: &Window) -> Self
Sourcepub(crate) fn note_pending_input_event(&self, event: ConstellationInputEvent)
pub(crate) fn note_pending_input_event(&self, event: ConstellationInputEvent)
Note a pending compositor event, to be processed at the next update_the_rendering
task.
Sourcepub(crate) fn has_pending_input_events(&self) -> bool
pub(crate) fn has_pending_input_events(&self) -> bool
Whether or not this [Document
] has any pending input events to be processed during
“update the rendering.”
pub(crate) fn alternate_action_keyboard_modifier_active(&self) -> bool
pub(crate) fn handle_pending_input_events(&self, can_gc: CanGc)
fn notify_webdriver_input_event_completed(&self, event: InputEvent)
pub(crate) fn set_cursor(&self, cursor: Option<Cursor>)
fn handle_mouse_left_viewport_event( &self, input_event: &ConstellationInputEvent, mouse_leave_event: &MouseLeftViewportEvent, can_gc: CanGc, )
fn handle_mouse_enter_leave_event( &self, event_target: DomRoot<Node>, related_target: Option<DomRoot<Node>>, event_type: FireMouseEventType, hit_test_result: &HitTestResult, input_event: &ConstellationInputEvent, can_gc: CanGc, )
Sourcefn handle_native_mouse_move_event(
&self,
input_event: &ConstellationInputEvent,
can_gc: CanGc,
)
fn handle_native_mouse_move_event( &self, input_event: &ConstellationInputEvent, can_gc: CanGc, )
fn update_current_hover_target_and_status( &self, new_hover_target: Option<DomRoot<Element>>, )
pub(crate) fn handle_refresh_cursor(&self)
https://w3c.github.io/uievents/#mouseevent-algorithms Handles native mouse down, mouse up, mouse click.
fn maybe_fire_dblclick( &self, target: &Node, hit_test_result: &HitTestResult, input_event: &ConstellationInputEvent, can_gc: CanGc, )
fn handle_touch_event( &self, event: EmbedderTouchEvent, input_event: &ConstellationInputEvent, can_gc: CanGc, )
fn handle_touch_event_inner( &self, event: EmbedderTouchEvent, input_event: &ConstellationInputEvent, can_gc: CanGc, ) -> TouchEventResult
fn update_active_touch_points_when_early_return( &self, event: EmbedderTouchEvent, )
Sourcefn handle_keyboard_event(
&self,
keyboard_event: EmbedderKeyboardEvent,
can_gc: CanGc,
)
fn handle_keyboard_event( &self, keyboard_event: EmbedderKeyboardEvent, can_gc: CanGc, )
The entry point for all key processing for web content
fn handle_ime_event(&self, event: ImeEvent, can_gc: CanGc)
fn handle_wheel_event( &self, event: EmbedderWheelEvent, input_event: &ConstellationInputEvent, can_gc: CanGc, )
fn handle_gamepad_event(&self, gamepad_event: EmbedderGamepadEvent)
Sourcefn handle_gamepad_connect(
&self,
_index: usize,
name: String,
axis_bounds: (f64, f64),
button_bounds: (f64, f64),
supported_haptic_effects: GamepadSupportedHapticEffects,
)
fn handle_gamepad_connect( &self, _index: usize, name: String, axis_bounds: (f64, f64), button_bounds: (f64, f64), supported_haptic_effects: GamepadSupportedHapticEffects, )
Sourcefn handle_gamepad_disconnect(&self, index: usize)
fn handle_gamepad_disconnect(&self, index: usize)
Sourcefn handle_editing_action(
&self,
action: EditingActionEvent,
can_gc: CanGc,
) -> bool
fn handle_editing_action( &self, action: EditingActionEvent, can_gc: CanGc, ) -> bool
Sourcefn fire_clipboard_event(
&self,
event: &ClipboardEvent,
action: ClipboardEventType,
can_gc: CanGc,
)
fn fire_clipboard_event( &self, event: &ClipboardEvent, action: ClipboardEventType, can_gc: CanGc, )
pub(crate) fn fire_clipboardchange_event(&self, can_gc: CanGc)
Sourcefn write_content_to_the_clipboard(&self, drag_data_store: &DragDataStore)
fn write_content_to_the_clipboard(&self, drag_data_store: &DragDataStore)
Sourcefn handle_embedder_scroll_event(&self, event: ScrollEvent)
fn handle_embedder_scroll_event(&self, event: ScrollEvent)
Handle scroll event triggered by user interactions from embedder side. https://drafts.csswg.org/cssom-view/#scrolling-events
Trait Implementations§
Source§impl MallocSizeOf for DocumentEventHandler
impl MallocSizeOf for DocumentEventHandler
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Auto Trait Implementations§
impl !Freeze for DocumentEventHandler
impl !RefUnwindSafe for DocumentEventHandler
impl !Send for DocumentEventHandler
impl !Sync for DocumentEventHandler
impl Unpin for DocumentEventHandler
impl !UnwindSafe for DocumentEventHandler
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