Enum style::values::computed::length::LengthOrPercentage
[−]
[src]
pub enum LengthOrPercentage {
Length(Length),
Percentage(Percentage),
Calc(CalcLengthOrPercentage),
}Variants
Length(Length)Percentage(Percentage)Calc(CalcLengthOrPercentage)
Methods
impl LengthOrPercentage[src]
pub fn zero() -> LengthOrPercentage[src]
pub fn one() -> LengthOrPercentage[src]
1px length value for SVG defaults
pub fn is_definitely_zero(&self) -> bool[src]
Returns true if the computed value is absolute 0 or 0%.
(Returns false for calc() values, even if ones that may resolve to zero.)
pub fn to_hash_key(&self) -> (Au, NotNaN<f32>)[src]
pub fn to_used_value(&self, containing_length: Au) -> Au[src]
Returns the used value.
pub fn to_pixel_length(&self, containing_length: Au) -> Length[src]
Returns the used value as CSSPixelLength.
pub fn clamp_to_non_negative(self) -> Self[src]
Returns the clamped non-negative values.
Trait Implementations
impl From<LengthOrPercentage> for CalcLengthOrPercentage[src]
fn from(len: LengthOrPercentage) -> CalcLengthOrPercentage[src]
Performs the conversion.
impl Animate for LengthOrPercentage[src]
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>[src]
Animate a value towards another one, given an animation procedure.
impl Clone for LengthOrPercentage[src]
fn clone(&self) -> LengthOrPercentage[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl ComputeSquaredDistance for LengthOrPercentage[src]
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>[src]
Computes the squared distance between two animatable values.
impl Copy for LengthOrPercentage[src]
impl MallocSizeOf for LengthOrPercentage[src]
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize[src]
Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more
impl PartialEq for LengthOrPercentage[src]
fn eq(&self, __arg_0: &LengthOrPercentage) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &LengthOrPercentage) -> bool[src]
This method tests for !=.
impl ToAnimatedZero for LengthOrPercentage[src]
fn to_animated_zero(&self) -> Result<Self, ()>[src]
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
impl ToCss for LengthOrPercentage[src]
fn to_css<W>(&self, dest: &mut W) -> Result where
W: Write, [src]
W: Write,
Serialize self in CSS syntax, writing to dest.
fn to_css_string(&self) -> String[src]
Serialize self in CSS syntax and return a string. Read more
impl Debug for LengthOrPercentage[src]
fn fmt(&self, f: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl From<Au> for LengthOrPercentage[src]
impl From<LengthOrPercentage> for NonNegativeLengthOrPercentage[src]
fn from(lop: LengthOrPercentage) -> Self[src]
Performs the conversion.
impl From<NonNegativeLengthOrPercentage> for LengthOrPercentage[src]
fn from(lop: NonNegativeLengthOrPercentage) -> LengthOrPercentage[src]
Performs the conversion.
impl ToAbsoluteLength for ComputedLengthOrPercentage[src]
fn to_pixel_length(&self, containing_len: Option<Au>) -> Result<CSSFloat, ()>[src]
Returns the absolute length as pixel value.
impl RepeatableListAnimatable for LengthOrPercentage[src]
impl From<LengthOrPercentage> for NumberOrPercentage[src]
fn from(lop: LengthOrPercentage) -> NumberOrPercentage[src]
Performs the conversion.