pub struct LaidOutScene<L: StoreLayoutEngine = TaffyStoreLayout> { /* private fields */ }Expand description
One surface’s laid-out view of a NodeStore.
Holds zero copies of the tree: every query reads &NodeStore plus the engine’s rects.
Implementations§
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn close_request_target(&self) -> Option<NodeId>
pub fn close_request_target(&self) -> Option<NodeId>
The overlay an unconsumed close request closes (see the module docs). O(open overlays).
Sourcepub fn dispatch_routing_close_request(
&self,
events: ValidatedEvents<'_>,
batch: &mut EventBatchBuf,
dispatch: impl FnMut(ValidatedEvents<'_>) -> DispatchResult,
) -> bool
pub fn dispatch_routing_close_request( &self, events: ValidatedEvents<'_>, batch: &mut EventBatchBuf, dispatch: impl FnMut(ValidatedEvents<'_>) -> DispatchResult, ) -> bool
Dispatches events through dispatch, cut after every close key (a batch without one is
one dispatch); when a part reports a close request, its close key is unconsumed. Then
runs CloseRequestAction on the last unconsumed close key and dispatches its close
through dispatch too (that dispatch’s own close request is ignored: a close is no
close key). One close per call: the scene is not laid out again in between, so a second
would hit the same overlay. batch is the host’s reused close batch. Returns whether any
dispatch dirtied app state. Zero steady-state allocations.
Sourcepub fn try_dispatch_routing_close_request<E>(
&self,
events: ValidatedEvents<'_>,
batch: &mut EventBatchBuf,
dispatch: impl FnMut(ValidatedEvents<'_>) -> Result<DispatchResult, E>,
) -> Result<bool, E>
pub fn try_dispatch_routing_close_request<E>( &self, events: ValidatedEvents<'_>, batch: &mut EventBatchBuf, dispatch: impl FnMut(ValidatedEvents<'_>) -> Result<DispatchResult, E>, ) -> Result<bool, E>
Self::dispatch_routing_close_request for a fallible dispatch (e.g. a sandboxed
plugin slot): the first error aborts and is returned.
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn commit_frame(
&mut self,
store: &NodeStore,
changes: &ChangeSet,
) -> CommitOutcome
pub fn commit_frame( &mut self, store: &NodeStore, changes: &ChangeSet, ) -> CommitOutcome
Applies one committed ChangeSet (empty on clean ticks): the only commit entry point.
Sourcepub fn commit_frame_with<H: CommitHooks<L>>(
&mut self,
store: &NodeStore,
changes: &ChangeSet,
hooks: &mut H,
) -> CommitOutcome
pub fn commit_frame_with<H: CommitHooks<L>>( &mut self, store: &NodeStore, changes: &ChangeSet, hooks: &mut H, ) -> CommitOutcome
Self::commit_frame with backend hooks (animated transforms, frame hooks).
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn record_input_modality(&mut self, modality: FocusModality)
pub fn record_input_modality(&mut self, modality: FocusModality)
Records the most recent user-initiated input modality (Pointer or Keyboard),
driving :focus-visible for subsequent programmatic focus transitions.
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn set_focus_traversal_policy(
&mut self,
policy: Box<dyn FocusTraversalPolicy>,
)
pub fn set_focus_traversal_policy( &mut self, policy: Box<dyn FocusTraversalPolicy>, )
Installs a custom FocusTraversalPolicy on this scene (replacing TabOrderPolicy).
Sourcepub fn traverse_focus(
&mut self,
store: &NodeStore,
current: Option<NodeId>,
direction: FocusMove,
flags: FocusTraverseFlags,
) -> FocusTraversalOutcome
pub fn traverse_focus( &mut self, store: &NodeStore, current: Option<NodeId>, direction: FocusMove, flags: FocusTraverseFlags, ) -> FocusTraversalOutcome
Computes the next focus target in direction from current under the installed
FocusTraversalPolicy, optionally scrolling the resolved target into view.
Zero heap allocations once the scene’s internal scratch buffers are warm.
Sourcepub fn last_focus_scroll_dirty(&self) -> &[NodeId]
pub fn last_focus_scroll_dirty(&self) -> &[NodeId]
Scroll containers adjusted during the most recent Self::traverse_focus call when
FocusTraverseFlags::SCROLL_INTO_VIEW was requested.
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn compute_sticky_delta(&self, store: &NodeStore, id: NodeId) -> (f32, f32)
pub fn compute_sticky_delta(&self, store: &NodeStore, id: NodeId) -> (f32, f32)
Computes sticky offset (dx, dy) for id against its nearest scroll ancestor.
Sourcepub fn effective_transform(
&self,
store: &NodeStore,
id: NodeId,
) -> Option<Transform2D>
pub fn effective_transform( &self, store: &NodeStore, id: NodeId, ) -> Option<Transform2D>
Reads the Transform2D of id from NodeStore’s Transform table (including active
StateRules overrides), if id generates a box.
Sourcepub fn is_event_target(store: &NodeStore, id: NodeId) -> bool
pub fn is_event_target(store: &NodeStore, id: NodeId) -> bool
Returns true when id subscribes to any UI event via its Interaction table.
Sourcepub fn hit_test_paragraph_leaf(
&self,
store: &NodeStore,
para_id: NodeId,
local_x: f32,
local_y: f32,
) -> Option<NodeId>
pub fn hit_test_paragraph_leaf( &self, store: &NodeStore, para_id: NodeId, local_x: f32, local_y: f32, ) -> Option<NodeId>
Directly hit-tests local coordinates (local_x, local_y) inside paragraph root para_id’s
content box, returning the hit run’s leaf NodeId (None on trailing whitespace / miss).
Sourcepub fn is_scroll_container(store: &NodeStore, id: NodeId) -> bool
pub fn is_scroll_container(store: &NodeStore, id: NodeId) -> bool
Returns true when id is a scroll container (it owns a Scroll row, which also carries
its ScrollEvent listeners).
Sourcepub fn hit_test(&self, store: &NodeStore, x: f32, y: f32) -> Option<NodeId>
pub fn hit_test(&self, store: &NodeStore, x: f32, y: f32) -> Option<NodeId>
Hit-tests (x, y) in reverse CSS 2.1 Appendix E paint order for the deepest node
subscribing to events.
Sourcepub fn hit_test_painted(
&self,
store: &NodeStore,
x: f32,
y: f32,
) -> Option<NodeId>
pub fn hit_test_painted( &self, store: &NodeStore, x: f32, y: f32, ) -> Option<NodeId>
The deepest painted node at (x, y), unfiltered: the press hit of super::top_layer_press.
Sourcepub fn hit_test_scroll_container(
&self,
store: &NodeStore,
x: f32,
y: f32,
) -> Option<NodeId>
pub fn hit_test_scroll_container( &self, store: &NodeStore, x: f32, y: f32, ) -> Option<NodeId>
Hit-tests (x, y) in reverse CSS 2.1 Appendix E paint order for the deepest scroll
container (Scroll row).
Sourcepub fn hit_test_where(
&self,
store: &NodeStore,
x: f32,
y: f32,
accepts: impl Fn(NodeId) -> bool,
) -> Option<NodeId>
pub fn hit_test_where( &self, store: &NodeStore, x: f32, y: f32, accepts: impl Fn(NodeId) -> bool, ) -> Option<NodeId>
Hit-tests (x, y) in reverse CSS 2.1 Appendix E paint order for the deepest node
accepts admits (O(1) cached StackingPlan, 0 steady-state heap allocations).
Sourcepub fn hit_test_with_plan(
&self,
store: &NodeStore,
plan: &StackingPlan,
x: f32,
y: f32,
resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>,
accepts: impl Fn(NodeId) -> bool,
) -> Option<NodeId>
pub fn hit_test_with_plan( &self, store: &NodeStore, plan: &StackingPlan, x: f32, y: f32, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, accepts: impl Fn(NodeId) -> bool, ) -> Option<NodeId>
Hit-tests (x, y) using a caller-supplied pre-built StackingPlan (such as
SkiaBackend’s retained CompositorScene::stacking), guaranteeing exact 1:1 paint/hit
parity at O(1) zero rebuild cost and 0 heap allocations.
Sourcepub fn hit_test_with_plan_and_fg(
&self,
store: &NodeStore,
plan: &StackingPlan,
x: f32,
y: f32,
resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>,
has_plugin_fg: impl Fn(NodeId) -> bool,
accepts: impl Fn(NodeId) -> bool,
) -> Option<NodeId>
pub fn hit_test_with_plan_and_fg( &self, store: &NodeStore, plan: &StackingPlan, x: f32, y: f32, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, has_plugin_fg: impl Fn(NodeId) -> bool, accepts: impl Fn(NodeId) -> bool, ) -> Option<NodeId>
Like Self::hit_test_with_plan, also accepting a predicate reporting backend-specific
Step 7 foreground content (such as registered plugin tables) painted above NegSc children.
Sourcepub fn hit_test_where_with_transform(
&self,
store: &NodeStore,
x: f32,
y: f32,
resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>,
accepts: impl Fn(NodeId) -> bool,
) -> Option<NodeId>
pub fn hit_test_where_with_transform( &self, store: &NodeStore, x: f32, y: f32, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, accepts: impl Fn(NodeId) -> bool, ) -> Option<NodeId>
Hit-tests (x, y) allowing backends to supply an animated Transform2D override per node
while reusing the cached zero-alloc StackingPlan and detecting live identity <-> non-identity animated transform transitions even without a store commit.
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
pub fn interaction_tracker(&self) -> &InteractionTracker
Sourcepub fn interaction_epoch(&self) -> u64
pub fn interaction_epoch(&self) -> u64
Bumped on every pseudo-state change (pointer, focus, disabled, capture): state-rule results may differ since a caller last saw another value.
Sourcepub fn responsive_epoch(&self) -> u64
pub fn responsive_epoch(&self) -> u64
The engine’s StoreLayoutEngine::responsive_epoch: @media / @container results may
differ since a caller last saw another value.
pub fn interaction_tracker_mut(&mut self) -> &mut InteractionTracker
pub fn interaction_state(&self, node_id: NodeId) -> InteractionState
Sourcepub fn is_subtree_disabled(&self, store: &NodeStore, id: NodeId) -> bool
pub fn is_subtree_disabled(&self, store: &NodeStore, id: NodeId) -> bool
Returns true when id or any ancestor up to root is disabled (via Interaction::disabled
or InteractionTracker::is_disabled).
Sourcepub fn set_node_disabled(&mut self, id: NodeId, disabled: bool) -> &[NodeId]
pub fn set_node_disabled(&mut self, id: NodeId, disabled: bool) -> &[NodeId]
Marks id disabled or enabled in the InteractionTracker (dropping :active, focus
and every pointer capture on it), returning the dirty NodeIds.
Sourcepub fn is_interaction_target(&self, store: &NodeStore, id: NodeId) -> bool
pub fn is_interaction_target(&self, store: &NodeStore, id: NodeId) -> bool
Returns true when id participates in pointer hover/active/cursor hit-testing.
Sourcepub fn is_drop_target(store: &NodeStore, id: NodeId) -> bool
pub fn is_drop_target(store: &NodeStore, id: NodeId) -> bool
Returns true when id is an active drop target (DragDrop::accept != EMPTY).
Sourcepub fn is_draggable_target(store: &NodeStore, id: NodeId) -> bool
pub fn is_draggable_target(store: &NodeStore, id: NodeId) -> bool
Returns true when id is a live visible draggable source (DragDrop::draggable == true).
Sourcepub fn hit_test_interaction(
&self,
store: &NodeStore,
x: f32,
y: f32,
) -> Option<NodeId>
pub fn hit_test_interaction( &self, store: &NodeStore, x: f32, y: f32, ) -> Option<NodeId>
Hit-tests (x, y) in reverse paint order for the deepest interaction-eligible node.
Sourcepub fn hit_test_drop_zone(
&self,
store: &NodeStore,
x: f32,
y: f32,
) -> Option<NodeId>
pub fn hit_test_drop_zone( &self, store: &NodeStore, x: f32, y: f32, ) -> Option<NodeId>
Hit-tests (x, y) in reverse paint order for the deepest drop-zone target.
Sourcepub fn hit_test_draggable(
&self,
store: &NodeStore,
x: f32,
y: f32,
) -> Option<NodeId>
pub fn hit_test_draggable( &self, store: &NodeStore, x: f32, y: f32, ) -> Option<NodeId>
Hit-tests (x, y) in reverse paint order for the deepest draggable source node.
Sourcepub fn visit_effective_patches<'a>(
&self,
store: &'a NodeStore,
id: NodeId,
f: impl FnMut(RowPatchView<'a>),
)
pub fn visit_effective_patches<'a>( &self, store: &'a NodeStore, id: NodeId, f: impl FnMut(RowPatchView<'a>), )
Visits every RowPatchView overriding id’s base style in cascade order: matching
@media, then @container rules (committed layout env), then state rules matching its
current InteractionState (zero allocations up to 16 rules).
Sourcepub fn is_displayed(&self, store: &NodeStore, id: NodeId) -> bool
pub fn is_displayed(&self, store: &NodeStore, id: NodeId) -> bool
Whether id is live and its cascaded display is not none.
Sourcepub fn style_cascade(&self) -> StyleCascade<'_, L>
pub fn style_cascade(&self) -> StyleCascade<'_, L>
The scene’s single base -> @media -> @container -> state style cascade.
Sourcepub fn effective_visual(&self, store: &NodeStore, id: NodeId) -> VisualSnapshot
pub fn effective_visual(&self, store: &NodeStore, id: NodeId) -> VisualSnapshot
Resolves the effective VisualSnapshot for id with responsive and pseudo-state rules
applied.
Sourcepub fn effective_layout_and_visual(
&self,
store: &NodeStore,
id: NodeId,
) -> (LayoutSnapshot, VisualSnapshot)
pub fn effective_layout_and_visual( &self, store: &NodeStore, id: NodeId, ) -> (LayoutSnapshot, VisualSnapshot)
Resolves both LayoutSnapshot and VisualSnapshot for id with responsive and
pseudo-state rules applied.
Sourcepub fn effective_background_fill_res(
&self,
store: &NodeStore,
id: NodeId,
) -> Option<ResourceId>
pub fn effective_background_fill_res( &self, store: &NodeStore, id: NodeId, ) -> Option<ResourceId>
Resolves the effective BackgroundFillRes resource id for id, respecting responsive and
state-rule patches (including solid background overrides clearing a base gradient).
Sourcepub fn resolve_text_style_fields(
&self,
store: &NodeStore,
id: NodeId,
style: &VisualSnapshot,
parent_text: Option<(u16, TextAlign, Rgba, f32)>,
color_hooked: bool,
) -> (u16, TextAlign, Rgba, f32)
pub fn resolve_text_style_fields( &self, store: &NodeStore, id: NodeId, style: &VisualSnapshot, parent_text: Option<(u16, TextAlign, Rgba, f32)>, color_hooked: bool, ) -> (u16, TextAlign, Rgba, f32)
Resolves inherited (font_weight, text_align, text_color, font_size) for id using
branchless ResolvedRow<Typography> over parent_text, layered with responsive/state
patches and an optional animated text color override.
Sourcepub fn effective_cursor(&self, store: &NodeStore, id: NodeId) -> CursorKind
pub fn effective_cursor(&self, store: &NodeStore, id: NodeId) -> CursorKind
Resolves the effective CursorKind for id in a single O(depth) leaf-to-root walk,
converting Pointer to NotAllowed whenever id or any ancestor is disabled.
Sourcepub fn current_cursor(&self, store: &NodeStore) -> CursorKind
pub fn current_cursor(&self, store: &NodeStore) -> CursorKind
Resolves the active cursor in O(depth): checks captured node first, then the deepest
live hovered node, then the deepest live active node, falling back to CursorKind::Default.
Sourcepub fn pointer_move_in_store(
&mut self,
store: &NodeStore,
target: Option<NodeId>,
) -> InteractionChange<'_>
pub fn pointer_move_in_store( &mut self, store: &NodeStore, target: Option<NodeId>, ) -> InteractionChange<'_>
Moves the mouse (PointerKey::MOUSE) to target directly, bypassing hit testing and
event synthesis (pseudo-state drivers: benches, inspectors). Hosts route samples through
Self::resolve_pointer.
Sourcepub fn pointer_down_in_store(
&mut self,
store: &NodeStore,
target: Option<NodeId>,
) -> InteractionChange<'_>
pub fn pointer_down_in_store( &mut self, store: &NodeStore, target: Option<NodeId>, ) -> InteractionChange<'_>
Presses the mouse’s primary button on target directly (see Self::pointer_move_in_store).
Sourcepub fn pointer_up_in_store(
&mut self,
store: &NodeStore,
target: Option<NodeId>,
) -> (Option<NodeId>, InteractionChange<'_>)
pub fn pointer_up_in_store( &mut self, store: &NodeStore, target: Option<NodeId>, ) -> (Option<NodeId>, InteractionChange<'_>)
Releases the mouse over target directly, returning (clicked_node, change) (see
Self::pointer_move_in_store).
Sourcepub fn pointer_leave_in_store(
&mut self,
store: &NodeStore,
) -> InteractionChange<'_>
pub fn pointer_leave_in_store( &mut self, store: &NodeStore, ) -> InteractionChange<'_>
The pointer left the surface: clears :hover (an uncaptured press also drops :active).
Sourcepub fn pointer_cancel_in_store(
&mut self,
store: &NodeStore,
) -> InteractionChange<'_>
pub fn pointer_cancel_in_store( &mut self, store: &NodeStore, ) -> InteractionChange<'_>
Cancels every pointer (window blur): ends every pointer and its capture and clears
:hover, :active and :drag-over.
Sourcepub fn set_drag_over_in_store(
&mut self,
store: &NodeStore,
target: Option<NodeId>,
) -> InteractionChange<'_>
pub fn set_drag_over_in_store( &mut self, store: &NodeStore, target: Option<NodeId>, ) -> InteractionChange<'_>
Zero-alloc :drag-over ancestor-chain update against store, syncing inline paragraphs.
Sourcepub fn clear_active_in_store(
&mut self,
store: &NodeStore,
) -> InteractionChange<'_>
pub fn clear_active_in_store( &mut self, store: &NodeStore, ) -> InteractionChange<'_>
Zero-alloc :active press clear against store (used on drag activation).
Sourcepub fn set_focus_in_store(
&mut self,
store: &NodeStore,
node_id: Option<NodeId>,
modality: FocusModality,
) -> InteractionChange<'_>
pub fn set_focus_in_store( &mut self, store: &NodeStore, node_id: Option<NodeId>, modality: FocusModality, ) -> InteractionChange<'_>
Zero-alloc focus update against store, syncing any affected inline paragraphs and
capturing the focus anchor for deterministic post-commit unmount recovery.
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn overlay_contains_point(
&self,
store: &NodeStore,
ro: ResolvedOverlay,
x: f32,
y: f32,
) -> bool
pub fn overlay_contains_point( &self, store: &NodeStore, ro: ResolvedOverlay, x: f32, y: f32, ) -> bool
Returns true when viewport-space (x, y) lies inside the transform-aware visual box of
open top-layer overlay ro.
Sourcepub fn overlay_contains_point_with_transform(
&self,
store: &NodeStore,
ro: ResolvedOverlay,
x: f32,
y: f32,
resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>,
) -> bool
pub fn overlay_contains_point_with_transform( &self, store: &NodeStore, ro: ResolvedOverlay, x: f32, y: f32, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, ) -> bool
Like Self::overlay_contains_point, resolving live animated transforms through
resolve_transform (e.g., SkiaBackend’s MotionDriver).
Sourcepub fn visual_rect_of(
&self,
store: &NodeStore,
node_id: NodeId,
) -> Option<LayoutRect>
pub fn visual_rect_of( &self, store: &NodeStore, node_id: NodeId, ) -> Option<LayoutRect>
Computes the visual (scroll-shifted, sticky-clamped, Transform2D-mapped,
top-layer-adjusted) bounding rectangle of node_id in logical viewport coordinates.
Sourcepub fn visual_rect_of_with_transform(
&self,
store: &NodeStore,
node_id: NodeId,
resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>,
) -> Option<LayoutRect>
pub fn visual_rect_of_with_transform( &self, store: &NodeStore, node_id: NodeId, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, ) -> Option<LayoutRect>
Like Self::visual_rect_of, allowing backends with live animated transforms (such as
SkiaBackend’s MotionDriver) to supply the effective Transform2D per node.
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn open_overlays(&self) -> &[ResolvedOverlay]
pub fn open_overlays(&self) -> &[ResolvedOverlay]
Open top-layer overlays in deterministic document paint order.
Sourcepub fn resolved_overlay(&self, id: NodeId) -> Option<ResolvedOverlay>
pub fn resolved_overlay(&self, id: NodeId) -> Option<ResolvedOverlay>
Reconciled top-layer geometry for id if it is currently an open Overlay.
Sourcepub fn overlay_reconcile_count(&self) -> u64
pub fn overlay_reconcile_count(&self) -> u64
Monotonic count of completed full overlay reconcile passes.
Sourcepub fn any_overlay_anchor_affected(
&self,
store: &NodeStore,
dirty_nodes: &[NodeId],
) -> bool
pub fn any_overlay_anchor_affected( &self, store: &NodeStore, dirty_nodes: &[NodeId], ) -> bool
Returns true iff any open anchored overlay’s resolved anchor (or one of its DOM
ancestors) is present in dirty_nodes. O(1) false when no anchored overlays are open
(e.g., no overlays or only unanchored modals).
Sourcepub fn reconcile_overlays_with_transform(
&mut self,
store: &NodeStore,
resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>,
)
pub fn reconcile_overlays_with_transform( &mut self, store: &NodeStore, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, )
Reconciles viewport-space top-layer coordinates for every hoisted overlay root of the
layout engine’s crate::TopLayerIndex, in its document paint order (O(1) fast-exit
when nothing is hoisted; zero heap allocations in steady state). Anchor visual rects are
read through resolve_transform so animated anchor transforms reposition anchored
overlays in lockstep (backends call this directly after scroll-only frames).
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn pointer_geometry<'a>(
&'a self,
store: &'a NodeStore,
) -> SceneGeometry<'a, L>
pub fn pointer_geometry<'a>( &'a self, store: &'a NodeStore, ) -> SceneGeometry<'a, L>
This scene’s pointer geometry for the frame laid out from store.
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn apply_pointer(
&mut self,
store: &NodeStore,
ev: &ValidatedEvent<'_>,
p: &PointerProbe,
out: &mut EventBatchBuf,
) -> PointerResolution
pub fn apply_pointer( &mut self, store: &NodeStore, ev: &ValidatedEvent<'_>, p: &PointerProbe, out: &mut EventBatchBuf, ) -> PointerResolution
Applies probed raw sample ev to the tracker, appending the targeted events to out.
Sourcepub fn request_pointer_capture(
&mut self,
store: &NodeStore,
req: PointerCaptureRequest,
) -> Result<(), CaptureError>
pub fn request_pointer_capture( &mut self, store: &NodeStore, req: PointerCaptureRequest, ) -> Result<(), CaptureError>
W3C setPointerCapture / releasePointerCapture from the app: sets the pointer’s pending
capture (applied before its next sample). Capture needs a connected, enabled target.
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn is_capture_target(&self, store: &NodeStore, node: NodeId) -> bool
pub fn is_capture_target(&self, store: &NodeStore, node: NodeId) -> bool
Whether node may hold pointer capture: connected and not in a disabled subtree.
Sourcepub fn set_max_pointers(&mut self, max: usize)
pub fn set_max_pointers(&mut self, max: usize)
Caps simultaneously tracked pointers (NvGestureSettings::max_pointers).
Sourcepub fn top_layer_press_at(
&self,
store: &NodeStore,
painted: Option<NodeId>,
contains: impl Fn(ResolvedOverlay) -> bool,
) -> TopLayerPress
pub fn top_layer_press_at( &self, store: &NodeStore, painted: Option<NodeId>, contains: impl Fn(ResolvedOverlay) -> bool, ) -> TopLayerPress
The top-layer press decision over the open overlays for press hit painted.
Sourcepub fn resolve_pointer(
&mut self,
store: &NodeStore,
ev: &ValidatedEvent<'_>,
out: &mut EventBatchBuf,
) -> Option<PointerResolution>
pub fn resolve_pointer( &mut self, store: &NodeStore, ev: &ValidatedEvent<'_>, out: &mut EventBatchBuf, ) -> Option<PointerResolution>
Resolves raw sample ev against the scene’s own hit test, appending the targeted events
to out (None when ev is not a raw pointer sample).
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn capture_scroll_anchors(&mut self, store: &NodeStore)
pub fn capture_scroll_anchors(&mut self, store: &NodeStore)
Captures pre-layout scroll anchors for every live scrolled container with
Scroll::overflow_anchor == OverflowAnchor::Auto right before compute_layout.
O(1) no-op when no container is currently scrolled; 0 steady-state heap allocations.
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn apply_scroll_chain(
&mut self,
store: &NodeStore,
start: NodeId,
dx: f32,
dy: f32,
kind: ScrollInputKind,
) -> ScrollChainOutcome
pub fn apply_scroll_chain( &mut self, store: &NodeStore, start: NodeId, dx: f32, dy: f32, kind: ScrollInputKind, ) -> ScrollChainOutcome
Walks from start up through ancestor Scroll containers to NodeId::ROOT, enforcing
Scroll::axes, per-axis OverscrollBehavior::{Auto, Contain, None}, and top-layer
containment, and delegating per-axis consumption, overscroll, wheel smoothing, and gesture
transitions to the active [ScrollPhysicsEngine] (0 steady-state allocs).
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn scroll_into_view_box_with_transform(
&mut self,
store: &NodeStore,
box_node: NodeId,
box_rect: LayoutRect,
target_rect: LayoutRect,
resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>,
apply_scroll: impl FnMut(&mut Self, NodeId, f32, f32) -> (f32, f32),
scrolled_containers: Option<&mut Vec<NodeId>>,
) -> bool
pub fn scroll_into_view_box_with_transform( &mut self, store: &NodeStore, box_node: NodeId, box_rect: LayoutRect, target_rect: LayoutRect, resolve_transform: impl Fn(NodeId, Option<Transform2D>) -> Option<Transform2D>, apply_scroll: impl FnMut(&mut Self, NodeId, f32, f32) -> (f32, f32), scrolled_containers: Option<&mut Vec<NodeId>>, ) -> bool
Computes minimal scroll target (next_x, next_y) for each enclosing Scroll ancestor of
box_node so target_rect becomes visible, invoking apply_scroll(scroll_id, tx, ty)
(which returns the clamped (x, y) actually applied) and resolve_transform for live
animated transforms. Returns true if any scroll offset moved.
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
pub fn scroll_offsets(&self) -> &ScrollOffsets
pub fn last_reconciled_scroll_nodes(&self) -> &[NodeId]
pub fn last_scroll_chain_changed(&self) -> &[NodeId]
pub fn last_scroll_chain_clamped_changed(&self) -> &[NodeId]
pub fn last_physics_visual_changed(&self) -> &[NodeId]
pub fn last_physics_clamped_changed(&self) -> &[NodeId]
pub fn set_scroll_offset_raw(&mut self, id: NodeId, dx: f32, dy: f32)
pub fn scroll_offset(&self, id: NodeId) -> (f32, f32)
pub fn scroll_overscroll(&self, id: NodeId) -> (f32, f32)
Sourcepub fn visual_scroll_shift(&self, store: &NodeStore, id: NodeId) -> (f32, f32)
pub fn visual_scroll_shift(&self, store: &NodeStore, id: NodeId) -> (f32, f32)
Clamped visual scroll shift (without synthetic overscroll).
Sourcepub fn compositor_scroll_shift(
&self,
store: &NodeStore,
id: NodeId,
) -> (f32, f32)
pub fn compositor_scroll_shift( &self, store: &NodeStore, id: NodeId, ) -> (f32, f32)
Compositor scroll shift including active rubber-band (overscroll_x, overscroll_y) for
custom-drawn surfaces (SkiaBackend), hit-testing, and sticky header tracking.
Sourcepub fn set_scroll_physics(&mut self, engine: Box<dyn ScrollPhysicsEngine>)
pub fn set_scroll_physics(&mut self, engine: Box<dyn ScrollPhysicsEngine>)
Replaces this surface’s active ScrollPhysicsEngine.
pub fn scroll_physics(&self) -> &dyn ScrollPhysicsEngine
pub fn scroll_physics_mut(&mut self) -> &mut dyn ScrollPhysicsEngine
Sourcepub fn scroll_px_per_line(&self) -> f32
pub fn scroll_px_per_line(&self) -> f32
Logical pixels per discrete mouse-wheel line detent reported by the installed engine.
Sourcepub fn set_scroll_reduced_motion(&mut self, reduced: bool) -> bool
pub fn set_scroll_reduced_motion(&mut self, reduced: bool) -> bool
Updates the reduced-motion preference on the installed ScrollPhysicsEngine.
Returns true if any active smooth-wheel animations snapped immediately to their target.
pub fn set_scroll_synthetic_momentum(&mut self, enabled: bool)
pub fn has_active_scroll_physics(&self) -> bool
pub fn scroll_content_size( &self, store: &NodeStore, node_id: NodeId, ) -> Option<(f32, f32)>
Sourcepub fn cancel_scroll_physics(&mut self, node_id: NodeId) -> bool
pub fn cancel_scroll_physics(&mut self, node_id: NodeId) -> bool
Cancels any active scroll physics/overscroll on node_id. Returns true if the node had
non-zero rubber-band overscroll so callers can clear visual overscroll state immediately.
Sourcepub fn set_scroll_offset_clamped(
&mut self,
store: &NodeStore,
node_id: NodeId,
x: f32,
y: f32,
) -> (f32, f32, bool)
pub fn set_scroll_offset_clamped( &mut self, store: &NodeStore, node_id: NodeId, x: f32, y: f32, ) -> (f32, f32, bool)
Sets node_id’s scroll offset clamped to [0..=content - viewport] per Scroll::axes,
cancelling any active scroll physics on node_id. Returns (clamped_x, clamped_y, changed).
Sourcepub fn set_scroll_offset_clamped_with_bounds(
&mut self,
store: &NodeStore,
node_id: NodeId,
x: f32,
y: f32,
vw: f32,
vh: f32,
cw: f32,
ch: f32,
) -> (f32, f32, bool)
pub fn set_scroll_offset_clamped_with_bounds( &mut self, store: &NodeStore, node_id: NodeId, x: f32, y: f32, vw: f32, vh: f32, cw: f32, ch: f32, ) -> (f32, f32, bool)
Self::set_scroll_offset_clamped using pre-cached (viewport_w, viewport_h, content_w, content_h) bounds so retained hosts avoid recomputing content extents on 120 Hz scrolls.
Sourcepub fn apply_scroll_delta(
&mut self,
store: &NodeStore,
node_id: NodeId,
dx: f32,
dy: f32,
) -> (f32, f32, bool)
pub fn apply_scroll_delta( &mut self, store: &NodeStore, node_id: NodeId, dx: f32, dy: f32, ) -> (f32, f32, bool)
Applies an incremental scroll delta (dx, dy) clamped against content bounds & Scroll::axes.
Returns (clamped_x, clamped_y, changed).
Sourcepub fn reconcile_scroll_offsets(&mut self, store: &NodeStore) -> &[NodeId]
pub fn reconcile_scroll_offsets(&mut self, store: &NodeStore) -> &[NodeId]
Prunes removed/detached scroll nodes, honors exact Scroll::requested_scroll_seq
transitions (seq != 0 && seq != prev_seq), applies Layer-1 scroll anchor compensation,
reconciles active physics entries across mid-fling commits, and re-clamps offsets per
Scroll::axes in O(scroll_containers) time with zero steady-state allocations.
Source§impl<L: StoreLayoutEngine> LaidOutScene<L>
impl<L: StoreLayoutEngine> LaidOutScene<L>
Sourcepub fn new(layout: L) -> Self
pub fn new(layout: L) -> Self
Wraps layout, installing the deterministic HeuristicTextMeasurer.
Sourcepub fn with_text_measurer(
layout: L,
text_measurer: Arc<dyn TextMeasurer>,
) -> Self
pub fn with_text_measurer( layout: L, text_measurer: Arc<dyn TextMeasurer>, ) -> Self
Wraps layout and installs text_measurer into it.
pub fn layout_engine_name(&self) -> &'static str
pub fn layout_engine(&self) -> &L
pub fn layout_engine_mut(&mut self) -> &mut L
pub fn viewport(&self) -> Viewport
Sourcepub fn set_viewport(&mut self, viewport: Viewport) -> bool
pub fn set_viewport(&mut self, viewport: Viewport) -> bool
Sets the viewport; returns true when it changed (the next pass re-runs layout).
Sourcepub fn set_media_env(&mut self, env: MediaEnv) -> bool
pub fn set_media_env(&mut self, env: MediaEnv) -> bool
Sets the @media environment (color scheme, reduced motion, pointer; the viewport size
comes from Self::set_viewport). Returns true when it changed (the next pass
re-resolves @media / @container rules).
pub fn text_measurer(&self) -> &Arc<dyn TextMeasurer> ⓘ
pub fn set_text_measurer(&mut self, measurer: Arc<dyn TextMeasurer>)
Sourcepub fn swap_layout_engine<L2: StoreLayoutEngine>(
self,
next: L2,
) -> LaidOutScene<L2>
pub fn swap_layout_engine<L2: StoreLayoutEngine>( self, next: L2, ) -> LaidOutScene<L2>
Hot-swaps the layout engine, keeping viewport, text measurer, scroll, and interaction
state. Resolved overlays belong to the old engine’s top-layer index and are dropped; follow
with Self::commit_frame (empty or full ChangeSet) to lay out and re-resolve them.
Sourcepub fn last_layout_ran(&self) -> bool
pub fn last_layout_ran(&self) -> bool
Whether the most recent Self::recompute_layout / commit actually ran a layout pass.
Sourcepub fn replace_layout_engine(&mut self, next: L)
pub fn replace_layout_engine(&mut self, next: L)
Replaces the layout engine in-place when keeping the same engine type L (e.g.,
DynLayoutEngine), avoiding any intermediate allocation.
Sourcepub fn layout_of(&self, id: NodeId) -> Option<LayoutRect>
pub fn layout_of(&self, id: NodeId) -> Option<LayoutRect>
Absolute (surface-space) rect of id from the latest layout pass.
Sourcepub fn changed_rects(&self) -> Option<&[NodeId]>
pub fn changed_rects(&self) -> Option<&[NodeId]>
Exact nodes whose committed absolute layout rect changed during the latest layout pass (or
the union across both layout passes of a focus-recovery commit), or None when callers
must fall back to scanning all live nodes (e.g. dead root or an engine without incremental
rect tracking).
Sourcepub fn paragraphs(&self) -> Option<&ParagraphStore>
pub fn paragraphs(&self) -> Option<&ParagraphStore>
Borrowed compiled ParagraphStore from the active layout engine.
Sourcepub fn paragraphs_mut(&mut self) -> Option<&mut ParagraphStore>
pub fn paragraphs_mut(&mut self) -> Option<&mut ParagraphStore>
Mutable borrow of the compiled ParagraphStore from the active layout engine.
Sourcepub fn top_layer(&self) -> &TopLayerIndex
pub fn top_layer(&self) -> &TopLayerIndex
The layout engine’s TopLayerIndex: which overlay roots are hoisted, in paint order.
Sourcepub fn topmost_modal(&self) -> Option<NodeId>
pub fn topmost_modal(&self) -> Option<NodeId>
The topmost (last painted) resolved modal overlay: what hit-testing blocks below and what
accessibility (A11yGeometryProvider::topmost_modal) emits from.
Sourcepub fn is_inert_under_modal(&self, store: &NodeStore, id: NodeId) -> bool
pub fn is_inert_under_modal(&self, store: &NodeStore, id: NodeId) -> bool
true when a modal is open and id is neither inside the topmost modal’s subtree nor
inside a top-layer overlay painted above it. The one modal-inertness rule shared by
scroll chaining, hit-testing, focus, and accessibility (all read resolved overlays).
Sourcepub fn recompute_layout(&mut self, store: &NodeStore) -> bool
pub fn recompute_layout(&mut self, store: &NodeStore) -> bool
Runs the engine’s self-gated layout pass for the store root at the current viewport
(state-rule re-layouts between commits; commits go through Self::commit_frame).
Sourcepub fn measure_root(
&mut self,
store: &NodeStore,
constraints: SizeConstraints,
ideal: bool,
) -> SurfaceMeasure
pub fn measure_root( &mut self, store: &NodeStore, constraints: SizeConstraints, ideal: bool, ) -> SurfaceMeasure
Pure sizing pass over the store root without mutating committed layout boxes or rects.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Clears layout, interaction, scroll, and overlay state (keeps viewport and text measurer).
Sourcepub fn hit_scratch_stats(&self) -> (usize, usize)
pub fn hit_scratch_stats(&self) -> (usize, usize)
Current length and high-water capacity of the reusable stacking-plan item buffer.
Trait Implementations§
Source§impl Default for LaidOutScene<TaffyStoreLayout>
impl Default for LaidOutScene<TaffyStoreLayout>
Source§impl<L: StoreLayoutEngine> PointerHitTest for LaidOutScene<L>
impl<L: StoreLayoutEngine> PointerHitTest for LaidOutScene<L>
Source§fn hit_interaction(&self, store: &NodeStore, x: f32, y: f32) -> Option<NodeId>
fn hit_interaction(&self, store: &NodeStore, x: f32, y: f32) -> Option<NodeId>
(x, y) (falling back to any event target).Source§fn hit_painted(&self, store: &NodeStore, x: f32, y: f32) -> Option<NodeId>
fn hit_painted(&self, store: &NodeStore, x: f32, y: f32) -> Option<NodeId>
(x, y), unfiltered (the top-layer press hit).Source§fn overlay_contains(
&self,
store: &NodeStore,
ro: ResolvedOverlay,
x: f32,
y: f32,
) -> bool
fn overlay_contains( &self, store: &NodeStore, ro: ResolvedOverlay, x: f32, y: f32, ) -> bool
(x, y) lies inside the (transform-aware) box of open overlay ro.