Skip to main content

ComputedStyle

Struct ComputedStyle 

Source
pub struct ComputedStyle {
Show 146 fields pub custom_properties: HashMap<String, String>, pub registered_custom_properties: HashMap<String, PropertyRule>, pub box_sizing: BoxSizing, pub opacity: PercentageNumber, pub animation_name: AnimationNames, pub animation_duration: AnimationDurations, pub animation_delay: AnimationDurations, pub animation_timing_function: AnimationTimingFunctions, pub animation_iteration_count: AnimationIterationCounts, pub animation_direction: AnimationDirections, pub animation_fill_mode: AnimationFillModes, pub animation_play_state: AnimationPlayStates, pub display: Display, pub width: Length, pub height: Length, pub max_width: Length, pub max_height: Length, pub min_width: Length, pub min_height: Length, pub aspect_ratio: AspectRatio, pub padding_top: LengthDefaultsToZero, pub padding_right: LengthDefaultsToZero, pub padding_bottom: LengthDefaultsToZero, pub padding_left: LengthDefaultsToZero, pub margin_top: LengthDefaultsToZero, pub margin_right: LengthDefaultsToZero, pub margin_bottom: LengthDefaultsToZero, pub margin_left: LengthDefaultsToZero, pub top: Length, pub right: Length, pub bottom: Length, pub left: Length, pub flex_direction: FlexDirection, pub justify_self: AlignItems, pub justify_content: JustifyContent, pub align_content: JustifyContent, pub justify_items: AlignItems, pub align_items: AlignItems, pub align_self: AlignItems, pub flex_wrap: FlexWrap, pub flex_basis: Option<Length>, pub order: Order, pub z_index: ZIndex, pub position: Position, pub rotate: Option<Angle>, pub scale: SpacePair<PercentageNumber>, pub translate: SpacePair<Length>, pub transform: Option<Transforms>, pub transform_origin: TransformOrigin, pub mask_image: Option<BackgroundImages>, pub mask_size: BackgroundSizes, pub mask_position: BackgroundPositions, pub mask_repeat: BackgroundRepeats, pub column_gap: LengthDefaultsToZero, pub row_gap: LengthDefaultsToZero, pub flex_grow: Option<FlexGrow>, pub flex_shrink: Option<FlexGrow>, pub border_top_left_radius: SpacePair<LengthDefaultsToZero>, pub border_top_right_radius: SpacePair<LengthDefaultsToZero>, pub border_bottom_right_radius: SpacePair<LengthDefaultsToZero>, pub border_bottom_left_radius: SpacePair<LengthDefaultsToZero>, pub border_top_width: Length, pub border_right_width: Length, pub border_bottom_width: Length, pub border_left_width: Length, pub border_top_style: BorderStyle, pub border_right_style: BorderStyle, pub border_bottom_style: BorderStyle, pub border_left_style: BorderStyle, pub border_top_color: ColorInput, pub border_right_color: ColorInput, pub border_bottom_color: ColorInput, pub border_left_color: ColorInput, pub outline_width: Length, pub outline_style: BorderStyle, pub outline_color: ColorInput, pub outline_offset: Length, pub object_fit: ObjectFit, pub overflow_x: Overflow, pub overflow_y: Overflow, pub object_position: ObjectPosition, pub background_image: Option<BackgroundImages>, pub background_position: BackgroundPositions, pub background_size: BackgroundSizes, pub background_repeat: BackgroundRepeats, pub background_blend_mode: BlendModes, pub background_color: ColorDefaultsToTransparent, pub background_clip: BackgroundClip, pub box_shadow: Option<BoxShadows>, pub grid_auto_columns: Option<GridTrackSizes>, pub grid_auto_rows: Option<GridTrackSizes>, pub grid_auto_flow: GridAutoFlow, pub grid_row_start: GridPlacement, pub grid_row_end: GridPlacement, pub grid_column_start: GridPlacement, pub grid_column_end: GridPlacement, pub grid_template_columns: Option<GridTemplateComponents>, pub grid_template_rows: Option<GridTemplateComponents>, pub grid_template_areas: Option<GridTemplateAreas>, pub text_overflow: TextOverflow, pub text_fit: TextFit, pub text_transform: TextTransform, pub font_style: FontStyle, pub font_stretch: FontStretch, pub color: ColorInput, pub filter: Filters, pub backdrop_filter: Filters, pub font_size: FontSize, pub font_family: FontFamily, pub line_height: LineHeight, pub font_weight: FontWeight, pub font_variation_settings: FontVariationSettings, pub font_feature_settings: FontFeatureSettings, pub font_synthesis_weight: FontSynthesic, pub font_synthesis_style: FontSynthesic, pub line_clamp: Option<LineClamp>, pub text_align: TextAlign, pub webkit_text_stroke_width: Option<LengthDefaultsToZero>, pub webkit_text_stroke_color: Option<ColorInput>, pub webkit_text_fill_color: Option<ColorInput>, pub stroke_linejoin: LineJoin, pub text_shadow: Option<TextShadows>, pub text_decoration_line: Option<TextDecorationLines>, pub text_decoration_style: TextDecorationStyle, pub text_decoration_color: ColorInput, pub text_decoration_thickness: TextDecorationThickness, pub text_decoration_skip_ink: TextDecorationSkipInk, pub text_indent: TextIndent, pub letter_spacing: Length, pub word_spacing: Length, pub image_rendering: ImageScalingAlgorithm, pub overflow_wrap: OverflowWrap, pub word_break: WordBreak, pub clip_path: Option<BasicShape>, pub clip_rule: FillRule, pub white_space_collapse: WhiteSpaceCollapse, pub text_wrap_mode: TextWrapMode, pub text_wrap_style: TextWrapStyle, pub direction: Direction, pub float: Float, pub clear: Clear, pub isolation: Isolation, pub mix_blend_mode: BlendMode, pub visibility: Visibility, pub vertical_align: VerticalAlign, pub content: ContentValue,
}
Expand description

The computed style snapshot used during layout and rendering.

Fields§

§custom_properties: HashMap<String, String>§registered_custom_properties: HashMap<String, PropertyRule>§box_sizing: BoxSizing§opacity: PercentageNumber§animation_name: AnimationNames§animation_duration: AnimationDurations§animation_delay: AnimationDurations§animation_timing_function: AnimationTimingFunctions§animation_iteration_count: AnimationIterationCounts§animation_direction: AnimationDirections§animation_fill_mode: AnimationFillModes§animation_play_state: AnimationPlayStates§display: Display§width: Length§height: Length§max_width: Length§max_height: Length§min_width: Length§min_height: Length§aspect_ratio: AspectRatio§padding_top: LengthDefaultsToZero§padding_right: LengthDefaultsToZero§padding_bottom: LengthDefaultsToZero§padding_left: LengthDefaultsToZero§margin_top: LengthDefaultsToZero§margin_right: LengthDefaultsToZero§margin_bottom: LengthDefaultsToZero§margin_left: LengthDefaultsToZero§top: Length§right: Length§bottom: Length§left: Length§flex_direction: FlexDirection§justify_self: AlignItems§justify_content: JustifyContent§align_content: JustifyContent§justify_items: AlignItems§align_items: AlignItems§align_self: AlignItems§flex_wrap: FlexWrap§flex_basis: Option<Length>§order: Order§z_index: ZIndex§position: Position§rotate: Option<Angle>§scale: SpacePair<PercentageNumber>§translate: SpacePair<Length>§transform: Option<Transforms>§transform_origin: TransformOrigin§mask_image: Option<BackgroundImages>§mask_size: BackgroundSizes§mask_position: BackgroundPositions§mask_repeat: BackgroundRepeats§column_gap: LengthDefaultsToZero§row_gap: LengthDefaultsToZero§flex_grow: Option<FlexGrow>§flex_shrink: Option<FlexGrow>§border_top_left_radius: SpacePair<LengthDefaultsToZero>§border_top_right_radius: SpacePair<LengthDefaultsToZero>§border_bottom_right_radius: SpacePair<LengthDefaultsToZero>§border_bottom_left_radius: SpacePair<LengthDefaultsToZero>§border_top_width: Length§border_right_width: Length§border_bottom_width: Length§border_left_width: Length§border_top_style: BorderStyle§border_right_style: BorderStyle§border_bottom_style: BorderStyle§border_left_style: BorderStyle§border_top_color: ColorInput§border_right_color: ColorInput§border_bottom_color: ColorInput§border_left_color: ColorInput§outline_width: Length§outline_style: BorderStyle§outline_color: ColorInput§outline_offset: Length§object_fit: ObjectFit§overflow_x: Overflow§overflow_y: Overflow§object_position: ObjectPosition§background_image: Option<BackgroundImages>§background_position: BackgroundPositions§background_size: BackgroundSizes§background_repeat: BackgroundRepeats§background_blend_mode: BlendModes§background_color: ColorDefaultsToTransparent§background_clip: BackgroundClip§box_shadow: Option<BoxShadows>§grid_auto_columns: Option<GridTrackSizes>§grid_auto_rows: Option<GridTrackSizes>§grid_auto_flow: GridAutoFlow§grid_row_start: GridPlacement§grid_row_end: GridPlacement§grid_column_start: GridPlacement§grid_column_end: GridPlacement§grid_template_columns: Option<GridTemplateComponents>§grid_template_rows: Option<GridTemplateComponents>§grid_template_areas: Option<GridTemplateAreas>§text_overflow: TextOverflow§text_fit: TextFit§text_transform: TextTransform§font_style: FontStyle§font_stretch: FontStretch§color: ColorInput§filter: Filters§backdrop_filter: Filters§font_size: FontSize§font_family: FontFamily§line_height: LineHeight§font_weight: FontWeight§font_variation_settings: FontVariationSettings§font_feature_settings: FontFeatureSettings§font_synthesis_weight: FontSynthesic§font_synthesis_style: FontSynthesic§line_clamp: Option<LineClamp>§text_align: TextAlign§webkit_text_stroke_width: Option<LengthDefaultsToZero>§webkit_text_stroke_color: Option<ColorInput>§webkit_text_fill_color: Option<ColorInput>§stroke_linejoin: LineJoin§text_shadow: Option<TextShadows>§text_decoration_line: Option<TextDecorationLines>§text_decoration_style: TextDecorationStyle§text_decoration_color: ColorInput§text_decoration_thickness: TextDecorationThickness§text_decoration_skip_ink: TextDecorationSkipInk§text_indent: TextIndent§letter_spacing: Length§word_spacing: Length§image_rendering: ImageScalingAlgorithm§overflow_wrap: OverflowWrap§word_break: WordBreak§clip_path: Option<BasicShape>§clip_rule: FillRule§white_space_collapse: WhiteSpaceCollapse§text_wrap_mode: TextWrapMode§text_wrap_style: TextWrapStyle§direction: Direction§float: Float§clear: Clear§isolation: Isolation§mix_blend_mode: BlendMode§visibility: Visibility§vertical_align: VerticalAlign§content: ContentValue

Implementations§

Source§

impl ComputedStyle

Source

pub fn make_computed(&mut self, sizing: &SizingContext)

Normalize inheritable text-related values to computed values for this node.

Source

pub fn is_invisible(&self) -> bool

Source

pub fn is_z_index_applicable(&self, is_flex_or_grid_item: bool) -> bool

Source

pub fn participates_in_positioned_paint_bucket( &self, is_flex_or_grid_item: bool, ) -> bool

Source

pub fn creates_stacking_context( &self, border_box: Size<f32>, sizing: &SizingContext, is_flex_or_grid_item: bool, ) -> bool

Source

pub fn needs_offscreen_compositing(&self) -> bool

Source

pub fn has_non_identity_transform( &self, border_box: Size<f32>, sizing: &SizingContext, ) -> bool

Source

pub fn resolve_overflows(&self) -> SpacePair<Overflow>

Source

pub fn ellipsis_char(&self) -> &str

Source

pub fn text_wrap_mode_and_line_clamp( &self, ) -> (TextWrapMode, Option<Cow<'_, LineClamp>>)

Source

pub fn resolved_text_decoration_thickness( &self, sizing: &SizingContext, ) -> SizedTextDecorationThickness

Source

pub fn to_taffy_style(&self, sizing: &SizingContext) -> Style

Source§

impl ComputedStyle

Source

pub fn from_parent(parent: &Self) -> Self

Source

pub fn make_computed_values(&mut self, sizing: &SizingContext)

Trait Implementations§

Source§

impl Clone for ComputedStyle

Source§

fn clone(&self) -> ComputedStyle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ComputedStyle

Source§

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

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

impl Default for ComputedStyle

Source§

fn default() -> ComputedStyle

Returns the “default value” for a type. Read more

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> ErasedDestructor for T
where T: 'static,

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.