Enum style::values::specified::length::NoCalcLength
[−]
[src]
pub enum NoCalcLength {
Absolute(AbsoluteLength),
FontRelative(FontRelativeLength),
ViewportPercentage(ViewportPercentageLength),
ServoCharacterWidth(CharacterWidth),
}A <length> without taking calc expressions into account
Variants
Absolute(AbsoluteLength)An absolute length
FontRelative(FontRelativeLength)A font-relative length:
ViewportPercentage(ViewportPercentageLength)A viewport-relative length.
https://drafts.csswg.org/css-values/#viewport-relative-lengths
ServoCharacterWidth(CharacterWidth)HTML5 "character width", as defined in HTML5 § 14.5.4.
This cannot be specified by the user directly and is only generated by
Stylist::synthesize_rules_for_legacy_attributes().
Methods
impl NoCalcLength[src]
pub fn parse_dimension(
context: &ParserContext,
value: CSSFloat,
unit: &str
) -> Result<NoCalcLength, ()>[src]
context: &ParserContext,
value: CSSFloat,
unit: &str
) -> Result<NoCalcLength, ()>
Parse a given absolute or relative dimension.
pub fn zero() -> NoCalcLength[src]
Returns a zero length.
pub fn is_zero(&self) -> bool[src]
Checks whether the length value is zero.
pub fn to_computed_pixel_length_without_context(&self) -> Result<CSSFloat, ()>[src]
Get a px value without context.
pub fn from_px(px_value: CSSFloat) -> NoCalcLength[src]
Get an absolute length from a px value.
Trait Implementations
impl ToComputedValue for NoCalcLength[src]
type ComputedValue = CSSPixelLength
The computed value type we're going to be converted to.
fn to_computed_value(&self, context: &Context) -> Self::ComputedValue[src]
Convert a specified value to a computed value, using itself and the data inside the Context. Read more
fn from_computed_value(computed: &Self::ComputedValue) -> Self[src]
Convert a computed value to specified value form. Read more
impl Clone for NoCalcLength[src]
fn clone(&self) -> NoCalcLength[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 Copy for NoCalcLength[src]
impl Debug for NoCalcLength[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl MallocSizeOf for NoCalcLength[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 NoCalcLength[src]
fn eq(&self, __arg_0: &NoCalcLength) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &NoCalcLength) -> bool[src]
This method tests for !=.
impl ToCss for NoCalcLength[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 Mul<CSSFloat> for NoCalcLength[src]
type Output = NoCalcLength
The resulting type after applying the * operator.
fn mul(self, scalar: CSSFloat) -> NoCalcLength[src]
Performs the * operation.
impl From<NoCalcLength> for Length[src]
fn from(len: NoCalcLength) -> Self[src]
Performs the conversion.
impl From<NoCalcLength> for NonNegativeLength[src]
fn from(len: NoCalcLength) -> Self[src]
Performs the conversion.
impl From<NoCalcLength> for LengthOrPercentage[src]
fn from(len: NoCalcLength) -> Self[src]
Performs the conversion.
impl From<NoCalcLength> for LengthOrPercentageOrAuto[src]
fn from(len: NoCalcLength) -> Self[src]
Performs the conversion.
impl From<NoCalcLength> for NonNegativeLengthOrPercentage[src]
fn from(len: NoCalcLength) -> Self[src]
Performs the conversion.