pub struct CompactLayoutCache {
pub tier1_enums: Vec<u64>,
pub tier2_dims: Vec<CompactNodeProps>,
pub tier2b_text: Vec<CompactTextProps>,
pub tier3_overflow: Vec<Option<Box<CompactOverflowProps>>>,
}Expand description
Three-tier compact layout property cache.
Allocated once per restyle, indexed by node index (same as NodeId). Provides O(1) array-indexed access to all layout properties.
Fields§
§tier1_enums: Vec<u64>Tier 1: ALL enum properties bitpacked into u64 per node (8 B/node)
tier2_dims: Vec<CompactNodeProps>Tier 2: Numeric dimensions per node (64 B/node)
tier2b_text: Vec<CompactTextProps>Tier 2b: Text/IFC properties per node (24 B/node)
tier3_overflow: Vec<Option<Box<CompactOverflowProps>>>Tier 3: Overflow map for rare/complex properties (8 B/node, usually None)
Implementations§
Source§impl CompactLayoutCache
impl CompactLayoutCache
Sourcepub fn with_capacity(node_count: usize) -> Self
pub fn with_capacity(node_count: usize) -> Self
Create a cache pre-allocated for node_count nodes, filled with defaults.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Number of nodes in this cache.
pub fn get_display(&self, node_idx: usize) -> LayoutDisplay
pub fn get_position(&self, node_idx: usize) -> LayoutPosition
pub fn get_float(&self, node_idx: usize) -> LayoutFloat
pub fn get_overflow_x(&self, node_idx: usize) -> LayoutOverflow
pub fn get_overflow_y(&self, node_idx: usize) -> LayoutOverflow
pub fn get_box_sizing(&self, node_idx: usize) -> LayoutBoxSizing
pub fn get_flex_direction(&self, node_idx: usize) -> LayoutFlexDirection
pub fn get_flex_wrap(&self, node_idx: usize) -> LayoutFlexWrap
pub fn get_justify_content(&self, node_idx: usize) -> LayoutJustifyContent
pub fn get_align_items(&self, node_idx: usize) -> LayoutAlignItems
pub fn get_align_content(&self, node_idx: usize) -> LayoutAlignContent
pub fn get_writing_mode(&self, node_idx: usize) -> LayoutWritingMode
pub fn get_clear(&self, node_idx: usize) -> LayoutClear
pub fn get_font_weight(&self, node_idx: usize) -> StyleFontWeight
pub fn get_font_style(&self, node_idx: usize) -> StyleFontStyle
pub fn get_text_align(&self, node_idx: usize) -> StyleTextAlign
pub fn get_visibility(&self, node_idx: usize) -> StyleVisibility
pub fn get_white_space(&self, node_idx: usize) -> StyleWhiteSpace
pub fn get_direction(&self, node_idx: usize) -> StyleDirection
pub fn get_vertical_align(&self, node_idx: usize) -> StyleVerticalAlign
pub fn get_border_collapse(&self, node_idx: usize) -> StyleBorderCollapse
Sourcepub fn get_width_raw(&self, node_idx: usize) -> u32
pub fn get_width_raw(&self, node_idx: usize) -> u32
Get width as encoded u32 (use decode_pixel_value_u32 or check sentinel).
pub fn get_height_raw(&self, node_idx: usize) -> u32
pub fn get_min_width_raw(&self, node_idx: usize) -> u32
pub fn get_max_width_raw(&self, node_idx: usize) -> u32
pub fn get_min_height_raw(&self, node_idx: usize) -> u32
pub fn get_max_height_raw(&self, node_idx: usize) -> u32
pub fn get_font_size_raw(&self, node_idx: usize) -> u32
pub fn get_flex_basis_raw(&self, node_idx: usize) -> u32
Sourcepub fn get_padding_top(&self, node_idx: usize) -> Option<f32>
pub fn get_padding_top(&self, node_idx: usize) -> Option<f32>
Get padding-top as resolved px. Returns None if sentinel (needs slow path).
pub fn get_padding_right(&self, node_idx: usize) -> Option<f32>
pub fn get_padding_bottom(&self, node_idx: usize) -> Option<f32>
pub fn get_padding_left(&self, node_idx: usize) -> Option<f32>
pub fn get_margin_top(&self, node_idx: usize) -> Option<f32>
pub fn get_margin_right(&self, node_idx: usize) -> Option<f32>
pub fn get_margin_bottom(&self, node_idx: usize) -> Option<f32>
pub fn get_margin_left(&self, node_idx: usize) -> Option<f32>
Sourcepub fn is_margin_top_auto(&self, node_idx: usize) -> bool
pub fn is_margin_top_auto(&self, node_idx: usize) -> bool
Check if margin is Auto (important for centering logic).
pub fn is_margin_right_auto(&self, node_idx: usize) -> bool
pub fn is_margin_bottom_auto(&self, node_idx: usize) -> bool
pub fn is_margin_left_auto(&self, node_idx: usize) -> bool
pub fn get_border_top_width(&self, node_idx: usize) -> Option<f32>
pub fn get_border_right_width(&self, node_idx: usize) -> Option<f32>
pub fn get_border_bottom_width(&self, node_idx: usize) -> Option<f32>
pub fn get_border_left_width(&self, node_idx: usize) -> Option<f32>
pub fn get_padding_top_raw(&self, node_idx: usize) -> i16
pub fn get_padding_right_raw(&self, node_idx: usize) -> i16
pub fn get_padding_bottom_raw(&self, node_idx: usize) -> i16
pub fn get_padding_left_raw(&self, node_idx: usize) -> i16
pub fn get_margin_top_raw(&self, node_idx: usize) -> i16
pub fn get_margin_right_raw(&self, node_idx: usize) -> i16
pub fn get_margin_bottom_raw(&self, node_idx: usize) -> i16
pub fn get_margin_left_raw(&self, node_idx: usize) -> i16
pub fn get_border_top_width_raw(&self, node_idx: usize) -> i16
pub fn get_border_right_width_raw(&self, node_idx: usize) -> i16
pub fn get_border_bottom_width_raw(&self, node_idx: usize) -> i16
pub fn get_border_left_width_raw(&self, node_idx: usize) -> i16
pub fn get_top(&self, node_idx: usize) -> i16
pub fn get_right(&self, node_idx: usize) -> i16
pub fn get_bottom(&self, node_idx: usize) -> i16
pub fn get_left(&self, node_idx: usize) -> i16
pub fn get_flex_grow(&self, node_idx: usize) -> Option<f32>
pub fn get_flex_shrink(&self, node_idx: usize) -> Option<f32>
pub fn get_z_index(&self, node_idx: usize) -> i16
pub fn get_border_top_color_raw(&self, node_idx: usize) -> u32
pub fn get_border_right_color_raw(&self, node_idx: usize) -> u32
pub fn get_border_bottom_color_raw(&self, node_idx: usize) -> u32
pub fn get_border_left_color_raw(&self, node_idx: usize) -> u32
pub fn get_border_styles_packed(&self, node_idx: usize) -> u16
pub fn get_border_top_style(&self, node_idx: usize) -> BorderStyle
pub fn get_border_right_style(&self, node_idx: usize) -> BorderStyle
pub fn get_border_bottom_style(&self, node_idx: usize) -> BorderStyle
pub fn get_border_left_style(&self, node_idx: usize) -> BorderStyle
pub fn get_border_spacing_h_raw(&self, node_idx: usize) -> i16
pub fn get_border_spacing_v_raw(&self, node_idx: usize) -> i16
pub fn get_tab_size_raw(&self, node_idx: usize) -> i16
pub fn get_text_color_raw(&self, node_idx: usize) -> u32
pub fn get_font_family_hash(&self, node_idx: usize) -> u64
pub fn get_line_height(&self, node_idx: usize) -> Option<f32>
pub fn get_letter_spacing(&self, node_idx: usize) -> Option<f32>
pub fn get_word_spacing(&self, node_idx: usize) -> Option<f32>
pub fn get_text_indent(&self, node_idx: usize) -> Option<f32>
Sourcepub fn get_overflow_prop(
&self,
node_idx: usize,
prop: &CssPropertyType,
) -> Option<&CssProperty>
pub fn get_overflow_prop( &self, node_idx: usize, prop: &CssPropertyType, ) -> Option<&CssProperty>
Get overflow properties for a node (usually None).
Sourcepub fn set_overflow_prop(
&mut self,
node_idx: usize,
prop: CssPropertyType,
value: CssProperty,
)
pub fn set_overflow_prop( &mut self, node_idx: usize, prop: CssPropertyType, value: CssProperty, )
Insert a property into the Tier 3 overflow map for a node.
Trait Implementations§
Source§impl Clone for CompactLayoutCache
impl Clone for CompactLayoutCache
Source§fn clone(&self) -> CompactLayoutCache
fn clone(&self) -> CompactLayoutCache
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more