pub struct CssPropertyCache {
pub node_count: usize,
pub user_overridden_properties: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>,
pub cascaded_normal_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>,
pub cascaded_hover_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>,
pub cascaded_active_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>,
pub cascaded_focus_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>,
pub css_normal_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>,
pub css_hover_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>,
pub css_active_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>,
pub css_focus_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>,
pub computed_values: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssPropertyWithOrigin>>,
pub dependency_chains: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssDependencyChain>>,
}Fields§
§node_count: usize§user_overridden_properties: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>§cascaded_normal_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>§cascaded_hover_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>§cascaded_active_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>§cascaded_focus_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>§css_normal_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>§css_hover_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>§css_active_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>§css_focus_props: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssProperty>>§computed_values: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssPropertyWithOrigin>>§dependency_chains: BTreeMap<NodeId, BTreeMap<CssPropertyType, CssDependencyChain>>Implementations§
Source§impl CssPropertyCache
impl CssPropertyCache
Sourcepub fn restyle(
&mut self,
css: &mut Css,
node_data: &NodeDataContainerRef<'_, NodeData>,
node_hierarchy: &NodeHierarchyItemVec,
non_leaf_nodes: &ParentWithNodeDepthVec,
html_tree: &NodeDataContainerRef<'_, CascadeInfo>,
) -> Vec<TagIdToNodeIdMapping>
pub fn restyle( &mut self, css: &mut Css, node_data: &NodeDataContainerRef<'_, NodeData>, node_hierarchy: &NodeHierarchyItemVec, non_leaf_nodes: &ParentWithNodeDepthVec, html_tree: &NodeDataContainerRef<'_, CascadeInfo>, ) -> Vec<TagIdToNodeIdMapping>
Restyles the CSS property cache with a new CSS file
pub fn get_computed_css_style_string( &self, node_data: &NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> String
Source§impl CssPropertyCache
impl CssPropertyCache
pub fn empty(node_count: usize) -> Self
pub fn append(&mut self, other: &mut Self)
pub fn is_horizontal_overflow_visible( &self, node_data: &NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> bool
pub fn is_vertical_overflow_visible( &self, node_data: &NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> bool
pub fn get_text_color_or_default( &self, node_data: &NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> StyleTextColor
Sourcepub fn get_font_id_or_default(
&self,
node_data: &NodeData,
node_id: &NodeId,
node_state: &StyledNodeState,
) -> StyleFontFamilyVec
pub fn get_font_id_or_default( &self, node_data: &NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> StyleFontFamilyVec
Returns the font ID of the
pub fn get_font_size_or_default( &self, node_data: &NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> StyleFontSize
pub fn has_border( &self, node_data: &NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> bool
pub fn has_box_shadow( &self, node_data: &NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> bool
pub fn get_property<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, css_property_type: &CssPropertyType, ) -> Option<&CssProperty>
Sourcepub fn get_property_with_context<'a>(
&'a self,
node_data: &'a NodeData,
node_id: &NodeId,
context: &DynamicSelectorContext,
css_property_type: &CssPropertyType,
) -> Option<&CssProperty>
pub fn get_property_with_context<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, context: &DynamicSelectorContext, css_property_type: &CssPropertyType, ) -> Option<&CssProperty>
Get a CSS property using DynamicSelectorContext for evaluation.
This is the new API that supports @media queries, @container queries,
OS-specific styles, and all pseudo-states via CssPropertyWithConditions.
The evaluation follows “last wins” semantics - properties are evaluated in reverse order and the first matching property wins.
Sourcepub fn check_properties_changed(
node_data: &NodeData,
old_context: &DynamicSelectorContext,
new_context: &DynamicSelectorContext,
) -> bool
pub fn check_properties_changed( node_data: &NodeData, old_context: &DynamicSelectorContext, new_context: &DynamicSelectorContext, ) -> bool
Check if any properties with conditions would change between two contexts. This is used for re-layout detection on viewport/container resize.
Sourcepub fn check_layout_properties_changed(
node_data: &NodeData,
old_context: &DynamicSelectorContext,
new_context: &DynamicSelectorContext,
) -> bool
pub fn check_layout_properties_changed( node_data: &NodeData, old_context: &DynamicSelectorContext, new_context: &DynamicSelectorContext, ) -> bool
Check if any layout-affecting properties would change between two contexts. This is a more targeted check for re-layout detection.
pub fn get_background_content<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBackgroundContentVecValue>
pub fn get_hyphens<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleHyphensValue>
pub fn get_direction<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleDirectionValue>
pub fn get_white_space<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleWhiteSpaceValue>
pub fn get_background_position<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBackgroundPositionVecValue>
pub fn get_background_size<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBackgroundSizeVecValue>
pub fn get_background_repeat<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBackgroundRepeatVecValue>
pub fn get_font_size<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleFontSizeValue>
pub fn get_font_family<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleFontFamilyVecValue>
pub fn get_font_weight<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleFontWeightValue>
pub fn get_font_style<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleFontStyleValue>
pub fn get_text_color<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleTextColorValue>
pub fn get_text_indent<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleTextIndentValue>
pub fn get_initial_letter<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleInitialLetterValue>
pub fn get_line_clamp<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleLineClampValue>
pub fn get_hanging_punctuation<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleHangingPunctuationValue>
pub fn get_text_combine_upright<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleTextCombineUprightValue>
pub fn get_exclusion_margin<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleExclusionMarginValue>
pub fn get_hyphenation_language<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleHyphenationLanguageValue>
pub fn get_caret_color<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a CaretColorValue>
pub fn get_caret_width<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a CaretWidthValue>
pub fn get_caret_animation_duration<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a CaretAnimationDurationValue>
pub fn get_selection_background_color<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a SelectionBackgroundColorValue>
pub fn get_selection_color<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a SelectionColorValue>
pub fn get_selection_radius<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a SelectionRadiusValue>
pub fn get_text_justify<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutTextJustifyValue>
pub fn get_z_index<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutZIndexValue>
pub fn get_flex_basis<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutFlexBasisValue>
pub fn get_column_gap<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutColumnGapValue>
pub fn get_row_gap<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutRowGapValue>
pub fn get_grid_template_columns<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutGridTemplateColumnsValue>
pub fn get_grid_template_rows<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutGridTemplateRowsValue>
pub fn get_grid_auto_columns<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutGridAutoColumnsValue>
pub fn get_grid_auto_rows<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutGridAutoRowsValue>
pub fn get_grid_column<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutGridColumnValue>
pub fn get_grid_row<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutGridRowValue>
pub fn get_grid_auto_flow<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutGridAutoFlowValue>
pub fn get_justify_self<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutJustifySelfValue>
pub fn get_justify_items<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutJustifyItemsValue>
pub fn get_gap<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutGapValue>
pub fn get_grid_gap<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutGapValue>
pub fn get_align_self<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutAlignSelfValue>
pub fn get_font<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleFontValue>
pub fn get_writing_mode<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutWritingModeValue>
pub fn get_clear<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutClearValue>
pub fn get_shape_outside<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ShapeOutsideValue>
pub fn get_shape_inside<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ShapeInsideValue>
pub fn get_clip_path<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ClipPathValue>
pub fn get_scrollbar_style<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ScrollbarStyleValue>
pub fn get_scrollbar_width<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutScrollbarWidthValue>
pub fn get_scrollbar_color<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleScrollbarColorValue>
pub fn get_visibility<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleVisibilityValue>
pub fn get_break_before<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a PageBreakValue>
pub fn get_break_after<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a PageBreakValue>
pub fn get_break_inside<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a BreakInsideValue>
pub fn get_orphans<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a OrphansValue>
pub fn get_widows<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a WidowsValue>
pub fn get_box_decoration_break<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a BoxDecorationBreakValue>
pub fn get_column_count<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ColumnCountValue>
pub fn get_column_width<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ColumnWidthValue>
pub fn get_column_span<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ColumnSpanValue>
pub fn get_column_fill<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ColumnFillValue>
pub fn get_column_rule_width<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ColumnRuleWidthValue>
pub fn get_column_rule_style<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ColumnRuleStyleValue>
pub fn get_column_rule_color<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ColumnRuleColorValue>
pub fn get_flow_into<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a FlowIntoValue>
pub fn get_flow_from<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a FlowFromValue>
pub fn get_shape_margin<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ShapeMarginValue>
pub fn get_shape_image_threshold<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ShapeImageThresholdValue>
pub fn get_content<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a ContentValue>
pub fn get_counter_reset<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a CounterResetValue>
pub fn get_counter_increment<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a CounterIncrementValue>
pub fn get_string_set<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StringSetValue>
pub fn get_text_align<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleTextAlignValue>
pub fn get_user_select<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleUserSelectValue>
pub fn get_text_decoration<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleTextDecorationValue>
pub fn get_vertical_align<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleVerticalAlignValue>
pub fn get_line_height<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleLineHeightValue>
pub fn get_letter_spacing<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleLetterSpacingValue>
pub fn get_word_spacing<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleWordSpacingValue>
pub fn get_tab_width<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleTabWidthValue>
pub fn get_cursor<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleCursorValue>
pub fn get_box_shadow_left<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBoxShadowValue>
pub fn get_box_shadow_right<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBoxShadowValue>
pub fn get_box_shadow_top<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBoxShadowValue>
pub fn get_box_shadow_bottom<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBoxShadowValue>
pub fn get_border_top_color<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBorderTopColorValue>
pub fn get_border_left_color<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBorderLeftColorValue>
pub fn get_border_right_color<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBorderRightColorValue>
pub fn get_border_bottom_color<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBorderBottomColorValue>
pub fn get_border_top_style<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBorderTopStyleValue>
pub fn get_border_left_style<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBorderLeftStyleValue>
pub fn get_border_right_style<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBorderRightStyleValue>
pub fn get_border_bottom_style<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBorderBottomStyleValue>
pub fn get_border_top_left_radius<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBorderTopLeftRadiusValue>
pub fn get_border_top_right_radius<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBorderTopRightRadiusValue>
pub fn get_border_bottom_left_radius<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBorderBottomLeftRadiusValue>
pub fn get_border_bottom_right_radius<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBorderBottomRightRadiusValue>
pub fn get_opacity<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleOpacityValue>
pub fn get_transform<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleTransformVecValue>
pub fn get_transform_origin<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleTransformOriginValue>
pub fn get_perspective_origin<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StylePerspectiveOriginValue>
pub fn get_backface_visibility<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBackfaceVisibilityValue>
pub fn get_display<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutDisplayValue>
pub fn get_float<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutFloatValue>
pub fn get_box_sizing<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutBoxSizingValue>
pub fn get_width<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutWidthValue>
pub fn get_height<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutHeightValue>
pub fn get_min_width<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutMinWidthValue>
pub fn get_min_height<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutMinHeightValue>
pub fn get_max_width<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutMaxWidthValue>
pub fn get_max_height<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutMaxHeightValue>
pub fn get_position<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutPositionValue>
pub fn get_top<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutTopValue>
pub fn get_bottom<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutInsetBottomValue>
pub fn get_right<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutRightValue>
pub fn get_left<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutLeftValue>
pub fn get_padding_top<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutPaddingTopValue>
pub fn get_padding_bottom<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutPaddingBottomValue>
pub fn get_padding_left<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutPaddingLeftValue>
pub fn get_padding_right<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutPaddingRightValue>
pub fn get_margin_top<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutMarginTopValue>
pub fn get_margin_bottom<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutMarginBottomValue>
pub fn get_margin_left<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutMarginLeftValue>
pub fn get_margin_right<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutMarginRightValue>
pub fn get_border_top_width<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutBorderTopWidthValue>
pub fn get_border_left_width<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutBorderLeftWidthValue>
pub fn get_border_right_width<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutBorderRightWidthValue>
pub fn get_border_bottom_width<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutBorderBottomWidthValue>
pub fn get_overflow_x<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutOverflowValue>
pub fn get_overflow_y<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutOverflowValue>
pub fn get_flex_direction<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutFlexDirectionValue>
pub fn get_flex_wrap<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutFlexWrapValue>
pub fn get_flex_grow<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutFlexGrowValue>
pub fn get_flex_shrink<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutFlexShrinkValue>
pub fn get_justify_content<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutJustifyContentValue>
pub fn get_align_items<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutAlignItemsValue>
pub fn get_align_content<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutAlignContentValue>
pub fn get_mix_blend_mode<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleMixBlendModeValue>
pub fn get_filter<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleFilterVecValue>
pub fn get_backdrop_filter<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleFilterVecValue>
pub fn get_text_shadow<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBoxShadowValue>
pub fn get_list_style_type<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleListStyleTypeValue>
pub fn get_list_style_position<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleListStylePositionValue>
pub fn get_table_layout<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutTableLayoutValue>
pub fn get_border_collapse<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleBorderCollapseValue>
pub fn get_border_spacing<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a LayoutBorderSpacingValue>
pub fn get_caption_side<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleCaptionSideValue>
pub fn get_empty_cells<'a>( &'a self, node_data: &'a NodeData, node_id: &NodeId, node_state: &StyledNodeState, ) -> Option<&'a StyleEmptyCellsValue>
pub fn calc_width( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_width: f32, ) -> f32
pub fn calc_min_width( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_width: f32, ) -> f32
pub fn calc_max_width( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_width: f32, ) -> Option<f32>
pub fn calc_height( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_height: f32, ) -> f32
pub fn calc_min_height( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_height: f32, ) -> f32
pub fn calc_max_height( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_height: f32, ) -> Option<f32>
pub fn calc_left( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_width: f32, ) -> Option<f32>
pub fn calc_right( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_width: f32, ) -> Option<f32>
pub fn calc_top( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_height: f32, ) -> Option<f32>
pub fn calc_bottom( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_height: f32, ) -> Option<f32>
pub fn calc_border_left_width( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_width: f32, ) -> f32
pub fn calc_border_right_width( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_width: f32, ) -> f32
pub fn calc_border_top_width( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_height: f32, ) -> f32
pub fn calc_border_bottom_width( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_height: f32, ) -> f32
pub fn calc_padding_left( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_width: f32, ) -> f32
pub fn calc_padding_right( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_width: f32, ) -> f32
pub fn calc_padding_top( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_height: f32, ) -> f32
pub fn calc_padding_bottom( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_height: f32, ) -> f32
pub fn calc_margin_left( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_width: f32, ) -> f32
pub fn calc_margin_right( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_width: f32, ) -> f32
pub fn calc_margin_top( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_height: f32, ) -> f32
pub fn calc_margin_bottom( &self, node_data: &NodeData, node_id: &NodeId, styled_node_state: &StyledNodeState, reference_height: f32, ) -> f32
Sourcepub fn apply_ua_css(&mut self, node_data: &[NodeData])
pub fn apply_ua_css(&mut self, node_data: &[NodeData])
Applies user-agent (UA) CSS properties to the cascade before inheritance.
UA CSS has the lowest priority in the cascade, so it should only be applied if the node doesn’t already have the property from inline styles or author CSS.
This is critical for text nodes: UA CSS properties (like font-weight: bold for H1) must be in the cascade maps so they can be inherited by child text nodes.
Sourcepub fn compute_inherited_values(
&mut self,
node_hierarchy: &[NodeHierarchyItem],
node_data: &[NodeData],
) -> Vec<NodeId>
pub fn compute_inherited_values( &mut self, node_hierarchy: &[NodeHierarchyItem], node_data: &[NodeData], ) -> Vec<NodeId>
Compute inherited values and dependency chains for all nodes in the DOM tree.
Implements CSS inheritance: walk tree depth-first, apply cascade priority
(inherited → cascaded → css → inline → user), create dependency chains for
relative values. Call apply_ua_css() before this function.
Source§impl CssPropertyCache
impl CssPropertyCache
Sourcepub fn resolve_dependency_chain(
&self,
node_id: NodeId,
property_type: CssPropertyType,
root_font_size: f32,
) -> Option<f32>
pub fn resolve_dependency_chain( &self, node_id: NodeId, property_type: CssPropertyType, root_font_size: f32, ) -> Option<f32>
Resolve a dependency chain to an absolute pixel value.
This walks through the chain and resolves each dependency:
- Absolute values: return immediately
- Em values: multiply by source node’s font-size
- Percent values: multiply by source node’s property value
- Rem values: multiply by root node’s font-size
§Arguments
node_id- The node to resolve the property forproperty_type- The property type to resolveroot_font_size- Root element’s font-size for rem calculations (default 16px)
§Returns
The resolved pixel value, or None if the chain couldn’t be resolved
Sourcepub fn update_property_and_invalidate_dependents(
&mut self,
node_id: NodeId,
property: CssProperty,
node_hierarchy: &[NodeHierarchyItem],
_node_data: &[NodeData],
) -> Vec<NodeId>
pub fn update_property_and_invalidate_dependents( &mut self, node_id: NodeId, property: CssProperty, node_hierarchy: &[NodeHierarchyItem], _node_data: &[NodeData], ) -> Vec<NodeId>
Update a property value and invalidate all dependent chains.
When a property changes (e.g., font-size changes from 16px to 20px):
- Update the property value in computed_values
- Update/rebuild the dependency chain
- Find all nodes whose chains depend on this node
- Invalidate their cached values
- Return list of affected nodes that need re-layout
§Arguments
node_id- The node whose property changedproperty- The new property valuenode_hierarchy- DOM tree (needed to find children)node_data- Node data array
§Returns
Vector of NodeIds that were affected and need re-layout
Trait Implementations§
Source§impl Clone for CssPropertyCache
impl Clone for CssPropertyCache
Source§fn clone(&self) -> CssPropertyCache
fn clone(&self) -> CssPropertyCache
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CssPropertyCache
impl Debug for CssPropertyCache
Source§impl Default for CssPropertyCache
impl Default for CssPropertyCache
Source§fn default() -> CssPropertyCache
fn default() -> CssPropertyCache
Source§impl PartialEq for CssPropertyCache
impl PartialEq for CssPropertyCache
impl StructuralPartialEq for CssPropertyCache
Auto Trait Implementations§
impl Freeze for CssPropertyCache
impl RefUnwindSafe for CssPropertyCache
impl Send for CssPropertyCache
impl Sync for CssPropertyCache
impl Unpin for CssPropertyCache
impl UnwindSafe for CssPropertyCache
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