pub type NonNegativeLengthPercentage = NonNegative<LengthPercentage>;Expand description
A wrapper of LengthPercentage, whose value must be >= 0.
Aliased Type§
#[repr(transparent)]pub struct NonNegativeLengthPercentage(pub LengthPercentage);Tuple Fields§
§0: LengthPercentageImplementations§
Source§impl NonNegativeLengthPercentage
impl NonNegativeLengthPercentage
Sourcepub fn zero_percent() -> Self
pub fn zero_percent() -> Self
Returns a 0% value.
Sourcepub fn parse_quirky(
context: &ParserContext<'_>,
input: &mut Parser<'_>,
allow_quirks: AllowQuirks,
) -> Result<Self, ParseError>
pub fn parse_quirky( context: &ParserContext<'_>, input: &mut Parser<'_>, allow_quirks: AllowQuirks, ) -> Result<Self, ParseError>
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(
context: &ParserContext<'_>,
input: &mut Parser<'_>,
allow_quirks: AllowQuirks,
) -> Result<Self, ParseError>
pub fn parse_non_negative_with_anchor_size( context: &ParserContext<'_>, input: &mut Parser<'_>, allow_quirks: AllowQuirks, ) -> Result<Self, ParseError>
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(
context: &ParserContext<'_>,
input: &mut Parser<'_>,
) -> Result<Self, ParseError>
fn parse( context: &ParserContext<'_>, input: &mut Parser<'_>, ) -> Result<Self, ParseError>
Parse a value of this type. Read more