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
Sourcepub fn parse_non_negative_with_anchor_size<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks,
) -> Result<Self, ParseError<'i>>
pub fn parse_non_negative_with_anchor_size<'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,
as well as allowing anchor-size()
.
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