pub struct LayoutCache {
pub tree: Option<LayoutTree>,
pub calculated_positions: BTreeMap<usize, LogicalPosition>,
pub viewport: Option<LogicalRect>,
pub scroll_ids: BTreeMap<usize, u64>,
pub scroll_id_to_node_id: BTreeMap<u64, NodeId>,
pub counters: BTreeMap<(usize, String), i32>,
pub float_cache: BTreeMap<usize, FloatingContext>,
}Expand description
The persistent cache that holds the layout state between frames.
Fields§
§tree: Option<LayoutTree>The fully laid-out tree from the previous frame. This is our primary cache.
calculated_positions: BTreeMap<usize, LogicalPosition>The final, absolute positions of all nodes from the previous frame.
viewport: Option<LogicalRect>The viewport size from the last layout pass, used to detect resizes.
scroll_ids: BTreeMap<usize, u64>Stable scroll IDs computed from node_data_hash (layout index -> scroll ID)
scroll_id_to_node_id: BTreeMap<u64, NodeId>Mapping from scroll ID to DOM NodeId for hit testing
counters: BTreeMap<(usize, String), i32>CSS counter values for each node and counter name. Key: (layout_index, counter_name), Value: counter value This stores the computed counter values after processing counter-reset and counter-increment.
float_cache: BTreeMap<usize, FloatingContext>Cache of positioned floats for each BFC node (layout_index -> FloatingContext). This persists float positions across multiple layout passes, ensuring IFC children always have access to correct float exclusions even when layout is recalculated.
Trait Implementations§
Source§impl Clone for LayoutCache
impl Clone for LayoutCache
Source§fn clone(&self) -> LayoutCache
fn clone(&self) -> LayoutCache
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LayoutCache
impl Debug for LayoutCache
Source§impl Default for LayoutCache
impl Default for LayoutCache
Source§fn default() -> LayoutCache
fn default() -> LayoutCache
Auto Trait Implementations§
impl Freeze for LayoutCache
impl RefUnwindSafe for LayoutCache
impl Send for LayoutCache
impl Sync for LayoutCache
impl Unpin for LayoutCache
impl UnwindSafe for LayoutCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more