Struct style::values::specified::calc::CalcLengthOrPercentage [] [src]

pub struct CalcLengthOrPercentage {
    pub clamping_mode: AllowedNumericType,
    pub absolute: Option<AbsoluteLength>,
    pub vw: Option<CSSFloat>,
    pub vh: Option<CSSFloat>,
    pub vmin: Option<CSSFloat>,
    pub vmax: Option<CSSFloat>,
    pub em: Option<CSSFloat>,
    pub ex: Option<CSSFloat>,
    pub ch: Option<CSSFloat>,
    pub rem: Option<CSSFloat>,
    pub percentage: Option<Percentage>,
}

A struct to hold a simplified <length> or <percentage> expression.

In some cases, e.g. DOMMatrix, we support calc(), but reject all the relative lengths, and to_computed_pixel_length_without_context() handles this case. Therefore, if you want to add a new field, please make sure this function work properly.

Fields

Methods

impl CalcLengthOrPercentage
[src]

[src]

Compute font-size or line-height taking into account text-zoom if necessary.

[src]

Compute the value into pixel length as CSSFloat without context, so it returns Err(()) if there is any non-absolute unit.

Trait Implementations

impl ToComputedValue for CalcLengthOrPercentage
[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 Clone for CalcLengthOrPercentage
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for CalcLengthOrPercentage
[src]

impl Debug for CalcLengthOrPercentage
[src]

[src]

Formats the value using the given formatter. Read more

impl Default for CalcLengthOrPercentage
[src]

[src]

Returns the "default value" for a type. Read more

impl MallocSizeOf for CalcLengthOrPercentage
[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 CalcLengthOrPercentage
[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 CalcLengthOrPercentage
[src]

[src]

https://drafts.csswg.org/css-values/#calc-serialize

FIXME(emilio): Should this simplify away zeros?

[src]

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