#[repr(C)]pub enum GenericInset<P, LP> {
LengthPercentage(LP),
Auto,
AnchorFunction(Box<GenericAnchorFunction<P, LP>>),
AnchorSizeFunction(Box<GenericAnchorSizeFunction<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, LP>>)
Inset defined by the anchor element.
AnchorSizeFunction(Box<GenericAnchorSizeFunction<LP>>)
Inset defined by the size of the anchor element.
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<Self, ParseError<'i>>
pub fn parse_quirky<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, allow_quirks: AllowQuirks, ) -> Result<Self, ParseError<'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>where
P: Animate,
LP: Animate,
Box<GenericAnchorFunction<P, LP>>: Animate,
Box<GenericAnchorSizeFunction<LP>>: Animate,
impl<P, LP> Animate for GenericInset<P, LP>where
P: Animate,
LP: Animate,
Box<GenericAnchorFunction<P, LP>>: Animate,
Box<GenericAnchorSizeFunction<LP>>: Animate,
source§impl<P: Clone, LP: Clone> Clone for GenericInset<P, LP>
impl<P: Clone, LP: Clone> Clone for GenericInset<P, LP>
source§fn clone(&self) -> GenericInset<P, LP>
fn clone(&self) -> GenericInset<P, LP>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<P, LP> ComputeSquaredDistance for GenericInset<P, LP>where
P: ComputeSquaredDistance,
LP: ComputeSquaredDistance,
Box<GenericAnchorFunction<P, LP>>: ComputeSquaredDistance,
Box<GenericAnchorSizeFunction<LP>>: ComputeSquaredDistance,
impl<P, LP> ComputeSquaredDistance for GenericInset<P, LP>where
P: ComputeSquaredDistance,
LP: ComputeSquaredDistance,
Box<GenericAnchorFunction<P, LP>>: ComputeSquaredDistance,
Box<GenericAnchorSizeFunction<LP>>: ComputeSquaredDistance,
source§fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
Computes the squared distance between two animatable values.
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
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
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: KeywordsCollectFn<'_>)
fn collect_completion_keywords(f: KeywordsCollectFn<'_>)
Collect value starting words for the given specified value type.
This includes keyword and function names which can appear at the
beginning of a value of this type. Read more
source§const SUPPORTED_TYPES: u8 = 0u8
const SUPPORTED_TYPES: u8 = 0u8
Supported CssTypes by the given value type. Read more
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>
The type of the animated value.
source§fn from_animated_value(from: Self::AnimatedValue) -> Self
fn from_animated_value(from: Self::AnimatedValue) -> Self
Converts back an animated value into a computed value.
source§fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
Converts this value to an animated value.
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<Self, ()>
fn to_animated_zero(&self) -> Result<Self, ()>
Returns a value that, when added with an underlying value, will produce the underlying
value. This is used for SMIL animation’s “by-animation” where SMIL first interpolates from
the zero value to the ‘by’ value, and then adds the result to the underlying value. Read more
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>
The computed value type we’re going to be converted to.
source§fn from_computed_value(from: &Self::ComputedValue) -> Self
fn from_computed_value(from: &Self::ComputedValue) -> Self
Convert a computed value to specified value form. Read more
source§fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
Convert a specified value to a computed value, using itself and the data
inside the
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>
The resolved value type we’re going to be converted to.
source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Convert a resolved value to resolved value form.
source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Convert a resolved value to a resolved value.
source§impl<P, LP> ToShmem for GenericInset<P, LP>
impl<P, LP> ToShmem for GenericInset<P, LP>
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert