Skip to main content

StackingPlan

Struct StackingPlan 

Source
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

Source

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

Source

pub fn clear(&mut self)

Source

pub fn is_empty(&self) -> bool

Source

pub fn scope_items(&self, scope: ScopeIdx) -> &[StackingItem]

Source

pub fn scope_for_node(&self, id: NodeId) -> Option<ScopeIdx>

Source

pub fn item_idx_for_node(&self, id: NodeId) -> Option<usize>

Source

pub fn clip_depth(&self, idx: ClipScrollIdx) -> u16

Source

pub fn lca_clip(&self, a: ClipScrollIdx, b: ClipScrollIdx) -> ClipScrollIdx

Lowest common ancestor of two ClipScrollIdx handles in O(|depth_a - depth_b| + hops).

Source

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).

Source

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).

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for StackingPlan

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StackingPlan

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StackingPlan

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.