#[repr(C)]pub(crate) enum GenericInset<P, LP> {
LengthPercentage(LP),
Auto,
AnchorFunction(Box<GenericAnchorFunction<P, GenericInset<P, LP>>>),
AnchorSizeFunction(Box<GenericAnchorSizeFunction<GenericInset<P, LP>>>),
AnchorContainingCalcFunction(LP),
}
Expand description
Specified type for inset
properties, which allows
the use of the anchor()
function.
Note(dshin): LengthPercentageOrAuto
is not used here because
having LengthPercentageOrAuto
and AnchorFunction
in the enum
pays the price of the discriminator for LengthPercentage | Auto
as well as LengthPercentageOrAuto | AnchorFunction
. This increases
the size of the style struct, which would not be great.
On the other hand, we trade for code duplication, so… :(
Variants§
LengthPercentage(LP)
A <length-percentage>
value.
Auto
An auto
value.
AnchorFunction(Box<GenericAnchorFunction<P, GenericInset<P, LP>>>)
Inset defined by the anchor element.
AnchorSizeFunction(Box<GenericAnchorSizeFunction<GenericInset<P, LP>>>)
Inset defined by the size of the anchor element.
AnchorContainingCalcFunction(LP)
A <length-percentage>
value, guaranteed to contain calc()
,
which then is guaranteed to contain anchor()
or anchor-size()
.
Implementations§
Source§impl<P, LP> GenericInset<P, LP>
impl<P, LP> GenericInset<P, LP>
Source§impl GenericInset<Percentage, LengthPercentage>
impl GenericInset<Percentage, LengthPercentage>
Sourcepub fn parse_quirky<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks,
) -> Result<GenericInset<Percentage, LengthPercentage>, ParseError<'i, StyleParseErrorKind<'i>>>
pub fn parse_quirky<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, allow_quirks: AllowQuirks, ) -> Result<GenericInset<Percentage, LengthPercentage>, ParseError<'i, StyleParseErrorKind<'i>>>
Parses an inset type, allowing the unitless length quirk. https://quirks.spec.whatwg.org/#the-unitless-length-quirk
Trait Implementations§
Source§impl<P, LP> Animate for GenericInset<P, LP>
impl<P, LP> Animate for GenericInset<P, LP>
Source§fn animate(
&self,
other: &GenericInset<P, LP>,
procedure: Procedure,
) -> Result<GenericInset<P, LP>, ()>
fn animate( &self, other: &GenericInset<P, LP>, procedure: Procedure, ) -> Result<GenericInset<P, LP>, ()>
Source§impl<P, LP> Clone for GenericInset<P, LP>
impl<P, LP> Clone for GenericInset<P, LP>
Source§fn clone(&self) -> GenericInset<P, LP>
fn clone(&self) -> GenericInset<P, LP>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<P, LP> ComputeSquaredDistance for GenericInset<P, LP>where
P: ComputeSquaredDistance,
LP: ComputeSquaredDistance,
impl<P, LP> ComputeSquaredDistance for GenericInset<P, LP>where
P: ComputeSquaredDistance,
LP: ComputeSquaredDistance,
Source§fn compute_squared_distance(
&self,
other: &GenericInset<P, LP>,
) -> Result<SquaredDistance, ()>
fn compute_squared_distance( &self, other: &GenericInset<P, LP>, ) -> Result<SquaredDistance, ()>
Source§impl<P, LP> Debug for GenericInset<P, LP>
impl<P, LP> Debug for GenericInset<P, LP>
Source§impl<P, LP> MallocSizeOf for GenericInset<P, LP>where
P: MallocSizeOf,
LP: MallocSizeOf,
impl<P, LP> MallocSizeOf for GenericInset<P, LP>where
P: MallocSizeOf,
LP: MallocSizeOf,
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl Parse for GenericInset<Percentage, LengthPercentage>
impl Parse for GenericInset<Percentage, LengthPercentage>
Source§fn parse<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Result<GenericInset<Percentage, LengthPercentage>, ParseError<'i, StyleParseErrorKind<'i>>>
fn parse<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<GenericInset<Percentage, LengthPercentage>, ParseError<'i, StyleParseErrorKind<'i>>>
Source§impl<P, LP> PartialEq for GenericInset<P, LP>
impl<P, LP> PartialEq for GenericInset<P, LP>
Source§impl<P, LP> SpecifiedValueInfo for GenericInset<P, LP>where
LP: SpecifiedValueInfo,
impl<P, LP> SpecifiedValueInfo for GenericInset<P, LP>where
LP: SpecifiedValueInfo,
Source§fn collect_completion_keywords(f: &mut dyn FnMut(&[&'static str]))
fn collect_completion_keywords(f: &mut dyn FnMut(&[&'static str]))
Source§const SUPPORTED_TYPES: u8 = 0u8
const SUPPORTED_TYPES: u8 = 0u8
Source§impl<P, LP> ToAnimatedValue for GenericInset<P, LP>where
P: ToAnimatedValue,
LP: ToAnimatedValue,
impl<P, LP> ToAnimatedValue for GenericInset<P, LP>where
P: ToAnimatedValue,
LP: ToAnimatedValue,
Source§type AnimatedValue = GenericInset<<P as ToAnimatedValue>::AnimatedValue, <LP as ToAnimatedValue>::AnimatedValue>
type AnimatedValue = GenericInset<<P as ToAnimatedValue>::AnimatedValue, <LP as ToAnimatedValue>::AnimatedValue>
Source§fn from_animated_value(
from: <GenericInset<P, LP> as ToAnimatedValue>::AnimatedValue,
) -> GenericInset<P, LP>
fn from_animated_value( from: <GenericInset<P, LP> as ToAnimatedValue>::AnimatedValue, ) -> GenericInset<P, LP>
Source§fn to_animated_value(
self,
context: &Context<'_>,
) -> <GenericInset<P, LP> as ToAnimatedValue>::AnimatedValue
fn to_animated_value( self, context: &Context<'_>, ) -> <GenericInset<P, LP> as ToAnimatedValue>::AnimatedValue
Source§impl<P, LP> ToAnimatedZero for GenericInset<P, LP>where
P: ToAnimatedZero,
LP: ToAnimatedZero,
impl<P, LP> ToAnimatedZero for GenericInset<P, LP>where
P: ToAnimatedZero,
LP: ToAnimatedZero,
Source§fn to_animated_zero(&self) -> Result<GenericInset<P, LP>, ()>
fn to_animated_zero(&self) -> Result<GenericInset<P, LP>, ()>
Source§impl<P, LP> ToComputedValue for GenericInset<P, LP>where
P: ToComputedValue,
LP: ToComputedValue,
impl<P, LP> ToComputedValue for GenericInset<P, LP>where
P: ToComputedValue,
LP: ToComputedValue,
Source§type ComputedValue = GenericInset<<P as ToComputedValue>::ComputedValue, <LP as ToComputedValue>::ComputedValue>
type ComputedValue = GenericInset<<P as ToComputedValue>::ComputedValue, <LP as ToComputedValue>::ComputedValue>
Source§fn from_computed_value(
from: &<GenericInset<P, LP> as ToComputedValue>::ComputedValue,
) -> GenericInset<P, LP>
fn from_computed_value( from: &<GenericInset<P, LP> as ToComputedValue>::ComputedValue, ) -> GenericInset<P, LP>
Source§fn to_computed_value(
&self,
context: &Context<'_>,
) -> <GenericInset<P, LP> as ToComputedValue>::ComputedValue
fn to_computed_value( &self, context: &Context<'_>, ) -> <GenericInset<P, LP> as ToComputedValue>::ComputedValue
Context
.Source§impl<P, LP> ToCss for GenericInset<P, LP>
impl<P, LP> ToCss for GenericInset<P, LP>
Source§impl<P, LP> ToResolvedValue for GenericInset<P, LP>where
P: ToResolvedValue,
LP: ToResolvedValue,
impl<P, LP> ToResolvedValue for GenericInset<P, LP>where
P: ToResolvedValue,
LP: ToResolvedValue,
Source§type ResolvedValue = GenericInset<<P as ToResolvedValue>::ResolvedValue, <LP as ToResolvedValue>::ResolvedValue>
type ResolvedValue = GenericInset<<P as ToResolvedValue>::ResolvedValue, <LP as ToResolvedValue>::ResolvedValue>
Source§fn from_resolved_value(
from: <GenericInset<P, LP> as ToResolvedValue>::ResolvedValue,
) -> GenericInset<P, LP>
fn from_resolved_value( from: <GenericInset<P, LP> as ToResolvedValue>::ResolvedValue, ) -> GenericInset<P, LP>
Source§fn to_resolved_value(
self,
context: &Context<'_>,
) -> <GenericInset<P, LP> as ToResolvedValue>::ResolvedValue
fn to_resolved_value( self, context: &Context<'_>, ) -> <GenericInset<P, LP> as ToResolvedValue>::ResolvedValue
Source§impl<P, LP> ToShmem for GenericInset<P, LP>
impl<P, LP> ToShmem for GenericInset<P, LP>
Source§fn to_shmem(
&self,
builder: &mut SharedMemoryBuilder,
) -> Result<ManuallyDrop<GenericInset<P, LP>>, String>
fn to_shmem( &self, builder: &mut SharedMemoryBuilder, ) -> Result<ManuallyDrop<GenericInset<P, LP>>, String>
impl<P, LP> StructuralPartialEq for GenericInset<P, LP>
Auto Trait Implementations§
impl<P, LP> Freeze for GenericInset<P, LP>where
LP: Freeze,
impl<P, LP> RefUnwindSafe for GenericInset<P, LP>where
LP: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, LP> Send for GenericInset<P, LP>
impl<P, LP> Sync for GenericInset<P, LP>
impl<P, LP> Unpin for GenericInset<P, LP>where
LP: Unpin,
impl<P, LP> UnwindSafe for GenericInset<P, LP>where
LP: UnwindSafe,
P: 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> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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