#[repr(C, u8)]pub enum GenericSize<LengthPercent> {
LengthPercentage(LengthPercent),
Auto,
MaxContent,
MinContent,
FitContent,
WebkitFillAvailable,
Stretch,
FitContentFunction(LengthPercent),
AnchorSizeFunction(Box<GenericAnchorSizeFunction<Self>>),
AnchorContainingCalcFunction(LengthPercent),
}
Expand description
A generic value for the width
, height
, min-width
, or min-height
property.
Unlike max-width
or max-height
properties, a Size can be auto
,
and cannot be none
.
Note that it only accepts non-negative values.
Variants§
LengthPercentage(LengthPercent)
Auto
MaxContent
MinContent
FitContent
WebkitFillAvailable
Stretch
FitContentFunction(LengthPercent)
AnchorSizeFunction(Box<GenericAnchorSizeFunction<Self>>)
AnchorContainingCalcFunction(LengthPercent)
Implementations§
Source§impl GenericSize<NonNegative<LengthPercentage>>
impl GenericSize<NonNegative<LengthPercentage>>
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, with quirks.
Sourcefn parse_quirky_internal<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks,
allow_webkit_fill_available: bool,
) -> Result<Self, ParseError<'i>>
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’.
Sourcepub fn parse_size_for_width_or_height_quirky<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks,
) -> Result<Self, ParseError<'i>>
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’.
Sourcepub fn parse_size_for_width_or_height<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>>
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’.
Sourcepub fn zero_percent() -> Self
pub fn zero_percent() -> Self
Returns 0%
.
Trait Implementations§
Source§impl<LengthPercent> Animate for GenericSize<LengthPercent>where
LengthPercent: Animate,
impl<LengthPercent> Animate for GenericSize<LengthPercent>where
LengthPercent: Animate,
Source§impl<LengthPercent: Clone> Clone for GenericSize<LengthPercent>
impl<LengthPercent: Clone> Clone for GenericSize<LengthPercent>
Source§fn clone(&self) -> GenericSize<LengthPercent>
fn clone(&self) -> GenericSize<LengthPercent>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<LengthPercent> ComputeSquaredDistance for GenericSize<LengthPercent>where
LengthPercent: ComputeSquaredDistance,
impl<LengthPercent> ComputeSquaredDistance for GenericSize<LengthPercent>where
LengthPercent: ComputeSquaredDistance,
Source§fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
Source§impl<LengthPercent: Debug> Debug for GenericSize<LengthPercent>
impl<LengthPercent: Debug> Debug for GenericSize<LengthPercent>
Source§impl<LengthPercent> MallocSizeOf for GenericSize<LengthPercent>where
LengthPercent: MallocSizeOf,
impl<LengthPercent> MallocSizeOf for GenericSize<LengthPercent>where
LengthPercent: MallocSizeOf,
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl<LengthPercent: PartialEq> PartialEq for GenericSize<LengthPercent>
impl<LengthPercent: PartialEq> PartialEq for GenericSize<LengthPercent>
Source§impl<LengthPercent> SpecifiedValueInfo for GenericSize<LengthPercent>where
LengthPercent: SpecifiedValueInfo,
impl<LengthPercent> SpecifiedValueInfo for GenericSize<LengthPercent>where
LengthPercent: SpecifiedValueInfo,
Source§fn collect_completion_keywords(f: KeywordsCollectFn<'_>)
fn collect_completion_keywords(f: KeywordsCollectFn<'_>)
Source§const SUPPORTED_TYPES: u8 = 0u8
const SUPPORTED_TYPES: u8 = 0u8
Source§impl<LengthPercent> ToAnimatedValue for GenericSize<LengthPercent>where
LengthPercent: ToAnimatedValue,
impl<LengthPercent> ToAnimatedValue for GenericSize<LengthPercent>where
LengthPercent: ToAnimatedValue,
Source§type AnimatedValue = GenericSize<<LengthPercent as ToAnimatedValue>::AnimatedValue>
type AnimatedValue = GenericSize<<LengthPercent as ToAnimatedValue>::AnimatedValue>
Source§fn from_animated_value(from: Self::AnimatedValue) -> Self
fn from_animated_value(from: Self::AnimatedValue) -> Self
Source§fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
Source§impl<LengthPercent> ToAnimatedZero for GenericSize<LengthPercent>where
LengthPercent: ToAnimatedZero,
impl<LengthPercent> ToAnimatedZero for GenericSize<LengthPercent>where
LengthPercent: ToAnimatedZero,
Source§fn to_animated_zero(&self) -> Result<Self, ()>
fn to_animated_zero(&self) -> Result<Self, ()>
Source§impl<LengthPercent> ToComputedValue for GenericSize<LengthPercent>where
LengthPercent: ToComputedValue,
impl<LengthPercent> ToComputedValue for GenericSize<LengthPercent>where
LengthPercent: ToComputedValue,
Source§type ComputedValue = GenericSize<<LengthPercent as ToComputedValue>::ComputedValue>
type ComputedValue = GenericSize<<LengthPercent as ToComputedValue>::ComputedValue>
Source§fn from_computed_value(from: &Self::ComputedValue) -> Self
fn from_computed_value(from: &Self::ComputedValue) -> Self
Source§fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
Context
.Source§impl<LengthPercent> ToCss for GenericSize<LengthPercent>where
LengthPercent: ToCss,
impl<LengthPercent> ToCss for GenericSize<LengthPercent>where
LengthPercent: ToCss,
Source§fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
self
in CSS syntax, writing to dest
.Source§fn to_css_string(&self) -> String
fn to_css_string(&self) -> String
self
in CSS syntax and return a string. Read moreSource§fn to_css_cssstring(&self) -> String
fn to_css_cssstring(&self) -> String
self
in CSS syntax and return a CssString. Read moreSource§impl<LengthPercent> ToResolvedValue for GenericSize<LengthPercent>where
LengthPercent: ToResolvedValue,
impl<LengthPercent> ToResolvedValue for GenericSize<LengthPercent>where
LengthPercent: ToResolvedValue,
Source§type ResolvedValue = GenericSize<<LengthPercent as ToResolvedValue>::ResolvedValue>
type ResolvedValue = GenericSize<<LengthPercent as ToResolvedValue>::ResolvedValue>
Source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Source§impl<LengthPercent> ToShmem for GenericSize<LengthPercent>where
LengthPercent: ToShmem,
impl<LengthPercent> ToShmem for GenericSize<LengthPercent>where
LengthPercent: ToShmem,
Source§impl<LengthPercent> ToTyped for GenericSize<LengthPercent>
impl<LengthPercent> ToTyped for GenericSize<LengthPercent>
Source§fn to_typed(&self) -> Option<TypedValue>
fn to_typed(&self) -> Option<TypedValue>
impl<LengthPercent> StructuralPartialEq for GenericSize<LengthPercent>
Auto Trait Implementations§
impl<LengthPercent> Freeze for GenericSize<LengthPercent>where
LengthPercent: Freeze,
impl<LengthPercent> RefUnwindSafe for GenericSize<LengthPercent>where
LengthPercent: RefUnwindSafe,
impl<LengthPercent> Send for GenericSize<LengthPercent>where
LengthPercent: Send,
impl<LengthPercent> Sync for GenericSize<LengthPercent>where
LengthPercent: Sync,
impl<LengthPercent> Unpin for GenericSize<LengthPercent>where
LengthPercent: Unpin,
impl<LengthPercent> UnwindSafe for GenericSize<LengthPercent>where
LengthPercent: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more