pub struct StyleState { /* private fields */ }Expand description
Per-node style slot holding local and shared style entries (LPAR-07 §7.1).
This type is stored in an Option<Box<StyleState>> on [ObjectNode]
(the style field), following the same lazy-alloc pattern as
ScrollState (LPAR-05) and NodeAnimSet (LPAR-06). The slot is None
for nodes that carry no style overrides, keeping ObjectNode small.
Style entries are keyed by Selector and carry a StylePatch.
- Transition override (Tier 0) — highest precedence; written by
active
start_transitionanimations. - Local entries are owned by the node (
add_local_style). They take priority over added entries. - Added (shared) entries are
'staticreferences (add_style). Lower precedence than local entries.
Within each tier, the last-added entry wins for a given matching selector (§7.2 reverse-registration-order rule).
Implementations§
Source§impl StyleState
impl StyleState
Sourcepub fn transition_override_handle(&self) -> Rc<RefCell<TransitionOverride>>
pub fn transition_override_handle(&self) -> Rc<RefCell<TransitionOverride>>
Return a cloned handle to the transition override slot.
Callers (typically start_transition) clone this handle so that
animation apply closures can share ownership of the override cell
without holding a borrow on the crate::object::ObjectNode.
Sourcepub fn local_entries(&self) -> &[(Selector, StylePatch)]
pub fn local_entries(&self) -> &[(Selector, StylePatch)]
Return the local style entries as a (Selector, StylePatch) slice.
Used by crate::layout::resolve_layout_style to iterate local entries
in precedence order.
Sourcepub fn added_entries(&self) -> &[(Selector, &'static StylePatch)]
pub fn added_entries(&self) -> &[(Selector, &'static StylePatch)]
Return the added (shared) style entries as a (Selector, &StylePatch) slice.
Used by crate::layout::resolve_layout_style to iterate added entries
in precedence order.