Enum style::values::specified::length::LengthOrPercentage [] [src]

pub enum LengthOrPercentage {
    Length(NoCalcLength),
    Percentage(Percentage),
    Calc(Box<CalcLengthOrPercentage>),
}

A length or a percentage value.

Variants

Methods

impl LengthOrPercentage
[src]

[src]

Returns a zero length.

[src]

Parse a non-negative length.

[src]

Parse a non-negative length, with quirks.

[src]

Parse a length, treating dimensionless numbers as pixels

https://www.w3.org/TR/SVG2/types.html#presentation-attribute-css-value

[src]

Parse a non-negative length, treating dimensionless numbers as pixels

This is nonstandard behavior used by Firefox for SVG

[src]

Extract value from ref without a clone, replacing it with a 0 Au

Use when you need to move out of a length array without cloning

impl LengthOrPercentage
[src]

[src]

Parses a length or a percentage, allowing the unitless length quirk. https://quirks.spec.whatwg.org/#the-unitless-length-quirk

Trait Implementations

impl ToComputedValue for LengthOrPercentage
[src]

The computed value type we're going to be converted to.

[src]

Convert a specified value to a computed value, using itself and the data inside the Context. Read more

[src]

Convert a computed value to specified value form. Read more

impl ToAbsoluteLength for SpecifiedLengthOrPercentage
[src]

[src]

Returns the absolute length as pixel value.

impl From<LengthOrPercentage> for FontSize
[src]

[src]

Performs the conversion.

impl Clone for LengthOrPercentage
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for LengthOrPercentage
[src]

[src]

Formats the value using the given formatter. Read more

impl MallocSizeOf for LengthOrPercentage
[src]

[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]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl ToCss for LengthOrPercentage
[src]

[src]

Serialize self in CSS syntax, writing to dest.

[src]

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

impl From<Length> for LengthOrPercentage
[src]

[src]

Performs the conversion.

impl From<NoCalcLength> for LengthOrPercentage
[src]

[src]

Performs the conversion.

impl From<Percentage> for LengthOrPercentage
[src]

[src]

Performs the conversion.

impl From<Percentage> for LengthOrPercentage
[src]

[src]

Performs the conversion.

impl Parse for LengthOrPercentage
[src]

[src]

Parse a value of this type. Read more