style::values::computed::length_percentage

Type Alias NonNegativeLengthPercentage

Source
pub type NonNegativeLengthPercentage = NonNegative<LengthPercentage>;
Expand description

A wrapper of LengthPercentage, whose value must be >= 0.

Aliased Type§

struct NonNegativeLengthPercentage(pub LengthPercentage);

Fields§

§0: LengthPercentage

Implementations§

Source§

impl NonNegativeLengthPercentage

Source

pub fn is_definitely_zero(&self) -> bool

Returns true if the computed value is absolute 0 or 0%.

Source

pub fn to_used_value(&self, containing_length: Au) -> Au

Returns the used value.

Source

pub fn maybe_to_used_value(&self, containing_length: Option<Au>) -> Option<Au>

Convert the computed value into used value.

Trait Implementations§

Source§

impl ToAnimatedValue for NonNegativeLengthPercentage

Source§

type AnimatedValue = LengthPercentage

The type of the animated value.
Source§

fn to_animated_value(self, context: &AnimatedContext<'_>) -> Self::AnimatedValue

Converts this value to an animated value.
Source§

fn from_animated_value(animated: Self::AnimatedValue) -> Self

Converts back an animated value into a computed value.