pub struct ComputedStyle {Show 103 fields
pub display: Display,
pub position: Position,
pub float: Float,
pub clear: Clear,
pub box_sizing: BoxSizing,
pub content_visibility: ContentVisibility,
pub contain: Containment,
pub contain_intrinsic_width: Option<Dimension>,
pub contain_intrinsic_height: Option<Dimension>,
pub width: Dimension,
pub height: Dimension,
pub min_width: Dimension,
pub max_width: Dimension,
pub min_height: Dimension,
pub max_height: Dimension,
pub margin: EdgeInsets,
pub margin_auto_top: bool,
pub margin_auto_right: bool,
pub margin_auto_bottom: bool,
pub margin_auto_left: bool,
pub padding: EdgeInsets,
pub insets: EdgeInsets<Dimension>,
pub z_index: Option<i32>,
pub flex_direction: FlexDirection,
pub flex_wrap: FlexWrap,
pub justify_content: JustifyContent,
pub align_items: AlignItems,
pub align_self: AlignSelf,
pub flex_grow: f32,
pub flex_shrink: f32,
pub flex_basis: Dimension,
pub gap: f32,
pub gap_row: f32,
pub gap_col: f32,
pub grid_template_columns: Vec<GridTrack>,
pub grid_template_rows: Vec<GridTrack>,
pub grid_template_areas: Vec<Vec<String>>,
pub grid_auto_flow: GridAutoFlow,
pub grid_area: Option<String>,
pub grid_column_start: Option<i32>,
pub grid_column_end: Option<i32>,
pub grid_column_span: Option<u32>,
pub grid_row_start: Option<i32>,
pub grid_row_end: Option<i32>,
pub grid_row_span: Option<u32>,
pub table_layout: TableLayout,
pub border_collapse: BorderCollapse,
pub border_spacing: (f32, f32),
pub caption_side: CaptionSide,
pub colspan: u32,
pub rowspan: u32,
pub background_color: Option<Rgba>,
pub background_gradient: Option<Gradient>,
pub border_color: Option<Rgba>,
pub border_width: EdgeInsets,
pub border_radius: BorderRadius,
pub opacity: f32,
pub box_shadow: Vec<BoxShadow>,
pub overflow_x: Overflow,
pub overflow_y: Overflow,
pub color: Rgba,
pub font_family: AtomId,
pub font_size: f32,
pub root_font_size: f32,
pub font_weight: FontWeight,
pub font_style: FontStyle,
pub text_align: TextAlign,
pub line_height: f32,
pub letter_spacing: f32,
pub text_decoration: TextDecoration,
pub text_transform: TextTransform,
pub text_overflow: TextOverflow,
pub white_space: WhiteSpace,
pub vertical_align: VerticalAlign,
pub cursor: Cursor,
pub user_select: UserSelect,
pub pointer_events: PointerEvents,
pub visibility: Visibility,
pub caret_color: Option<Rgba>,
pub border_style: BorderStyle,
pub outline_width: f32,
pub outline_style: BorderStyle,
pub outline_color: Option<Rgba>,
pub outline_offset: f32,
pub aspect_ratio: Option<f32>,
pub backdrop_filter: Option<BackdropFilter>,
pub filter: Option<BackdropFilter>,
pub clip_path: Option<ClipPath>,
pub mix_blend_mode: BlendMode,
pub isolation: Isolation,
pub transitions: Vec<TransitionSpec>,
pub animations: Vec<AnimationSpec>,
pub transform: Vec<TransformOp>,
pub transform_origin: TransformOrigin,
pub transform_style: TransformStyle,
pub perspective: Option<f32>,
pub perspective_origin: (Dimension, Dimension),
pub backface_visibility: BackfaceVisibility,
pub custom_properties: Option<Arc<Vec<(AtomId, AtomId)>>>,
pub starting_style: Option<Box<ComputedStyle>>,
pub view_transition_name: Option<String>,
pub animation_timeline: AnimationTimeline,
pub animation_range: AnimationRange,
}Expand description
Fully computed and resolved styles for an element node.
Fields§
§display: Display§position: Position§float: Float§clear: Clear§box_sizing: BoxSizing§content_visibility: ContentVisibility§contain: Containment§contain_intrinsic_width: Option<Dimension>§contain_intrinsic_height: Option<Dimension>§width: Dimension§height: Dimension§min_width: Dimension§max_width: Dimension§min_height: Dimension§max_height: Dimension§margin: EdgeInsets§margin_auto_top: bool§margin_auto_right: bool§margin_auto_bottom: bool§margin_auto_left: bool§padding: EdgeInsets§insets: EdgeInsets<Dimension>§z_index: Option<i32>§flex_direction: FlexDirection§flex_wrap: FlexWrap§justify_content: JustifyContent§align_items: AlignItems§align_self: AlignSelf§flex_grow: f32§flex_shrink: f32§flex_basis: Dimension§gap: f32§gap_row: f32§gap_col: f32§grid_template_columns: Vec<GridTrack>§grid_template_rows: Vec<GridTrack>§grid_template_areas: Vec<Vec<String>>§grid_auto_flow: GridAutoFlow§grid_area: Option<String>§grid_column_start: Option<i32>§grid_column_end: Option<i32>§grid_column_span: Option<u32>§grid_row_start: Option<i32>§grid_row_end: Option<i32>§grid_row_span: Option<u32>§table_layout: TableLayout§border_collapse: BorderCollapse§border_spacing: (f32, f32)§caption_side: CaptionSide§colspan: u32§rowspan: u32§background_color: Option<Rgba>§background_gradient: Option<Gradient>§border_color: Option<Rgba>§border_width: EdgeInsets§border_radius: BorderRadius§opacity: f32§box_shadow: Vec<BoxShadow>§overflow_x: Overflow§overflow_y: Overflow§color: Rgba§font_family: AtomId§font_size: f32§root_font_size: f32§font_weight: FontWeight§font_style: FontStyle§text_align: TextAlign§line_height: f32§letter_spacing: f32§text_decoration: TextDecoration§text_transform: TextTransform§text_overflow: TextOverflow§white_space: WhiteSpace§vertical_align: VerticalAlign§cursor: Cursor§user_select: UserSelect§pointer_events: PointerEvents§visibility: Visibility§caret_color: Option<Rgba>§border_style: BorderStyle§outline_width: f32§outline_style: BorderStyle§outline_color: Option<Rgba>§outline_offset: f32§aspect_ratio: Option<f32>§backdrop_filter: Option<BackdropFilter>§filter: Option<BackdropFilter>§clip_path: Option<ClipPath>§mix_blend_mode: BlendMode§isolation: Isolation§transitions: Vec<TransitionSpec>§animations: Vec<AnimationSpec>§transform: Vec<TransformOp>§transform_origin: TransformOrigin§transform_style: TransformStyle§perspective: Option<f32>§perspective_origin: (Dimension, Dimension)§backface_visibility: BackfaceVisibility§custom_properties: Option<Arc<Vec<(AtomId, AtomId)>>>§starting_style: Option<Box<ComputedStyle>>§view_transition_name: Option<String>§animation_timeline: AnimationTimeline§animation_range: AnimationRangeImplementations§
Source§impl ComputedStyle
impl ComputedStyle
Sourcepub fn has_animations(&self) -> bool
pub fn has_animations(&self) -> bool
Returns true if this style defines any animations.
Sourcepub fn has_transform(&self) -> bool
pub fn has_transform(&self) -> bool
Returns true if this style defines any 2D or 3D transform operations.
Sourcepub fn has_visual_effects(&self) -> bool
pub fn has_visual_effects(&self) -> bool
Returns true if this style defines any visual filters, backdrop filters, clip-paths, or blend modes.
Sourcepub fn compute_transform_matrix(&self, width: f32, height: f32) -> Matrix4x4
pub fn compute_transform_matrix(&self, width: f32, height: f32) -> Matrix4x4
Computes the composite 4x4 matrix for this element’s transform given layout width and height.
Sourcepub fn establishes_fixed_containing_block(&self) -> bool
pub fn establishes_fixed_containing_block(&self) -> bool
Evaluates if this element establishes a containing block for position: fixed
(and position: absolute) descendants per CSS Transforms Level 1 §2 and Filter Effects Level 1 §5.
Sourcepub fn establishes_stacking_context_in(
&self,
parent_display: Option<Display>,
is_root: bool,
) -> bool
pub fn establishes_stacking_context_in( &self, parent_display: Option<Display>, is_root: bool, ) -> bool
Evaluates if this element establishes an isolated stacking context per W3C CSS 2.1 Appendix E, CSS Flexbox §4.3, CSS Grid §5.4, CSS Positioned Layout Level 3 §3.1, and CSS Compositing Level 1.
Note: Per CSS 2.1 Appendix E / CSS Overflow Level 3, overflow != Visible clips scrollable
content without establishing an atomic stacking context.
Sourcepub fn establishes_stacking_context(&self) -> bool
pub fn establishes_stacking_context(&self) -> bool
Evaluates if this element establishes an isolated stacking context without parent display context.
Sourcepub fn inherit_from(parent: &ComputedStyle) -> ComputedStyle
pub fn inherit_from(parent: &ComputedStyle) -> ComputedStyle
Constructs an unstyled node inheriting inheritable properties from parent with zero heap allocations.
Sourcepub fn get_custom_property(&self, key: AtomId) -> Option<AtomId>
pub fn get_custom_property(&self, key: AtomId) -> Option<AtomId>
Looks up a CSS custom property by AtomId.
Sourcepub fn set_custom_property(&mut self, key: AtomId, value: AtomId)
pub fn set_custom_property(&mut self, key: AtomId, value: AtomId)
Sets or overrides a CSS custom property using Copy-On-Write semantics.
Trait Implementations§
Source§impl Clone for ComputedStyle
impl Clone for ComputedStyle
Source§fn clone(&self) -> ComputedStyle
fn clone(&self) -> ComputedStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more