pub struct HitTestItem {
pub point_in_viewport: LogicalPosition,
pub point_relative_to_item: LogicalPosition,
pub is_focusable: bool,
pub is_virtual_view_hit: Option<(DomId, LogicalPosition)>,
pub hit_depth: u32,
}Expand description
A single hit-test result for a regular (non-scroll) DOM node.
Fields§
§point_in_viewport: LogicalPositionThe hit point in the coordinate space of the “viewport” of the display item. The viewport is the scroll node formed by the root reference frame of the display item’s pipeline.
point_relative_to_item: LogicalPositionThe coordinates of the original hit test point relative to the origin of this item. This is useful for calculating things like text offsets in the client.
is_focusable: boolNecessary to easily get the nearest VirtualView node
is_virtual_view_hit: Option<(DomId, LogicalPosition)>If this hit is a VirtualView node, stores the VirtualViews DomId + the origin of the VirtualView
hit_depth: u32Z-order depth from WebRender hit test (0 = frontmost/topmost in z-order). Lower values are closer to the user. This preserves the ordering from WebRender’s hit test results which returns items front-to-back.
Trait Implementations§
Source§impl Clone for HitTestItem
impl Clone for HitTestItem
Source§fn clone(&self) -> HitTestItem
fn clone(&self) -> HitTestItem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HitTestItem
impl Debug for HitTestItem
Source§impl PartialEq for HitTestItem
impl PartialEq for HitTestItem
Source§fn eq(&self, other: &HitTestItem) -> bool
fn eq(&self, other: &HitTestItem) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for HitTestItem
impl PartialOrd for HitTestItem
impl Copy for HitTestItem
impl StructuralPartialEq for HitTestItem
Auto Trait Implementations§
impl Freeze for HitTestItem
impl RefUnwindSafe for HitTestItem
impl Send for HitTestItem
impl Sync for HitTestItem
impl Unpin for HitTestItem
impl UnsafeUnpin for HitTestItem
impl UnwindSafe for HitTestItem
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
Mutably borrows from an owned value. Read more