Skip to main content

CompactLayoutCache

Struct CompactLayoutCache 

Source
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

Source

pub fn empty() -> Self

Create an empty cache (no nodes).

Source

pub fn with_capacity(node_count: usize) -> Self

Create a cache pre-allocated for node_count nodes, filled with defaults.

Source

pub fn node_count(&self) -> usize

Number of nodes in this cache.

Source

pub fn get_display(&self, node_idx: usize) -> LayoutDisplay

Source

pub fn get_position(&self, node_idx: usize) -> LayoutPosition

Source

pub fn get_float(&self, node_idx: usize) -> LayoutFloat

Source

pub fn get_overflow_x(&self, node_idx: usize) -> LayoutOverflow

Source

pub fn get_overflow_y(&self, node_idx: usize) -> LayoutOverflow

Source

pub fn get_box_sizing(&self, node_idx: usize) -> LayoutBoxSizing

Source

pub fn get_flex_direction(&self, node_idx: usize) -> LayoutFlexDirection

Source

pub fn get_flex_wrap(&self, node_idx: usize) -> LayoutFlexWrap

Source

pub fn get_justify_content(&self, node_idx: usize) -> LayoutJustifyContent

Source

pub fn get_align_items(&self, node_idx: usize) -> LayoutAlignItems

Source

pub fn get_align_content(&self, node_idx: usize) -> LayoutAlignContent

Source

pub fn get_writing_mode(&self, node_idx: usize) -> LayoutWritingMode

Source

pub fn get_clear(&self, node_idx: usize) -> LayoutClear

Source

pub fn get_font_weight(&self, node_idx: usize) -> StyleFontWeight

Source

pub fn get_font_style(&self, node_idx: usize) -> StyleFontStyle

Source

pub fn get_text_align(&self, node_idx: usize) -> StyleTextAlign

Source

pub fn get_visibility(&self, node_idx: usize) -> StyleVisibility

Source

pub fn get_white_space(&self, node_idx: usize) -> StyleWhiteSpace

Source

pub fn get_direction(&self, node_idx: usize) -> StyleDirection

Source

pub fn get_vertical_align(&self, node_idx: usize) -> StyleVerticalAlign

Source

pub fn get_border_collapse(&self, node_idx: usize) -> StyleBorderCollapse

Source

pub fn get_width_raw(&self, node_idx: usize) -> u32

Get width as encoded u32 (use decode_pixel_value_u32 or check sentinel).

Source

pub fn get_height_raw(&self, node_idx: usize) -> u32

Source

pub fn get_min_width_raw(&self, node_idx: usize) -> u32

Source

pub fn get_max_width_raw(&self, node_idx: usize) -> u32

Source

pub fn get_min_height_raw(&self, node_idx: usize) -> u32

Source

pub fn get_max_height_raw(&self, node_idx: usize) -> u32

Source

pub fn get_font_size_raw(&self, node_idx: usize) -> u32

Source

pub fn get_flex_basis_raw(&self, node_idx: usize) -> u32

Source

pub fn get_padding_top(&self, node_idx: usize) -> Option<f32>

Get padding-top as resolved px. Returns None if sentinel (needs slow path).

Source

pub fn get_padding_right(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_padding_bottom(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_padding_left(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_margin_top(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_margin_right(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_margin_bottom(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_margin_left(&self, node_idx: usize) -> Option<f32>

Source

pub fn is_margin_top_auto(&self, node_idx: usize) -> bool

Check if margin is Auto (important for centering logic).

Source

pub fn is_margin_right_auto(&self, node_idx: usize) -> bool

Source

pub fn is_margin_bottom_auto(&self, node_idx: usize) -> bool

Source

pub fn is_margin_left_auto(&self, node_idx: usize) -> bool

Source

pub fn get_border_top_width(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_border_right_width(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_border_bottom_width(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_border_left_width(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_padding_top_raw(&self, node_idx: usize) -> i16

Source

pub fn get_padding_right_raw(&self, node_idx: usize) -> i16

Source

pub fn get_padding_bottom_raw(&self, node_idx: usize) -> i16

Source

pub fn get_padding_left_raw(&self, node_idx: usize) -> i16

Source

pub fn get_margin_top_raw(&self, node_idx: usize) -> i16

Source

pub fn get_margin_right_raw(&self, node_idx: usize) -> i16

Source

pub fn get_margin_bottom_raw(&self, node_idx: usize) -> i16

Source

pub fn get_margin_left_raw(&self, node_idx: usize) -> i16

Source

pub fn get_border_top_width_raw(&self, node_idx: usize) -> i16

Source

pub fn get_border_right_width_raw(&self, node_idx: usize) -> i16

Source

pub fn get_border_bottom_width_raw(&self, node_idx: usize) -> i16

Source

pub fn get_border_left_width_raw(&self, node_idx: usize) -> i16

Source

pub fn get_top(&self, node_idx: usize) -> i16

Source

pub fn get_right(&self, node_idx: usize) -> i16

Source

pub fn get_bottom(&self, node_idx: usize) -> i16

Source

pub fn get_left(&self, node_idx: usize) -> i16

Source

pub fn get_flex_grow(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_flex_shrink(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_z_index(&self, node_idx: usize) -> i16

Source

pub fn get_border_top_color_raw(&self, node_idx: usize) -> u32

Source

pub fn get_border_right_color_raw(&self, node_idx: usize) -> u32

Source

pub fn get_border_bottom_color_raw(&self, node_idx: usize) -> u32

Source

pub fn get_border_left_color_raw(&self, node_idx: usize) -> u32

Source

pub fn get_border_styles_packed(&self, node_idx: usize) -> u16

Source

pub fn get_border_top_style(&self, node_idx: usize) -> BorderStyle

Source

pub fn get_border_right_style(&self, node_idx: usize) -> BorderStyle

Source

pub fn get_border_bottom_style(&self, node_idx: usize) -> BorderStyle

Source

pub fn get_border_left_style(&self, node_idx: usize) -> BorderStyle

Source

pub fn get_border_spacing_h_raw(&self, node_idx: usize) -> i16

Source

pub fn get_border_spacing_v_raw(&self, node_idx: usize) -> i16

Source

pub fn get_tab_size_raw(&self, node_idx: usize) -> i16

Source

pub fn get_text_color_raw(&self, node_idx: usize) -> u32

Source

pub fn get_font_family_hash(&self, node_idx: usize) -> u64

Source

pub fn get_line_height(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_letter_spacing(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_word_spacing(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_text_indent(&self, node_idx: usize) -> Option<f32>

Source

pub fn get_overflow_prop( &self, node_idx: usize, prop: &CssPropertyType, ) -> Option<&CssProperty>

Get overflow properties for a node (usually None).

Source

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

Source§

fn clone(&self) -> CompactLayoutCache

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CompactLayoutCache

Source§

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

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

impl PartialEq for CompactLayoutCache

Source§

fn eq(&self, other: &CompactLayoutCache) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for CompactLayoutCache

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.