Type Alias style::values::specified::length::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 zero_percent() -> Self

Returns a 0% value.

source

pub fn parse_quirky<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, allow_quirks: AllowQuirks, ) -> Result<Self, ParseError<'i>>

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

Trait Implementations§

source§

impl From<NoCalcLength> for NonNegativeLengthPercentage

source§

fn from(len: NoCalcLength) -> Self

Converts to this type from the input type.
source§

impl Parse for NonNegativeLengthPercentage

source§

fn parse<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>

Parse a value of this type. Read more