pub struct AppRuntime {Show 56 fields
pub root_blueprint: NodeBlueprint,
pub ir_graph: UiIrGraph,
pub layout_root: LayoutNode,
pub display_list: DisplayList,
pub spatial_index: SpatialIndex,
pub viewport_width: f32,
pub viewport_height: f32,
pub dpr: f32,
pub frame_count: u64,
pub active_focus: Option<ActiveInput>,
pub input_states: HashMap<String, TextInputState>,
pub caret_blink_epoch: Instant,
pub last_caret_blink_state: bool,
pub current_cursor: CursorIcon,
pub drag_selection_active: bool,
pub last_click_info: Option<(Instant, f32, f32, usize)>,
pub pending_window_drag: Option<(f32, f32)>,
pub last_drag_click: Option<(Instant, f32, f32)>,
pub current_hover_path: Option<Vec<usize>>,
pub current_focus_path: Option<Vec<usize>>,
pub is_mouse_down: bool,
pub is_dark_mode: bool,
pub last_mouse_pos: (f32, f32),
pub hover_tooltip_text: Option<String>,
pub hover_tooltip_path: Option<Vec<usize>>,
pub hover_tooltip_anchor: (f32, f32),
pub hover_tooltip_since: Option<Instant>,
pub hover_tooltip_visible: bool,
pub hover_tooltip_delay: Duration,
pub scroll_offsets: HashMap<Vec<usize>, (f32, f32)>,
pub scroll_offsets_by_id: HashMap<String, (f32, f32)>,
pub active_scrollbars: Vec<ActiveScrollbar>,
pub scrollbar_drag: Option<ScrollbarDrag>,
pub active_smooth_scroll: Option<SmoothScrollTracker>,
pub last_scroll_interaction: Option<Instant>,
pub applied_scroll_offsets: HashMap<Vec<usize>, (f32, f32)>,
pub applied_portal_offsets: HashMap<Vec<usize>, (f32, f32)>,
pub runtime_start_epoch: Instant,
pub transition_manager: TransitionManager,
pub animation_manager: AnimationManager,
pub base_node_styles: HashMap<u64, ComputedStyle>,
pub previous_node_styles: HashMap<u64, ComputedStyle>,
pub node_paths: HashMap<u64, Vec<usize>>,
pub path_node_ids: HashMap<Vec<usize>, u64>,
pub view_transition_manager: ViewTransitionManager,
pub had_active_animations: bool,
pub gpu_path_pipeline: GpuPathPipeline,
pub mcp_cursor: Option<McpCursorState>,
pub a11y_bridge: A11yBridge,
pub a11y_tree: Option<A11yTree>,
pub a11y_updates_count: u64,
pub dynamic_text_bindings: Vec<DynamicTextBinding>,
pub dom_mutation_receiver: Option<Receiver<DomMutationRecord>>,
pub csd_controller: CsdController,
pub pointer_capture_target: Option<(Vec<usize>, bool)>,
pub observed_element_sizes: HashMap<u64, (f32, f32)>,
/* private fields */
}Expand description
Live running application instance holding active state, layout tree, and display list.
Fields§
§root_blueprint: NodeBlueprint§ir_graph: UiIrGraph§layout_root: LayoutNode§display_list: DisplayList§spatial_index: SpatialIndex§viewport_width: f32§viewport_height: f32§dpr: f32§frame_count: u64§active_focus: Option<ActiveInput>§input_states: HashMap<String, TextInputState>§caret_blink_epoch: Instant§last_caret_blink_state: bool§current_cursor: CursorIcon§drag_selection_active: bool§last_click_info: Option<(Instant, f32, f32, usize)>§pending_window_drag: Option<(f32, f32)>Press origin of a possible window drag started on a data-app-region="drag" surface.
last_drag_click: Option<(Instant, f32, f32)>Time and position of the previous drag-region press, for double-click maximize toggling.
current_hover_path: Option<Vec<usize>>Hierarchical index path of the currently hovered element node.
current_focus_path: Option<Vec<usize>>Hierarchical index path of the currently focused element node.
is_mouse_down: boolWhether pointer primary button is currently held down.
is_dark_mode: boolWhether dark mode is active for theme-dependent utility styling.
last_mouse_pos: (f32, f32)Last recorded pointer coordinates.
hover_tooltip_text: Option<String>Resolved native tooltip text (title or button/image alt) for the hovered element.
hover_tooltip_path: Option<Vec<usize>>Tree path of the element that owns hover_tooltip_text.
hover_tooltip_anchor: (f32, f32)Pointer coordinates used to anchor the native hover tooltip.
hover_tooltip_since: Option<Instant>Timestamp when pointer dwell began on the current tooltip target.
hover_tooltip_visible: boolWhether the native hover tooltip popup is currently displayed.
hover_tooltip_delay: DurationDwell delay before a native hover tooltip becomes visible.
scroll_offsets: HashMap<Vec<usize>, (f32, f32)>Scroll offsets keyed by hierarchical tree path (e.g. [0, 1, 0]).
scroll_offsets_by_id: HashMap<String, (f32, f32)>Scroll offsets keyed by element string ID (e.g. “browser-viewport-tab-1”).
active_scrollbars: Vec<ActiveScrollbar>Active scrollbars currently visible on screen.
scrollbar_drag: Option<ScrollbarDrag>Active drag operation on a scrollbar thumb.
active_smooth_scroll: Option<SmoothScrollTracker>Active kinetic smooth scroll animation tracker.
last_scroll_interaction: Option<Instant>Timestamp of the last scroll interaction (for animated scrollbar thumb fade).
applied_scroll_offsets: HashMap<Vec<usize>, (f32, f32)>Scroll offsets currently applied via translation to the layout tree, keyed by hierarchical tree path.
applied_portal_offsets: HashMap<Vec<usize>, (f32, f32)>Anchored top-layer <Portal> translations currently applied to the layout tree, keyed by path.
runtime_start_epoch: InstantContinuous presentation epoch for animation and transition timing.
transition_manager: TransitionManagerCoordinator for CSS transition properties across elements.
animation_manager: AnimationManagerCoordinator for CSS keyframe animations across elements.
base_node_styles: HashMap<u64, ComputedStyle>Base un-animated computed styles for all layout tree nodes keyed by deterministic node ID.
previous_node_styles: HashMap<u64, ComputedStyle>Previous frame’s computed styles for transition diffing.
node_paths: HashMap<u64, Vec<usize>>Mapping from deterministic node ID to its hierarchical tree path.
path_node_ids: HashMap<Vec<usize>, u64>Mapping from hierarchical tree path to its identity-aware animation node ID.
view_transition_manager: ViewTransitionManagerCoordinator for CSS View Transitions Module snapshots and element morphing.
had_active_animations: boolWhether animations or transitions were active in the prior frame (to allow clean final state settlement).
gpu_path_pipeline: GpuPathPipelineHardware GPU path compilation pipeline for direct compute shader execution.
mcp_cursor: Option<McpCursorState>Active MCP emulated cursor state (smooth interpolation, hotspot, fade timer).
a11y_bridge: A11yBridgeAccessibility tree bridge connecting Strata layout and reactive DOM with AccessKit and screen readers.
a11y_tree: Option<A11yTree>Latest snapshot of the accessible hierarchy.
a11y_updates_count: u64Number of accessibility tree synchronizations performed.
dynamic_text_bindings: Vec<DynamicTextBinding>Fine-grained dynamic text bindings mapped directly to layout node paths.
dom_mutation_receiver: Option<Receiver<DomMutationRecord>>Background channel receiver for live DOM mutations from scripts or browser tabs.
csd_controller: CsdControllerClient-Side Decorations (CSD) controller managing titlebar geometry and drag tracking.
pointer_capture_target: Option<(Vec<usize>, bool)>Active pointer capture or drag target (tree_path, explicit_capture).
observed_element_sizes: HashMap<u64, (f32, f32)>Last observed (width, height) for elements with onresize listeners, keyed by node ID.
Implementations§
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn apply_edit_command(&mut self, cmd: EditCommand) -> bool
pub fn apply_edit_command(&mut self, cmd: EditCommand) -> bool
Applies one editing command to the focused text input. Returns true when something changed.
Sourcepub fn drain_edit_commands(&mut self) -> bool
pub fn drain_edit_commands(&mut self) -> bool
Runs every edit command queued through queue_edit_command (e.g. from a context menu).
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn compute_idle_sleep(&self, was_active: bool) -> Duration
pub fn compute_idle_sleep(&self, was_active: bool) -> Duration
Dynamically computes the appropriate thread sleep duration based on runtime activity state. Returns:
- 16ms if animations, smooth scrolling, scrollbar dragging, window dragging, active interactions, or dirty signals are active.
- 50ms if a text input currently has active focus (to service responsive caret blinking).
- 200ms if the runtime is completely idle (dropping CPU consumption to ~0%).
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn extract_text_content(bp: &NodeBlueprint) -> String
pub fn extract_text_content(bp: &NodeBlueprint) -> String
Recursively extracts concatenated text content from a blueprint subtree.
Sourcepub fn update_accessibility_tree(&mut self) -> A11yTreeUpdate
pub fn update_accessibility_tree(&mut self) -> A11yTreeUpdate
Re-evaluates accessibility tree matching current blueprint and layout, emitting incremental diffs to the bridge.
Sourcepub fn full_accessibility_update(&self) -> A11yTreeUpdate
pub fn full_accessibility_update(&self) -> A11yTreeUpdate
Returns a full accessibility tree update snapshot containing all current nodes.
Sourcepub fn dispatch_accessibility_action(
&mut self,
target_node: A11yNodeId,
action: A11yAction,
) -> bool
pub fn dispatch_accessibility_action( &mut self, target_node: A11yNodeId, action: A11yAction, ) -> bool
Dispatches an assistive technology action (e.g. from screen reader) to the target node.
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn sync_tree_animations(&mut self, now_ms: f64)
pub fn sync_tree_animations(&mut self, now_ms: f64)
Synchronizes running animations and transitions with the current layout tree.
Sourcepub fn apply_animations_to_layout_tree(&mut self)
pub fn apply_animations_to_layout_tree(&mut self)
Applies active transition and animation values directly onto the layout tree.
Sourcepub fn evaluate_scroll_animations(
&mut self,
anim_events: &mut Vec<AnimationLifecycleEvent>,
)
pub fn evaluate_scroll_animations( &mut self, anim_events: &mut Vec<AnimationLifecycleEvent>, )
Evaluates all active scroll-driven animations based on current container scroll positions.
Sourcepub fn sync_scroll_animations(&mut self)
pub fn sync_scroll_animations(&mut self)
Evaluates scroll-driven animations synchronously during container scroll, consuming 0% CPU when stationary.
Sourcepub fn capture_view_transitions(&mut self)
pub fn capture_view_transitions(&mut self)
Captures element layout bounding boxes for elements with view-transition-name before DOM mutation.
Sourcepub fn start_view_transition(&mut self, duration_ms: f32)
pub fn start_view_transition(&mut self, duration_ms: f32)
Triggers a view transition after DOM mutation, pairing old bounds with new layout bounds.
Sourcepub fn has_active_transitions(&self) -> bool
pub fn has_active_transitions(&self) -> bool
Returns true if any CSS property transitions or view transitions are currently active.
Sourcepub fn has_active_animations(&self) -> bool
pub fn has_active_animations(&self) -> bool
Returns true if there are any active transitions or keyframe animations running.
Sourcepub fn poll_animations(&mut self) -> bool
pub fn poll_animations(&mut self) -> bool
Advances active animations and transitions by current clock time. Returns true if any animation stepped and a redraw is needed.
Sourcepub fn dispatch_animation_event(&self, event: AnimationLifecycleEvent)
pub fn dispatch_animation_event(&self, event: AnimationLifecycleEvent)
Dispatches a synthetic W3C animation lifecycle event to matching RSX element event listeners.
Sourcepub fn dispatch_transition_event(&self, event: TransitionLifecycleEvent)
pub fn dispatch_transition_event(&self, event: TransitionLifecycleEvent)
Dispatches a synthetic W3C transition lifecycle event to matching RSX element event listeners.
Sourcepub fn register_keyframes_stylesheet(&mut self, sheet: &StyleSheet)
pub fn register_keyframes_stylesheet(&mut self, sheet: &StyleSheet)
Registers all parsed @keyframes rules from a stylesheet into the runtime animation registry.
Sourcepub fn register_keyframe_rule(&mut self, rule: &KeyframeRule)
pub fn register_keyframe_rule(&mut self, rule: &KeyframeRule)
Registers a single compiled @keyframes rule into the runtime animation registry.
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn render_canvas_3d_scenes(&mut self)
pub fn render_canvas_3d_scenes(&mut self)
Extracts declarative or programmatic 3D canvas viewports when not already emitted by [Compositor].
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn register_dom_mutation_channel(&mut self) -> Sender<DomMutationRecord>
pub fn register_dom_mutation_channel(&mut self) -> Sender<DomMutationRecord>
Registers a background channel receiver for DOM mutations and returns the transmitting sender.
Sourcepub fn poll_dom_mutations(&mut self, document: Option<&Document>) -> bool
pub fn poll_dom_mutations(&mut self, document: Option<&Document>) -> bool
Polls pending DOM mutations from the registered channel and hydrates them into the presentation tree.
Returns true if any mutations were processed and a frame redraw is required.
Sourcepub fn hydrate_dom_mutations(
&mut self,
records: &[DomMutationRecord],
document: Option<&Document>,
) -> bool
pub fn hydrate_dom_mutations( &mut self, records: &[DomMutationRecord], document: Option<&Document>, ) -> bool
Hydrates a sequence of fine-grained DOM mutation records directly into the live layout tree.
Sourcepub fn hydrate_dom_mutation(
&mut self,
record: &DomMutationRecord,
document: Option<&Document>,
) -> bool
pub fn hydrate_dom_mutation( &mut self, record: &DomMutationRecord, document: Option<&Document>, ) -> bool
Hydrates an individual DOM mutation record in-place without triggering a full page transpile.
Sourcepub fn incremental_relayout(&mut self, dirty_path: &[usize]) -> bool
pub fn incremental_relayout(&mut self, dirty_path: &[usize]) -> bool
Performs incremental layout recomputation along a dirty tree path, leveraging layout boundaries or ancestor cache invalidation.
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn current_cursor(&self) -> CursorIcon
pub fn current_cursor(&self) -> CursorIcon
Returns the currently active platform mouse cursor icon.
Sourcepub fn dispatch_pointer_down_action(
&mut self,
px: f32,
py: f32,
) -> PointerDownAction
pub fn dispatch_pointer_down_action( &mut self, px: f32, py: f32, ) -> PointerDownAction
Dispatches pointer down at (px, py) coordinates with default modifiers. Returns the detailed action result (CaretMoved, FocusChanged, DomListenerInvoked, or Ignored).
Sourcepub fn dispatch_pointer_down(&mut self, px: f32, py: f32) -> bool
pub fn dispatch_pointer_down(&mut self, px: f32, py: f32) -> bool
Dispatches pointer down at (px, py) coordinates with no active modifier keys. Returns true if focus or selection state changed.
Sourcepub fn dispatch_pointer_down_with_modifiers(
&mut self,
px: f32,
py: f32,
modifiers: Modifiers,
) -> bool
pub fn dispatch_pointer_down_with_modifiers( &mut self, px: f32, py: f32, modifiers: Modifiers, ) -> bool
Dispatches pointer down at (px, py) coordinates to manage native input element focus, multi-click, Shift+click range extension, and text selection. Returns true if focus or selection state changed.
Sourcepub fn dispatch_pointer_down_action_with_modifiers(
&mut self,
px: f32,
py: f32,
modifiers: Modifiers,
) -> PointerDownAction
pub fn dispatch_pointer_down_action_with_modifiers( &mut self, px: f32, py: f32, modifiers: Modifiers, ) -> PointerDownAction
Dispatches pointer down with modifier keys, returning whether the interaction only moved the caret in the already-active input, changed focus, or invoked a DOM listener.
Dispatches pointer down with explicit mouse button (0 = Left, 1 = Middle, 2 = Right)
and modifier keys, managing text input focus/caret on primary clicks and invoking DOM
PointerDown / MouseDown listeners with accurate button / buttons metadata.
Sourcepub fn dispatch_pointer_move_action(
&mut self,
px: f32,
py: f32,
) -> PointerMoveAction
pub fn dispatch_pointer_move_action( &mut self, px: f32, py: f32, ) -> PointerMoveAction
Dispatches pointer move at (px, py), returning detailed action result.
Sourcepub fn dispatch_pointer_move(&mut self, px: f32, py: f32) -> bool
pub fn dispatch_pointer_move(&mut self, px: f32, py: f32) -> bool
Dispatches pointer move at (px, py) to update mouse drag text selection and DOM move listeners.
Sourcepub fn dispatch_pointer_up_action(
&mut self,
px: f32,
py: f32,
) -> PointerUpAction
pub fn dispatch_pointer_up_action( &mut self, px: f32, py: f32, ) -> PointerUpAction
Dispatches pointer up with primary button (0), returning detailed action result.
Dispatches pointer up with explicit mouse button (0 = Left, 1 = Middle, 2 = Right).
Sourcepub fn dispatch_pointer_up(&mut self, px: f32, py: f32) -> bool
pub fn dispatch_pointer_up(&mut self, px: f32, py: f32) -> bool
Dispatches pointer up to finalize mouse drag text selection and notify DOM up listeners.
Sourcepub fn dispatch_key_event(&mut self, event: &PlatformEvent) -> KeyDispatchResult
pub fn dispatch_key_event(&mut self, event: &PlatformEvent) -> KeyDispatchResult
Dispatches keyboard events to the active focused input element, returning a fine-grained KeyDispatchResult.
Sourcepub fn handle_key_event(&mut self, event: &PlatformEvent) -> bool
pub fn handle_key_event(&mut self, event: &PlatformEvent) -> bool
Dispatches keyboard events to the active focused input element. Returns true if the key event was consumed by the focused input.
Sourcepub fn create_mouse_event(
&self,
event_type: EventType,
px: f32,
py: f32,
button: i16,
detail: i32,
target_box: Option<&Rect>,
) -> Event
pub fn create_mouse_event( &self, event_type: EventType, px: f32, py: f32, button: i16, detail: i32, target_box: Option<&Rect>, ) -> Event
Creates a fully populated synthetic W3C DOM Event for mouse and pointer interactions, with client, page, screen, and offset coordinates, button identifiers, click detail, and keyboard modifier flags.
Sourcepub fn target_is_retained_canvas3d(&self, px: f32, py: f32) -> bool
pub fn target_is_retained_canvas3d(&self, px: f32, py: f32) -> bool
Returns true when the active pointer capture target or element at (px, py) belongs to
a retained <Canvas3D> viewport tracked by this runtime.
Sourcepub fn dispatch_click(&self, px: f32, py: f32) -> bool
pub fn dispatch_click(&self, px: f32, py: f32) -> bool
Dispatches a pointer click event at (x, y) coordinates into the application blueprint tree. Returns true if an event listener was invoked.
Sourcepub fn dispatch_mouse_click(
&self,
px: f32,
py: f32,
button: i16,
detail: i32,
) -> bool
pub fn dispatch_mouse_click( &self, px: f32, py: f32, button: i16, detail: i32, ) -> bool
Dispatches a mouse click event with specific button (0 = Left, 1 = Middle, 2 = Right) and detail.
Sourcepub fn dispatch_dblclick(&self, px: f32, py: f32) -> bool
pub fn dispatch_dblclick(&self, px: f32, py: f32) -> bool
Dispatches a standard W3C dblclick event at (x, y) coordinates to the nearest element with an ondblclick listener.
Dispatches a W3C contextmenu event at (x, y) to the nearest element that registered
an oncontextmenu listener. Returns false (and leaves the platform default untouched)
when nothing at that point listens, so a context menu never appears on arbitrary surfaces.
Sourcepub fn begin_window_drag_candidate(&mut self, px: f32, py: f32) -> bool
pub fn begin_window_drag_candidate(&mut self, px: f32, py: f32) -> bool
Records a possible window drag when a primary press lands on a data-app-region="drag"
surface (the equivalent of -webkit-app-region: drag). Interactive children opt out with
data-app-region="no-drag". A quick second press toggles maximize, as native title bars do.
Sourcepub fn poll_window_drag(&mut self, px: f32, py: f32) -> bool
pub fn poll_window_drag(&mut self, px: f32, py: f32) -> bool
Starts a native window move once the pointer travelled past the drag threshold. Returns true when the window’s maximized state changed (such as unmaximizing on drag).
Sourcepub fn dispatch_file_drop(&mut self, paths: Vec<PathBuf>) -> bool
pub fn dispatch_file_drop(&mut self, paths: Vec<PathBuf>) -> bool
Dispatches an OS file drop (PlatformEvent::FileDrop) to the drop target under last_mouse_pos
(or the primary ondrop listener in the tree), populating event.files and event.data.
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn unproject_point(layout: &LayoutNode, px: f32, py: f32) -> (f32, f32)
pub fn unproject_point(layout: &LayoutNode, px: f32, py: f32) -> (f32, f32)
Unprojects a world pointer coordinate into an element’s local coordinate system if transformed.
Sourcepub fn establishes_stacking_context(node: &LayoutNode, is_root: bool) -> bool
pub fn establishes_stacking_context(node: &LayoutNode, is_root: bool) -> bool
Returns true if node establishes an atomic stacking context for paint and hit-testing.
Sourcepub fn establishes_stacking_context_in(
node: &LayoutNode,
parent_display: Option<Display>,
is_root: bool,
) -> bool
pub fn establishes_stacking_context_in( node: &LayoutNode, parent_display: Option<Display>, is_root: bool, ) -> bool
Returns true if node establishes an atomic stacking context given parent_display.
Sourcepub fn hit_test_event_with_box_and_entity<'a>(
blueprint: &'a NodeBlueprint,
layout: &'a LayoutNode,
px: f32,
py: f32,
event_type: EventType,
) -> Option<(Rc<dyn Fn(Event)>, &'a Rect, EntityId)>
pub fn hit_test_event_with_box_and_entity<'a>( blueprint: &'a NodeBlueprint, layout: &'a LayoutNode, px: f32, py: f32, event_type: EventType, ) -> Option<(Rc<dyn Fn(Event)>, &'a Rect, EntityId)>
Recursively hit tests a coordinate point against the blueprint and computed layout hierarchy,
returning the nearest listener registered for event_type, its element border box, and its EntityId.
Sourcepub fn hit_test_event_with_box<'a>(
blueprint: &'a NodeBlueprint,
layout: &'a LayoutNode,
px: f32,
py: f32,
event_type: EventType,
) -> Option<(Rc<dyn Fn(Event)>, &'a Rect)>
pub fn hit_test_event_with_box<'a>( blueprint: &'a NodeBlueprint, layout: &'a LayoutNode, px: f32, py: f32, event_type: EventType, ) -> Option<(Rc<dyn Fn(Event)>, &'a Rect)>
Recursively hit tests a coordinate point against the blueprint and computed layout hierarchy,
returning the nearest listener registered for event_type and its element border box.
Sourcepub fn find_event_at_or_above_path<'a>(
blueprint: &'a NodeBlueprint,
layout: &'a LayoutNode,
path: &[usize],
event_type: EventType,
) -> Option<(Rc<dyn Fn(Event)>, &'a Rect, EntityId)>
pub fn find_event_at_or_above_path<'a>( blueprint: &'a NodeBlueprint, layout: &'a LayoutNode, path: &[usize], event_type: EventType, ) -> Option<(Rc<dyn Fn(Event)>, &'a Rect, EntityId)>
Walks from path up toward the root to find the nearest ancestor (or self)
registering a listener for event_type, returning (handler, border_box, entity_id).
Sourcepub fn hit_test_event(
blueprint: &NodeBlueprint,
layout: &LayoutNode,
px: f32,
py: f32,
event_type: EventType,
) -> Option<Rc<dyn Fn(Event)>>
pub fn hit_test_event( blueprint: &NodeBlueprint, layout: &LayoutNode, px: f32, py: f32, event_type: EventType, ) -> Option<Rc<dyn Fn(Event)>>
Recursively hit tests a coordinate point against the blueprint and computed layout hierarchy,
returning the nearest (deepest, front-most) listener registered for event_type.
Sourcepub fn hit_test_click(
blueprint: &NodeBlueprint,
layout: &LayoutNode,
px: f32,
py: f32,
) -> Option<Rc<dyn Fn(Event)>>
pub fn hit_test_click( blueprint: &NodeBlueprint, layout: &LayoutNode, px: f32, py: f32, ) -> Option<Rc<dyn Fn(Event)>>
Hit tests for the nearest onclick listener at a coordinate point.
Sourcepub fn hit_test_cursor(
blueprint: &NodeBlueprint,
layout: &LayoutNode,
px: f32,
py: f32,
) -> CursorIcon
pub fn hit_test_cursor( blueprint: &NodeBlueprint, layout: &LayoutNode, px: f32, py: f32, ) -> CursorIcon
Recursively hit tests a coordinate point against the blueprint and computed layout hierarchy to determine cursor style.
Sourcepub fn hit_test_property(
blueprint: &NodeBlueprint,
layout: &LayoutNode,
px: f32,
py: f32,
key: &str,
) -> Option<String>
pub fn hit_test_property( blueprint: &NodeBlueprint, layout: &LayoutNode, px: f32, py: f32, key: &str, ) -> Option<String>
Finds the value of the deepest element property key whose border box contains the point.
Elements are tested front-to-back according to CSS stacking contexts so overlays win over what they cover.
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn find_node_by_path<'a>(
blueprint: &'a NodeBlueprint,
layout: &'a LayoutNode,
path: &[usize],
) -> Option<(&'a NodeBlueprint, &'a LayoutNode)>
pub fn find_node_by_path<'a>( blueprint: &'a NodeBlueprint, layout: &'a LayoutNode, path: &[usize], ) -> Option<(&'a NodeBlueprint, &'a LayoutNode)>
Locates the blueprint and layout node at a hierarchical index path in the tree.
Sourcepub fn hit_test_node_path(
blueprint: &NodeBlueprint,
layout: &LayoutNode,
px: f32,
py: f32,
) -> Option<Vec<usize>>
pub fn hit_test_node_path( blueprint: &NodeBlueprint, layout: &LayoutNode, px: f32, py: f32, ) -> Option<Vec<usize>>
Recursively hit tests a coordinate point against the blueprint and computed layout hierarchy, returning the hierarchical index path of the deepest matching element node.
Sourcepub fn dispatch_boundary_events(
&self,
old_path: Option<&[usize]>,
new_path: Option<&[usize]>,
px: f32,
py: f32,
)
pub fn dispatch_boundary_events( &self, old_path: Option<&[usize]>, new_path: Option<&[usize]>, px: f32, py: f32, )
Dispatches W3C boundary events (mouseout, mouseleave, mouseover, mouseenter)
between the previous hover path and the newly active hover path.
Sourcepub fn node_path_has_hover_effects(
blueprint: &NodeBlueprint,
path: &[usize],
) -> bool
pub fn node_path_has_hover_effects( blueprint: &NodeBlueprint, path: &[usize], ) -> bool
Checks whether any element along the index path has active hover styles (Tailwind or <style>) or boundary handlers.
Sourcepub fn node_has_hover_effects(node: &NodeBlueprint) -> bool
pub fn node_has_hover_effects(node: &NodeBlueprint) -> bool
Checks if a single blueprint node has hover utility classes (including chained modifiers like dark:hover:*),
.group descendants with group-hover:*, or boundary event listeners.
Sourcepub fn update_hover(&mut self, px: f32, py: f32) -> bool
pub fn update_hover(&mut self, px: f32, py: f32) -> bool
Continuously updates hover state from pointer coordinates. Dispatches boundary events and rebuilds layout tree if the hovered element changed and has hover effects. Returns true if the hover target changed and an interactive frame rebuild is required.
Sourcepub fn restyle_for_hover_paint(&mut self)
pub fn restyle_for_hover_paint(&mut self)
Re-applies hover/active styles, synchronizes CSS transitions, and recompiles paint commands without re-running layout when paint-only.
Paint-only hover variants (hover:bg-*, hover:text-*, hover:underline,
shadows, opacity, <style> :hover color/background rules) do not change box geometry.
Rebuilding the tree carries the new styles; the previous geometry, line boxes, and inline item streams
are transplanted so the display list can be recompiled immediately.
Sourcepub fn restyle_for_active_change(&mut self) -> bool
pub fn restyle_for_active_change(&mut self) -> bool
Re-applies :active styles only when the hovered path can visually react
to pointer press/release, returning true if a repaint is needed.
Sourcepub fn clear_hover(&mut self) -> bool
pub fn clear_hover(&mut self) -> bool
Clears any active hover state when the pointer departs the window surface.
Sourcepub fn dismiss_hover_tooltip(&mut self) -> bool
pub fn dismiss_hover_tooltip(&mut self) -> bool
Clears all pending/visible native hover tooltip state.
Returns true if a visible tooltip was dismissed.
Sourcepub fn dismiss_hover_tooltip_and_repaint(&mut self) -> bool
pub fn dismiss_hover_tooltip_and_repaint(&mut self) -> bool
Dismisses any visible or pending native hover tooltip and recompiles the display list if the tooltip was visible on screen.
Sourcepub fn next_hover_tooltip_due_in(&self) -> Option<Duration>
pub fn next_hover_tooltip_due_in(&self) -> Option<Duration>
Returns the remaining duration until a pending native hover tooltip should appear.
Sourcepub fn poll_hover_tooltip(&mut self) -> bool
pub fn poll_hover_tooltip(&mut self) -> bool
Advances the native hover tooltip dwell timer. Returns true when the tooltip transitions
to visible and updates the display list.
Sourcepub fn render_hover_tooltip(&mut self)
pub fn render_hover_tooltip(&mut self)
Appends native hover tooltip draw commands on top of the compiled display list when active.
Source§impl AppRuntime
impl AppRuntime
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn hit_test_input(
blueprint: &NodeBlueprint,
layout: &LayoutNode,
px: f32,
py: f32,
) -> Option<InputHitTarget>
pub fn hit_test_input( blueprint: &NodeBlueprint, layout: &LayoutNode, px: f32, py: f32, ) -> Option<InputHitTarget>
Recursively hit tests a coordinate point against the blueprint to find clickable text input elements.
Sourcepub fn find_input_layout<'a>(
blueprint: &NodeBlueprint,
layout: &'a LayoutNode,
target_index: usize,
target_id: Option<&str>,
counter: &mut usize,
) -> Option<&'a LayoutNode>
pub fn find_input_layout<'a>( blueprint: &NodeBlueprint, layout: &'a LayoutNode, target_index: usize, target_id: Option<&str>, counter: &mut usize, ) -> Option<&'a LayoutNode>
Locates the LayoutNode corresponding to a target input index or id in document order.
Sourcepub fn find_input_layout_mut<'a>(
blueprint: &NodeBlueprint,
layout: &'a mut LayoutNode,
target_index: usize,
target_id: Option<&str>,
counter: &mut usize,
) -> Option<&'a mut LayoutNode>
pub fn find_input_layout_mut<'a>( blueprint: &NodeBlueprint, layout: &'a mut LayoutNode, target_index: usize, target_id: Option<&str>, counter: &mut usize, ) -> Option<&'a mut LayoutNode>
Locates the mutable LayoutNode corresponding to a target input index or id in document order.
Sourcepub fn find_input_blueprint<'a>(
blueprint: &'a NodeBlueprint,
target_index: usize,
target_id: Option<&str>,
counter: &mut usize,
) -> Option<&'a NodeBlueprint>
pub fn find_input_blueprint<'a>( blueprint: &'a NodeBlueprint, target_index: usize, target_id: Option<&str>, counter: &mut usize, ) -> Option<&'a NodeBlueprint>
Locates the blueprint element corresponding to a target input index or ID.
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn find_blueprint_at_path<'a>(
blueprint: &'a NodeBlueprint,
path: &[usize],
) -> Option<&'a NodeBlueprint>
pub fn find_blueprint_at_path<'a>( blueprint: &'a NodeBlueprint, path: &[usize], ) -> Option<&'a NodeBlueprint>
Locates a blueprint node given its hierarchical index path.
Sourcepub fn build_ir_graph(blueprint: &NodeBlueprint) -> UiIrGraph
pub fn build_ir_graph(blueprint: &NodeBlueprint) -> UiIrGraph
Compiles a reactive blueprint tree into a 64-byte cache-aligned UiIrGraph.
Sourcepub fn sync_layout_to_ir(layout_root: &LayoutNode, ir_graph: &mut UiIrGraph)
pub fn sync_layout_to_ir(layout_root: &LayoutNode, ir_graph: &mut UiIrGraph)
Synchronizes computed 2D geometry from LayoutNode hierarchy to UiIrGraph FixedRect coordinates.
Sourcepub fn build_layout_from_ir(graph: &UiIrGraph, node_id: NodeId) -> LayoutNode
pub fn build_layout_from_ir(graph: &UiIrGraph, node_id: NodeId) -> LayoutNode
Reconstructs a LayoutNode hierarchy directly from a UiIrGraph.
Sourcepub fn build_layout_tree(blueprint: &NodeBlueprint) -> LayoutNode
pub fn build_layout_tree(blueprint: &NodeBlueprint) -> LayoutNode
Recursively transforms an RSX NodeBlueprint into a LayoutNode hierarchy with styling and inheritance.
Sourcepub fn build_layout_tree_with_interaction(
blueprint: &NodeBlueprint,
ctx: &InteractionContext<'_>,
) -> LayoutNode
pub fn build_layout_tree_with_interaction( blueprint: &NodeBlueprint, ctx: &InteractionContext<'_>, ) -> LayoutNode
Recursively transforms an RSX NodeBlueprint into a LayoutNode hierarchy with styling, inheritance, and interaction state.
Sourcepub fn build_layout_tree_with_hover(
blueprint: &NodeBlueprint,
hovered_path: Option<&[usize]>,
) -> LayoutNode
pub fn build_layout_tree_with_hover( blueprint: &NodeBlueprint, hovered_path: Option<&[usize]>, ) -> LayoutNode
Recursively transforms an RSX NodeBlueprint into a LayoutNode hierarchy with styling, inheritance, and hover state.
Sourcepub fn build_layout_tree_with_parent(
blueprint: &NodeBlueprint,
parent_style: Option<&ComputedStyle>,
) -> LayoutNode
pub fn build_layout_tree_with_parent( blueprint: &NodeBlueprint, parent_style: Option<&ComputedStyle>, ) -> LayoutNode
Internal recursive tree builder passing parent ComputedStyle for W3C CSS property inheritance.
Sourcepub fn build_layout_tree_with_context(
blueprint: &NodeBlueprint,
parent_style: Option<&ComputedStyle>,
current_path: &mut Vec<usize>,
hovered_path: Option<&[usize]>,
) -> LayoutNode
pub fn build_layout_tree_with_context( blueprint: &NodeBlueprint, parent_style: Option<&ComputedStyle>, current_path: &mut Vec<usize>, hovered_path: Option<&[usize]>, ) -> LayoutNode
Internal recursive tree builder passing parent style, node path, and active hover state.
Sourcepub fn build_layout_tree_with_interaction_context(
blueprint: &NodeBlueprint,
parent_style: Option<&ComputedStyle>,
current_path: &mut Vec<usize>,
ctx: &InteractionContext<'_>,
) -> LayoutNode
pub fn build_layout_tree_with_interaction_context( blueprint: &NodeBlueprint, parent_style: Option<&ComputedStyle>, current_path: &mut Vec<usize>, ctx: &InteractionContext<'_>, ) -> LayoutNode
Internal recursive tree builder passing parent style, node path, and full interaction context.
Sourcepub fn append_child_layout_nodes(
blueprint: &NodeBlueprint,
parent_style: Option<&ComputedStyle>,
out: &mut Vec<LayoutNode>,
)
pub fn append_child_layout_nodes( blueprint: &NodeBlueprint, parent_style: Option<&ComputedStyle>, out: &mut Vec<LayoutNode>, )
Recursively flattens Fragment blueprints so child elements splice directly into parent layout contexts.
Sourcepub fn rebuild_layout_tree(&mut self)
pub fn rebuild_layout_tree(&mut self)
Re-evaluates styling with the current interaction state, recomputes layout, and compiles display list.
Sourcepub fn layout_compute_count(&self) -> u64
pub fn layout_compute_count(&self) -> u64
Number of full layout computations performed by this runtime.
Sourcepub fn find_layout_node_mut<'a>(
root: &'a mut LayoutNode,
path: &[usize],
) -> Option<&'a mut LayoutNode>
pub fn find_layout_node_mut<'a>( root: &'a mut LayoutNode, path: &[usize], ) -> Option<&'a mut LayoutNode>
Locates a mutable LayoutNode in the layout hierarchy by its hierarchical tree path.
Sourcepub fn collect_dynamic_text_bindings(
blueprint: &NodeBlueprint,
parent_path: &mut Vec<usize>,
bindings: &mut Vec<DynamicTextBinding>,
)
pub fn collect_dynamic_text_bindings( blueprint: &NodeBlueprint, parent_path: &mut Vec<usize>, bindings: &mut Vec<DynamicTextBinding>, )
Recursively collects dynamic text node bindings with their exact hierarchical paths.
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn ensure_mcp_cursor(&mut self) -> &mut McpCursorState
pub fn ensure_mcp_cursor(&mut self) -> &mut McpCursorState
Ensures that an emulated MCP cursor state is active, initializing it at center viewport if needed.
Sourcepub fn mcp_move_pointer(&mut self, x: f32, y: f32, smooth: bool) -> bool
pub fn mcp_move_pointer(&mut self, x: f32, y: f32, smooth: bool) -> bool
Emulates AI pointer movement to (x, y). Smooth interpolation is enabled by default.
Automatically resolves and applies the element’s CSS cursor style (e.g. pointer, text).
Returns true if a view rebuild or display list redraw is required.
Sourcepub fn mcp_mouse_down(
&mut self,
button: MouseButton,
x: Option<f32>,
y: Option<f32>,
) -> bool
pub fn mcp_mouse_down( &mut self, button: MouseButton, x: Option<f32>, y: Option<f32>, ) -> bool
Emulates AI mouse button down event.
Sourcepub fn mcp_mouse_up(
&mut self,
_button: MouseButton,
x: Option<f32>,
y: Option<f32>,
) -> bool
pub fn mcp_mouse_up( &mut self, _button: MouseButton, x: Option<f32>, y: Option<f32>, ) -> bool
Emulates AI mouse button release up event.
Sourcepub fn mcp_mouse_click(
&mut self,
button: MouseButton,
x: Option<f32>,
y: Option<f32>,
count: usize,
) -> bool
pub fn mcp_mouse_click( &mut self, button: MouseButton, x: Option<f32>, y: Option<f32>, count: usize, ) -> bool
Emulates AI mouse click (press down and release).
Sourcepub fn mcp_mouse_scroll(
&mut self,
delta_x: f32,
delta_y: f32,
x: Option<f32>,
y: Option<f32>,
) -> bool
pub fn mcp_mouse_scroll( &mut self, delta_x: f32, delta_y: f32, x: Option<f32>, y: Option<f32>, ) -> bool
Emulates AI mouse wheel scroll event.
Sourcepub fn mcp_keyboard_type(&mut self, text: &str) -> bool
pub fn mcp_keyboard_type(&mut self, text: &str) -> bool
Emulates AI keyboard character input.
Sourcepub fn mcp_keyboard_key(&mut self, key: KeyCode, modifiers: Modifiers) -> bool
pub fn mcp_keyboard_key(&mut self, key: KeyCode, modifiers: Modifiers) -> bool
Emulates AI key combination or non-character navigation key.
Sourcepub fn mcp_inspect_element(
&self,
x: f32,
y: f32,
) -> (String, Vec<String>, Rect, String, CursorIcon)
pub fn mcp_inspect_element( &self, x: f32, y: f32, ) -> (String, Vec<String>, Rect, String, CursorIcon)
Inspects the layout element at coordinates (x, y) returning tag, CSS classes, bounds, text, and cursor style.
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn apply_viewport_clamps(&mut self)
pub fn apply_viewport_clamps(&mut self)
Shifts every data-clamp-viewport element (popups such as context menus) back inside the
viewport with an 8px margin, using the live viewport size rather than any hardcoded value.
Sourcepub fn get_layout_node_mut<'a>(
root: &'a mut LayoutNode,
path: &[usize],
) -> Option<&'a mut LayoutNode>
pub fn get_layout_node_mut<'a>( root: &'a mut LayoutNode, path: &[usize], ) -> Option<&'a mut LayoutNode>
Traverses the LayoutNode hierarchy down a slice of child indices in O(depth).
Sourcepub fn get_layout_node<'a>(
root: &'a LayoutNode,
path: &[usize],
) -> Option<&'a LayoutNode>
pub fn get_layout_node<'a>( root: &'a LayoutNode, path: &[usize], ) -> Option<&'a LayoutNode>
Traverses the LayoutNode hierarchy down a slice of child indices in O(depth).
Sourcepub fn unapply_scroll_offsets(&mut self)
pub fn unapply_scroll_offsets(&mut self)
Restores any scrollable containers and anchored <Portal> nodes previously translated by
apply_scroll_offsets back to their baseline unshifted coordinates so layout computations
and metric measurements remain invariant.
Sourcepub fn apply_scroll_offsets(&mut self)
pub fn apply_scroll_offsets(&mut self)
Discovers scrollable containers, clamps offsets, translates children, computes scrollbars,
and anchors top-layer <Portal> overlays to their trigger elements’ live post-scroll bounds.
Sourcepub fn resolve_top_layer_portals(&mut self)
pub fn resolve_top_layer_portals(&mut self)
Resolves anchored <Portal> / CSS position-anchor nodes against their trigger elements’
live post-scroll bounding boxes with automatic viewport collision flipping (bottom-end <-> top-end)
and viewport margin shifting.
Sourcepub fn dispatch_scroll(
&mut self,
px: f32,
py: f32,
delta_x: f32,
delta_y: f32,
) -> bool
pub fn dispatch_scroll( &mut self, px: f32, py: f32, delta_x: f32, delta_y: f32, ) -> bool
Dispatches an immediate synchronous scroll wheel delta to the innermost scrollable container under (px, py). Cancels any active kinetic smooth scroll animation. Returns true if a scroll offset changed or a DOM wheel listener handled the event.
Sourcepub fn dispatch_smooth_scroll_action(
&mut self,
px: f32,
py: f32,
delta_x: f32,
delta_y: f32,
) -> (bool, bool)
pub fn dispatch_smooth_scroll_action( &mut self, px: f32, py: f32, delta_x: f32, delta_y: f32, ) -> (bool, bool)
Dispatches a smooth kinetic scroll impulse to the innermost scrollable container under (px, py).
Accumulates velocity for rapid consecutive wheel events and initiates a critically damped
kinetic transition curve with Chromium Blink parity.
Dispatches a smooth scroll or DOM wheel event, returning (wheel_handled, scroll_changed).
Sourcepub fn dispatch_smooth_scroll(
&mut self,
px: f32,
py: f32,
delta_x: f32,
delta_y: f32,
) -> bool
pub fn dispatch_smooth_scroll( &mut self, px: f32, py: f32, delta_x: f32, delta_y: f32, ) -> bool
Dispatches a smooth kinetic scroll impulse to the innermost scrollable container under (px, py).
Returns true if either a DOM wheel listener handled the event or a scroll animation updated.
Sourcepub fn poll_smooth_scroll_at(&mut self, now: Instant) -> bool
pub fn poll_smooth_scroll_at(&mut self, now: Instant) -> bool
Polls and updates active kinetic smooth scroll animation at a specific timestamp. Returns true if a position changed and a redraw is required.
Sourcepub fn poll_smooth_scroll(&mut self) -> bool
pub fn poll_smooth_scroll(&mut self) -> bool
Evaluates active smooth scroll animation at the current instant.
Sourcepub fn scroll_to_top(&mut self, px: f32, py: f32) -> bool
pub fn scroll_to_top(&mut self, px: f32, py: f32) -> bool
Scrolls the innermost scroll container under (px, py) to the very top.
Sourcepub fn scroll_to_bottom(&mut self, px: f32, py: f32) -> bool
pub fn scroll_to_bottom(&mut self, px: f32, py: f32) -> bool
Scrolls the innermost scroll container under (px, py) to the very bottom.
Sourcepub fn scroll_offset_by_id(&self, id: &str) -> (f32, f32)
pub fn scroll_offset_by_id(&self, id: &str) -> (f32, f32)
Returns the live (scroll_left, scroll_top) offset for a scrollable element id.
Sourcepub fn scroll_to_by_id(
&mut self,
id: &str,
scroll_x: f32,
scroll_y: f32,
) -> bool
pub fn scroll_to_by_id( &mut self, id: &str, scroll_x: f32, scroll_y: f32, ) -> bool
Scrolls the scroll container with element id (or the primary scroll container if id is empty)
to (scroll_x, scroll_y), clamping to the container’s maximum scroll bounds and firing EventType::Scroll.
Sourcepub fn scroll_to_top_by_id(&mut self, id: &str) -> bool
pub fn scroll_to_top_by_id(&mut self, id: &str) -> bool
Scrolls the scroll container with element id (or the primary scroll container if id is empty) to the top.
Sourcepub fn scroll_to_bottom_by_id(&mut self, id: &str) -> bool
pub fn scroll_to_bottom_by_id(&mut self, id: &str) -> bool
Scrolls the scroll container with element id (or the primary scroll container if id is empty) to the bottom.
Sourcepub fn scroll_into_view(&mut self, target_id: &str) -> bool
pub fn scroll_into_view(&mut self, target_id: &str) -> bool
Scrolls the nearest enclosing scroll container so that the descendant element with target_id is visible.
Sourcepub fn flush_pending_scroll_commands(&mut self) -> bool
pub fn flush_pending_scroll_commands(&mut self) -> bool
Drains and executes any programmatic scroll commands queued via strata_dom::scroll_to,
scroll_to_top, scroll_to_bottom, or scroll_into_view.
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn render_scrollbars(&mut self)
pub fn render_scrollbars(&mut self)
Renders sleek semi-transparent scrollbar thumbs for all overflowing scroll containers.
Sourcepub fn check_scrollbar_thumb_press(&mut self, px: f32, py: f32) -> bool
pub fn check_scrollbar_thumb_press(&mut self, px: f32, py: f32) -> bool
Checks if a pointer press landed on any active scrollbar thumb or track and starts dragging.
Sourcepub fn poll_scrollbar_drag(&mut self, _px: f32, py: f32) -> bool
pub fn poll_scrollbar_drag(&mut self, _px: f32, py: f32) -> bool
Updates active scrollbar thumb drag during pointer movement.
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn reset_caret_blink(&mut self)
pub fn reset_caret_blink(&mut self)
Resets the caret blink cycle so the insertion caret is immediately solid and visible.
Sourcepub fn poll_caret_blink(&mut self) -> bool
pub fn poll_caret_blink(&mut self) -> bool
Polls caret blink cycle and returns true if blink state toggled (requiring a redraw).
Sourcepub fn sync_active_input_layout(&mut self)
pub fn sync_active_input_layout(&mut self)
Synchronizes the active focused text input’s live buffer and styling into the layout tree.
Sourcepub fn calculate_exact_char_index_at_offset(
text: &str,
rel_x: f32,
font_size: f32,
line_height: f32,
is_mono: bool,
font_family: AtomId,
) -> usize
pub fn calculate_exact_char_index_at_offset( text: &str, rel_x: f32, font_size: f32, line_height: f32, is_mono: bool, font_family: AtomId, ) -> usize
Calculates the exact character index from an x offset within an input using active font metrics and character advances.
Sourcepub fn render_active_input_caret(&mut self)
pub fn render_active_input_caret(&mut self)
Renders the visible insertion caret cursor and selection highlight for the currently focused text input.
Sourcepub fn active_caret_rect(&self) -> Option<Rect>
pub fn active_caret_rect(&self) -> Option<Rect>
Computes the exact bounding box of the active text caret if an input is currently focused.
Sourcepub fn sync_ime_cursor_location<W: PlatformWindow>(&self, window: &mut W)
pub fn sync_ime_cursor_location<W: PlatformWindow>(&self, window: &mut W)
Synchronizes the IME candidate window location with the active caret position.
Sourcepub fn update_gtk_ime_location(&self)
pub fn update_gtk_ime_location(&self)
Directly updates GTK IME context with current caret location if running on Linux GTK.
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn apply_tailwind_classes(
style: &mut ComputedStyle,
classes: &ClassList,
is_hovered: bool,
is_focused: bool,
is_dark: bool,
)
pub fn apply_tailwind_classes( style: &mut ComputedStyle, classes: &ClassList, is_hovered: bool, is_focused: bool, is_dark: bool, )
Full Tailwind CSS class parser supporting hover, focus, and dark mode variants.
Sourcepub fn apply_tailwind_classes_with_pseudo_state(
style: &mut ComputedStyle,
classes: &ClassList,
state: &PseudoState,
)
pub fn apply_tailwind_classes_with_pseudo_state( style: &mut ComputedStyle, classes: &ClassList, state: &PseudoState, )
Full Tailwind CSS class parser supporting hover, focus, active, disabled, dark, and group-* variants.
Sourcepub fn apply_base_tailwind_classes(
style: &mut ComputedStyle,
classes: &ClassList,
state: &PseudoState,
)
pub fn apply_base_tailwind_classes( style: &mut ComputedStyle, classes: &ClassList, state: &PseudoState, )
Applies only non-interactive (base + dark: + disabled:) Tailwind classes.
Sourcepub fn apply_interactive_tailwind_classes(
style: &mut ComputedStyle,
classes: &ClassList,
state: &PseudoState,
)
pub fn apply_interactive_tailwind_classes( style: &mut ComputedStyle, classes: &ClassList, state: &PseudoState, )
Applies only active interactive (hover:, group-hover:, focus:, active:) Tailwind classes.
Sourcepub fn hover_is_paint_only(&self) -> bool
pub fn hover_is_paint_only(&self) -> bool
Returns true when the last hover transition was resolved by a paint-only restyle.
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn find_all(&self, query: &NodeQuery) -> Vec<Vec<usize>>
pub fn find_all(&self, query: &NodeQuery) -> Vec<Vec<usize>>
Returns the tree paths of every element matching query, in document order.
Sourcepub fn find(&self, query: &NodeQuery) -> Option<Vec<usize>>
pub fn find(&self, query: &NodeQuery) -> Option<Vec<usize>>
First (bottom-most in paint order) element matching query.
Sourcepub fn find_last(&self, query: &NodeQuery) -> Option<Vec<usize>>
pub fn find_last(&self, query: &NodeQuery) -> Option<Vec<usize>>
Last (top-most in paint order) element matching query, e.g. a modal’s button when the
same label also exists on the page behind it.
Sourcepub fn find_by_text(&self, text: &str) -> Option<Vec<usize>>
pub fn find_by_text(&self, text: &str) -> Option<Vec<usize>>
Shorthand for find(&NodeQuery::text(text)).
Sourcepub fn find_last_by_text(&self, text: &str) -> Option<Vec<usize>>
pub fn find_last_by_text(&self, text: &str) -> Option<Vec<usize>>
Shorthand for find_last(&NodeQuery::text(text)).
Sourcepub fn find_by_title(&self, title: &str) -> Option<Vec<usize>>
pub fn find_by_title(&self, title: &str) -> Option<Vec<usize>>
Shorthand for find(&NodeQuery::title(title)).
Sourcepub fn find_last_by_title(&self, title: &str) -> Option<Vec<usize>>
pub fn find_last_by_title(&self, title: &str) -> Option<Vec<usize>>
Shorthand for find_last(&NodeQuery::title(title)).
Sourcepub fn node_text(&self, path: &[usize]) -> Option<String>
pub fn node_text(&self, path: &[usize]) -> Option<String>
Rendered text content of the element at path, whitespace-normalized.
Sourcepub fn node_center(&self, path: &[usize]) -> Option<(f32, f32)>
pub fn node_center(&self, path: &[usize]) -> Option<(f32, f32)>
Border-box center of the element at path in window coordinates.
Sourcepub fn click_node(&self, path: &[usize]) -> bool
pub fn click_node(&self, path: &[usize]) -> bool
Clicks the center of the element at path through the normal hit-test path (so an
occluding element receives the click, as for a real pointer). Returns true if a
click listener ran.
Sourcepub fn click(&self, query: &NodeQuery) -> bool
pub fn click(&self, query: &NodeQuery) -> bool
Clicks the first element matching query. Returns false if none matched or no listener ran.
Sourcepub fn click_last(&self, query: &NodeQuery) -> bool
pub fn click_last(&self, query: &NodeQuery) -> bool
Clicks the last (top-most) element matching query.
Sourcepub fn click_text(&self, text: &str) -> bool
pub fn click_text(&self, text: &str) -> bool
Clicks the first element whose text equals text.
Sourcepub fn click_last_text(&self, text: &str) -> bool
pub fn click_last_text(&self, text: &str) -> bool
Clicks the last (top-most) element whose text equals text.
Sourcepub fn click_title(&self, title: &str) -> bool
pub fn click_title(&self, title: &str) -> bool
Clicks the first element whose title or (on button/img) alt equals title; either
attribute may match. See NodeQuery::title.
Sourcepub fn click_last_title(&self, title: &str) -> bool
pub fn click_last_title(&self, title: &str) -> bool
Clicks the last (top-most) element whose title or (on button/img) alt equals title;
either attribute may match. See NodeQuery::title.
Source§impl AppRuntime
impl AppRuntime
Sourcepub fn new(
root_view: View,
viewport_width: f32,
viewport_height: f32,
dpr: f32,
) -> Self
pub fn new( root_view: View, viewport_width: f32, viewport_height: f32, dpr: f32, ) -> Self
Creates and mounts a new application runtime from a root view.
Sourcepub fn tick_frame(&mut self) -> &DisplayList
pub fn tick_frame(&mut self) -> &DisplayList
Re-evaluates layout and compiles display commands for the current frame.
Sourcepub fn interaction_context(&self) -> InteractionContext<'_>
pub fn interaction_context(&self) -> InteractionContext<'_>
Returns the current interaction context.
Sourcepub fn set_dark_mode(&mut self, is_dark: bool) -> bool
pub fn set_dark_mode(&mut self, is_dark: bool) -> bool
Sets the active dark mode state and triggers a layout and style recomputation if changed.
Sourcepub fn set_focus_path(&mut self, path: Option<Vec<usize>>) -> bool
pub fn set_focus_path(&mut self, path: Option<Vec<usize>>) -> bool
Sets the active focused element path and triggers a layout and style recomputation if changed.
Sourcepub fn rebuild_spatial_index(&mut self)
pub fn rebuild_spatial_index(&mut self)
Clears and rebuilds the spatial acceleration index.
Sourcepub fn query_entity_at_point(&self, px: f32, py: f32) -> Option<EntityId>
pub fn query_entity_at_point(&self, px: f32, py: f32) -> Option<EntityId>
Queries the front-most EntityId at point (px, py).
Sourcepub fn query_event_at_point(
&self,
px: f32,
py: f32,
event_type: EventType,
) -> Option<(EntityId, Rc<dyn Fn(Event)>, Rect)>
pub fn query_event_at_point( &self, px: f32, py: f32, event_type: EventType, ) -> Option<(EntityId, Rc<dyn Fn(Event)>, Rect)>
Queries the front-most event listener registered for event_type at point (px, py).
Sourcepub fn find_layout_by_entity(&self, entity_id: EntityId) -> Option<&LayoutNode>
pub fn find_layout_by_entity(&self, entity_id: EntityId) -> Option<&LayoutNode>
Recursively locates a layout node by its EntityId.
Sourcepub fn find_layout_mut_by_entity(
&mut self,
entity_id: EntityId,
) -> Option<&mut LayoutNode>
pub fn find_layout_mut_by_entity( &mut self, entity_id: EntityId, ) -> Option<&mut LayoutNode>
Recursively locates a mutable layout node by its EntityId.
Sourcepub fn find_blueprint_by_entity(
&self,
entity_id: EntityId,
) -> Option<&NodeBlueprint>
pub fn find_blueprint_by_entity( &self, entity_id: EntityId, ) -> Option<&NodeBlueprint>
Recursively locates a blueprint node by its EntityId.
Sourcepub fn query_element_rect(&self, element_id: &str) -> Option<Rect>
pub fn query_element_rect(&self, element_id: &str) -> Option<Rect>
Queries the laid-out border-box rectangle (x, y, width, height) for an element by id.
Sourcepub fn warp_cursor(&mut self, x: f32, y: f32)
pub fn warp_cursor(&mut self, x: f32, y: f32)
Warps the OS pointer to window-local (x, y) and records the target so the
resulting synthetic motion delta is filtered from movement_x / movement_y.
Sourcepub fn set_cursor_position(&mut self, x: f32, y: f32)
pub fn set_cursor_position(&mut self, x: f32, y: f32)
Alias for AppRuntime::warp_cursor.
Sourcepub fn update_element_flex(
&mut self,
element_id: &str,
flex_grow: f32,
flex_shrink: f32,
flex_basis: Option<Dimension>,
) -> bool
pub fn update_element_flex( &mut self, element_id: &str, flex_grow: f32, flex_shrink: f32, flex_basis: Option<Dimension>, ) -> bool
Updates flex_grow, flex_shrink, and optional flex_basis on the layout node
matching element_id in-place, invalidating only its ancestor chain’s layout cache.
Sourcepub fn update_split_ratios(&mut self, updates: &[(&str, f32)]) -> bool
pub fn update_split_ratios(&mut self, updates: &[(&str, f32)]) -> bool
Updates flex_grow ratios for multiple element_ids in-place and runs an isolated
layout-only pass without rebuilding the DOM, stylesheets, or IR graph.
Sourcepub fn relayout_in_place(&mut self)
pub fn relayout_in_place(&mut self)
Recomputes layout, scroll/viewport clamps, resize observers, spatial index, and
display list in-place without rebuilding layout_root or ir_graph.
Sourcepub fn dispatch_resize_observers(&mut self) -> bool
pub fn dispatch_resize_observers(&mut self) -> bool
Dispatches EventType::Resize (onresize) callbacks for any element whose laid-out
(width, height) changed since the last observation. Returns true if any callback fired.
Sourcepub fn update_view(&mut self, new_view: View)
pub fn update_view(&mut self, new_view: View)
Updates the application root view, incrementally reconciling unchanged subtrees and compiling a new display list.
Sourcepub fn sync_dynamic_text(&mut self) -> bool
pub fn sync_dynamic_text(&mut self) -> bool
Evaluates registered fine-grained dynamic text closures and updates target layout nodes directly in-place without rebuilding the blueprint tree or calling root view functions. Returns true if any text value changed and triggered a frame update.
Sourcepub fn cursor_theme(&self) -> &CursorTheme
pub fn cursor_theme(&self) -> &CursorTheme
System cursor theme, loaded on first use. Reading cursor files from disk costs several milliseconds and only the MCP cursor overlay needs it.
Sourcepub fn mark_viewport_3d_dirty(&mut self)
pub fn mark_viewport_3d_dirty(&mut self)
Marks only 3D viewports dirty without invalidating 2D layout or recompiling the display list.
Sourcepub fn poll_retained_3d_dirty(&self) -> bool
pub fn poll_retained_3d_dirty(&self) -> bool
Returns true when any retained 3D viewport has newer camera/geometry/overlay generations
than what was last presented, or when viewport_3d_dirty was set explicitly.
Sourcepub fn acknowledge_retained_3d_presented(&mut self)
pub fn acknowledge_retained_3d_presented(&mut self)
Records the current generations of all tracked [RetainedScene3D] handles as presented.
Sourcepub fn has_uncapped_canvas3d(&self) -> bool
pub fn has_uncapped_canvas3d(&self) -> bool
Returns true if any <Canvas3D> in the current blueprint opted into uncapped presentation.
Sourcepub fn mark_paint_dirty(&mut self)
pub fn mark_paint_dirty(&mut self)
Marks the compiled display list stale so the next dirty-gated compile rebuilds it.
Sourcepub fn is_paint_dirty(&self) -> bool
pub fn is_paint_dirty(&self) -> bool
Whether the display list is stale relative to runtime state.
Sourcepub fn compiles_skipped(&self) -> u64
pub fn compiles_skipped(&self) -> u64
Number of dirty-gated compiles that were skipped as unchanged.
Sourcepub fn compile_display_list_if_dirty(&mut self) -> bool
pub fn compile_display_list_if_dirty(&mut self) -> bool
Compiles the display list only when something changed since the last compile. Returns true when a compile ran.
Sourcepub fn compile_display_list(&mut self)
pub fn compile_display_list(&mut self)
Generates draw commands for all computed layout rectangles using the 7-layer CSS compositor with spatial viewport scissoring.
Sourcepub fn gpu_path_segments(&self) -> &[GpuPathSegment]
pub fn gpu_path_segments(&self) -> &[GpuPathSegment]
Returns the compiled GPU path segments from the latest frame.
Sourcepub fn gpu_path_uniform_bytes(&self) -> &[u8] ⓘ
pub fn gpu_path_uniform_bytes(&self) -> &[u8] ⓘ
Returns the raw uniform bytes for the GPU path compute pipeline.
Sourcepub fn step_event(&mut self, event: &PlatformEvent) -> bool
pub fn step_event(&mut self, event: &PlatformEvent) -> bool
Processes an incoming platform event, updating viewport/scale or dispatching synthetic events. Returns true if a dirty layout or presentation redraw was triggered.
Sourcepub fn layout_computations(&self) -> u64
pub fn layout_computations(&self) -> u64
Number of full layout computations performed by this runtime.
Sourcepub fn last_update_reconciled(&self) -> bool
pub fn last_update_reconciled(&self) -> bool
True when the most recent update_view reconciled the existing layout tree in place.
Sourcepub fn frame_profile(&self) -> FrameProfile
pub fn frame_profile(&self) -> FrameProfile
Phase timings accumulated since the last presented frame.
Sourcepub fn set_frame_profile_hook(
&mut self,
hook: Option<Box<dyn FnMut(&FrameProfile)>>,
)
pub fn set_frame_profile_hook( &mut self, hook: Option<Box<dyn FnMut(&FrameProfile)>>, )
Registers an observer called with each completed FrameProfile.
Sourcepub fn record_raster_time(&mut self, elapsed: Duration)
pub fn record_raster_time(&mut self, elapsed: Duration)
Adds time spent rasterizing, for presenting backends that rasterize outside the runtime.
Sourcepub fn record_present_time(&mut self, elapsed: Duration)
pub fn record_present_time(&mut self, elapsed: Duration)
Adds time spent presenting, for backends that present outside the runtime.
Sourcepub fn finish_frame_profile(&mut self) -> FrameProfile
pub fn finish_frame_profile(&mut self) -> FrameProfile
Publishes the accumulated profile to the hook and starts a fresh frame. Returns the profile that was completed.
Sourcepub fn render_frame<P: SurfacePresenter>(
&mut self,
compositor: &mut SwapchainCompositor,
presenter: &mut P,
force_redraw: bool,
) -> Result<bool, PresentError>
pub fn render_frame<P: SurfacePresenter>( &mut self, compositor: &mut SwapchainCompositor, presenter: &mut P, force_redraw: bool, ) -> Result<bool, PresentError>
Renders the current frame and presents it to the given surface presenter via the swapchain compositor.
Sourcepub fn run_with_window<W, E, P>(
&mut self,
window: &mut W,
event_loop: &mut E,
compositor: &mut SwapchainCompositor,
presenter: &mut P,
)
pub fn run_with_window<W, E, P>( &mut self, window: &mut W, event_loop: &mut E, compositor: &mut SwapchainCompositor, presenter: &mut P, )
Runs the reactive event loop against a live platform window and surface presenter.
Sourcepub fn render_to_framebuffer(&mut self) -> FrameBuffer
pub fn render_to_framebuffer(&mut self) -> FrameBuffer
Rasterizes the current application frame to an offscreen headless FrameBuffer.