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
impl Size
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, with quirks.
Sourcepub fn parse_size_for_flex_basis_width(
context: &ParserContext<'_>,
input: &mut Parser<'_>,
) -> Result<Self, ParseError>
pub fn parse_size_for_flex_basis_width( context: &ParserContext<'_>, input: &mut Parser<'_>, ) -> Result<Self, ParseError>
Parses for flex-basis:
Sourcefn parse_quirky_internal(
context: &ParserContext<'_>,
input: &mut Parser<'_>,
allow_quirks: AllowQuirks,
allow_webkit_fill_available: bool,
allow_anchor_functions: ParseAnchorFunctions,
) -> Result<Self, ParseError>
fn parse_quirky_internal( context: &ParserContext<'_>, input: &mut Parser<'_>, allow_quirks: AllowQuirks, allow_webkit_fill_available: bool, allow_anchor_functions: ParseAnchorFunctions, ) -> Result<Self, ParseError>
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’.
Sourcepub fn parse_size_for_width_or_height_quirky(
context: &ParserContext<'_>,
input: &mut Parser<'_>,
allow_quirks: AllowQuirks,
) -> Result<Self, ParseError>
pub fn parse_size_for_width_or_height_quirky( context: &ParserContext<'_>, input: &mut Parser<'_>, allow_quirks: AllowQuirks, ) -> Result<Self, ParseError>
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’.
Sourcepub fn parse_size_for_width_or_height(
context: &ParserContext<'_>,
input: &mut Parser<'_>,
) -> Result<Self, ParseError>
pub fn parse_size_for_width_or_height( context: &ParserContext<'_>, input: &mut Parser<'_>, ) -> Result<Self, ParseError>
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’.
Sourcepub fn zero_percent() -> Self
pub fn zero_percent() -> Self
Returns 0%.