Skip to main content

ComputedStyle

Struct ComputedStyle 

Source
pub struct ComputedStyle {
Show 59 fields pub display: Display, pub position: Position, pub float: Float, pub clear: Clear, pub box_sizing: BoxSizing, pub width: LengthPercentageAuto, pub height: LengthPercentageAuto, pub min_width: LengthPercentage, pub min_height: LengthPercentage, pub max_width: LengthPercentageNone, pub max_height: LengthPercentageNone, pub margin_top: LengthPercentageAuto, pub margin_right: LengthPercentageAuto, pub margin_bottom: LengthPercentageAuto, pub margin_left: LengthPercentageAuto, pub padding_top: LengthPercentage, pub padding_right: LengthPercentage, pub padding_bottom: LengthPercentage, pub padding_left: LengthPercentage, pub border_top_width: f32, pub border_right_width: f32, pub border_bottom_width: f32, pub border_left_width: f32, pub top: LengthPercentageAuto, pub right: LengthPercentageAuto, pub bottom: LengthPercentageAuto, pub left: LengthPercentageAuto, pub overflow_x: Overflow, pub overflow_y: Overflow, pub text_align: TextAlign, pub vertical_align: VerticalAlign, pub line_height: f32, pub white_space: WhiteSpace, pub flex_direction: FlexDirection, pub flex_wrap: FlexWrap, pub flex_grow: f32, pub flex_shrink: f32, pub flex_basis: LengthPercentageAuto, pub align_items: AlignItems, pub align_self: AlignSelf, pub align_content: AlignContent, pub justify_content: JustifyContent, pub order: i32, pub grid_template_rows: Vec<TrackDefinition>, pub grid_template_columns: Vec<TrackDefinition>, pub grid_auto_rows: Vec<TrackSizingFunction>, pub grid_auto_columns: Vec<TrackSizingFunction>, pub grid_auto_flow: GridAutoFlow, pub row_gap: f32, pub column_gap: f32, pub grid_row_start: GridPlacement, pub grid_row_end: GridPlacement, pub grid_column_start: GridPlacement, pub grid_column_end: GridPlacement, pub table_layout: TableLayout, pub border_collapse: BorderCollapse, pub border_spacing: f32, pub caption_side: CaptionSide, pub z_index: NumberOrAuto,
}
Expand description

Full computed style for a layout node.

Fields§

§display: Display§position: Position§float: Float§clear: Clear§box_sizing: BoxSizing§width: LengthPercentageAuto§height: LengthPercentageAuto§min_width: LengthPercentage§min_height: LengthPercentage§max_width: LengthPercentageNone§max_height: LengthPercentageNone§margin_top: LengthPercentageAuto§margin_right: LengthPercentageAuto§margin_bottom: LengthPercentageAuto§margin_left: LengthPercentageAuto§padding_top: LengthPercentage§padding_right: LengthPercentage§padding_bottom: LengthPercentage§padding_left: LengthPercentage§border_top_width: f32§border_right_width: f32§border_bottom_width: f32§border_left_width: f32§top: LengthPercentageAuto§right: LengthPercentageAuto§bottom: LengthPercentageAuto§left: LengthPercentageAuto§overflow_x: Overflow§overflow_y: Overflow§text_align: TextAlign§vertical_align: VerticalAlign§line_height: f32§white_space: WhiteSpace§flex_direction: FlexDirection§flex_wrap: FlexWrap§flex_grow: f32§flex_shrink: f32§flex_basis: LengthPercentageAuto§align_items: AlignItems§align_self: AlignSelf§align_content: AlignContent§justify_content: JustifyContent§order: i32§grid_template_rows: Vec<TrackDefinition>§grid_template_columns: Vec<TrackDefinition>§grid_auto_rows: Vec<TrackSizingFunction>§grid_auto_columns: Vec<TrackSizingFunction>§grid_auto_flow: GridAutoFlow§row_gap: f32§column_gap: f32§grid_row_start: GridPlacement§grid_row_end: GridPlacement§grid_column_start: GridPlacement§grid_column_end: GridPlacement§table_layout: TableLayout§border_collapse: BorderCollapse§border_spacing: f32§caption_side: CaptionSide§z_index: NumberOrAuto

Implementations§

Source§

impl ComputedStyle

Source

pub fn block() -> Self

Create a block-level element style with default values.

Source

pub fn inline() -> Self

Create an inline element style.

Source

pub fn establishes_bfc(&self) -> bool

Whether this element establishes a new block formatting context.

Source

pub fn is_out_of_flow(&self) -> bool

Whether this element is out of flow.

Trait Implementations§

Source§

impl Clone for ComputedStyle

Source§

fn clone(&self) -> ComputedStyle

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 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() -> Self

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

impl PartialEq for ComputedStyle

Source§

fn eq(&self, other: &ComputedStyle) -> 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 ComputedStyle

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.