layout_2020::taffy::stylo_taffy::convert::stylo

Type Alias AspectRatio

Source
pub(crate) type AspectRatio = GenericAspectRatio<NonNegative<f32>>;
Expand description

A computed value for the aspect-ratio property.

Aliased Type§

struct AspectRatio {
    pub auto: bool,
    pub ratio: PreferredRatio<NonNegative<f32>>,
}

Fields§

§auto: bool

Specifiy auto or not.

§ratio: PreferredRatio<NonNegative<f32>>

The preferred aspect-ratio value.

Implementations

Source§

impl<N> GenericAspectRatio<N>

Source

pub fn auto() -> GenericAspectRatio<N>

Returns auto

Trait Implementations

Source§

impl<N> Animate for GenericAspectRatio<N>

Source§

fn animate( &self, other: &GenericAspectRatio<N>, procedure: Procedure, ) -> Result<GenericAspectRatio<N>, ()>

Animate a value towards another one, given an animation procedure.
Source§

impl<N> Clone for GenericAspectRatio<N>
where N: Clone,

Source§

fn clone(&self) -> GenericAspectRatio<N>

Returns a copy 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<N> ComputeSquaredDistance for GenericAspectRatio<N>

Source§

fn compute_squared_distance( &self, other: &GenericAspectRatio<N>, ) -> Result<SquaredDistance, ()>

Computes the squared distance between two animatable values.
Source§

impl<N> Debug for GenericAspectRatio<N>
where N: Debug,

Source§

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

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

impl<N> MallocSizeOf for GenericAspectRatio<N>
where N: MallocSizeOf,

Source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
Source§

impl<N> PartialEq for GenericAspectRatio<N>
where N: PartialEq,

Source§

fn eq(&self, other: &GenericAspectRatio<N>) -> 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<N> SpecifiedValueInfo for GenericAspectRatio<N>

Source§

const SUPPORTED_TYPES: u8

Supported CssTypes by the given value type. Read more
Source§

fn collect_completion_keywords(_f: &mut dyn FnMut(&[&'static str]))

Collect value starting words for the given specified value type. This includes keyword and function names which can appear at the beginning of a value of this type. Read more
Source§

impl<N> ToAnimatedValue for GenericAspectRatio<N>
where N: ToAnimatedValue,

Source§

type AnimatedValue = GenericAspectRatio<<N as ToAnimatedValue>::AnimatedValue>

The type of the animated value.
Source§

fn from_animated_value( from: <GenericAspectRatio<N> as ToAnimatedValue>::AnimatedValue, ) -> GenericAspectRatio<N>

Converts back an animated value into a computed value.
Source§

fn to_animated_value( self, context: &Context<'_>, ) -> <GenericAspectRatio<N> as ToAnimatedValue>::AnimatedValue

Converts this value to an animated value.
Source§

impl<N> ToAnimatedZero for GenericAspectRatio<N>

Source§

fn to_animated_zero(&self) -> Result<GenericAspectRatio<N>, ()>

Returns a value that, when added with an underlying value, will produce the underlying value. This is used for SMIL animation’s “by-animation” where SMIL first interpolates from the zero value to the ‘by’ value, and then adds the result to the underlying value. Read more
Source§

impl<N> ToComputedValue for GenericAspectRatio<N>
where N: ToComputedValue,

Source§

type ComputedValue = GenericAspectRatio<<N as ToComputedValue>::ComputedValue>

The computed value type we’re going to be converted to.
Source§

fn from_computed_value( from: &<GenericAspectRatio<N> as ToComputedValue>::ComputedValue, ) -> GenericAspectRatio<N>

Convert a computed value to specified value form. Read more
Source§

fn to_computed_value( &self, context: &Context<'_>, ) -> <GenericAspectRatio<N> as ToComputedValue>::ComputedValue

Convert a specified value to a computed value, using itself and the data inside the Context.
Source§

impl<N> ToCss for GenericAspectRatio<N>
where N: ToCss, PreferredRatio<N>: ToCss,

Source§

fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Result<(), Error>
where W: Write,

Serialize self in CSS syntax, writing to dest.
Source§

fn to_css_string(&self) -> String

Serialize self in CSS syntax and return a string. Read more
Source§

impl<N> ToResolvedValue for GenericAspectRatio<N>
where N: ToResolvedValue,

Source§

type ResolvedValue = GenericAspectRatio<<N as ToResolvedValue>::ResolvedValue>

The resolved value type we’re going to be converted to.
Source§

fn from_resolved_value( from: <GenericAspectRatio<N> as ToResolvedValue>::ResolvedValue, ) -> GenericAspectRatio<N>

Convert a resolved value to resolved value form.
Source§

fn to_resolved_value( self, context: &Context<'_>, ) -> <GenericAspectRatio<N> as ToResolvedValue>::ResolvedValue

Convert a resolved value to a resolved value.
Source§

impl<N> ToShmem for GenericAspectRatio<N>
where N: ToShmem,

Source§

fn to_shmem( &self, builder: &mut SharedMemoryBuilder, ) -> Result<ManuallyDrop<GenericAspectRatio<N>>, String>

Clones this value into a form suitable for writing into a SharedMemoryBuilder. Read more
Source§

impl<N> Copy for GenericAspectRatio<N>
where N: Copy,

Source§

impl<N> StructuralPartialEq for GenericAspectRatio<N>