Type Alias Size

Source
pub type Size = GenericSize<NonNegativeLengthPercentage>;
Expand description

A specified value for min-width, min-height, width or height property.

Aliased Type§

#[repr(C, u8)]
pub enum Size { LengthPercentage(NonNegative<LengthPercentage>), Auto, MaxContent, MinContent, FitContent, WebkitFillAvailable, Stretch, FitContentFunction(NonNegative<LengthPercentage>), AnchorSizeFunction(Box<GenericAnchorSizeFunction<GenericSize<NonNegative<LengthPercentage>>>>), AnchorContainingCalcFunction(NonNegative<LengthPercentage>), }

Variants§

§

LengthPercentage(NonNegative<LengthPercentage>)

§

Auto

§

MaxContent

§

MinContent

§

FitContent

§

WebkitFillAvailable

§

Stretch

§

FitContentFunction(NonNegative<LengthPercentage>)

§

AnchorSizeFunction(Box<GenericAnchorSizeFunction<GenericSize<NonNegative<LengthPercentage>>>>)

§

AnchorContainingCalcFunction(NonNegative<LengthPercentage>)

Implementations§

Source§

impl Size

Source

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

Parses, with quirks.

Source

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

Parses, with quirks and configurable support for whether the ‘-webkit-fill-available’ keyword is allowed. TODO(dholbert) Fold this function into callsites in bug 1989073 when removing ‘layout.css.webkit-fill-available.all-size-properties.enabled’.

Source

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

Parse a size for width or height, where -webkit-fill-available support is only controlled by one pref (vs. other properties where there’s an additional pref check): TODO(dholbert) Remove this custom parse func in bug 1989073, along with ‘layout.css.webkit-fill-available.all-size-properties.enabled’.

Source

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

Parse a size for width or height, where -webkit-fill-available support is only controlled by one pref (vs. other properties where there’s an additional pref check): TODO(dholbert) Remove this custom parse func in bug 1989073, along with ‘layout.css.webkit-fill-available.all-size-properties.enabled’.

Source

pub fn zero_percent() -> Self

Returns 0%.

Trait Implementations§

Source§

impl Parse for Size

Source§

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

Parse a value of this type. Read more