pub enum SystemChange {
Show 30 variants
TextSelectionClick {
position: LogicalPosition,
timestamp: Instant,
},
TextSelectionDrag {
start_position: LogicalPosition,
current_position: LogicalPosition,
},
ApplySelectionOp {
target: DomNodeId,
op: SelectionOp,
seat_id: u64,
},
CopyToClipboard,
CutToClipboard {
target: DomNodeId,
},
PasteFromClipboard,
SelectAllText,
UndoTextEdit {
target: DomNodeId,
},
RedoTextEdit {
target: DomNodeId,
},
AddCursorAtClick {
position: LogicalPosition,
},
SelectNextOccurrence {
target: DomNodeId,
},
SeatShortcut {
seat_id: u64,
target: DomNodeId,
shortcut: KeyboardShortcut,
},
ApplyPendingTextInput,
ApplyTextChangeset,
ActivateNodeDrag {
dom_id: DomId,
node_id: NodeId,
},
ActivateWindowDrag,
InitDragVisualState,
SetDragOverState {
target: DomNodeId,
active: bool,
},
UpdateDropTarget {
target: DomNodeId,
},
UpdateDragGpuTransform,
DeactivateDrag,
SetSeatFocus {
seat_id: u64,
new_focus: Option<DomNodeId>,
old_focus: Option<DomNodeId>,
},
SetFocus {
new_focus: Option<DomNodeId>,
old_focus: Option<DomNodeId>,
visible: bool,
},
ClearAllSelections,
FinalizePendingFocusChanges,
ScrollSelectionIntoView,
ScrollNodeIntoView {
target: DomNodeId,
},
ScrollCursorIntoViewAfterTextInput,
StartAutoScrollTimer,
StopAutoScrollTimer,
}Expand description
Framework-determined side effects (system changes).
Unlike CallbackChange (from user callbacks), these are determined by the
framework’s event analysis: hit tests, gesture detection, focus rules,
text selection, keyboard shortcuts, etc.
Both CallbackChange (user) and SystemChange (framework) are processed
through exhaustive match on PlatformWindowV2 — adding a new variant
causes a compile error in apply_system_change().
Variants§
TextSelectionClick
Advance layout animations by an EXACT step, bypassing the wall clock.
Only the E2E surface emits this. A headless scenario cannot sample real
time: the same test would land on a different point of the curve on a
fast machine than a slow one, so any assertion mid-flight would be
flaky. Stepping by a fixed dt makes the trajectory a pure function of
how many times this ran.
A SystemChange rather than a direct call because CallbackInfo hands
out &LayoutWindow only — mutation is required to go through this
channel, which is also where the mutable window actually exists.
Process a mouse click for text selection (single/double/triple click).
TextSelectionDrag
Extend text selection via mouse drag.
ApplySelectionOp
Unified selection operation: cursor movement, selection extension, or deletion.
Replaces the old ArrowKeyNavigation and DeleteTextSelection variants.
Every keyboard shortcut maps to a single SelectionOp — see its docs.
Fields
op: SelectionOpCopyToClipboard
Copy selected text to system clipboard (Ctrl+C / Cmd+C).
CutToClipboard
Cut selected text to clipboard and delete (Ctrl+X / Cmd+X).
PasteFromClipboard
Paste text from system clipboard at cursor (Ctrl+V / Cmd+V).
SelectAllText
Select all text in focused node (Ctrl+A / Cmd+A).
UndoTextEdit
Undo last text edit (Ctrl+Z / Cmd+Z).
RedoTextEdit
Redo last undone edit (Ctrl+Y / Ctrl+Shift+Z / Cmd+Shift+Z).
AddCursorAtClick
Add a cursor at the clicked position (Ctrl+Click). The position will be hit-tested to find the text cursor location.
Fields
position: LogicalPositionSelectNextOccurrence
Select the next occurrence of the current selection’s text (Ctrl+D). If the primary selection is a cursor, expand it to the word first.
SeatShortcut
A NON-primary seat’s editing shortcut (9b-ii-a-i-d-ii-b-i): Copy / Cut / Paste / Select-all / Undo / Redo on THAT seat’s focus and caret. The primary’s shortcuts stay the dedicated variants above.
ApplyPendingTextInput
Apply pending text input from platform (keyboard/IME).
ApplyTextChangeset
Apply text changeset (incremental relayout).
ActivateNodeDrag
Activate node drag on a draggable element.
ActivateWindowDrag
Activate window drag (CSD titlebar).
InitDragVisualState
Set up drag visual state (:dragging pseudo-state, GPU transform key).
SetDragOverState
Set :drag-over pseudo-state on a target node.
UpdateDropTarget
Update current drop target in drag context.
UpdateDragGpuTransform
Update GPU transform for active node drag.
DeactivateDrag
End drag: clear pseudo-states, remove GPU keys, end drag session.
SetSeatFocus
Move a NON-primary seat’s focus (9b-ii-a-i-d): only that seat’s
entry changes - no :focus restyle, no caret / blink timer, no soft
keyboard, which all follow the primary’s focus (the text-edit session
is one). A primary-seat change is SetFocus.
SetFocus
Change focus to a new target (or clear focus if None).
Handles: set_focused_node, apply_focus_restyle, scroll_node_into_view,
cursor_blink_timer start/stop.
Fields
visible: boolShould this focus be INDICATED - the W3C :focus-visible question.
It travels WITH the change because the handler restyles and regenerates the display list, and the focus ring is emitted by that regeneration. Setting the flag afterwards (which the shell used to do for the keyboard route) means the frame that was just built did not know focus was indicated, so the ring only appeared on whatever repaint happened NEXT - a click, a resize. On the device that read as “Tab does not ring anything until you click something”, while the E2E harness - which happened to set the flag first - showed a ring and passed (device report, 2026-09-01).
ClearAllSelections
Clear all text selections.
FinalizePendingFocusChanges
Finalize pending focus changes (cursor initialization after layout).
ScrollSelectionIntoView
Scroll cursor/selection into view.
ScrollNodeIntoView
Scroll a specific node into view.
ScrollCursorIntoViewAfterTextInput
Scroll cursor into view after text input (needs relayout first).
StartAutoScrollTimer
Start auto-scroll timer for drag-to-scroll (60Hz).
StopAutoScrollTimer
Cancel auto-scroll timer.
Trait Implementations§
Source§impl Clone for SystemChange
impl Clone for SystemChange
Source§fn clone(&self) -> SystemChange
fn clone(&self) -> SystemChange
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more