pub struct StackingPlan {
pub root: Option<ScopeIdx>,
pub top_layers: Vec<TopLayerScope>,
pub scopes: Vec<StackingScope>,
pub ordered_items: Vec<StackingItem>,
pub clips: Vec<ClipScrollNode>,
pub node_to_scope: Vec<ScopeIdx>,
pub node_to_item: Vec<u32>,
/* private fields */
}Expand description
Flat, zero-allocation reusable CSS 2.1 Appendix E stacking tree and clip/scroll graph.
Fields§
§root: Option<ScopeIdx>§top_layers: Vec<TopLayerScope>§scopes: Vec<StackingScope>§ordered_items: Vec<StackingItem>§clips: Vec<ClipScrollNode>§node_to_scope: Vec<ScopeIdx>Dense NodeId::index() -> ScopeIdx (ScopeIdx::NONE if leaf/absent).
node_to_item: Vec<u32>Dense NodeId::index() -> index in ordered_items (u32::MAX if root/absent).
Implementations§
Source§impl StackingPlan
impl StackingPlan
Sourcepub fn build<S: StackingStyleSource>(
&mut self,
store: &NodeStore,
open_overlays: &[ResolvedOverlay],
style: &S,
)
pub fn build<S: StackingStyleSource>( &mut self, store: &NodeStore, open_overlays: &[ResolvedOverlay], style: &S, )
Rebuilds the entire stacking tree and clip/scroll graph in-place with 0 steady-state heap allocations once capacity is warm.
Source§impl StackingPlan
impl StackingPlan
pub fn clear(&mut self)
pub fn is_empty(&self) -> bool
pub fn scope_items(&self, scope: ScopeIdx) -> &[StackingItem]
pub fn scope_for_node(&self, id: NodeId) -> Option<ScopeIdx>
pub fn item_idx_for_node(&self, id: NodeId) -> Option<usize>
pub fn clip_depth(&self, idx: ClipScrollIdx) -> u16
Sourcepub fn lca_clip(&self, a: ClipScrollIdx, b: ClipScrollIdx) -> ClipScrollIdx
pub fn lca_clip(&self, a: ClipScrollIdx, b: ClipScrollIdx) -> ClipScrollIdx
Lowest common ancestor of two ClipScrollIdx handles in O(|depth_a - depth_b| + hops).
Sourcepub fn resort_scope_in_place(&mut self, scope: ScopeIdx)
pub fn resort_scope_in_place(&mut self, scope: ScopeIdx)
Re-sorts one scope’s existing ordered_items span in place with 0 heap allocations
(called on 120 Hz COMPOSITE z_index changes that preserve SC membership).
Sourcepub fn sc_item_z_changed(&self, id: NodeId, new_z: i32) -> bool
pub fn sc_item_z_changed(&self, id: NodeId, new_z: i32) -> bool
Returns true iff id is a RealStackingContext item whose recorded z_index or bucket
differs from new_z (read-only check for speculative fast-path bail-outs before mutating).
Sourcepub fn update_sc_item_z(&mut self, id: NodeId, new_z: i32) -> Option<ScopeIdx>
pub fn update_sc_item_z(&mut self, id: NodeId, new_z: i32) -> Option<ScopeIdx>
Updates an existing RealStackingContext item’s z_index & bucket in-place and returns
its owning scope for Self::resort_scope_in_place.
Sourcepub fn has_transform_mismatch<S: StackingStyleSource>(
&self,
store: &NodeStore,
style: &S,
) -> bool
pub fn has_transform_mismatch<S: StackingStyleSource>( &self, store: &NodeStore, style: &S, ) -> bool
Returns true iff any live box in this plan disagrees with style.has_transform(store, id).
Used by LaidOutScene::hit_test_where_with_transform to detect live animated transform
transitions (identity <-> non-identity) without a store commit while staying 0-alloc.