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
impl NonNegativeLengthPercentage
sourcepub fn zero_percent() -> Self
pub fn zero_percent() -> Self
Returns a 0%
value.
sourcepub fn parse_quirky<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks,
) -> Result<Self, ParseError<'i>>
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
impl From<NoCalcLength> for NonNegativeLengthPercentage
source§fn from(len: NoCalcLength) -> Self
fn from(len: NoCalcLength) -> Self
Converts to this type from the input type.
source§impl Parse for NonNegativeLengthPercentage
impl Parse for NonNegativeLengthPercentage
source§fn parse<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>>
fn parse<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>
Parse a value of this type. Read more